# Restrict Video Meeting Creation to Pro Users
## Description
This PR restricts the video meeting creation functionality to Pro users only. It also adds rate limiting to the meeting creation endpoint to prevent abuse. The UI has been updated to hide the video meeting button for non-Pro users.
## Type of Change
- [x] ✨ New feature (non-breaking change which adds functionality)
- [x] 🔒 Security enhancement
- [x] ⚡ Performance improvement
## Areas Affected
- [x] User Interface/Experience
- [x] Authentication/Authorization
- [x] API Endpoints
## Testing Done
- [x] Manual testing performed
## Security Considerations
- [x] Authentication checks are in place
- [x] Rate limiting is implemented
## Checklist
- [x] I have performed a self-review of my code
- [x] My changes generate no new warnings
## Additional Notes
The PR includes:
1. Refactoring the Pro user detection logic into a reusable utility function
2. Adding rate limiting to the meeting creation endpoint (10 requests per minute)
3. Conditionally rendering the video meeting button in the sidebar based on Pro status
4. Proper error handling for unauthorized meeting creation attempts
# READ CAREFULLY THEN REMOVE
Remove bullet points that are not relevant.
PLEASE REFRAIN FROM USING AI TO WRITE YOUR CODE AND PR DESCRIPTION. IF YOU DO USE AI TO WRITE YOUR CODE PLEASE PROVIDE A DESCRIPTION AND REVIEW IT CAREFULLY. MAKE SURE YOU UNDERSTAND THE CODE YOU ARE SUBMITTING USING AI.
- Pull requests that do not follow these guidelines will be closed without review or comment.
- If you use AI to write your PR description your pr will be close without review or comment.
- If you are unsure about anything, feel free to ask for clarification.
## Description
Please provide a clear description of your changes.
---
## Type of Change
Please delete options that are not relevant.
- [ ] 🐛 Bug fix (non-breaking change which fixes an issue)
- [ ] ✨ New feature (non-breaking change which adds functionality)
- [ ] 💥 Breaking change (fix or feature with breaking changes)
- [ ] 📝 Documentation update
- [ ] 🎨 UI/UX improvement
- [ ] 🔒 Security enhancement
- [ ] ⚡ Performance improvement
## Areas Affected
Please check all that apply:
- [ ] Email Integration (Gmail, IMAP, etc.)
- [ ] User Interface/Experience
- [ ] Authentication/Authorization
- [ ] Data Storage/Management
- [ ] API Endpoints
- [ ] Documentation
- [ ] Testing Infrastructure
- [ ] Development Workflow
- [ ] Deployment/Infrastructure
## Testing Done
Describe the tests you've done:
- [ ] Unit tests added/updated
- [ ] Integration tests added/updated
- [ ] Manual testing performed
- [ ] Cross-browser testing (if UI changes)
- [ ] Mobile responsiveness verified (if UI changes)
## Security Considerations
For changes involving data or authentication:
- [ ] No sensitive data is exposed
- [ ] Authentication checks are in place
- [ ] Input validation is implemented
- [ ] Rate limiting is considered (if applicable)
## Checklist
- [ ] I have read the [CONTRIBUTING](https://github.com/Mail-0/Zero/blob/staging/.github/CONTRIBUTING.md) document
- [ ] My code follows the project's style guidelines
- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in complex areas
- [ ] I have updated the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix/feature works
- [ ] All tests pass locally
- [ ] Any dependent changes are merged and published
## Additional Notes
Add any other context about the pull request here.
## Screenshots/Recordings
Add screenshots or recordings here if applicable.
---
_By submitting this pull request, I confirm that my contribution is made under the terms of the project's license._
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Improved thread counting performance by batching label queries and added Apache license headers to workflow files.
- **Refactors**
- Replaced individual thread count queries with a single batched query for all labels.
- Added license headers to workflow-related source files.
<!-- End of auto-generated description by cubic. -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
* **New Features**
* Improved thread counting performance by enabling batch counting of threads across multiple folders or labels.
* **Refactor**
* Streamlined folder synchronization logic and removed unused or commented-out code for better maintainability.
* **Documentation**
* Added Apache 2.0 license headers to several files to clarify usage and licensing terms.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
# Implement Database Sharding for Email Storage
This PR implements database sharding to improve scalability and performance for email storage. The system now distributes email data across multiple shards instead of storing all data in a single database instance.
## Type of Change
- ✨ New feature (non-breaking change which adds functionality)
- ⚡ Performance improvement
## Areas Affected
- [x] Email Integration (Gmail, IMAP, etc.)
- [x] Data Storage/Management
- [x] API Endpoints
## Description
This PR introduces a sharding mechanism for email storage to handle large volumes of data more efficiently:
1. Created a new `ShardRegistry` Durable Object to track and manage shards for each connection
2. Implemented logic to distribute threads across multiple shards based on size limits (9GB per shard)
3. Modified thread operations to work across shards, including:
- Thread retrieval with shard fallback
- Aggregation of results from multiple shards
- Sequential processing for paginated results
4. Moved notification handling from a separate component to the AI sidebar
5. Added shard count display in the user interface
6. Refactored server utilities to support the new sharding architecture
7. Updated API endpoints to work with the sharded database structure
The implementation ensures that as email volume grows, the system can scale horizontally by adding new shards rather than being limited by a single database's capacity.
## Testing Done
- [x] Manual testing performed
- [x] Cross-browser testing (if UI changes)
## Checklist
- [x] I have performed a self-review of my code
- [x] My changes generate no new warnings
- [x] All tests pass locally
## Additional Notes
This change significantly improves the system's ability to handle large email volumes by distributing data across multiple database shards. The UI now displays the number of shards in use, providing transparency about the underlying storage architecture.
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
* **New Features**
* Introduced sharding support for improved scalability and performance.
* Added display of shard count in the user interface.
* Enhanced sidebar to handle real-time updates for mail, labels, and state.
* **Bug Fixes**
* Improved cache invalidation and data refresh for more accurate mail and label updates.
* **Refactor**
* Centralized thread and label operations for better maintainability.
* Simplified and streamlined backend logic for thread and label management.
* **Chores**
* Updated configuration to support new sharding infrastructure.
* Removed unused notification provider component and related logic.
* **Documentation**
* UI now reflects the number of database shards in relevant menus.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
# Migrate ZeroDriver to use SQLite database with Drizzle ORM
## Description
This PR refactors the ZeroDriver to use a SQLite database with Drizzle ORM for managing threads and labels, replacing the previous storage approach. The implementation includes:
- Added a new database schema with tables for threads, labels, and thread-label relationships
- Created comprehensive database operations for thread and label management
- Updated all agent methods to use the new database layer
- Modified TRPC routes and tools to work with the updated database structure
- Added thread count information to the DoState to display folder counts in the UI
This change improves query capabilities, enables more complex filtering operations, and provides a more reliable storage solution for email data.
## Type of Change
- ✨ New feature (non-breaking change which adds functionality)
- ⚡ Performance improvement
## Areas Affected
- [x] Email Integration (Gmail, IMAP, etc.)
- [x] User Interface/Experience
- [x] Data Storage/Management
- [x] API Endpoints
## Testing Done
- [x] Manual testing performed
## Checklist
- [x] I have performed a self-review of my code
- [x] My changes generate no new warnings
- [x] I have updated the documentation
## Additional Notes
The PR includes database migration files to ensure smooth transitions for existing users. The new database structure allows for more efficient querying of threads by labels and supports complex filtering operations that were previously difficult to implement.
---
_By submitting this pull request, I confirm that my contribution is made under the terms of the project's license._
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
* **New Features**
* Introduced a new SQLite-backed database layer for managing email threads and labels, enabling advanced filtering, pagination, and label management.
* Added a "Force re-sync" option and a syncing status indicator with detailed info to the user menu.
* Enhanced syncing status UI for improved clarity and visual feedback.
* **Improvements**
* Optimized email syncing and label modification logic for greater reliability and performance.
* Standardized agent usage across mail, label, and draft operations for consistency.
* Refined UI elements for syncing feedback and debug actions.
* **Bug Fixes**
* Improved handling of thread and label counts and syncing state in the user interface.
* **Chores**
* Migrated internal data access to use Drizzle ORM and modular database functions.
* Added configuration and migration files to support the new database backend.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
# Redesigned Mail Categories with Label-Based Filtering
## Description
Reimplemented the mail categories feature to use label-based filtering instead of search queries. This change makes it easier for users to customize and manage their inbox views by selecting specific labels rather than writing complex search queries.
The PR enables the categories settings page in the navigation and completely redesigns the UI to focus on label selection. Users can now add, delete, reorder, and set default categories with a more intuitive interface.
## Type of Change
- ✨ New feature (non-breaking change which adds functionality)
- 🎨 UI/UX improvement
## Areas Affected
- [x] User Interface/Experience
- [x] Data Storage/Management
## Testing Done
- [x] Manual testing performed
## Checklist
- [x] I have performed a self-review of my code
- [x] My changes generate no new warnings
- [x] My code follows the project's style guidelines
## Additional Notes
The PR also includes improvements to the thread querying logic in the backend to better support label-based filtering. The categories feature is now called "Views" in the UI to better reflect its purpose.
---
_By submitting this pull request, I confirm that my contribution is made under the terms of the project's license._
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
* **New Features**
* Categories settings page is now accessible from navigation.
* Categories (now called "Views") can be managed with multi-select label filters, drag-and-drop reordering, add/delete actions, and unsaved changes tracking.
* Save and reset options are available for category changes.
* **Improvements**
* Category selection supports multi-label filtering with a dropdown menu.
* UI styling updated for better dark mode support and usability.
* Localization updated to rename "Categories" to "Views".
* Navigation and mail list no longer use category query parameters, simplifying URL handling.
* **Bug Fixes**
* Removed unused and AI-related code for category search queries.
* **Chores**
* Added a pre-commit script to enforce linting before commits.
* Refactored internal logic for category and thread management for better maintainability.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
# READ CAREFULLY THEN REMOVE
Remove bullet points that are not relevant.
PLEASE REFRAIN FROM USING AI TO WRITE YOUR CODE AND PR DESCRIPTION. IF YOU DO USE AI TO WRITE YOUR CODE PLEASE PROVIDE A DESCRIPTION AND REVIEW IT CAREFULLY. MAKE SURE YOU UNDERSTAND THE CODE YOU ARE SUBMITTING USING AI.
- Pull requests that do not follow these guidelines will be closed without review or comment.
- If you use AI to write your PR description your pr will be close without review or comment.
- If you are unsure about anything, feel free to ask for clarification.
## Description
Please provide a clear description of your changes.
---
## Type of Change
Please delete options that are not relevant.
- [ ] 🐛 Bug fix (non-breaking change which fixes an issue)
- [ ] ✨ New feature (non-breaking change which adds functionality)
- [ ] 💥 Breaking change (fix or feature with breaking changes)
- [ ] 📝 Documentation update
- [ ] 🎨 UI/UX improvement
- [ ] 🔒 Security enhancement
- [ ] ⚡ Performance improvement
## Areas Affected
Please check all that apply:
- [ ] Email Integration (Gmail, IMAP, etc.)
- [ ] User Interface/Experience
- [ ] Authentication/Authorization
- [ ] Data Storage/Management
- [ ] API Endpoints
- [ ] Documentation
- [ ] Testing Infrastructure
- [ ] Development Workflow
- [ ] Deployment/Infrastructure
## Testing Done
Describe the tests you've done:
- [ ] Unit tests added/updated
- [ ] Integration tests added/updated
- [ ] Manual testing performed
- [ ] Cross-browser testing (if UI changes)
- [ ] Mobile responsiveness verified (if UI changes)
## Security Considerations
For changes involving data or authentication:
- [ ] No sensitive data is exposed
- [ ] Authentication checks are in place
- [ ] Input validation is implemented
- [ ] Rate limiting is considered (if applicable)
## Checklist
- [ ] I have read the [CONTRIBUTING](https://github.com/Mail-0/Zero/blob/staging/.github/CONTRIBUTING.md) document
- [ ] My code follows the project's style guidelines
- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in complex areas
- [ ] I have updated the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix/feature works
- [ ] All tests pass locally
- [ ] Any dependent changes are merged and published
## Additional Notes
Add any other context about the pull request here.
## Screenshots/Recordings
Add screenshots or recordings here if applicable.
---
_By submitting this pull request, I confirm that my contribution is made under the terms of the project's license._
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Added thread, folder, and filter context to chat prompts and enforced strict security rules to prevent unsafe responses.
- **Security**
- Wrapped all chat prompts with locked instructions to block code, markup, and unsafe content.
- **Context Awareness**
- Passed current thread, folder, and filter info to chat prompts for more relevant responses.
<!-- End of auto-generated description by cubic. -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
* **New Features**
* Chat prompts now include enhanced security instructions and contextual information such as thread, folder, and filter details for improved safety and relevance.
* All chat messages, including system messages, are now displayed in the chat interface.
* **Improvements**
* Contextual information is now passed throughout the chat pipeline, enabling more accurate and context-aware responses.
* Updated default chat prompts for improved consistency.
* Message submission now clears the editor content and ensures the chat view scrolls to the latest message.
* **Bug Fixes**
* Ensured editor content is cleared and chat scrolls to the bottom after sending a message.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
# Cleanup: Remove console logs and refactor AI chat prompt
## Description
This PR removes unnecessary console logs from the codebase and refactors the AI chat prompt to be more concise and structured. The changes include:
1. Removing debug console.log statements from notification settings and hot key handling
2. Adding error handling to the AI sidebar component
3. Streamlining the AI chat prompt structure for better readability and maintenance
4. Improving the inboxRag function with better error handling and logging
## Type of Change
- 🐛 Bug fix (non-breaking change which fixes an issue)
- ⚡ Performance improvement
## Areas Affected
- [x] User Interface/Experience
- [x] API Endpoints
## Testing Done
- [x] Manual testing performed
## Checklist
- [x] I have performed a self-review of my code
- [x] My changes generate no new warnings
- [x] All tests pass locally
## Additional Notes
The AI chat prompt refactoring significantly improves readability while maintaining the same functionality. The removal of console logs helps keep the browser console clean in production.
---
_By submitting this pull request, I confirm that my contribution is made under the terms of the project's license._
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
* **New Features**
* Enhanced email search with improved AI-generated query refinement for more accurate results.
* **Bug Fixes**
* Improved error handling and fallback messaging during AI-powered searches to prevent disruptions.
* **Refactor**
* Streamlined and restructured the AI assistant’s internal prompt for clearer, more direct responses and safer actions.
* Refined tool orchestration for chat streaming to improve reliability.
* **Chores**
* Removed unused tools and related features to simplify the system.
* Eliminated unnecessary console logging for cleaner operation.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
# READ CAREFULLY THEN REMOVE
Remove bullet points that are not relevant.
PLEASE REFRAIN FROM USING AI TO WRITE YOUR CODE AND PR DESCRIPTION. IF YOU DO USE AI TO WRITE YOUR CODE PLEASE PROVIDE A DESCRIPTION AND REVIEW IT CAREFULLY. MAKE SURE YOU UNDERSTAND THE CODE YOU ARE SUBMITTING USING AI.
- Pull requests that do not follow these guidelines will be closed without review or comment.
- If you use AI to write your PR description your pr will be close without review or comment.
- If you are unsure about anything, feel free to ask for clarification.
## Description
Please provide a clear description of your changes.
---
## Type of Change
Please delete options that are not relevant.
- [ ] 🐛 Bug fix (non-breaking change which fixes an issue)
- [ ] ✨ New feature (non-breaking change which adds functionality)
- [ ] 💥 Breaking change (fix or feature with breaking changes)
- [ ] 📝 Documentation update
- [ ] 🎨 UI/UX improvement
- [ ] 🔒 Security enhancement
- [ ] ⚡ Performance improvement
## Areas Affected
Please check all that apply:
- [ ] Email Integration (Gmail, IMAP, etc.)
- [ ] User Interface/Experience
- [ ] Authentication/Authorization
- [ ] Data Storage/Management
- [ ] API Endpoints
- [ ] Documentation
- [ ] Testing Infrastructure
- [ ] Development Workflow
- [ ] Deployment/Infrastructure
## Testing Done
Describe the tests you've done:
- [ ] Unit tests added/updated
- [ ] Integration tests added/updated
- [ ] Manual testing performed
- [ ] Cross-browser testing (if UI changes)
- [ ] Mobile responsiveness verified (if UI changes)
## Security Considerations
For changes involving data or authentication:
- [ ] No sensitive data is exposed
- [ ] Authentication checks are in place
- [ ] Input validation is implemented
- [ ] Rate limiting is considered (if applicable)
## Checklist
- [ ] I have read the [CONTRIBUTING](https://github.com/Mail-0/Zero/blob/staging/.github/CONTRIBUTING.md) document
- [ ] My code follows the project's style guidelines
- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in complex areas
- [ ] I have updated the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix/feature works
- [ ] All tests pass locally
- [ ] Any dependent changes are merged and published
## Additional Notes
Add any other context about the pull request here.
## Screenshots/Recordings
Add screenshots or recordings here if applicable.
---
_By submitting this pull request, I confirm that my contribution is made under the terms of the project's license._
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Fixed type errors and updated function signatures in server routes and effects to resolve hotfix issues. Removed an unused import in the mail UI navigation component.
- **Bug Fixes**
- Updated `syncThread` to accept an object with `threadId` for consistency.
- Fixed type parameters in `ZeroMCP` class.
- Removed unused constructor and import statements.
<!-- End of auto-generated description by cubic. -->
# Improved Attachment Handling and UI Refinements
## Description
This PR improves email attachment handling by implementing on-demand attachment fetching and enhancing error handling. It also includes several UI refinements to the email composer and navigation components.
Key changes:
- Added a dedicated hook and API endpoint for fetching message attachments
- Improved error handling with user-facing toast notifications for attachment operations
- Updated the email composer to hide subject input when replying to messages
- Enhanced styling for compose button, categories dropdown, and search bar
- Fixed attachment loading issues by fetching data on demand instead of storing large attachment data
## Type of Change
- [x] 🐛 Bug fix (non-breaking change which fixes an issue)
- [x] ✨ New feature (non-breaking change which adds functionality)
- [x] 🎨 UI/UX improvement
- [x] ⚡ Performance improvement
## Areas Affected
- [x] Email Integration (Gmail, IMAP, etc.)
- [x] User Interface/Experience
- [x] Data Storage/Management
- [x] API Endpoints
## Testing Done
- [x] Manual testing performed
## Security Considerations
- [x] No sensitive data is exposed
- [x] Input validation is implemented
## Checklist
- [x] I have performed a self-review of my code
- [x] My changes generate no new warnings
## Additional Notes
The attachment handling improvements should resolve issues where large attachments were causing performance problems or failing to load properly. The UI refinements provide a more consistent experience across the application.
# Gmail Search Query Builder and MCP Tool Registration Improvements
## Description
This PR adds a dedicated Gmail search query builder tool and improves the Model Context Protocol (MCP) agent implementation. The changes include:
1. Added a new `BuildGmailSearchQuery` tool that leverages AI to help users construct effective Gmail search queries
2. Migrated MCP agent tools to use the newer `registerTool` method with proper descriptions and input schemas
3. Added initial message handling for AI sidebar component
4. Reduced thread sync max count from 40 to 5 to improve performance during development
## Type of Change
- [x] ✨ New feature (non-breaking change which adds functionality)
- [x] ⚡ Performance improvement
## Areas Affected
- [x] Email Integration (Gmail, IMAP, etc.)
- [x] User Interface/Experience
- [x] API Endpoints
## Testing Done
- [x] Manual testing performed
## Checklist
- [x] I have performed a self-review of my code
- [x] My changes generate no new warnings
## Additional Notes
The Gmail search query builder tool helps users construct more effective search queries by translating natural language requests into Gmail's search syntax. This should improve the user experience when trying to find specific emails.
The MCP tool registration improvements provide better documentation and type safety for the available tools.
## Description
Refactored the AI chat component and email assistant to improve performance, reliability, and user experience. This PR introduces a new `inboxRag` tool for natural language email search, replaces the previous `listThreads` implementation, and enhances the prompt design for more efficient inbox management.
---
## Type of Change
- ✨ New feature (non-breaking change which adds functionality)
- ⚡ Performance improvement
## Areas Affected
- [x] Email Integration (Gmail, IMAP, etc.)
- [x] User Interface/Experience
- [x] API Endpoints
## Testing Done
- [x] Manual testing performed
## Checklist
- [x] I have performed a self-review of my code
- [x] My changes generate no new warnings
## Additional Notes
Key improvements:
- Added `ThreadPreview` component to replace the previous thread rendering approach
- Refactored `ToolResponse` to use specialized subcomponents for different tool types
- Updated AI prompts with better instructions for multi-step and parallel operations
- Switched backend models to Claude 3.5 for improved reasoning capabilities
- Fixed key prop issues in attachment rendering to prevent React warnings
- Increased agent max steps from 5 to 10 for more complex operations
- Added better markdown styling support for lists and other elements
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
* **New Features**
* Introduced advanced AI-powered inbox search and organization with new tools and richer assistant guidance.
* Added support for Anthropic AI models for chat and search tasks.
* Enabled new streaming tool for natural language inbox search.
* **Improvements**
* Enhanced AI assistant prompt with detailed instructions, expanded use cases, and improved communication style.
* Modularized and streamlined AI chat component for clearer tool response rendering and better markdown styling.
* Increased chat step limit in the AI sidebar for longer conversations.
* Improved uniqueness of attachment keys to prevent display issues.
* **Bug Fixes**
* Corrected parameter naming for thread and draft listing to ensure accurate pagination.
* **Chores**
* Updated dependencies and environment variables for improved configuration and model support.
* Cleaned up unused code and imports for better maintainability.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Ran oxc (https://oxc.rs/docs/guide/usage/linter.html#vscode-extension) and fixed all the issues that came up, set it up to run as a PR check and added steps to the README.md asking users to use it.
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
* **New Features**
* Introduced JavaScript linting using oxlint in development guidelines and CI workflow for improved code quality.
* Added oxlint configuration and dependencies to the project.
* **Bug Fixes**
* Improved error logging in various components and utilities for better debugging.
* Enhanced React list rendering by updating keys to use unique values instead of array indices, reducing rendering issues.
* Replaced browser alerts with toast notifications for a smoother user experience.
* **Refactor**
* Simplified component logic and state management by removing unused code, imports, props, and components across multiple files.
* Updated function and component signatures for clarity and maintainability.
* Improved efficiency of certain operations by switching from arrays to sets for membership checks.
* **Chores**
* Cleaned up and reorganized import statements throughout the codebase.
* Removed deprecated files, components, and middleware to streamline the codebase.
* **Documentation**
* Updated contribution guidelines to include linting requirements for code submissions.
* **Style**
* Minor formatting and readability improvements in JSX and code structure.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
# Implement BIMI Avatar Support for Email Logos
This PR adds support for Brand Indicators for Message Identification (BIMI) avatars in the mail interface. BIMI is an email specification that allows organizations to display their logos in supporting email clients by adding specific DNS records.
The implementation includes:
- New `BimiAvatar` component that fetches and displays BIMI logos from DNS records
- Server-side TRPC routes to fetch and validate BIMI records
- Integration of the component throughout the mail interface
- Fallback mechanisms when BIMI logos aren't available
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
* **New Features**
* Introduced BIMI (Brand Indicators for Message Identification) avatar support, displaying brand logos or fallback initials for email senders and recipients.
* Added a new avatar component that automatically fetches and displays BIMI logos when available.
* Enhanced avatar rendering in mail lists and mail display views with improved fallback and styling.
* Added backend support for querying BIMI DNS records and fetching SVG logos via a new API route.
* **Bug Fixes**
* Improved reliability and consistency of avatar display, ensuring appropriate fallbacks if brand logos are unavailable.
* **Chores**
* Updated backend to support BIMI logo lookups and retrieval for enhanced email branding.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
# Add "Open in New Tab" Feature and Fix Email Handling
## Description
This PR adds an "Open in New Tab" feature to the thread context menu, allowing users to open email threads in a new browser tab. It also fixes several issues with email handling:
1. Adds an "Open in New Tab" option to the thread context menu with an ExternalLink icon
2. Improves draft handling by saving drafts before sending emails
3. Fixes the identification of the latest email in threads by properly filtering out drafts
4. Updates the styling of the "Mark as Important" icon in the thread context menu
5. Removes unnecessary console.log statements and async/await usage where not needed
6. Fixes the web search tool to work with or without data streaming
## Type of Change
- [x] 🐛 Bug fix (non-breaking change which fixes an issue)
- [x] ✨ New feature (non-breaking change which adds functionality)
- [x] 🎨 UI/UX improvement
- [x] ⚡ Performance improvement
## Areas Affected
- [x] Email Integration (Gmail, IMAP, etc.)
- [x] User Interface/Experience
- [x] Data Storage/Management
## Testing Done
- [x] Manual testing performed
## Checklist
- [x] I have performed a self-review of my code
- [x] My changes generate no new warnings
## Additional Notes
The "Open in New Tab" feature improves workflow for users who need to reference multiple email threads simultaneously. The draft handling improvements ensure that emails are properly saved before sending, preventing data loss.
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
* **New Features**
* Added "Open in New Tab" action to the email thread context menu for easier access to threads in a new browser tab.
* **Improvements**
* Drafts are now saved automatically before sending emails, ensuring no unsaved changes are lost.
* More accurate detection of the latest email in a thread.
* Localization updated with a new string for the "Open in New Tab" action.
* Email and thread operations now consistently use an updated agent interface for improved backend handling.
* **Bug Fixes**
* Latest message and reply counts now exclude drafts, improving thread accuracy.
* **Style**
* Minor visual updates to icons and CSS class ordering.
* Code formatting and import reordering for consistency.
* **Chores**
* Internal state updates are now handled synchronously for improved performance.
* Removed unnecessary logging and simplified cache management.
* Removed deprecated notification function and related imports.
* Simplified query cache clearing on account switch.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
# Refactor Labels API Usage and Optimize Component Performance
## Description
This PR refactors how labels are accessed throughout the application by restructuring the `useLabels` hook to return `userLabels` and `systemLabels` separately. It also adds performance optimizations by memoizing component calculations and action handlers in the thread context menu. Additionally, it introduces a new category dropdown component for better label filtering and temporarily disables the categories settings page.
## Type of Change
- [x] 🐛 Bug fix (non-breaking change which fixes an issue)
- [x] ⚡ Performance improvement
## Areas Affected
- [x] User Interface/Experience
- [x] Data Storage/Management
## Testing Done
- [x] Manual testing performed
## Checklist
- [x] I have performed a self-review of my code
- [x] My changes generate no new warnings
- [x] All tests pass locally
## Additional Notes
The main changes include:
1. Restructured `useLabels` hook to separate user and system labels
2. Updated all components to use the new label structure
3. Added memoization to thread context menu actions and calculations
4. Implemented a new CategoryDropdown component for label filtering
5. Commented out the categories settings page route
6. Fixed spacing and alignment issues in the mail layout
## Description
Fixed label folder structure in the sidebar by updating the `color` prop type from `number` to `string` in the file tree component. Also improved the folder hierarchy logic to properly handle nested labels and prevent duplicate folder entries when a label with the same name as a folder exists.
The changes ensure that:
1. Label colors are properly passed through the component hierarchy
2. Folders with the same name as a label are properly merged
3. The bookmark icon styling is fixed to properly display colors
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
* **New Features**
* Improved label grouping in the sidebar to prevent redundant folder labels and ensure accurate folder metadata.
* Consistent color information is now displayed for all labels and folders.
* **Style**
* Updated label and folder color handling for a more uniform appearance.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
# READ CAREFULLY THEN REMOVE
Remove bullet points that are not relevant.
PLEASE REFRAIN FROM USING AI TO WRITE YOUR CODE AND PR DESCRIPTION. IF YOU DO USE AI TO WRITE YOUR CODE PLEASE PROVIDE A DESCRIPTION AND REVIEW IT CAREFULLY. MAKE SURE YOU UNDERSTAND THE CODE YOU ARE SUBMITTING USING AI.
- Pull requests that do not follow these guidelines will be closed without review or comment.
- If you use AI to write your PR description your pr will be close without review or comment.
- If you are unsure about anything, feel free to ask for clarification.
## Description
Please provide a clear description of your changes.
---
## Type of Change
Please delete options that are not relevant.
- [ ] 🐛 Bug fix (non-breaking change which fixes an issue)
- [ ] ✨ New feature (non-breaking change which adds functionality)
- [ ] 💥 Breaking change (fix or feature with breaking changes)
- [ ] 📝 Documentation update
- [ ] 🎨 UI/UX improvement
- [ ] 🔒 Security enhancement
- [ ] ⚡ Performance improvement
## Areas Affected
Please check all that apply:
- [ ] Email Integration (Gmail, IMAP, etc.)
- [ ] User Interface/Experience
- [ ] Authentication/Authorization
- [ ] Data Storage/Management
- [ ] API Endpoints
- [ ] Documentation
- [ ] Testing Infrastructure
- [ ] Development Workflow
- [ ] Deployment/Infrastructure
## Testing Done
Describe the tests you've done:
- [ ] Unit tests added/updated
- [ ] Integration tests added/updated
- [ ] Manual testing performed
- [ ] Cross-browser testing (if UI changes)
- [ ] Mobile responsiveness verified (if UI changes)
## Security Considerations
For changes involving data or authentication:
- [ ] No sensitive data is exposed
- [ ] Authentication checks are in place
- [ ] Input validation is implemented
- [ ] Rate limiting is considered (if applicable)
## Checklist
- [ ] I have read the [CONTRIBUTING](https://github.com/Mail-0/Zero/blob/staging/.github/CONTRIBUTING.md) document
- [ ] My code follows the project's style guidelines
- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in complex areas
- [ ] I have updated the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix/feature works
- [ ] All tests pass locally
- [ ] Any dependent changes are merged and published
## Additional Notes
Add any other context about the pull request here.
## Screenshots/Recordings
Add screenshots or recordings here if applicable.
---
_By submitting this pull request, I confirm that my contribution is made under the terms of the project's license._
# READ CAREFULLY THEN REMOVE
Remove bullet points that are not relevant.
PLEASE REFRAIN FROM USING AI TO WRITE YOUR CODE AND PR DESCRIPTION. IF YOU DO USE AI TO WRITE YOUR CODE PLEASE PROVIDE A DESCRIPTION AND REVIEW IT CAREFULLY. MAKE SURE YOU UNDERSTAND THE CODE YOU ARE SUBMITTING USING AI.
- Pull requests that do not follow these guidelines will be closed without review or comment.
- If you use AI to write your PR description your pr will be close without review or comment.
- If you are unsure about anything, feel free to ask for clarification.
## Description
Please provide a clear description of your changes.
---
## Type of Change
Please delete options that are not relevant.
- [ ] 🐛 Bug fix (non-breaking change which fixes an issue)
- [ ] ✨ New feature (non-breaking change which adds functionality)
- [ ] 💥 Breaking change (fix or feature with breaking changes)
- [ ] 📝 Documentation update
- [ ] 🎨 UI/UX improvement
- [ ] 🔒 Security enhancement
- [ ] ⚡ Performance improvement
## Areas Affected
Please check all that apply:
- [ ] Email Integration (Gmail, IMAP, etc.)
- [ ] User Interface/Experience
- [ ] Authentication/Authorization
- [ ] Data Storage/Management
- [ ] API Endpoints
- [ ] Documentation
- [ ] Testing Infrastructure
- [ ] Development Workflow
- [ ] Deployment/Infrastructure
## Testing Done
Describe the tests you've done:
- [ ] Unit tests added/updated
- [ ] Integration tests added/updated
- [ ] Manual testing performed
- [ ] Cross-browser testing (if UI changes)
- [ ] Mobile responsiveness verified (if UI changes)
## Security Considerations
For changes involving data or authentication:
- [ ] No sensitive data is exposed
- [ ] Authentication checks are in place
- [ ] Input validation is implemented
- [ ] Rate limiting is considered (if applicable)
## Checklist
- [ ] I have read the [CONTRIBUTING](https://github.com/Mail-0/Zero/blob/staging/.github/CONTRIBUTING.md) document
- [ ] My code follows the project's style guidelines
- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in complex areas
- [ ] I have updated the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix/feature works
- [ ] All tests pass locally
- [ ] Any dependent changes are merged and published
## Additional Notes
Add any other context about the pull request here.
## Screenshots/Recordings
Add screenshots or recordings here if applicable.
---
_By submitting this pull request, I confirm that my contribution is made under the terms of the project's license._
# READ CAREFULLY THEN REMOVE
Remove bullet points that are not relevant.
PLEASE REFRAIN FROM USING AI TO WRITE YOUR CODE AND PR DESCRIPTION. IF YOU DO USE AI TO WRITE YOUR CODE PLEASE PROVIDE A DESCRIPTION AND REVIEW IT CAREFULLY. MAKE SURE YOU UNDERSTAND THE CODE YOU ARE SUBMITTING USING AI.
- Pull requests that do not follow these guidelines will be closed without review or comment.
- If you use AI to write your PR description your pr will be close without review or comment.
- If you are unsure about anything, feel free to ask for clarification.
## Description
Please provide a clear description of your changes.
---
## Type of Change
Please delete options that are not relevant.
- [ ] 🐛 Bug fix (non-breaking change which fixes an issue)
- [ ] ✨ New feature (non-breaking change which adds functionality)
- [ ] 💥 Breaking change (fix or feature with breaking changes)
- [ ] 📝 Documentation update
- [ ] 🎨 UI/UX improvement
- [ ] 🔒 Security enhancement
- [ ] ⚡ Performance improvement
## Areas Affected
Please check all that apply:
- [ ] Email Integration (Gmail, IMAP, etc.)
- [ ] User Interface/Experience
- [ ] Authentication/Authorization
- [ ] Data Storage/Management
- [ ] API Endpoints
- [ ] Documentation
- [ ] Testing Infrastructure
- [ ] Development Workflow
- [ ] Deployment/Infrastructure
## Testing Done
Describe the tests you've done:
- [ ] Unit tests added/updated
- [ ] Integration tests added/updated
- [ ] Manual testing performed
- [ ] Cross-browser testing (if UI changes)
- [ ] Mobile responsiveness verified (if UI changes)
## Security Considerations
For changes involving data or authentication:
- [ ] No sensitive data is exposed
- [ ] Authentication checks are in place
- [ ] Input validation is implemented
- [ ] Rate limiting is considered (if applicable)
## Checklist
- [ ] I have read the [CONTRIBUTING](https://github.com/Mail-0/Zero/blob/staging/.github/CONTRIBUTING.md) document
- [ ] My code follows the project's style guidelines
- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in complex areas
- [ ] I have updated the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix/feature works
- [ ] All tests pass locally
- [ ] Any dependent changes are merged and published
## Additional Notes
Add any other context about the pull request here.
## Screenshots/Recordings
Add screenshots or recordings here if applicable.
---
_By submitting this pull request, I confirm that my contribution is made under the terms of the project's license._
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
* **New Features**
* Introduced a new localization system replacing translation hooks with direct message function calls.
* Added localization project configuration and Inlang plugins for improved message formatting.
* **Bug Fixes**
* Enhanced pluralization handling across all supported languages for accurate message display.
* **Refactor**
* Unified translation and locale management across components by removing hook-based translations.
* Removed obsolete navigation and email signature settings pages.
* Simplified query and server provider logic, removing connection-specific and internationalization context code.
* Disabled server-side rendering in the mail app.
* Removed Cloudflare Worker request handler and related environment augmentations.
* **Chores**
* Updated dependencies and scripts, adding Inlang CLI and removing unused packages.
* Cleaned up configuration files including Vite, Wrangler, and i18n settings.
* Added `.gitignore` for localization cache.
* Updated static asset handling and environment configurations for Cloudflare deployments.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
# READ CAREFULLY THEN REMOVE
Remove bullet points that are not relevant.
PLEASE REFRAIN FROM USING AI TO WRITE YOUR CODE AND PR DESCRIPTION. IF YOU DO USE AI TO WRITE YOUR CODE PLEASE PROVIDE A DESCRIPTION AND REVIEW IT CAREFULLY. MAKE SURE YOU UNDERSTAND THE CODE YOU ARE SUBMITTING USING AI.
- Pull requests that do not follow these guidelines will be closed without review or comment.
- If you use AI to write your PR description your pr will be close without review or comment.
- If you are unsure about anything, feel free to ask for clarification.
## Description
Please provide a clear description of your changes.
---
## Type of Change
Please delete options that are not relevant.
- [ ] 🐛 Bug fix (non-breaking change which fixes an issue)
- [ ] ✨ New feature (non-breaking change which adds functionality)
- [ ] 💥 Breaking change (fix or feature with breaking changes)
- [ ] 📝 Documentation update
- [ ] 🎨 UI/UX improvement
- [ ] 🔒 Security enhancement
- [ ] ⚡ Performance improvement
## Areas Affected
Please check all that apply:
- [ ] Email Integration (Gmail, IMAP, etc.)
- [ ] User Interface/Experience
- [ ] Authentication/Authorization
- [ ] Data Storage/Management
- [ ] API Endpoints
- [ ] Documentation
- [ ] Testing Infrastructure
- [ ] Development Workflow
- [ ] Deployment/Infrastructure
## Testing Done
Describe the tests you've done:
- [ ] Unit tests added/updated
- [ ] Integration tests added/updated
- [ ] Manual testing performed
- [ ] Cross-browser testing (if UI changes)
- [ ] Mobile responsiveness verified (if UI changes)
## Security Considerations
For changes involving data or authentication:
- [ ] No sensitive data is exposed
- [ ] Authentication checks are in place
- [ ] Input validation is implemented
- [ ] Rate limiting is considered (if applicable)
## Checklist
- [ ] I have read the [CONTRIBUTING](https://github.com/Mail-0/Zero/blob/staging/.github/CONTRIBUTING.md) document
- [ ] My code follows the project's style guidelines
- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in complex areas
- [ ] I have updated the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix/feature works
- [ ] All tests pass locally
- [ ] Any dependent changes are merged and published
## Additional Notes
Add any other context about the pull request here.
## Screenshots/Recordings
Add screenshots or recordings here if applicable.
---
_By submitting this pull request, I confirm that my contribution is made under the terms of the project's license._
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
* **New Features**
* Introduced label-based filtering for email threads, allowing users to filter threads by selected labels.
* Added a new search hook to manage label filters via the URL.
* Implemented local caching and synchronization for email threads to improve responsiveness.
* **Improvements**
* Read threads now appear visually dimmed for easier distinction.
* Increased the height of the mail list container on larger screens for better visibility.
* Enhanced reliability and consistency of email attachment header display.
* **Bug Fixes**
* Improved thread data fetching and synchronization, reducing delays and inconsistencies.
* **Developer Experience**
* Strengthened type validation and schema enforcement for email data structures.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
# Refactor Command Palette to use URL State and Improve Agent Communication
## Description
This PR refactors the command palette to use URL state instead of React state, allowing for better persistence and sharing of the command palette's open state. It also improves the agent communication architecture by implementing proper RPC targets for both database and agent operations.
Key changes:
- Refactored command palette to use URL query parameters instead of React state
- Added loading indicator for search processing
- Improved empty state messaging in command palette
- Fixed filter clearing when navigating between folders
- Enhanced agent communication with proper RPC targets
- Removed unnecessary toast notifications
- Fixed type issues in sidebar labels component
## Type of Change
- 🐛 Bug fix (non-breaking change which fixes an issue)
- ✨ New feature (non-breaking change which adds functionality)
- ⚡ Performance improvement
## Areas Affected
- [x] Email Integration (Gmail, IMAP, etc.)
- [x] User Interface/Experience
- [x] API Endpoints
## Testing Done
- [x] Manual testing performed
## Checklist
- [x] I have performed a self-review of my code
- [x] My changes generate no new warnings
- [x] All tests pass locally
## Additional Notes
The command palette now maintains its state via URL parameters, which improves the user experience when navigating between pages. The agent communication architecture has been improved to use proper RPC targets, which should make the code more maintainable and robust.
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
- **New Features**
- Enhanced command palette loading UI with a spinning loader icon during searches.
- Added output validation for label and mail count queries to improve data reliability.
- **Improvements**
- Unified the command palette open state with the URL query for better navigation and consistency.
- Refined search handling to prevent concurrent searches and improve performance.
- Sidebar labels now only appear when an account is active for a cleaner interface.
- Updated navigation UI with revised sign-in button behavior and streamlined GitHub link label.
- **Bug Fixes**
- Resolved issues with command palette state and filter clearing on route changes.
- **Removed**
- Toast notifications for clearing filters, saving searches, and deleting saved searches have been removed.
- Removed the navigation bar component and Product Hunt badge from the home content.
- Removed interactive sign-in button from home content, replaced with static badge.
- **Developer Changes**
- Updated and streamlined type definitions for user accounts and connections.
- Refactored backend authentication setup to use explicit connection IDs and added RPC proxy class for mail operations.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
# READ CAREFULLY THEN REMOVE
Remove bullet points that are not relevant.
PLEASE REFRAIN FROM USING AI TO WRITE YOUR CODE AND PR DESCRIPTION. IF YOU DO USE AI TO WRITE YOUR CODE PLEASE PROVIDE A DESCRIPTION AND REVIEW IT CAREFULLY. MAKE SURE YOU UNDERSTAND THE CODE YOU ARE SUBMITTING USING AI.
- Pull requests that do not follow these guidelines will be closed without review or comment.
- If you use AI to write your PR description your pr will be close without review or comment.
- If you are unsure about anything, feel free to ask for clarification.
## Description
Please provide a clear description of your changes.
---
## Type of Change
Please delete options that are not relevant.
- [ ] 🐛 Bug fix (non-breaking change which fixes an issue)
- [ ] ✨ New feature (non-breaking change which adds functionality)
- [ ] 💥 Breaking change (fix or feature with breaking changes)
- [ ] 📝 Documentation update
- [ ] 🎨 UI/UX improvement
- [ ] 🔒 Security enhancement
- [ ] ⚡ Performance improvement
## Areas Affected
Please check all that apply:
- [ ] Email Integration (Gmail, IMAP, etc.)
- [ ] User Interface/Experience
- [ ] Authentication/Authorization
- [ ] Data Storage/Management
- [ ] API Endpoints
- [ ] Documentation
- [ ] Testing Infrastructure
- [ ] Development Workflow
- [ ] Deployment/Infrastructure
## Testing Done
Describe the tests you've done:
- [ ] Unit tests added/updated
- [ ] Integration tests added/updated
- [ ] Manual testing performed
- [ ] Cross-browser testing (if UI changes)
- [ ] Mobile responsiveness verified (if UI changes)
## Security Considerations
For changes involving data or authentication:
- [ ] No sensitive data is exposed
- [ ] Authentication checks are in place
- [ ] Input validation is implemented
- [ ] Rate limiting is considered (if applicable)
## Checklist
- [ ] I have read the [CONTRIBUTING](https://github.com/Mail-0/Zero/blob/staging/.github/CONTRIBUTING.md) document
- [ ] My code follows the project's style guidelines
- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in complex areas
- [ ] I have updated the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix/feature works
- [ ] All tests pass locally
- [ ] Any dependent changes are merged and published
## Additional Notes
Add any other context about the pull request here.
## Screenshots/Recordings
Add screenshots or recordings here if applicable.
---
_By submitting this pull request, I confirm that my contribution is made under the terms of the project's license._
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
- **New Features**
- Introduced a global loading indicator with animated overlay and customizable messages for improved user feedback during operations.
- **Improvements**
- Enhanced account switching with explicit loading states, improved cache management, and clearer success or error notifications.
- Added new localized messages for account switching status.
- **Chores**
- Updated package manager version for improved tooling support.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
# Client-Side Rendering Migration and Authentication Provider Refactoring
## Description
This PR migrates the mail app from server-side rendering to client-side rendering and refactors how authentication providers are loaded. Key changes include:
1. Renamed loader functions to `clientLoader` across multiple pages to support client-side rendering
2. Added a new `/api/public/providers` endpoint to fetch authentication provider information
3. Removed direct environment variable access from the client and replaced with API calls
4. Added loading fallback components for better UX during hydration
5. Refactored email content rendering to use direct HTML instead of iframes
6. Removed unused components and Microsoft identity association files
7. Fixed reply count calculation to exclude draft messages in threads
## Type of Change
- [x] 🐛 Bug fix (non-breaking change which fixes an issue)
- [x] ✨ New feature (non-breaking change which adds functionality)
- [x] 💥 Breaking change (fix or feature with breaking changes)
- [x] ⚡ Performance improvement
## Areas Affected
- [x] Email Integration (Gmail, IMAP, etc.)
- [x] User Interface/Experience
- [x] Authentication/Authorization
- [x] API Endpoints
- [x] Deployment/Infrastructure
## Testing Done
- [x] Manual testing performed
- [x] Cross-browser testing (if UI changes)
- [x] Mobile responsiveness verified (if UI changes)
## Security Considerations
- [x] No sensitive data is exposed
- [x] Authentication checks are in place
## Checklist
- [x] I have performed a self-review of my code
- [x] My changes generate no new warnings
- [x] All tests pass locally
## Additional Notes
The migration to client-side rendering should improve the initial load performance and reduce server load. The new authentication provider API endpoint provides a more secure way to fetch provider information without exposing environment variables to the client.
# READ CAREFULLY THEN REMOVE
Remove bullet points that are not relevant.
PLEASE REFRAIN FROM USING AI TO WRITE YOUR CODE AND PR DESCRIPTION. IF YOU DO USE AI TO WRITE YOUR CODE PLEASE PROVIDE A DESCRIPTION AND REVIEW IT CAREFULLY. MAKE SURE YOU UNDERSTAND THE CODE YOU ARE SUBMITTING USING AI.
- Pull requests that do not follow these guidelines will be closed without review or comment.
- If you use AI to write your PR description your pr will be close without review or comment.
- If you are unsure about anything, feel free to ask for clarification.
## Description
Please provide a clear description of your changes.
---
## Type of Change
Please delete options that are not relevant.
- [ ] 🐛 Bug fix (non-breaking change which fixes an issue)
- [ ] ✨ New feature (non-breaking change which adds functionality)
- [ ] 💥 Breaking change (fix or feature with breaking changes)
- [ ] 📝 Documentation update
- [ ] 🎨 UI/UX improvement
- [ ] 🔒 Security enhancement
- [ ] ⚡ Performance improvement
## Areas Affected
Please check all that apply:
- [ ] Email Integration (Gmail, IMAP, etc.)
- [ ] User Interface/Experience
- [ ] Authentication/Authorization
- [ ] Data Storage/Management
- [ ] API Endpoints
- [ ] Documentation
- [ ] Testing Infrastructure
- [ ] Development Workflow
- [ ] Deployment/Infrastructure
## Testing Done
Describe the tests you've done:
- [ ] Unit tests added/updated
- [ ] Integration tests added/updated
- [ ] Manual testing performed
- [ ] Cross-browser testing (if UI changes)
- [ ] Mobile responsiveness verified (if UI changes)
## Security Considerations
For changes involving data or authentication:
- [ ] No sensitive data is exposed
- [ ] Authentication checks are in place
- [ ] Input validation is implemented
- [ ] Rate limiting is considered (if applicable)
## Checklist
- [ ] I have read the [CONTRIBUTING](../CONTRIBUTING.md) document
- [ ] My code follows the project's style guidelines
- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in complex areas
- [ ] I have updated the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix/feature works
- [ ] All tests pass locally
- [ ] Any dependent changes are merged and published
## Additional Notes
Add any other context about the pull request here.
## Screenshots/Recordings
Add screenshots or recordings here if applicable.
---
_By submitting this pull request, I confirm that my contribution is made under the terms of the project's license._
# Implement Gmail Push Notifications with Workflows
This PR implements a comprehensive Gmail push notification system using Cloudflare Workflows. It creates a subscription factory pattern to handle different email providers, with Google implementation completed. The system processes Gmail history updates, vectorizes messages, generates thread summaries, and applies AI-generated labels.
## Type of Change
- ✨ New feature (non-breaking change which adds functionality)
- ⚡ Performance improvement
## Areas Affected
- [x] Email Integration (Gmail, IMAP, etc.)
- [x] User Interface/Experience
- [x] Data Storage/Management
- [x] API Endpoints
## Testing Done
- [x] Manual testing performed
## Checklist
- [x] I have performed a self-review of my code
- [x] I have commented my code, particularly in complex areas
- [x] My changes generate no new warnings
## Additional Notes
Key changes:
1. Created subscription factory pattern with Google implementation
2. Added Cloudflare Workflows for processing Gmail notifications
3. Implemented thread and message vectorization
4. Added AI-based thread labeling
5. Fixed string template in party.tsx component
6. Added cheerio for HTML parsing
7. Enabled interactive dev session in wrangler config
The system now processes Gmail notifications in real-time, extracts meaningful data, and provides AI-generated labels for better email organization.
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
- **New Features**
- Introduced advanced workflows for processing and labeling email threads using AI, including summarization, vectorization, and automatic label assignment.
- Added support for managing subscriptions and notifications for Google and Outlook email providers.
- Implemented user notification and token verification features for enhanced security and real-time updates.
- **Improvements**
- Streamlined subscription management with new queue-based and scheduled background processing for renewals and state tracking.
- Enhanced label management with detailed default categories for email threads.
- Improved connection and subscription state handling for greater reliability and clarity.
- **Bug Fixes**
- Adjusted connection handling to ensure correct context usage and state updates.
- **Chores**
- Updated environment configurations to support new workflows, queues, and storage namespaces.
- Added new dependencies and updated development scripts for improved development experience.
- **Documentation**
- Expanded type definitions and documentation for new features and provider support.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
# Enhanced Toast Component UI and Functionality
## Description
This PR enhances the toast component's UI and functionality by:
1. Renaming `CustomToaster` to `Toaster` for better semantic clarity
2. Adding a loading icon using Lucide's `Loader2` component with animation
3. Improving toast styling with better padding, rounded corners, and proper dark mode support
5. Refining the action button styling with proper flex layout and gap spacing
## Type of Change
- [x] 🎨 UI/UX improvement
## Areas Affected
- [x] User Interface/Experience
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
- **New Features**
- Added a loading icon to the loading toast notification for improved user feedback.
- Updated the "Undo" action in persistent toast notifications to include an icon for better visual clarity.
- **Style**
- Refreshed toast notification styles, including updated colors, padding, and button layouts for a more polished appearance and improved dark mode support.
- **Refactor**
- Renamed the toast component for consistency across the app.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
# Refactor Navigation Item Handling in Mail App
## Description
This PR fixes an issue where when tabbing through the sidebar you would need to click tab twice to move to the next item.
## Type of Change
- [x] 🐛 Bug fix (non-breaking change which fixes an issue)
- [x] 🎨 UI/UX improvement
- [x] ⚡ Performance improvement
## Areas Affected
- [x] User Interface/Experience
## Testing Done
- [x] Manual testing performed
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
- **Refactor**
- Improved navigation handling in the sidebar menu for a smoother user experience, including automatic closing of the mobile sidebar when a menu item is selected.
- Updated styling for better consistency across navigation items.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
# READ CAREFULLY THEN REMOVE
Remove bullet points that are not relevant.
PLEASE REFRAIN FROM USING AI TO WRITE YOUR CODE AND PR DESCRIPTION. IF YOU DO USE AI TO WRITE YOUR CODE PLEASE PROVIDE A DESCRIPTION AND REVIEW IT CAREFULLY. MAKE SURE YOU UNDERSTAND THE CODE YOU ARE SUBMITTING USING AI.
- Pull requests that do not follow these guidelines will be closed without review or comment.
- If you use AI to write your PR description your pr will be close without review or comment.
- If you are unsure about anything, feel free to ask for clarification.
## Description
Please provide a clear description of your changes.
---
## Type of Change
Please delete options that are not relevant.
- [ ] 🐛 Bug fix (non-breaking change which fixes an issue)
- [ ] ✨ New feature (non-breaking change which adds functionality)
- [ ] 💥 Breaking change (fix or feature with breaking changes)
- [ ] 📝 Documentation update
- [ ] 🎨 UI/UX improvement
- [ ] 🔒 Security enhancement
- [ ] ⚡ Performance improvement
## Areas Affected
Please check all that apply:
- [ ] Email Integration (Gmail, IMAP, etc.)
- [ ] User Interface/Experience
- [ ] Authentication/Authorization
- [ ] Data Storage/Management
- [ ] API Endpoints
- [ ] Documentation
- [ ] Testing Infrastructure
- [ ] Development Workflow
- [ ] Deployment/Infrastructure
## Testing Done
Describe the tests you've done:
- [ ] Unit tests added/updated
- [ ] Integration tests added/updated
- [ ] Manual testing performed
- [ ] Cross-browser testing (if UI changes)
- [ ] Mobile responsiveness verified (if UI changes)
## Security Considerations
For changes involving data or authentication:
- [ ] No sensitive data is exposed
- [ ] Authentication checks are in place
- [ ] Input validation is implemented
- [ ] Rate limiting is considered (if applicable)
## Checklist
- [ ] I have read the [CONTRIBUTING](../CONTRIBUTING.md) document
- [ ] My code follows the project's style guidelines
- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in complex areas
- [ ] I have updated the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix/feature works
- [ ] All tests pass locally
- [ ] Any dependent changes are merged and published
## Additional Notes
Add any other context about the pull request here.
## Screenshots/Recordings
Add screenshots or recordings here if applicable.
---
_By submitting this pull request, I confirm that my contribution is made under the terms of the project's license._
# READ CAREFULLY THEN REMOVE
Remove bullet points that are not relevant.
PLEASE REFRAIN FROM USING AI TO WRITE YOUR CODE AND PR DESCRIPTION. IF YOU DO USE AI TO WRITE YOUR CODE PLEASE PROVIDE A DESCRIPTION AND REVIEW IT CAREFULLY. MAKE SURE YOU UNDERSTAND THE CODE YOU ARE SUBMITTING USING AI.
- Pull requests that do not follow these guidelines will be closed without review or comment.
- If you use AI to write your PR description your pr will be close without review or comment.
- If you are unsure about anything, feel free to ask for clarification.
## Description
Please provide a clear description of your changes.
---
## Type of Change
Please delete options that are not relevant.
- [ ] 🐛 Bug fix (non-breaking change which fixes an issue)
- [ ] ✨ New feature (non-breaking change which adds functionality)
- [ ] 💥 Breaking change (fix or feature with breaking changes)
- [ ] 📝 Documentation update
- [ ] 🎨 UI/UX improvement
- [ ] 🔒 Security enhancement
- [ ] ⚡ Performance improvement
## Areas Affected
Please check all that apply:
- [ ] Email Integration (Gmail, IMAP, etc.)
- [ ] User Interface/Experience
- [ ] Authentication/Authorization
- [ ] Data Storage/Management
- [ ] API Endpoints
- [ ] Documentation
- [ ] Testing Infrastructure
- [ ] Development Workflow
- [ ] Deployment/Infrastructure
## Testing Done
Describe the tests you've done:
- [ ] Unit tests added/updated
- [ ] Integration tests added/updated
- [ ] Manual testing performed
- [ ] Cross-browser testing (if UI changes)
- [ ] Mobile responsiveness verified (if UI changes)
## Security Considerations
For changes involving data or authentication:
- [ ] No sensitive data is exposed
- [ ] Authentication checks are in place
- [ ] Input validation is implemented
- [ ] Rate limiting is considered (if applicable)
## Checklist
- [ ] I have read the [CONTRIBUTING](../CONTRIBUTING.md) document
- [ ] My code follows the project's style guidelines
- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in complex areas
- [ ] I have updated the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix/feature works
- [ ] All tests pass locally
- [ ] Any dependent changes are merged and published
## Additional Notes
Add any other context about the pull request here.
## Screenshots/Recordings
Add screenshots or recordings here if applicable.
---
_By submitting this pull request, I confirm that my contribution is made under the terms of the project's license._
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
- **New Features**
- The "From" email selector in the email composer now always appears when aliases are available, offering improved flexibility when composing emails.
- **Bug Fixes**
- Improved layering of the "From" selector dropdown to ensure it displays correctly above other elements.
- **Chores**
- Internal fetching of email aliases streamlines the email composer setup.
- Enhanced logging for email alias retrieval to aid in monitoring and troubleshooting.
- **Style**
- Minor formatting and whitespace improvements across several components for consistency and readability.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
# READ CAREFULLY THEN REMOVE
Remove bullet points that are not relevant.
PLEASE REFRAIN FROM USING AI TO WRITE YOUR CODE AND PR DESCRIPTION. IF YOU DO USE AI TO WRITE YOUR CODE PLEASE PROVIDE A DESCRIPTION AND REVIEW IT CAREFULLY. MAKE SURE YOU UNDERSTAND THE CODE YOU ARE SUBMITTING USING AI.
- Pull requests that do not follow these guidelines will be closed without review or comment.
- If you use AI to write your PR description your pr will be close without review or comment.
- If you are unsure about anything, feel free to ask for clarification.
## Description
Please provide a clear description of your changes.
---
## Type of Change
Please delete options that are not relevant.
- [ ] 🐛 Bug fix (non-breaking change which fixes an issue)
- [ ] ✨ New feature (non-breaking change which adds functionality)
- [ ] 💥 Breaking change (fix or feature with breaking changes)
- [ ] 📝 Documentation update
- [ ] 🎨 UI/UX improvement
- [ ] 🔒 Security enhancement
- [ ] ⚡ Performance improvement
## Areas Affected
Please check all that apply:
- [ ] Email Integration (Gmail, IMAP, etc.)
- [ ] User Interface/Experience
- [ ] Authentication/Authorization
- [ ] Data Storage/Management
- [ ] API Endpoints
- [ ] Documentation
- [ ] Testing Infrastructure
- [ ] Development Workflow
- [ ] Deployment/Infrastructure
## Testing Done
Describe the tests you've done:
- [ ] Unit tests added/updated
- [ ] Integration tests added/updated
- [ ] Manual testing performed
- [ ] Cross-browser testing (if UI changes)
- [ ] Mobile responsiveness verified (if UI changes)
## Security Considerations
For changes involving data or authentication:
- [ ] No sensitive data is exposed
- [ ] Authentication checks are in place
- [ ] Input validation is implemented
- [ ] Rate limiting is considered (if applicable)
## Checklist
- [ ] I have read the [CONTRIBUTING](../CONTRIBUTING.md) document
- [ ] My code follows the project's style guidelines
- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in complex areas
- [ ] I have updated the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix/feature works
- [ ] All tests pass locally
- [ ] Any dependent changes are merged and published
## Additional Notes
Add any other context about the pull request here.
## Screenshots/Recordings
Add screenshots or recordings here if applicable.
---
_By submitting this pull request, I confirm that my contribution is made under the terms of the project's license._
# READ CAREFULLY THEN REMOVE
Remove bullet points that are not relevant.
PLEASE REFRAIN FROM USING AI TO WRITE YOUR CODE AND PR DESCRIPTION. IF YOU DO USE AI TO WRITE YOUR CODE PLEASE PROVIDE A DESCRIPTION AND REVIEW IT CAREFULLY. MAKE SURE YOU UNDERSTAND THE CODE YOU ARE SUBMITTING USING AI.
- Pull requests that do not follow these guidelines will be closed without review or comment.
- If you use AI to write your PR description your pr will be close without review or comment.
- If you are unsure about anything, feel free to ask for clarification.
## Description
Please provide a clear description of your changes.
---
## Type of Change
Please delete options that are not relevant.
- [ ] 🐛 Bug fix (non-breaking change which fixes an issue)
- [ ] ✨ New feature (non-breaking change which adds functionality)
- [ ] 💥 Breaking change (fix or feature with breaking changes)
- [ ] 📝 Documentation update
- [ ] 🎨 UI/UX improvement
- [ ] 🔒 Security enhancement
- [ ] ⚡ Performance improvement
## Areas Affected
Please check all that apply:
- [ ] Email Integration (Gmail, IMAP, etc.)
- [ ] User Interface/Experience
- [ ] Authentication/Authorization
- [ ] Data Storage/Management
- [ ] API Endpoints
- [ ] Documentation
- [ ] Testing Infrastructure
- [ ] Development Workflow
- [ ] Deployment/Infrastructure
## Testing Done
Describe the tests you've done:
- [ ] Unit tests added/updated
- [ ] Integration tests added/updated
- [ ] Manual testing performed
- [ ] Cross-browser testing (if UI changes)
- [ ] Mobile responsiveness verified (if UI changes)
## Security Considerations
For changes involving data or authentication:
- [ ] No sensitive data is exposed
- [ ] Authentication checks are in place
- [ ] Input validation is implemented
- [ ] Rate limiting is considered (if applicable)
## Checklist
- [ ] I have read the [CONTRIBUTING](../CONTRIBUTING.md) document
- [ ] My code follows the project's style guidelines
- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in complex areas
- [ ] I have updated the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix/feature works
- [ ] All tests pass locally
- [ ] Any dependent changes are merged and published
## Additional Notes
Add any other context about the pull request here.
## Screenshots/Recordings
Add screenshots or recordings here if applicable.
---
_By submitting this pull request, I confirm that my contribution is made under the terms of the project's license._
# READ CAREFULLY THEN REMOVE
Remove bullet points that are not relevant.
PLEASE REFRAIN FROM USING AI TO WRITE YOUR CODE AND PR DESCRIPTION. IF YOU DO USE AI TO WRITE YOUR CODE PLEASE PROVIDE A DESCRIPTION AND REVIEW IT CAREFULLY. MAKE SURE YOU UNDERSTAND THE CODE YOU ARE SUBMITTING USING AI.
- Pull requests that do not follow these guidelines will be closed without review or comment.
- If you use AI to write your PR description your pr will be close without review or comment.
- If you are unsure about anything, feel free to ask for clarification.
## Description
Please provide a clear description of your changes.
---
## Type of Change
Please delete options that are not relevant.
- [ ] 🐛 Bug fix (non-breaking change which fixes an issue)
- [ ] ✨ New feature (non-breaking change which adds functionality)
- [ ] 💥 Breaking change (fix or feature with breaking changes)
- [ ] 📝 Documentation update
- [ ] 🎨 UI/UX improvement
- [ ] 🔒 Security enhancement
- [ ] ⚡ Performance improvement
## Areas Affected
Please check all that apply:
- [ ] Email Integration (Gmail, IMAP, etc.)
- [ ] User Interface/Experience
- [ ] Authentication/Authorization
- [ ] Data Storage/Management
- [ ] API Endpoints
- [ ] Documentation
- [ ] Testing Infrastructure
- [ ] Development Workflow
- [ ] Deployment/Infrastructure
## Testing Done
Describe the tests you've done:
- [ ] Unit tests added/updated
- [ ] Integration tests added/updated
- [ ] Manual testing performed
- [ ] Cross-browser testing (if UI changes)
- [ ] Mobile responsiveness verified (if UI changes)
## Security Considerations
For changes involving data or authentication:
- [ ] No sensitive data is exposed
- [ ] Authentication checks are in place
- [ ] Input validation is implemented
- [ ] Rate limiting is considered (if applicable)
## Checklist
- [ ] I have read the [CONTRIBUTING](../CONTRIBUTING.md) document
- [ ] My code follows the project's style guidelines
- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in complex areas
- [ ] I have updated the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix/feature works
- [ ] All tests pass locally
- [ ] Any dependent changes are merged and published
## Additional Notes
Add any other context about the pull request here.
## Screenshots/Recordings
Add screenshots or recordings here if applicable.
---
_By submitting this pull request, I confirm that my contribution is made under the terms of the project's license._
# READ CAREFULLY THEN REMOVE
Remove bullet points that are not relevant.
PLEASE REFRAIN FROM USING AI TO WRITE YOUR CODE AND PR DESCRIPTION. IF YOU DO USE AI TO WRITE YOUR CODE PLEASE PROVIDE A DESCRIPTION AND REVIEW IT CAREFULLY. MAKE SURE YOU UNDERSTAND THE CODE YOU ARE SUBMITTING USING AI.
- Pull requests that do not follow these guidelines will be closed without review or comment.
- If you use AI to write your PR description your pr will be close without review or comment.
- If you are unsure about anything, feel free to ask for clarification.
## Description
Please provide a clear description of your changes.
---
## Type of Change
Please delete options that are not relevant.
- [ ] 🐛 Bug fix (non-breaking change which fixes an issue)
- [ ] ✨ New feature (non-breaking change which adds functionality)
- [ ] 💥 Breaking change (fix or feature with breaking changes)
- [ ] 📝 Documentation update
- [ ] 🎨 UI/UX improvement
- [ ] 🔒 Security enhancement
- [ ] ⚡ Performance improvement
## Areas Affected
Please check all that apply:
- [ ] Email Integration (Gmail, IMAP, etc.)
- [ ] User Interface/Experience
- [ ] Authentication/Authorization
- [ ] Data Storage/Management
- [ ] API Endpoints
- [ ] Documentation
- [ ] Testing Infrastructure
- [ ] Development Workflow
- [ ] Deployment/Infrastructure
## Testing Done
Describe the tests you've done:
- [ ] Unit tests added/updated
- [ ] Integration tests added/updated
- [ ] Manual testing performed
- [ ] Cross-browser testing (if UI changes)
- [ ] Mobile responsiveness verified (if UI changes)
## Security Considerations
For changes involving data or authentication:
- [ ] No sensitive data is exposed
- [ ] Authentication checks are in place
- [ ] Input validation is implemented
- [ ] Rate limiting is considered (if applicable)
## Checklist
- [ ] I have read the [CONTRIBUTING](../CONTRIBUTING.md) document
- [ ] My code follows the project's style guidelines
- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in complex areas
- [ ] I have updated the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix/feature works
- [ ] All tests pass locally
- [ ] Any dependent changes are merged and published
## Additional Notes
Add any other context about the pull request here.
## Screenshots/Recordings
Add screenshots or recordings here if applicable.
---
_By submitting this pull request, I confirm that my contribution is made under the terms of the project's license._
# READ CAREFULLY THEN REMOVE
Remove bullet points that are not relevant.
PLEASE REFRAIN FROM USING AI TO WRITE YOUR CODE AND PR DESCRIPTION. IF YOU DO USE AI TO WRITE YOUR CODE PLEASE PROVIDE A DESCRIPTION AND REVIEW IT CAREFULLY. MAKE SURE YOU UNDERSTAND THE CODE YOU ARE SUBMITTING USING AI.
- Pull requests that do not follow these guidelines will be closed without review or comment.
- If you use AI to write your PR description your pr will be close without review or comment.
- If you are unsure about anything, feel free to ask for clarification.
## Description
Please provide a clear description of your changes.
---
## Type of Change
Please delete options that are not relevant.
- [ ] 🐛 Bug fix (non-breaking change which fixes an issue)
- [ ] ✨ New feature (non-breaking change which adds functionality)
- [ ] 💥 Breaking change (fix or feature with breaking changes)
- [ ] 📝 Documentation update
- [ ] 🎨 UI/UX improvement
- [ ] 🔒 Security enhancement
- [ ] ⚡ Performance improvement
## Areas Affected
Please check all that apply:
- [ ] Email Integration (Gmail, IMAP, etc.)
- [ ] User Interface/Experience
- [ ] Authentication/Authorization
- [ ] Data Storage/Management
- [ ] API Endpoints
- [ ] Documentation
- [ ] Testing Infrastructure
- [ ] Development Workflow
- [ ] Deployment/Infrastructure
## Testing Done
Describe the tests you've done:
- [ ] Unit tests added/updated
- [ ] Integration tests added/updated
- [ ] Manual testing performed
- [ ] Cross-browser testing (if UI changes)
- [ ] Mobile responsiveness verified (if UI changes)
## Security Considerations
For changes involving data or authentication:
- [ ] No sensitive data is exposed
- [ ] Authentication checks are in place
- [ ] Input validation is implemented
- [ ] Rate limiting is considered (if applicable)
## Checklist
- [ ] I have read the [CONTRIBUTING](../CONTRIBUTING.md) document
- [ ] My code follows the project's style guidelines
- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in complex areas
- [ ] I have updated the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix/feature works
- [ ] All tests pass locally
- [ ] Any dependent changes are merged and published
## Additional Notes
Add any other context about the pull request here.
## Screenshots/Recordings
Add screenshots or recordings here if applicable.
---
_By submitting this pull request, I confirm that my contribution is made under the terms of the project's license._