Commit Graph

39 Commits

Author SHA1 Message Date
Adam
a34028c1bc Streamline email assistant prompt and add server-side tool execution (#1887)
# READ CAREFULLY THEN REMOVE

Remove bullet points that are not relevant.

PLEASE REFRAIN FROM USING AI TO WRITE YOUR CODE AND PR DESCRIPTION. IF YOU DO USE AI TO WRITE YOUR CODE PLEASE PROVIDE A DESCRIPTION AND REVIEW IT CAREFULLY. MAKE SURE YOU UNDERSTAND THE CODE YOU ARE SUBMITTING USING AI.

- Pull requests that do not follow these guidelines will be closed without review or comment.
- If you use AI to write your PR description your pr will be close without review or comment.
- If you are unsure about anything, feel free to ask for clarification.

## Description

Please provide a clear description of your changes.

---

## Type of Change

Please delete options that are not relevant.

- [ ] 🐛 Bug fix (non-breaking change which fixes an issue)
- [ ]  New feature (non-breaking change which adds functionality)
- [ ] 💥 Breaking change (fix or feature with breaking changes)
- [ ] 📝 Documentation update
- [ ] 🎨 UI/UX improvement
- [ ] 🔒 Security enhancement
- [ ]  Performance improvement

## Areas Affected

Please check all that apply:

- [ ] Email Integration (Gmail, IMAP, etc.)
- [ ] User Interface/Experience
- [ ] Authentication/Authorization
- [ ] Data Storage/Management
- [ ] API Endpoints
- [ ] Documentation
- [ ] Testing Infrastructure
- [ ] Development Workflow
- [ ] Deployment/Infrastructure

## Testing Done

Describe the tests you've done:

- [ ] Unit tests added/updated
- [ ] Integration tests added/updated
- [ ] Manual testing performed
- [ ] Cross-browser testing (if UI changes)
- [ ] Mobile responsiveness verified (if UI changes)

## Security Considerations

For changes involving data or authentication:

- [ ] No sensitive data is exposed
- [ ] Authentication checks are in place
- [ ] Input validation is implemented
- [ ] Rate limiting is considered (if applicable)

## Checklist

- [ ] I have read the [CONTRIBUTING](https://github.com/Mail-0/Zero/blob/staging/.github/CONTRIBUTING.md) document
- [ ] My code follows the project's style guidelines
- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in complex areas
- [ ] I have updated the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix/feature works
- [ ] All tests pass locally
- [ ] Any dependent changes are merged and published

## Additional Notes

Add any other context about the pull request here.

## Screenshots/Recordings

Add screenshots or recordings here if applicable.

---

_By submitting this pull request, I confirm that my contribution is made under the terms of the project's license._

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

## Summary by cubic
Simplified the email assistant system prompt for clarity and added server-side tool execution for voice and web integrations.

- **Refactors**
  - Rewrote the assistant prompt to be shorter, more direct, and easier for models to follow.
  - Removed unused and verbose prompt sections.

- **New Features**
  - Added a server-side tool execution endpoint and utility for handling tool calls from the client.
  - Introduced a script to register all tools with ElevenLabs for voice agent integration.

<!-- End of auto-generated description by cubic. -->
2025-08-01 14:14:50 -07:00
Brandon McConnell
1ea4bfe69c Upgrade to Tailwind CSS v4 (#1881)
Co-authored-by: Adam <13007539+MrgSub@users.noreply.github.com>
Co-authored-by: Aj Wazzan <x_1337@outlook.com>
2025-08-01 09:58:19 -07:00
Adam
3bb42e5357 better ai (#1724)
## Description

Refactored the AI chat component and email assistant to improve performance, reliability, and user experience. This PR introduces a new `inboxRag` tool for natural language email search, replaces the previous `listThreads` implementation, and enhances the prompt design for more efficient inbox management.

---

## Type of Change

-  New feature (non-breaking change which adds functionality)
-  Performance improvement

## Areas Affected

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

## Testing Done

- [x] Manual testing performed

## Checklist

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

## Additional Notes

Key improvements:
- Added `ThreadPreview` component to replace the previous thread rendering approach
- Refactored `ToolResponse` to use specialized subcomponents for different tool types
- Updated AI prompts with better instructions for multi-step and parallel operations
- Switched backend models to Claude 3.5 for improved reasoning capabilities
- Fixed key prop issues in attachment rendering to prevent React warnings
- Increased agent max steps from 5 to 10 for more complex operations
- Added better markdown styling support for lists and other elements

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

* **New Features**
  * Introduced advanced AI-powered inbox search and organization with new tools and richer assistant guidance.
  * Added support for Anthropic AI models for chat and search tasks.
  * Enabled new streaming tool for natural language inbox search.

* **Improvements**
  * Enhanced AI assistant prompt with detailed instructions, expanded use cases, and improved communication style.
  * Modularized and streamlined AI chat component for clearer tool response rendering and better markdown styling.
  * Increased chat step limit in the AI sidebar for longer conversations.
  * Improved uniqueness of attachment keys to prevent display issues.

* **Bug Fixes**
  * Corrected parameter naming for thread and draft listing to ensure accurate pagination.

* **Chores**
  * Updated dependencies and environment variables for improved configuration and model support.
  * Cleaned up unused code and imports for better maintainability.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-07-13 16:34:03 -07:00
Adam
34bb334cec Fixing type errors (#1488)
# Refactor Command Palette to use URL State and Improve Agent Communication

## Description

This PR refactors the command palette to use URL state instead of React state, allowing for better persistence and sharing of the command palette's open state. It also improves the agent communication architecture by implementing proper RPC targets for both database and agent operations.

Key changes:
- Refactored command palette to use URL query parameters instead of React state
- Added loading indicator for search processing
- Improved empty state messaging in command palette
- Fixed filter clearing when navigating between folders
- Enhanced agent communication with proper RPC targets
- Removed unnecessary toast notifications
- Fixed type issues in sidebar labels component

## Type of Change

- 🐛 Bug fix (non-breaking change which fixes an issue)
-  New feature (non-breaking change which adds functionality)
-  Performance improvement

## Areas Affected

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

## Testing Done

- [x] Manual testing performed

## Checklist

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

## Additional Notes

The command palette now maintains its state via URL parameters, which improves the user experience when navigating between pages. The agent communication architecture has been improved to use proper RPC targets, which should make the code more maintainable and robust.

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

- **New Features**
  - Enhanced command palette loading UI with a spinning loader icon during searches.
  - Added output validation for label and mail count queries to improve data reliability.

- **Improvements**
  - Unified the command palette open state with the URL query for better navigation and consistency.
  - Refined search handling to prevent concurrent searches and improve performance.
  - Sidebar labels now only appear when an account is active for a cleaner interface.
  - Updated navigation UI with revised sign-in button behavior and streamlined GitHub link label.

- **Bug Fixes**
  - Resolved issues with command palette state and filter clearing on route changes.

- **Removed**
  - Toast notifications for clearing filters, saving searches, and deleting saved searches have been removed.
  - Removed the navigation bar component and Product Hunt badge from the home content.
  - Removed interactive sign-in button from home content, replaced with static badge.

- **Developer Changes**
  - Updated and streamlined type definitions for user accounts and connections.
  - Refactored backend authentication setup to use explicit connection IDs and added RPC proxy class for mail operations.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-06-25 13:56:20 -07:00
Adam
8ae5cc9397 Add unsaved email confirmation dialog (#1364)
## Description

Added a confirmation dialog when users attempt to close the email composer with unsaved content. This prevents accidental data loss by prompting users to confirm before discarding their draft. Also implemented browser-level protection against navigation/refresh when there's unsaved content in the composer.

## Type of Change

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

## Areas Affected

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

## Testing Done

- [x] Manual testing performed

## Checklist

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

## Additional Notes

The changes include:
1. Added a confirmation dialog when users try to close the email composer with unsaved content
2. Implemented browser-level protection against navigation/refresh with unsaved content
3. Fixed the Escape key behavior to show confirmation dialog instead of immediately closing
4. Improved state cleanup when closing the composer (clearing threadId, activeReplyId, etc.)
5. Fixed compose hotkey behavior to only close the compose window, not toggle it
6. Added proper cleanup of draft state when unmounting the composer component
2025-06-18 17:06:26 -07:00
needle
17828fe541 composer styling (#1259)
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

- **New Features**
  - Added support for forwarding emails, allowing users to send existing messages to new recipients with original content included.
- **Bug Fixes**
  - Improved formatting for quoted and forwarded message sections in email bodies.
- **Chores**
  - Enhanced email composition options to handle more flexible message metadata, such as optional attachments, headers, and recipient fields.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-06-09 19:10:38 -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
Adam
e5b6dd8e21 Merge branch 'staging' into feat/delete-all-spam-button-886 2025-05-25 18:02:51 -07:00
Rahul Mishra
11ea9fc8cc fix: use historyId to invalidate mail.get cache (#1063) 2025-05-25 19:06:59 +05:30
Adam
4ca801b9d0 Merge branch 'staging' into feat/delete-all-spam-button-886 2025-05-24 11:52:00 -07:00
Ahmet Kilinc
a345d71a2b new labels 2025-05-24 15:17:44 +01:00
giteshsarvaiya
e9ca37e412 chore: conflit resolve 2025-05-23 13:18:41 +00:00
BlankParticle
2969ad2ca8 fix: some perf improvements 2025-05-23 14:15:04 +05:30
giteshsarvaiya
ffcae30960 feat(mail/spam): add 'Delete All Spam' button (#886) 2025-05-12 19:15:04 +00:00
BlankParticle
94e7d68db9 feat: first working version of separated backend 2025-05-08 00:44:52 +05:30
BlankParticle
f059f95f1f chore: cleanup and refactor, remove unused files and routes 2025-05-06 00:23:56 +05:30
BlankParticle
86fcdd148c feat: rewrite mail driver with better types 2025-05-04 17:17:47 +05:30
BlankParticle
5082eda6db feat: server-action/SWR to trpc/tanstack-query 2025-05-03 18:32:20 +05:30
Aj Wazzan
fc6d6376a8 Refactor mail API and components by reorganizing imports, enhancing error handling, and improving label management. Removed unused thread-labels route and updated label handling in various components for better consistency and performance. 2025-04-24 18:05:03 -07:00
Aj Wazzan
a14ba51714 Refactor email sending logic and enhance EmailComposer component 2025-04-23 21:29:48 -07:00
Atharva Deosthale
9a754537df feat: allow sending from email aliases added through gmail (#743) 2025-04-22 12:01:55 +01:00
Aj Wazzan
8db5a64a99 Refactor mail actions and types to improve thread handling and response structure. Update getMail to return IGetThreadResponse, modify related components to utilize new structure, and enhance error handling in driver functions. 2025-04-16 15:47:35 -07:00
kingstondoesit
45112c48dd add bcc prop to ParsedMessage 2025-04-13 17:32:06 +01:00
Nizzy
5b1f652b51 bcc cc 2025-04-11 10:46:37 -07:00
Aj Wazzan
6cbd6f7b90 Enhance email sending functionality by adding support for CC and BCC fields, integrating the 'mimetext' library for MIME message creation, and refactoring the reply composer. Update user settings to remove signature options and improve email parsing logic. 2025-04-09 00:09:32 -07:00
Nizzy
fac65f413d onMouseDown 2025-04-06 12:52:46 -07:00
Aj Wazzan
406b297e33 refactoring & improvements 2025-03-21 11:43:12 -07:00
Dante Issaias
66f9c3ebdf Merge branch 'staging' into parse-to-cc 2025-03-20 21:39:47 +00:00
Dante Issaias
2bda96e706 Check if email was sent with TLS 2025-03-20 21:24:30 +00:00
Dante Issaias
560dd723ba Parse to and cc headers 2025-03-20 20:58:52 +00:00
Dante Issaias
abb64e4a3c One-click unsubscribe 2025-03-16 22:33:41 +00:00
Nikita D
a1ae68b8fe Merge branch 'staging' of https://github.com/Mail-0/Zero into fix/lints 2025-03-13 16:17:25 -07:00
Nikita D
65d6014a6f Added TODO comment 2025-03-13 14:24:56 -07:00
jkirubai
dcf5b2496c fix:redundant session calls; layout inconsistencies (#432) 2025-03-13 13:12:50 -04:00
Ahmet Kilinc
d2bf55f2c9 Attachments accordion in mail-display.tsx (#416)
* added attachments view to email-display and added grabbing attachments to google driver

* move attachments dialog

* remove comments

* nitpick comments from rabbit ai

* changed framer motion imports to motion/react

* quality improvements

* refactored google.ts for usability and attachments now work

---------

Co-authored-by: Nizzy <nizabizaher@gmail.com>
2025-03-13 13:12:31 -04:00
Ahmet Kilinc
554f884dcb refactored to resolve comments 2025-03-11 17:29:53 +00:00
Ahmet Kilinc
d6b1c3b243 Release 2 (#351)
* fix: remove tracked node_modules/.bin files

* added to .gitignore

* update compose

* feat: Add AI brain and summary features for email

- Implemented EnableBrain action to subscribe to mail gateway
- Created GetSummary action to retrieve email thread summaries
- Added useSummary hook for fetching summaries
- Introduced mail0_summary database table
- Added Brain button to app sidebar for enabling AI features

* fix: Improve null safety and remove unused imports

- Fixed potential null access in thread-display by checking array first
- Removed unused markAsReadAction import in use-threads hook
- Removed unnecessary cache deletion logic in IndexedDB storage provider
- Removed threadId from ParsedMessage type definition

* fix: Use environment variable for brain gateway URL

- Replace hardcoded mail gateway URL with configurable environment variable
- Improve flexibility and configuration of brain subscription endpoint

* big push for connections and server actions:
- unread count 
- remove `/connect-email` 
- update redirects and callbacks to `/settings/connections` 
- make everything else server actions 
- remove old route.ts files 

* feat: Improve HTML text extraction and email parsing

- Added Cheerio for robust HTML text extraction in extractTextFromHTML
- Enhanced null safety in Google email driver for sender name and subject
- Updated mail list and threads hooks to handle potential undefined values
- Improved text cleaning and handling of edge cases in email parsing

* editor working

* compose and video

* fix: remove t3-oss env

* update max results to 10 per requst

* zero button floating sidebar

* lots of changes:
- removes old mail compose modal
- smaller upload limit
- useReducer on components with lots of state
- image logos for some file types (still more to add)
- resolve comments from previous review

* add logos

* straing to staging

* improvements to create ui (#345)

* made create wider

* send to multiple emails and new ui for 'to' list

* add icons for file upload (#346)

* added icon for figma icon

* added else ifs for other icons

* add file name to the getLogo func

* fix figma if statement

* fix figma

* fix excel

* remove console logs

* fix back to original component

* file icons

* ui tweaks

---------

Co-authored-by: Nizzy <nizabizaher@gmail.com>
Co-authored-by: nizzy <140507264+nizzyabi@users.noreply.github.com>

* fix: sidebar and settings page ui fixes (#348)

* fixes

* define to emails

* rotate on hover logo

* early access count on homepage

* updated readme

---------

Co-authored-by: Sijan Mainali <sijanmainali2@gmail.com>
Co-authored-by: Adam <x_1337@outlook.com>
Co-authored-by: Nizzy <nizabizaher@gmail.com>
Co-authored-by: user12224 <122770437+user12224@users.noreply.github.com>
Co-authored-by: nizzy <140507264+nizzyabi@users.noreply.github.com>
2025-03-01 16:36:17 -05:00
Nizzy
dd34d7d420 monorepo 2025-02-24 21:00:46 -05:00
Jacob
45c65daa4a init: move to turborepo and configure workspaces 2025-02-14 07:47:14 +10:00