Commit Graph

64 Commits

Author SHA1 Message Date
Adam
6c76d3d44d Implement thread deletion functionality (#1799)
# 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._
2025-07-22 14:18:31 -07:00
amrit
4c3753e3f8 feat: ability to snooze emails (#1477)
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
Co-authored-by: Adam <13007539+MrgSub@users.noreply.github.com>
2025-07-20 18:25:32 -07:00
Adam
7f0893b669 all round fixes (#1697)
# 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 -->
2025-07-09 15:58:45 -07:00
Adam
7fec116c24 categories (#1689)
# 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
2025-07-08 16:16:53 -07:00
Adam
2fbaf7b312 SPA (#1538)
# 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 -->
2025-06-30 11:37:18 -07:00
Ahmet Kilinc
33d52ceebf optimistic thread state for thread context menu (#1300)
# 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 -->
2025-06-27 18:30:25 +01:00
abhix4
0bc63a6528 Add opacity to icons and fix separator colors in mail context menu (#1296) 2025-06-16 19:04:35 -07:00
Ahmet Kilinc
3234c032d6 fixes height (#1234)
## 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 -->
2025-06-07 10:45:26 -07:00
Adam
7bdc0be2eb Optimistic Fixes (#1231)
# 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._
2025-06-07 10:40:09 -07:00
github-actions[bot]
629d400423 Deploy to production (Automated) (#1137)
Co-authored-by: Adam <x_1337@outlook.com>
Co-authored-by: Ahmet Kilinc <akx9@icloud.com>
Co-authored-by: nizzy <140507264+nizzyabi@users.noreply.github.com>
2025-05-29 12:23:47 -07:00
Adam
c20868cf1a Replace hardcoded dark mode colors with theme variables (#1129)
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._
2025-05-28 12:00:54 -07:00
Ahmet Kilinc
17c79ad4f2 fix thread-context 2025-05-27 18:13:22 -07:00
Ahmet Kilinc
93f56145d2 optimistic updates and undo actions
fix page issue

optimistic in thread context menu
2025-05-27 18:13:22 -07:00
nizzy
cc26c52ffa Small changes (#1098)
# 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._
2025-05-26 18:36:15 -07:00
Adarsh Tiwari
116340f948 merge staging 2025-05-23 19:46:51 +05:30
BlankParticle
2969ad2ca8 fix: some perf improvements 2025-05-23 14:15:04 +05:30
BlankParticle
fa45abaf44 feat: remixify and whatever else needed to be done 2025-05-20 13:56:47 +05:30
Aj Wazzan
fb16043912 Refactor thread deletion and pricing upgrade processes to utilize toast notifications for improved user feedback. Remove unused imports and streamline error handling in ThreadContextMenu and PricingCard components. 2025-05-19 12:11:18 -07:00
Adarsh Tiwari
682dc19bf7 Merge branch 'staging' into fixing-toast-label 2025-05-18 22:01:02 +05:30
BlankParticle
c00b8e95cb feat: add important toogle api and UI 2025-05-18 11:15:05 +05:30
Adarsh Tiwari
13b2b35dd5 refactor(mail): improve error handling and feedback for label and favorite actions 2025-05-16 14:01:30 +05:30
BlankParticle
9c0cc3aa8c chore: invalidate query count on marking read/uread 2025-05-12 11:02:17 +05:30
Aj Wazzan
113a3bc329 fix: update SRH_TOKEN in docker-compose.yaml and refactor dialog components for improved consistency 2025-05-06 14:59:05 -07:00
BlankParticle
f059f95f1f chore: cleanup and refactor, remove unused files and routes 2025-05-06 00:23:56 +05:30
BlankParticle
5082eda6db feat: server-action/SWR to trpc/tanstack-query 2025-05-03 18:32:20 +05:30
Ahmet Kilinc
8c12bc1189 removed mute thread 2025-05-01 00:25:15 +01:00
Ahmet Kilinc
b7942853f6 addds labels to thread display and context menu 2025-04-30 21:59:46 +01:00
Ahmet Kilinc
8b7a864e5a centralise all toasts - use custom classes 2025-04-29 22:00:43 +01:00
Aj Wazzan
ce4fa5c624 Enhance email reply functionality and clean up components
- 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.
2025-04-27 22:34:41 -07:00
Aj Wazzan
2a9d995385 Update dependencies and refactor email rendering logic
- 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.
2025-04-27 21:58:23 -07:00
Nizzy
fdd1de7d11 fix 2025-04-26 12:47:11 -07:00
Nizzy
50b97119e0 staging 2025-04-26 11:27:09 -07:00
Adarsh Tiwari
e9f159d79f User can able to delete from bin (#670)
* 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>
2025-04-25 10:51:43 -07:00
Aj Wazzan
b82ca1894b Add background queue functionality to thread context 2025-04-21 16:34:39 -07:00
Aj Wazzan
063b62aa5d Update error handling and throwing unauthorized error 2025-04-21 16:11:20 -07:00
Aj Wazzan
cae347de4d Update thread context menu to show unread status 2025-04-20 23:18:17 -07:00
Aj Wazzan
ac75d3e9eb Update intl library imports in mail components 2025-04-17 18:52:47 -07:00
Aj Wazzan
a7d92c5c22 Update useStats hook to handle null data in useStats 2025-04-17 18:48:27 -07:00
Aj Wazzan
b104ddaa7c Update thread context and mail actions- Update mail actions and thread context 2025-04-17 18:30:02 -07:00
Nizzy
f5b5b456c0 context menu 2025-04-17 16:40:29 -07:00
needle
ed1471c110 cleanup 2025-04-10 12:16:56 +02:00
needle
3294bd5739 bin 2025-04-10 06:45:42 +02:00
user12224
1db16a1c32 cleanup 2025-04-06 19:02:29 +02:00
user12224
33635d834f cleanup 2025-04-06 09:40:47 +02:00
user12224
e0d34d4026 context 2025-04-05 22:01:07 +02:00
user12224
c3887fd872 gg 2025-03-26 20:43:23 +02:00
Aj Wazzan
c4ee12820c fixes errors and useStats (partially) 2025-03-21 12:47:46 -07:00
Adam
540dc7ad7b Merge branch 'thread-movement' into feat/improved-markAsRead 2025-03-21 11:59:07 -07:00
Aj Wazzan
406b297e33 refactoring & improvements 2025-03-21 11:43:12 -07:00
user12224
8f2bc42bd2 Merge branch 'staging' of https://github.com/Mail-0/Zero into thread-movement 2025-03-21 20:24:30 +02:00