# 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
Simplified the email assistant system prompt for clarity and added server-side tool execution for voice and web integrations.
- **Refactors**
- Rewrote the assistant prompt to be shorter, more direct, and easier for models to follow.
- Removed unused and verbose prompt sections.
- **New Features**
- Added a server-side tool execution endpoint and utility for handling tool calls from the client.
- Introduced a script to register all tools with ElevenLabs for voice agent integration.
<!-- End of auto-generated description by cubic. -->
## 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 -->
# 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 -->
## Description
Added a confirmation dialog when users attempt to close the email composer with unsaved content. This prevents accidental data loss by prompting users to confirm before discarding their draft. Also implemented browser-level protection against navigation/refresh when there's unsaved content in the composer.
## Type of Change
- [x] 🐛 Bug fix (non-breaking change which fixes an issue)
- [x] 🎨 UI/UX improvement
## Areas Affected
- [x] User Interface/Experience
- [x] Email Integration (Gmail, IMAP, etc.)
## 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 changes include:
1. Added a confirmation dialog when users try to close the email composer with unsaved content
2. Implemented browser-level protection against navigation/refresh with unsaved content
3. Fixed the Escape key behavior to show confirmation dialog instead of immediately closing
4. Improved state cleanup when closing the composer (clearing threadId, activeReplyId, etc.)
5. Fixed compose hotkey behavior to only close the compose window, not toggle it
6. Added proper cleanup of draft state when unmounting the composer component
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
- **New Features**
- Added support for forwarding emails, allowing users to send existing messages to new recipients with original content included.
- **Bug Fixes**
- Improved formatting for quoted and forwarded message sections in email bodies.
- **Chores**
- Enhanced email composition options to handle more flexible message metadata, such as optional attachments, headers, and recipient fields.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This PR standardizes dark mode colors across the application by replacing hardcoded color values with semantic color variables. It also enhances the AI Chat component with improved tool response rendering and adds a new voice chat capability.
Key changes:
- Replaced hardcoded dark background colors (`#1A1A1A`) with the semantic `bg-panelDark` class
- Replaced hardcoded text colors with semantic classes like `text-muted-foreground`
- Enhanced the AI Chat component with better tool response visualization
- Added tooltips to display tool arguments in AI responses
- Improved email composer editor focus handling
- Added a new Tools enum to better type and organize AI tool capabilities
- [x] 🎨 UI/UX improvement
- [x] ⚡ Performance improvement
- [x] User Interface/Experience
- [x] Manual testing performed
- [x] Cross-browser testing (if UI changes)
- [x] Mobile responsiveness verified (if UI changes)
- [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
This PR is part of our ongoing effort to standardize the UI color system and improve the dark mode experience. The changes to the AI Chat component make tool responses more informative and easier to understand.
_By submitting this pull request, I confirm that my contribution is made under the terms of the project's license._
* added attachments view to email-display and added grabbing attachments to google driver
* move attachments dialog
* remove comments
* nitpick comments from rabbit ai
* changed framer motion imports to motion/react
* quality improvements
* refactored google.ts for usability and attachments now work
---------
Co-authored-by: Nizzy <nizabizaher@gmail.com>
* fix: remove tracked node_modules/.bin files
* added to .gitignore
* update compose
* feat: Add AI brain and summary features for email
- Implemented EnableBrain action to subscribe to mail gateway
- Created GetSummary action to retrieve email thread summaries
- Added useSummary hook for fetching summaries
- Introduced mail0_summary database table
- Added Brain button to app sidebar for enabling AI features
* fix: Improve null safety and remove unused imports
- Fixed potential null access in thread-display by checking array first
- Removed unused markAsReadAction import in use-threads hook
- Removed unnecessary cache deletion logic in IndexedDB storage provider
- Removed threadId from ParsedMessage type definition
* fix: Use environment variable for brain gateway URL
- Replace hardcoded mail gateway URL with configurable environment variable
- Improve flexibility and configuration of brain subscription endpoint
* big push for connections and server actions:
- unread count ✅
- remove `/connect-email` ✅
- update redirects and callbacks to `/settings/connections` ✅
- make everything else server actions ✅
- remove old route.ts files ✅
* feat: Improve HTML text extraction and email parsing
- Added Cheerio for robust HTML text extraction in extractTextFromHTML
- Enhanced null safety in Google email driver for sender name and subject
- Updated mail list and threads hooks to handle potential undefined values
- Improved text cleaning and handling of edge cases in email parsing
* editor working
* compose and video
* fix: remove t3-oss env
* update max results to 10 per requst
* zero button floating sidebar
* lots of changes:
- removes old mail compose modal
- smaller upload limit
- useReducer on components with lots of state
- image logos for some file types (still more to add)
- resolve comments from previous review
* add logos
* straing to staging
* improvements to create ui (#345)
* made create wider
* send to multiple emails and new ui for 'to' list
* add icons for file upload (#346)
* added icon for figma icon
* added else ifs for other icons
* add file name to the getLogo func
* fix figma if statement
* fix figma
* fix excel
* remove console logs
* fix back to original component
* file icons
* ui tweaks
---------
Co-authored-by: Nizzy <nizabizaher@gmail.com>
Co-authored-by: nizzy <140507264+nizzyabi@users.noreply.github.com>
* fix: sidebar and settings page ui fixes (#348)
* fixes
* define to emails
* rotate on hover logo
* early access count on homepage
* updated readme
---------
Co-authored-by: Sijan Mainali <sijanmainali2@gmail.com>
Co-authored-by: Adam <x_1337@outlook.com>
Co-authored-by: Nizzy <nizabizaher@gmail.com>
Co-authored-by: user12224 <122770437+user12224@users.noreply.github.com>
Co-authored-by: nizzy <140507264+nizzyabi@users.noreply.github.com>