Skip to content

Comments

feat: Add Lair404 driver implementation and integrate its connection setup into the mail client#2054

Open
illforte wants to merge 87 commits intoMail-0:mainfrom
illforte:lair404-clean
Open

feat: Add Lair404 driver implementation and integrate its connection setup into the mail client#2054
illforte wants to merge 87 commits intoMail-0:mainfrom
illforte:lair404-clean

Conversation

@illforte
Copy link

Summary

This PR adds support for Lair404 mail server as a custom mail provider, allowing users to connect their Lair404 email accounts to the mail client.

Changes

  • Lair404 Mail Driver: New driver implementation for Lair404 mail server using SMTP/nodemailer
  • Connection Setup UI: Added Lair404-specific setup form with SMTP configuration
  • Crypto Module: Email password encryption/decryption support
  • Verification: Email verification utilities for SMTP connections
  • Schema Updates: Extended connection schema to support Lair404 provider type
  • Icons: Added Lair404 branding icons

Technical Details

  • Uses nodemailer for SMTP-based email sending
  • Supports custom SMTP host/port configuration (default: mail.lair404.xyz:587)
  • Implements MailManager interface for consistency with other providers
  • Includes encrypted password storage for security

Testing

  • ESLint: All linting errors resolved (0 warnings, 0 errors)
  • TypeScript: Type-safe implementation following existing patterns
  • Integration: Follows same patterns as Google/Microsoft drivers

Screenshots

N/A - Backend implementation


🤖 Generated with Claude Code

khardikk and others added 30 commits August 3, 2025 15:16
…ch queries (Mail-0#1902)

# 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 -->
…on (Mail-0#1915)

# Email Syncing Status Indicators

## Description

Added real-time email syncing status indicators to the mail UI that show when emails are being synchronized, which folders are currently syncing, and the current storage size. This provides users with better visibility into background processes.

## 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

## 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

This PR implements a state management system for email synchronization status using Jotai atoms. The server now broadcasts syncing status through Party, and the UI displays this information in a non-intrusive way at the top of the mail interface.

Key changes:
- Created a new `useDoState` hook to manage syncing state
- Added status indicators in the mail layout component
- Modified the server to track and broadcast syncing status
- Improved folder synchronization logic to be more efficient
- Removed unnecessary delays in the synchronization process

---

_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**
  * Added a real-time syncing status indicator in the mail interface, displaying current sync progress, folders being synced, and storage usage.
  * Introduced live syncing state updates communicated between server and client for improved sync transparency.

* **Improvements**
  * Enhanced background synchronization logic to provide clearer feedback on syncing activity.
  * Real-time updates now reflect the latest syncing state without delays.
  * Removed artificial delays in syncing processes for faster synchronization.
  * Triggered folder syncing asynchronously when fetching threads from the database.

* **Bug Fixes**
  * Removed unused and obsolete code related to database table management and sync rate-limiting.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Hey team,

[**Lingo.dev**](https://lingo.dev) here with fresh translations!

### In this update

- Added missing translations
- Performed brand voice, context and glossary checks
- Enhanced translations using Lingo.dev Localization Engine

### Next Steps

- [ ] Review the changes
- [ ] Merge when ready
    
<!-- This is an auto-generated description by cubic. -->
---

## Summary by cubic
Updated translations for the "categories" label in all supported languages to use the more accurate term for "views" in each locale. This improves clarity in the mail app navigation.

<!-- End of auto-generated description by cubic. -->
# 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
Removed email hover tracking and all related event listeners from the mail list and hotkey logic.

- **Refactors**
  - Commented out email hover event dispatch and handlers in mail-list and mail components.
  - Removed emailHover event listener logic from mail-list-hotkeys.

<!-- End of auto-generated description by cubic. -->
…ement (Mail-0#1917)

# 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 -->
Co-authored-by: amrit <iamamrit27@gmail.com>
# 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
Removed the sync status indicator from the mail layout and fixed trailing commas in wrangler.jsonc files to ensure valid JSONC formatting.

- **Bug Fixes**
  - Cleaned up JSONC files by removing trailing commas that could cause parsing errors.

<!-- End of auto-generated description by cubic. -->



<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

* **Bug Fixes**
  * Removed the syncing status indicator from the mail interface.

* **Chores**
  * Updated configuration files with improved formatting and added new rules for handling certain file types in different environments.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Hey team,

[**Lingo.dev**](https://lingo.dev) here with fresh translations!

### In this update

- Added missing translations
- Performed brand voice, context and glossary checks
- Enhanced translations using Lingo.dev Localization Engine

### Next Steps

- [ ] Review the changes
- [ ] Merge when ready
    
<!-- This is an auto-generated description by cubic. -->
---

## Summary by cubic
Added missing translations for the "Undo Send" feature in all supported languages to improve email settings localization.

<!-- End of auto-generated description by cubic. -->
# 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
Updated email queue IDs in wrangler.jsonc to match new configuration and removed an unused import from the mail component.

<!-- End of auto-generated description by cubic. -->
# 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
Removed the created_at and updated_at fields from the threads table and updated related code and migrations.

<!-- End of auto-generated description by cubic. -->
# 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
Switched thread label management to use label names instead of label IDs throughout the backend.

- **Refactors**
  - Updated database schema and related code to remove label ID fields and use label names for adding, removing, and displaying thread labels.
  - Adjusted prompt instructions and tool descriptions to reference label names.

<!-- End of auto-generated description by cubic. -->



<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

* **New Features**
  * Introduced a new web search tool that provides concise answers to user queries using Perplexity AI.

* **Bug Fixes**
  * Improved reliability when modifying thread labels, ensuring accurate label retrieval even if a thread is not initially found.

* **Refactor**
  * Updated label handling to use label names instead of IDs throughout the app.
  * Removed unused label-related data from thread records for improved data consistency.

* **Style**
  * Enhanced descriptions for label modification parameters to clarify expected input.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
…1928)

# 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
Updated example queries in the chat interface and clarified tool descriptions to make them easier to understand and use.

- **Improvements**
  - Replaced and refined example queries for better relevance.
  - Expanded tool descriptions to give clearer guidance on their purpose and usage.
  - Added a rule to prevent returning IDs directly in responses.

<!-- End of auto-generated description by cubic. -->
# Add Numeric Hotkeys for Category Selection in Mail List

## Description

This PR adds keyboard shortcuts for quickly toggling mail categories in the inbox view:
- Numbers 1-9 toggle the corresponding categories (based on their index)
- Number 0 clears all selected labels

The implementation uses React Hotkeys Hook to register these shortcuts within the mail-list scope, making View switching much faster for keyboard-oriented users.

## Type of Change

- [x] ✨ New feature (non-breaking change which adds functionality)
- [x] 🎨 UI/UX improvement

## Areas Affected

- [x] User Interface/Experience

## Testing Done

- [x] Manual testing performed

## Checklist

- [x] I have performed a self-review of my code
- [x] My changes generate no new warnings

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

* **New Features**
  * Added keyboard shortcuts (number keys 1–9) to quickly toggle category label filters in the mail category dropdown.
  * Added a keyboard shortcut (0 key) to clear all active category label filters.

* **Refactor**
  * Disabled previous keyboard shortcuts for switching mail list categories to avoid conflicts and streamline shortcut behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
…l-0#1929)

# 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
When resetting the sync state, the system now deletes the thread_labels and labels tables in addition to threads. This ensures all related label data is cleared during a sync reset.

<!-- End of auto-generated description by cubic. -->



<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

* **Bug Fixes**
  * Improved data consistency by ensuring that additional related tables are cleared during a forced resynchronization.
<!-- 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 do state broadcasting to the syncThread function so that state changes are shared after each sync.

- **New Features**
  - Calls sendDoState and logs the result after syncing a thread.
  - Handles errors during broadcasting without interrupting the sync process.

<!-- End of auto-generated description by cubic. -->
…0#1931)

# 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 a retry mechanism to syncThreads so that if thread listing fails, it waits 1 minute and retries the same page instead of skipping it.

- **Bug Fixes**
  - Prevents data loss by ensuring failed thread listing pages are retried, not skipped.

<!-- End of auto-generated description by cubic. -->



<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

* **Bug Fixes**
  * Improved error handling and retry logic to prevent immediate failures when listing threads, enabling automatic retries after a short delay.
  * Enhanced logging to provide clearer information about retry attempts and page processing status.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
The new implementation:
- Uses a single `useHotkeys` call with an array of key combinations
- Determines the appropriate category based on the pressed key
- Handles toggling labels in a more centralized way

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

* **Refactor**
  * Simplified hotkey handling for category selection by consolidating multiple hotkey registrations into a single, unified hotkey listener.
  * The '0' key now selects the 10th category instead of clearing all labels.

<!-- 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 a ThreadSyncWorker Durable Object to handle thread synchronization, improving reliability and separation of concerns in thread syncing.

- **New Features**
  - Introduced ThreadSyncWorker for dedicated thread sync operations.
  - Updated server logic to use ThreadSyncWorker for fetching and storing thread data.
  - Registered ThreadSyncWorker in environment and configuration files.

<!-- End of auto-generated description by cubic. -->



<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

* **New Features**
  * Introduced a new background worker to improve email thread synchronization reliability and performance.
  * Enhanced logging for thread synchronization, including duration and progress details.

* **Bug Fixes**
  * Increased retry attempts for Gmail rate-limiting errors to improve sync robustness.

* **Chores**
  * Updated environment and configuration settings to support the new background worker.
  * Removed keyboard shortcut functionality for category labels in the mail interface.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Adam <github@ajxb.net>
Co-authored-by: Aj Wazzan <x_1337@outlook.com>
…imits (Mail-0#1941)

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Adam <github@ajxb.net>
Co-authored-by: Aj Wazzan <x_1337@outlook.com>
…ail-0#1943)

# 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 -->
<!-- This is an auto-generated description by cubic. -->

## Summary by cubic
Refined the system prompt for the email assistant to clarify tool usage, safety protocols, and response guidelines. Updated eval test case builders for more realistic coverage and improved test data generation.

- **Prompt Improvements**
  - Expanded instructions on when and how to use tools, safety checks, and bulk actions.
  - Added detailed workflow examples, safety protocols, and clearer self-check steps.
  - Updated common use cases and removed manual instruction responses.

- **Eval Updates**
  - Replaced and improved test case builders for Gmail search and email composition.
  - Made test prompts and expected outputs more realistic and varied.

<!-- End of auto-generated description by cubic. -->



<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

* **New Features**
  * Enhanced AI assistant guidance with more detailed instructions for tool usage, safety protocols, and workflow examples.
  * Added comprehensive safety protocols for bulk and destructive email operations, including confirmation steps and undo guidance.
  * Expanded support for contextual assistance and smart organization workflows.

* **Refactor**
  * Improved and modularized test case generation for AI email search and composition, with stricter validation and clearer prompts.

* **Style**
  * Updated prompt language to prioritize relevance in email retrieval instead of a fixed number of recent emails.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
<!-- This is an auto-generated description by cubic. -->

## Summary by cubic
Added Playwright end-to-end tests for bulk actions and search in the AI chat sidebar to ensure key workflows work as expected.

- **New Features**
  - Added tests that simulate sending bulk action and search commands in the chat sidebar.
  - Updated chat message markup to support easier test targeting.

<!-- End of auto-generated description by cubic. -->



<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

* **Bug Fixes**
  * Improved identification of message roles in the AI chat component for enhanced accessibility and testing.

* **Tests**
  * Added a new end-to-end test suite to verify AI Chat Sidebar functionality, including user interactions and AI responses.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
added playwright tests for marking an email as read, unread and starring it upon right clicking
    
<!-- This is an auto-generated description by cubic. -->
---

## Summary by cubic
Added Playwright tests to cover marking an email as read, unread, and favoriting it using right-click actions in the inbox.

<!-- End of auto-generated description by cubic. -->



<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

* **Tests**
  * Added a new end-to-end test verifying that users can mark emails as favorite, read, and unread in the inbox. The test ensures proper UI interactions and state changes for these mail actions.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
…n sidebar (Mail-0#1920)

# 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 Playwright end-to-end tests to verify that the sidebar correctly summarizes the past five emails.

- **Testing**
  - Checks that the AI chat sidebar opens and displays a summary when prompted.
  - Confirms the summary is visible and contains content.

<!-- End of auto-generated description by cubic. -->



<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

* **New Features**
  * Added an end-to-end test to verify that the AI chat can summarize recent emails and display the result in the inbox sidebar.

* **Style**
  * Added a data attribute to each AI chat message for improved message role identification.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
goes through the cmd+k search shortcut and runs:

1. last seven days of emails
2. starred emails
3. with attachments

run w `pnpm test:e2e:headed search-bar.spec.ts`
    
<!-- This is an auto-generated description by cubic. -->
---

## Summary by cubic
Added Playwright end-to-end tests to verify that the search bar correctly applies and clears filters for "Last 7 Days," "Starred Emails," and "With Attachments" using the command palette.

<!-- End of auto-generated description by cubic. -->



<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

* **Tests**
  * Added a new end-to-end test to verify that search bar filters ("With Attachments", "Last 7 Days", "Starred Emails") can be applied and cleared using the command palette. The test also checks for the correct display and removal of the "Clear" button in the search bar.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
…ail-0#1944)

<!-- This is an auto-generated description by cubic. -->

## Summary by cubic
Added GitHub workflows to automatically close stale issues and pull requests with unresolved merge conflicts older than 3 days.

- **Automation**
  - Closes open pull requests with merge conflicts after 3 days.
  - Closes issues immediately when marked as stale.

<!-- End of auto-generated description by cubic. -->



<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

* **Chores**
  * Introduced automated workflows to close old pull requests with unresolved merge conflicts and to close stale issues, helping keep the repository clean and up to date.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
MrgSub and others added 27 commits August 10, 2025 10:43
# 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
Upgraded wrangler from version 4.22.0 to 4.28.1 to ensure compatibility with the latest Cloudflare tooling.

- **Dependencies**
  - Updated wrangler and related packages in pnpm-lock.yaml and pnpm-workspace.yaml.

<!-- End of auto-generated description by cubic. -->
# Add ability to delete drafts

This PR adds the ability to delete drafts directly from the mail list interface. It implements:

1. A delete button that appears when hovering over draft items
2. Backend support for draft deletion in both Google and Microsoft mail providers
3. Optimistic UI updates to immediately remove deleted drafts from the view

The implementation follows the existing optimistic action pattern used for other mail operations, ensuring a consistent user experience.

## Type of Change

- ✨ New feature (non-breaking change which adds functionality)

## Areas Affected

- [x] Email Integration (Gmail, Outlook, etc.)
- [x] User Interface/Experience
- [x] API Endpoints

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- New Features
  - Delete drafts directly from the mail list via a new trash icon on each draft.
  - Immediate, optimistic removal of deleted drafts from the list for faster feedback.
  - Contextual tooltips on draft actions for clearer guidance.

- Bug Fixes
  - Corrected a visual offset issue in the action bar for consistent positioning.
  - Improved range selection behavior for multi-select actions.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
…-0#1984)

## Description

Fixed a UI issue in the mail list component by changing the overflow behavior of draft messages from `overflow-clip` to `overflow-visible`. Also removed an unnecessary decorative bar element that was positioned absolutely on the left side of draft messages.

## Type of Change

- [x] 🐛 Bug fix (non-breaking change which fixes an issue)
- [x] 🎨 UI/UX improvement

## Areas Affected

- [x] User Interface/Experience

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

- **Style**
  - Updated the appearance of draft messages in the Mail list: removed the left-side accent line for a cleaner look.
  - Adjusted item layout to allow content to display fully without being clipped, improving readability and visual consistency.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
…ail-0#1978)

<!-- This is an auto-generated description by cubic. -->

## Summary by cubic
Added autofocus to the email composer after selecting a template, so users can start editing right away. This improves workflow by placing the cursor at the end of the content automatically.

<!-- End of auto-generated description by cubic. -->



<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

- New Features
  - Added a delete confirmation toast with an action before removing a template.
  - Added an empty-state message when no templates are available.
  - Applying a template now fills subject, body, and recipients, then returns focus to the editor.
  - The template menu closes immediately after selection.
  - Smoother searching/filtering when browsing templates.

- Bug Fixes
  - Templates list refreshes after creating a new template to reliably show the latest items.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
…ail-0#1979)

<!-- This is an auto-generated description by cubic. -->

## Summary by cubic
Added a close (cross) button to the undo email toast and reduced the undo window from 30 seconds to 15 seconds. 

- **UI Improvements**
 - The undo toast now shows a close button for quick dismissal.
 - The undo option is available for 15 seconds instead of 30.

<!-- End of auto-generated description by cubic. -->



<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

* **New Features**
  * Improved Undo experience: separate flows for scheduled vs. immediate sends with clearer toasts. Undoing a scheduled send cancels scheduling; undoing an immediate send restores the draft (including attachments) and reopens the composer. Toasts now last 15 seconds and include a close button.
  * Default delay before processing a send/schedule reduced from 30 seconds to 15 seconds.

* **Bug Fixes**
  * Prevented negative time remaining, ensuring Undo is reliably available and consistent with the 5-second gating.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Co-authored-by: Adam <13007539+MrgSub@users.noreply.github.com>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
…consistent vertical spacing in the navigation links (Mail-0#2004)
# 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 -->
- Prefix all unused parameters with underscores in lair404.ts, microsoft.ts
- Remove unused imports and declarations from chat.ts (parseHeaders, groq, ThreadRow, createSimpleAuth, SimpleAuth, ConnectionContext)
- Remove unused catch parameters from email-verification.ts and chat.ts
- Update error references to _error where error is logged but parameter was renamed
- Remove unused variable pageCount from chat.ts

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
fscheugen4 and others added 2 commits February 16, 2026 15:40
- Docker Compose config for lair404 (port 3050)
- PostgreSQL + Valkey/Redis stack
- Nginx reverse proxy with Cloudflare Access SSO
- AMD64 build script (GHCR push)
- Automated deployment script
- Comprehensive deployment guide

Security:
- 127.0.0.1 port binding (no 0.0.0.0)
- JWT authentication via Cloudflare Access
- Environment variables from .env file
- Dual credential storage (Vault + MCP)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- apps/server/src/lib/driver/imap.ts: Full ImapMailManager class with all
  patches baked in (folder-aware IDs, latest field, sender parsing, etc.)
- apps/server/src/lib/driver/index.ts: Register 'lair404' provider
- packages/imap-proxy/: Complete IMAP/SMTP HTTP bridge service
- DEPLOY-LAIR404.md: Rebuild instructions for ghcr.io/lair404xyz images

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.