# Implement Thread Deletion Functionality
## Description
This PR implements thread deletion functionality, allowing users to permanently delete threads from the bin. The implementation includes:
1. Replacing the optimistic delete with a real deletion using TRPC mutation
2. Enabling the previously disabled delete button in the thread context menu
3. Adding server-side support for thread deletion from the database
4. Adding folder name normalization to handle 'bin' vs 'trash' naming differences
## Type of Change
- [x] ✨ New feature (non-breaking change which adds functionality)
- [x] 🐛 Bug fix (non-breaking change which fixes an issue)
## Areas Affected
- [x] Email Integration (Gmail, IMAP, etc.)
- [x] User Interface/Experience
- [x] Data Storage/Management
## Testing Done
- [x] Manual testing performed
## Checklist
- [x] I have performed a self-review of my code
- [x] My changes generate no new warnings
## Additional Notes
The implementation now properly deletes threads from the database when the user selects the delete option from the context menu. The UI provides toast notifications to indicate the deletion status.
_By submitting this pull request, I confirm that my contribution is made under the terms of the project's license._
# Add "Open in New Tab" Feature and Fix Email Handling
## Description
This PR adds an "Open in New Tab" feature to the thread context menu, allowing users to open email threads in a new browser tab. It also fixes several issues with email handling:
1. Adds an "Open in New Tab" option to the thread context menu with an ExternalLink icon
2. Improves draft handling by saving drafts before sending emails
3. Fixes the identification of the latest email in threads by properly filtering out drafts
4. Updates the styling of the "Mark as Important" icon in the thread context menu
5. Removes unnecessary console.log statements and async/await usage where not needed
6. Fixes the web search tool to work with or without data streaming
## Type of Change
- [x] 🐛 Bug fix (non-breaking change which fixes an issue)
- [x] ✨ New feature (non-breaking change which adds functionality)
- [x] 🎨 UI/UX improvement
- [x] ⚡ Performance improvement
## Areas Affected
- [x] Email Integration (Gmail, IMAP, etc.)
- [x] User Interface/Experience
- [x] Data Storage/Management
## Testing Done
- [x] Manual testing performed
## Checklist
- [x] I have performed a self-review of my code
- [x] My changes generate no new warnings
## Additional Notes
The "Open in New Tab" feature improves workflow for users who need to reference multiple email threads simultaneously. The draft handling improvements ensure that emails are properly saved before sending, preventing data loss.
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
* **New Features**
* Added "Open in New Tab" action to the email thread context menu for easier access to threads in a new browser tab.
* **Improvements**
* Drafts are now saved automatically before sending emails, ensuring no unsaved changes are lost.
* More accurate detection of the latest email in a thread.
* Localization updated with a new string for the "Open in New Tab" action.
* Email and thread operations now consistently use an updated agent interface for improved backend handling.
* **Bug Fixes**
* Latest message and reply counts now exclude drafts, improving thread accuracy.
* **Style**
* Minor visual updates to icons and CSS class ordering.
* Code formatting and import reordering for consistency.
* **Chores**
* Internal state updates are now handled synchronously for improved performance.
* Removed unnecessary logging and simplified cache management.
* Removed deprecated notification function and related imports.
* Simplified query cache clearing on account switch.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
# Refactor Labels API Usage and Optimize Component Performance
## Description
This PR refactors how labels are accessed throughout the application by restructuring the `useLabels` hook to return `userLabels` and `systemLabels` separately. It also adds performance optimizations by memoizing component calculations and action handlers in the thread context menu. Additionally, it introduces a new category dropdown component for better label filtering and temporarily disables the categories settings page.
## Type of Change
- [x] 🐛 Bug fix (non-breaking change which fixes an issue)
- [x] ⚡ Performance improvement
## Areas Affected
- [x] User Interface/Experience
- [x] Data Storage/Management
## Testing Done
- [x] Manual testing performed
## Checklist
- [x] I have performed a self-review of my code
- [x] My changes generate no new warnings
- [x] All tests pass locally
## Additional Notes
The main changes include:
1. Restructured `useLabels` hook to separate user and system labels
2. Updated all components to use the new label structure
3. Added memoization to thread context menu actions and calculations
4. Implemented a new CategoryDropdown component for label filtering
5. Commented out the categories settings page route
6. Fixed spacing and alignment issues in the mail layout
# READ CAREFULLY THEN REMOVE
Remove bullet points that are not relevant.
PLEASE REFRAIN FROM USING AI TO WRITE YOUR CODE AND PR DESCRIPTION. IF YOU DO USE AI TO WRITE YOUR CODE PLEASE PROVIDE A DESCRIPTION AND REVIEW IT CAREFULLY. MAKE SURE YOU UNDERSTAND THE CODE YOU ARE SUBMITTING USING AI.
- Pull requests that do not follow these guidelines will be closed without review or comment.
- If you use AI to write your PR description your pr will be close without review or comment.
- If you are unsure about anything, feel free to ask for clarification.
## Description
Please provide a clear description of your changes.
---
## Type of Change
Please delete options that are not relevant.
- [ ] 🐛 Bug fix (non-breaking change which fixes an issue)
- [ ] ✨ New feature (non-breaking change which adds functionality)
- [ ] 💥 Breaking change (fix or feature with breaking changes)
- [ ] 📝 Documentation update
- [ ] 🎨 UI/UX improvement
- [ ] 🔒 Security enhancement
- [ ] ⚡ Performance improvement
## Areas Affected
Please check all that apply:
- [ ] Email Integration (Gmail, IMAP, etc.)
- [ ] User Interface/Experience
- [ ] Authentication/Authorization
- [ ] Data Storage/Management
- [ ] API Endpoints
- [ ] Documentation
- [ ] Testing Infrastructure
- [ ] Development Workflow
- [ ] Deployment/Infrastructure
## Testing Done
Describe the tests you've done:
- [ ] Unit tests added/updated
- [ ] Integration tests added/updated
- [ ] Manual testing performed
- [ ] Cross-browser testing (if UI changes)
- [ ] Mobile responsiveness verified (if UI changes)
## Security Considerations
For changes involving data or authentication:
- [ ] No sensitive data is exposed
- [ ] Authentication checks are in place
- [ ] Input validation is implemented
- [ ] Rate limiting is considered (if applicable)
## Checklist
- [ ] I have read the [CONTRIBUTING](https://github.com/Mail-0/Zero/blob/staging/.github/CONTRIBUTING.md) document
- [ ] My code follows the project's style guidelines
- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in complex areas
- [ ] I have updated the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix/feature works
- [ ] All tests pass locally
- [ ] Any dependent changes are merged and published
## Additional Notes
Add any other context about the pull request here.
## Screenshots/Recordings
Add screenshots or recordings here if applicable.
---
_By submitting this pull request, I confirm that my contribution is made under the terms of the project's license._
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
* **New Features**
* Introduced a new localization system replacing translation hooks with direct message function calls.
* Added localization project configuration and Inlang plugins for improved message formatting.
* **Bug Fixes**
* Enhanced pluralization handling across all supported languages for accurate message display.
* **Refactor**
* Unified translation and locale management across components by removing hook-based translations.
* Removed obsolete navigation and email signature settings pages.
* Simplified query and server provider logic, removing connection-specific and internationalization context code.
* Disabled server-side rendering in the mail app.
* Removed Cloudflare Worker request handler and related environment augmentations.
* **Chores**
* Updated dependencies and scripts, adding Inlang CLI and removing unused packages.
* Cleaned up configuration files including Vite, Wrangler, and i18n settings.
* Added `.gitignore` for localization cache.
* Updated static asset handling and environment configurations for Cloudflare deployments.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
# Implement Optimistic UI for Label Management in Email Threads
This PR adds optimistic UI updates for label management in email threads context menu.
## Type of Change
- ✨ New feature (non-breaking change which adds functionality)
## Areas Affected
- [x] User Interface/Experience
- [x] Data Storage/Management
## Testing Done
- [x] Manual testing performed
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
- **New Features**
- Added support for bulk label toggling on multiple mail threads.
- Labels now update instantly in the UI with optimistic updates, reflecting changes before server confirmation.
- **Improvements**
- Checkbox states for labels now accurately reflect pending changes for a smoother user experience.
- Enhanced feedback with toast messages indicating label changes, including support for multiple threads.
- **Style**
- Minor formatting improvements in context menu components.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Description
Added overflow-y-auto and max-height constraints to the thread context menu to ensure proper scrolling behavior when the menu contains many items. This prevents the menu from extending beyond the viewport, particularly when displaying a large number of labels.
## 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
- **New Features**
- Added vertical scrolling to the context menu and labels submenu for improved navigation.
- Set a maximum height for the labels submenu to ensure content remains accessible and visually manageable.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
# READ CAREFULLY THEN REMOVE
Remove bullet points that are not relevant.
PLEASE REFRAIN FROM USING AI TO WRITE YOUR CODE AND PR DESCRIPTION. IF YOU DO USE AI TO WRITE YOUR CODE PLEASE PROVIDE A DESCRIPTION AND REVIEW IT CAREFULLY. MAKE SURE YOU UNDERSTAND THE CODE YOU ARE SUBMITTING USING AI.
- Pull requests that do not follow these guidelines will be closed without review or comment.
- If you use AI to write your PR description your pr will be close without review or comment.
- If you are unsure about anything, feel free to ask for clarification.
## Description
Please provide a clear description of your changes.
---
## Type of Change
Please delete options that are not relevant.
- [ ] 🐛 Bug fix (non-breaking change which fixes an issue)
- [ ] ✨ New feature (non-breaking change which adds functionality)
- [ ] 💥 Breaking change (fix or feature with breaking changes)
- [ ] 📝 Documentation update
- [ ] 🎨 UI/UX improvement
- [ ] 🔒 Security enhancement
- [ ] ⚡ Performance improvement
## Areas Affected
Please check all that apply:
- [ ] Email Integration (Gmail, IMAP, etc.)
- [ ] User Interface/Experience
- [ ] Authentication/Authorization
- [ ] Data Storage/Management
- [ ] API Endpoints
- [ ] Documentation
- [ ] Testing Infrastructure
- [ ] Development Workflow
- [ ] Deployment/Infrastructure
## Testing Done
Describe the tests you've done:
- [ ] Unit tests added/updated
- [ ] Integration tests added/updated
- [ ] Manual testing performed
- [ ] Cross-browser testing (if UI changes)
- [ ] Mobile responsiveness verified (if UI changes)
## Security Considerations
For changes involving data or authentication:
- [ ] No sensitive data is exposed
- [ ] Authentication checks are in place
- [ ] Input validation is implemented
- [ ] Rate limiting is considered (if applicable)
## Checklist
- [ ] I have read the [CONTRIBUTING](../CONTRIBUTING.md) document
- [ ] My code follows the project's style guidelines
- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in complex areas
- [ ] I have updated the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix/feature works
- [ ] All tests pass locally
- [ ] Any dependent changes are merged and published
## Additional Notes
Add any other context about the pull request here.
## Screenshots/Recordings
Add screenshots or recordings here if applicable.
---
_By submitting this pull request, I confirm that my contribution is made under the terms of the project's license._
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._
# 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._
- Added `setActiveReplyId` state management to track the latest reply in `ThreadContextMenu`, `MailDisplay`, and `MailList` components.
- Updated reply, reply all, and forward handlers to set the active reply ID based on the latest thread data.
- Refactored `EmailComposer` to remove unused state and improve placeholder text.
- Cleaned up CSS styles in `prosemirror.css` and adjusted component structures for better readability.
- Added `@react-email/components` dependency to `bun.lock` and `package.json`.
- Removed the `extractText.ts` file as it is no longer needed.
- Refactored email rendering in `mail-iframe.tsx` to utilize the new `template` function from `email-utils.client.tsx`.
- Improved handling of image loading based on sender trust status.
- Updated various components to enhance readability and maintainability.
* delete mails permanently from bin
* add English translations for delete mail actions
* update the call handleDelete
* fixed handle delete function
* handleDelete call
* enhance handledelete to reset bulk selection after deletion
* removed the scope
* delete mails permanently from bin
* add English translations for delete mail actions
* update the call handleDelete
* handleDelete call
* enhance handledelete to reset bulk selection after deletion
* removed the scope
---------
Co-authored-by: Ahmet Kilinc <akx9@icloud.com>
Co-authored-by: Adam <x_1337@outlook.com>