# Package Dependency Updates
## Description
This PR updates several package dependencies across the project:
- Updated `@elevenlabs/react` from 0.1.5 to 0.5.1 in mail app
- Added `@elevenlabs/elevenlabs-js` 2.12.2 to server app
- Removed unused dependencies: `deepmerge`, `dexie`, `emblor`, and `react-markdown`
- Added `sanitize-html` 2.16.0 to mail app
- Removed `elevenlabs` 1.59.0 from server (replaced with newer `@elevenlabs/elevenlabs-js`)
- Updated PNPM package manager from 10.12.1 to 10.15.0
- Updated Node types from 22.15.29 to 24.3.0
- Updated various dev dependencies including prettier, dotenv-cli, and tsx
- Updated Zod from 3.25.42 to 4.1.1
- Updated wrangler catalog version from 4.28.1 to 4.32.0
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
* **Security**
* Safer message rendering via HTML sanitization.
* **Improvements**
* Updated voice/AI integration for increased reliability and compatibility.
* General stability and performance enhancements across the app.
* **Chores**
* Upgraded core libraries, developer tooling, and package manager to latest versions.
<!-- 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
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. -->
1. Get both the better auth session tokens from appliations/cookies in .env
<img width="852" height="316" alt="image" src="https://github.com/user-attachments/assets/0177c496-103c-4111-8a80-089d1f4a6f94" />
2. Enter the email you wish to send to in .env
3. `cd packages/testing`
3. run `npm test:e2e:headed`
thats it tbh
https://github.com/user-attachments/assets/b703e78c-2373-40a2-b431-f9ba53d5d871
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Added Playwright end-to-end tests for the mail inbox flow, including authentication setup and email send/reply actions.
- **New Features**
- Added Playwright config, test scripts, and environment variables for E2E testing.
- Implemented tests to sign in, send an email, and reply within the same session.
<!-- End of auto-generated description by cubic. -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
## Summary by CodeRabbit
* **New Features**
* Introduced a comprehensive testing package with support for unit, UI, and end-to-end tests.
* Added Playwright-based authentication setup and mail inbox end-to-end test scripts.
* Provided a dedicated test configuration and TypeScript setup for robust test execution.
* **Chores**
* Updated environment variable examples to support Playwright testing.
* Enhanced main project scripts to facilitate various testing modes.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Description
Integrated Dub Analytics into the application to track user interactions and improve analytics capabilities. This PR adds the Dub Analytics component to the mail application layout and configures the analytics plugin in the authentication system.
---
## Type of Change
- [x] ✨ New feature (non-breaking change which adds functionality)
- [x] ⚡ Performance improvement
## Areas Affected
- [x] Authentication/Authorization
- [x] User Interface/Experience
- [x] Data Storage/Management
## Testing Done
- [x] Manual testing performed
## 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] I have updated the documentation
## Additional Notes
The Dub Analytics integration provides better insights into user behavior while maintaining privacy standards. The implementation includes:
1. Added Dub Analytics component to the mail application layout with domain configuration
2. Integrated Dub analytics plugin into the authentication system
3. Added required dependencies (@dub/analytics, @dub/better-auth, and dub) to the project
<!-- 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 -->
…essing
# 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**
- Introduced AI voice call handling with Twilio and ElevenLabs integration, enabling real-time conversational AI over phone calls.
- Added a new /ai API route for voice and call management.
- Implemented a system prompt for an AI email assistant with robust tool invocation and safety protocols.
- Added a new database table for key management (JWKS).
- Added endpoints for obtaining signed URLs for ElevenLabs conversational AI.
- Added voice-related API routes and integrated voiceRouter into main API.
- **Improvements**
- Enhanced authentication by supporting bearer tokens and refining session user handling throughout the app.
- Updated Zod schema descriptions for improved API documentation.
- Streamlined context management for user sessions across server routes and procedures.
- **Chores**
- Updated dependencies and added new packages for Twilio, ElevenLabs, and JOSE.
- Added scripts for streamlined Docker database management and development startup.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
- Update deps
- Fix i8n issues where it tries to translate hardcoded strings
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
- **Bug Fixes**
- Improved translation handling for navigation titles in the command palette, ensuring titles are translated only once and displayed correctly.
- **Chores**
- Removed unnecessary 'use client' directives from several UI components.
- Updated and cleaned up dependencies across the workspace, including removal of unused packages and bumping versions.
- Simplified and reorganized script commands for development and database operations.
- Adjusted configuration files for improved client/server build warmup and removed obsolete Turbo tasks.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Updated `turbo.json` with a corrected cache configuration URL. Removed `@inquirer/prompts` from `devDependencies` in `package.json` as it is no longer needed.
Removed the "ui" field from turbo.json as it's no longer needed. Added a new "scripts" command in package.json to run mail app scripts with bun, improving functionality and organization.
Enhanced email assistant prompts with new system prompt templates and dynamic style generation logic. Updated dependencies including @langchain/core, @ai-sdk/groq, and others for improved functionality and compatibility.
* fix: improve mail list and thread management with updated hooks and layout adjustments
* conflicts
---------
Co-authored-by: Nizzy <nizabizaher@gmail.com>