Conversation
|
Caution Review failedThe pull request is closed. WalkthroughThis update introduces JavaScript linting with oxlint across the codebase, adds its configuration, and integrates lint checks into development and CI workflows. It removes unused imports, components, and code, especially in editor and mail-related files, and simplifies or eliminates toolbar, node selector, and attachment UI. Several function and type signatures are updated for clarity and efficiency. Minor error logging and React key improvements are also included. The Next.js mail middleware is deleted. Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer
participant Linter as oxlint
participant CI as CI Workflow
Dev->>Linter: Run pnpm dlx oxlint@latest (pre-commit/IDE)
Linter-->>Dev: Reports errors/warnings
CI->>Linter: Run pnpm dlx oxlint@latest --deny-warnings
Linter-->>CI: Lint results (fail on warnings)
Possibly related PRs
Suggested labels
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (107)
⛔ Files not processed due to max files limit (8)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
This stack of pull requests is managed by Graphite. Learn more about stacking. |
51938a1 to
af5fb2f
Compare
|
@CodeRabbit review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 11
🔭 Outside diff range comments (8)
apps/mail/components/ui/gauge.tsx (2)
62-69:colorprop is effectively ignored due to hard-coded stroke.
stroke="#8B5CF6"overrides thecurrentColorcoming from the Tailwind class passed viacolor, so consumers can never change the gauge colour.- className={`animate-gauge_fill ${color}`} + className={`animate-gauge_fill ${color}`} … - stroke="#8B5CF6" + stroke="currentColor"This lets callers control the stroke through the
colorprop while preserving existing behaviour (default string already resolves to a purple hue).
16-21: Guard against out-of-range values to avoid invalid SVG stroke offsets.
Ifvalueexceedsmax(or is negative)strokeDashoffsetbecomes invalid, producing a flipped or empty gauge.- const valueInCircumference = (value / max) * circumference; + const clampedValue = Math.min(Math.max(value, 0), max); + const valueInCircumference = (clampedValue / max) * circumference;A simple clamp keeps the component resilient to bad props with negligible cost.
apps/mail/hooks/use-mail-navigation.ts (1)
110-118:navigateNextnever advances past the current item
newIndexis set toprevIndexinstead ofprevIndex + 1, so pressing “next” repeatedly will never move the focus. Looks like an off-by-one error that predates this PR but will surface now that the file was touched.- const newIndex = prevIndex; + const newIndex = prevIndex + 1;apps/mail/lib/constants.tsx (1)
1-31: Name collision breaks TypeScript — interface shadows imported component.
import { GmailColor } …brings in a React component (value).
Lines 28-31 then declareinterface GmailColor, producing a duplicate identifier error.Fix by renaming the interface (or the import). Example:
-import { GmailColor } from '../components/icons/icons'; +import { GmailColor as GmailIcon } from '../components/icons/icons'; … -interface GmailColor { +interface GmailPalette { textColor: string; backgroundColor: string; }Then update
emailProvidersandGMAIL_COLORSreferences accordingly..github/workflows/ci.yml (1)
21-28: Workflow will fail:actions/setup-node@v4requiresnode-version.Without the mandatory input the job exits early, so the new Oxlint step never runs.
- - name: Setup Node 📦 - uses: actions/setup-node@v4 + - name: Setup Node 📦 + uses: actions/setup-node@v4 + with: + node-version: 20 # or your project’s required versionOptional: cache pnpm store to speed up installs.
Also note the previous security-bot warning about missing top-level
permissions; consider adding:permissions: contents: readapps/server/src/lib/services.ts (1)
12-21: Remove commented-out dead code.With the removal of the
forceUseRealServiceparameter, the commented-out conditional block (lines 13-20) is now unreachable dead code and should be removed to keep the codebase clean.-export const twilio = () => { - // if (env.NODE_ENV === 'development' && !forceUseRealService) { - // return { - // messages: { - // send: async (to: string, body: string) => - // console.log(`[TWILIO:MOCK] Sending message to ${to}: ${body}`), - // }, - // }; - // } - +export const twilio = () => { if (!env.TWILIO_ACCOUNT_SID || !env.TWILIO_AUTH_TOKEN || !env.TWILIO_PHONE_NUMBER) {.oxlintrc.json (1)
1-19: Fix JSON syntax errors - inline comments are not supported.JSON doesn't support inline comments, which is causing parse errors. The oxlint configuration needs to be restructured.
Apply this diff to fix the syntax:
{ "plugins": ["react", "unicorn", "typescript", "oxc"], "rules": { - "no-alert": "error", // Emit an error message when a call to `alert()` is found - "oxc/approx-constant": "warn", // Show a warning when you write a number close to a known constant - "no-plusplus": "off", // Allow using the `++` and `--` operators + "no-alert": "error", + "oxc/approx-constant": "warn", + "no-plusplus": "off", "no-useless-call": "error", "no-accumulating-spread": "error", "no-array-index-key": "error", "jsx-no-jsx-as-prop": "error", "jsx-no-new-array-as-prop": "error", "jsx-no-new-function-as-prop": "error", "jsx-no-new-object-as-prop": "error", "prefer-array-find": "error", "prefer-set-has": "error", "exhaustive-deps": "off" } }apps/mail/lib/elevenlabs-tools.ts (1)
272-275: The webSearch function result is not properly returned.Similar to summarizeEmail, this function destructures but doesn't use the
textvariable in the return statement.The
textvariable from the API response should be included in the return object to provide the actual search results to the caller.
🧹 Nitpick comments (15)
apps/mail/app/(routes)/settings/security/page.tsx (1)
15-16: Remove stray blank line introduced by the import cleanupThe extra empty line left behind after deleting
KeyRoundis the only formatting deviation in this diff. It’s harmless but triggers the “no-multiple-empty-lines” rule in most ESLint presets and can cause noisy diffs later.@@ -import { useForm } from 'react-hook-form'; - +import { useForm } from 'react-hook-form';apps/mail/components/create/uploaded-file-icon.tsx (1)
39-46: Revoke object URLs to avoid memory leaksCreating a new
URL.createObjectURLon every re-render will leak if not revoked. Wrap the URL inuseMemo+useEffectto revoke on unmount or file change.+ const objectUrl = React.useMemo(() => URL.createObjectURL(file), [file]); + React.useEffect(() => () => URL.revokeObjectURL(objectUrl), [objectUrl]); ... - <img src={URL.createObjectURL(file)} alt={file.name} className="object-cover" /> + <img src={objectUrl} alt={file.name} className="object-cover" />apps/mail/components/icons/icons.tsx (1)
311-326: Consider the impact of hardcoded styling on component reusability.The removal of the
classNameprop and hardcoding of"mr-[8px]"reduces the flexibility of this icon component. If this icon is used in multiple contexts, this change could cause styling issues.If the icon is indeed only used in one specific context (as suggested by the AI summary), consider either:
- Keeping the className prop for future flexibility
- Renaming the component to reflect its specific use case (e.g.,
PaperPlaneWithMargin)-export const PaperPlane = () => ( +export const PaperPlane = ({ className }: { className?: string }) => ( <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" - className="mr-[8px]" + className={className || "mr-[8px]"} >apps/mail/app/(routes)/settings/categories/page.tsx (1)
13-17: Remove the empty import statement.The import statement for select components is empty and should be removed entirely.
Apply this diff to clean up the empty import:
import { Popover, PopoverTrigger, PopoverContent } from '@/components/ui/popover'; - -import { Sparkles } from '@/components/icons/icons'; -import { Loader, GripVertical } from 'lucide-react'; -import { - } from '@/components/ui/select'; -import { Badge } from '@/components/ui/badge'; +import { Sparkles } from '@/components/icons/icons'; +import { Loader, GripVertical } from 'lucide-react'; +import { Badge } from '@/components/ui/badge';apps/mail/lib/hotkeys/thread-display-hotkeys.tsx (1)
1-3: Tiny style nit – drop the dangling comma in the import.-import { useThread, } from '@/hooks/use-threads'; +import { useThread } from '@/hooks/use-threads';It avoids an ESLint / formatter churn later.
apps/server/src/lib/server-utils.ts (1)
1-1: Remove the empty import statement.The empty import statement serves no purpose and should be removed entirely to clean up the codebase.
-import { } from '../routes/chat';apps/mail/hooks/driver/use-delete.ts (1)
16-16: Fix the trailing comma syntax issue.Remove the trailing comma after
addToQueueto fix the destructuring syntax.- const { addToQueue, } = useBackgroundQueue(); + const { addToQueue } = useBackgroundQueue();apps/mail/components/mail/thread-subject.tsx (1)
1-1: Remove the empty import statement.The empty import statement serves no purpose and should be removed entirely to clean up the codebase.
-import { } from '@/components/ui/tooltip';.github/CONTRIBUTING.md (1)
82-83: Great addition for code quality, but fix the bare URL.Adding linting instructions for contributors is excellent and aligns with the oxlint integration. However, the bare URL should be properly formatted in markdown.
Apply this diff to fix the bare URL:
- - Please lint using `pnpm dlx oxlint@latest` or by downloading an IDE extension here: https://oxc.rs/docs/guide/usage/linter.html#vscode-extension + - Please lint using `pnpm dlx oxlint@latest` or by downloading an IDE extension from the [oxc documentation](https://oxc.rs/docs/guide/usage/linter.html#vscode-extension)apps/mail/components/mail/render-labels.tsx (1)
2-2: Remove the unused import entirely.Since no Popover components are used in this file, the import line should be removed completely rather than having an empty import.
-import { } from '../ui/popover';apps/mail/components/voice-button.tsx (1)
4-4: Remove the empty import statement.The empty import
import { } from '@/components/ui/card';serves no purpose and should be removed entirely.-import { } from '@/components/ui/card';apps/mail/hooks/use-optimistic-actions.ts (1)
278-278: Consider removing commented setFocusedIndex calls.Since the
focusedIndexAtomimport and usage have been removed, these commented calls tosetFocusedIndex(null)can likely be removed entirely unless they're being kept for future reference.- // setFocusedIndex(null);Also applies to: 337-337
apps/mail/components/mail/reply-composer.tsx (1)
170-171: Consider removing the commented-out parameters.The commented-out
replyToMessage.decodedBodyparameters suggest these are no longer needed by the utility functions. Since the AI summary mentions that these parameters were removed from the function signatures, consider removing these comments entirely for cleaner code.Apply this diff to remove the commented lines:
// replyToMessage.decodedBody,Remove both commented lines on 170 and 177.
Also applies to: 177-178
apps/mail/components/create/ai-chat.tsx (1)
332-333: Consider using optional chaining for safer property access.The static analysis tool suggests using optional chaining here for safer property access.
Apply this diff to use optional chaining:
- part.toolInvocation && - part.toolInvocation.result && + part.toolInvocation?.result &&apps/mail/components/ui/app-sidebar.tsx (1)
8-14: Clean up remaining empty import statements.Several import statements have been reduced to empty destructuring, which can be removed entirely to complete the cleanup.
Apply this diff to remove the empty import statements:
-import { } from '../icons/animated/square-pen'; -import { } from './input-otp'; -import { } from 'motion/react';
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (107)
.github/CONTRIBUTING.md(1 hunks).github/workflows/ci.yml(1 hunks).oxlintrc.json(1 hunks)apps/mail/app/(full-width)/contributors.tsx(6 hunks)apps/mail/app/(full-width)/hr.tsx(2 hunks)apps/mail/app/(full-width)/pricing.tsx(1 hunks)apps/mail/app/(full-width)/privacy.tsx(1 hunks)apps/mail/app/(full-width)/terms.tsx(1 hunks)apps/mail/app/(routes)/layout.tsx(1 hunks)apps/mail/app/(routes)/mail/[folder]/page.tsx(2 hunks)apps/mail/app/(routes)/mail/layout.tsx(1 hunks)apps/mail/app/(routes)/settings/appearance/page.tsx(1 hunks)apps/mail/app/(routes)/settings/categories/page.tsx(1 hunks)apps/mail/app/(routes)/settings/connections/page.tsx(2 hunks)apps/mail/app/(routes)/settings/danger-zone/page.tsx(2 hunks)apps/mail/app/(routes)/settings/general/page.tsx(3 hunks)apps/mail/app/(routes)/settings/labels/page.tsx(1 hunks)apps/mail/app/(routes)/settings/security/page.tsx(1 hunks)apps/mail/app/(routes)/settings/shortcuts/page.tsx(3 hunks)apps/mail/components/context/command-palette-context.tsx(4 hunks)apps/mail/components/context/label-sidebar-context.tsx(0 hunks)apps/mail/components/context/sidebar-context.tsx(0 hunks)apps/mail/components/create/ai-chat.tsx(3 hunks)apps/mail/components/create/create-email.tsx(2 hunks)apps/mail/components/create/editor-buttons.tsx(0 hunks)apps/mail/components/create/editor.colors.tsx(2 hunks)apps/mail/components/create/editor.link-selector.tsx(0 hunks)apps/mail/components/create/editor.node-selector.tsx(0 hunks)apps/mail/components/create/editor.text-buttons.tsx(1 hunks)apps/mail/components/create/editor.tsx(2 hunks)apps/mail/components/create/email-composer.tsx(7 hunks)apps/mail/components/create/image-compression-settings.tsx(1 hunks)apps/mail/components/create/selectors/link-selector.tsx(0 hunks)apps/mail/components/create/selectors/math-selector.tsx(0 hunks)apps/mail/components/create/selectors/node-selector.tsx(0 hunks)apps/mail/components/create/slash-command.tsx(1 hunks)apps/mail/components/create/toolbar.tsx(0 hunks)apps/mail/components/create/uploaded-file-icon.tsx(1 hunks)apps/mail/components/home/HomeContent.tsx(3 hunks)apps/mail/components/home/footer.tsx(6 hunks)apps/mail/components/icons/icons.tsx(1 hunks)apps/mail/components/labels/label-dialog.tsx(4 hunks)apps/mail/components/magicui/file-tree.tsx(3 hunks)apps/mail/components/mail/mail-display.tsx(9 hunks)apps/mail/components/mail/mail-list.tsx(5 hunks)apps/mail/components/mail/mail.tsx(4 hunks)apps/mail/components/mail/navbar.tsx(2 hunks)apps/mail/components/mail/note-panel.tsx(0 hunks)apps/mail/components/mail/render-labels.tsx(1 hunks)apps/mail/components/mail/reply-composer.tsx(3 hunks)apps/mail/components/mail/select-all-checkbox.tsx(1 hunks)apps/mail/components/mail/thread-display.tsx(9 hunks)apps/mail/components/mail/thread-subject.tsx(1 hunks)apps/mail/components/motion-primitives/text-effect.tsx(1 hunks)apps/mail/components/navigation.tsx(1 hunks)apps/mail/components/onboarding.tsx(3 hunks)apps/mail/components/party.tsx(2 hunks)apps/mail/components/pricing/comparision.tsx(1 hunks)apps/mail/components/setup-phone.tsx(1 hunks)apps/mail/components/ui/ai-sidebar.tsx(1 hunks)apps/mail/components/ui/app-sidebar.tsx(3 hunks)apps/mail/components/ui/dialog.tsx(1 hunks)apps/mail/components/ui/gauge.tsx(1 hunks)apps/mail/components/ui/nav-main.tsx(2 hunks)apps/mail/components/ui/nav-user.tsx(5 hunks)apps/mail/components/ui/pricing-dialog.tsx(1 hunks)apps/mail/components/ui/recursive-folder.tsx(1 hunks)apps/mail/components/ui/sheet.tsx(1 hunks)apps/mail/components/ui/sidebar-labels.tsx(1 hunks)apps/mail/components/voice-button.tsx(1 hunks)apps/mail/config/navigation.ts(0 hunks)apps/mail/hooks/driver/use-delete.ts(1 hunks)apps/mail/hooks/use-compose-editor.ts(0 hunks)apps/mail/hooks/use-mail-navigation.ts(1 hunks)apps/mail/hooks/use-notes.tsx(1 hunks)apps/mail/hooks/use-optimistic-actions.ts(2 hunks)apps/mail/hooks/use-threads.ts(3 hunks)apps/mail/lib/constants.tsx(1 hunks)apps/mail/lib/elevenlabs-tools.ts(3 hunks)apps/mail/lib/email-utils.client.tsx(1 hunks)apps/mail/lib/hotkeys/mail-list-hotkeys.tsx(1 hunks)apps/mail/lib/hotkeys/thread-display-hotkeys.tsx(1 hunks)apps/mail/lib/hotkeys/use-hotkey-utils.ts(2 hunks)apps/mail/lib/timezones.ts(1 hunks)apps/mail/lib/utils.ts(1 hunks)apps/mail/middleware.ts(0 hunks)apps/mail/package.json(2 hunks)apps/mail/providers/query-provider.tsx(1 hunks)apps/mail/providers/voice-provider.tsx(3 hunks)apps/mail/vite.config.ts(2 hunks)apps/server/src/lib/auth.ts(3 hunks)apps/server/src/lib/driver/google.ts(3 hunks)apps/server/src/lib/driver/microsoft.ts(0 hunks)apps/server/src/lib/driver/types.ts(1 hunks)apps/server/src/lib/driver/utils.ts(1 hunks)apps/server/src/lib/factories/base-subscription.factory.ts(1 hunks)apps/server/src/lib/factories/google-subscription.factory.ts(2 hunks)apps/server/src/lib/factories/outlook-subscription.factory.ts(1 hunks)apps/server/src/lib/server-utils.ts(1 hunks)apps/server/src/lib/services.ts(1 hunks)apps/server/src/lib/timezones.ts(1 hunks)apps/server/src/main.ts(1 hunks)apps/server/src/pipelines.effect.ts(4 hunks)apps/server/src/routes/agent/orchestrator.ts(1 hunks)apps/server/src/routes/agent/tools.ts(2 hunks)apps/server/src/routes/chat.ts(8 hunks)apps/server/src/services/writing-style-service.ts(1 hunks)
⛔ Files not processed due to max files limit (8)
- apps/server/src/trpc/routes/bimi.ts
- apps/server/src/trpc/routes/connections.ts
- apps/server/src/trpc/routes/label.ts
- apps/server/src/trpc/routes/mail.ts
- apps/server/src/trpc/routes/settings.ts
- apps/server/src/trpc/trpc.ts
- eslint.config.mjs
- scripts/seed-style/seeder.ts
💤 Files with no reviewable changes (14)
- apps/mail/components/context/sidebar-context.tsx
- apps/mail/config/navigation.ts
- apps/mail/components/create/toolbar.tsx
- apps/mail/components/context/label-sidebar-context.tsx
- apps/mail/components/create/selectors/math-selector.tsx
- apps/mail/components/create/editor-buttons.tsx
- apps/mail/hooks/use-compose-editor.ts
- apps/mail/middleware.ts
- apps/mail/components/mail/note-panel.tsx
- apps/mail/components/create/selectors/link-selector.tsx
- apps/mail/components/create/selectors/node-selector.tsx
- apps/server/src/lib/driver/microsoft.ts
- apps/mail/components/create/editor.link-selector.tsx
- apps/mail/components/create/editor.node-selector.tsx
🧰 Additional context used
🧠 Learnings (56)
📓 Common learnings
Learnt from: JagjeevanAK
PR: Mail-0/Zero#1583
File: apps/docs/package.json:1-0
Timestamp: 2025-07-01T12:53:32.495Z
Learning: The Zero project prefers to handle dependency updates through automated tools like Dependabot rather than immediate manual updates, allowing for proper testing and validation through their established workflow.
apps/mail/components/create/slash-command.tsx (1)
Learnt from: retrogtx
PR: Mail-0/Zero#1328
File: apps/mail/lib/hotkeys/mail-list-hotkeys.tsx:202-209
Timestamp: 2025-06-18T17:26:50.918Z
Learning: In apps/mail/lib/hotkeys/mail-list-hotkeys.tsx, the switchCategoryByIndex function using hardcoded indices for category hotkeys does not break when users reorder categories, contrary to the theoretical index-shifting issue. The actual implementation has constraints or mechanisms that prevent hotkey targeting issues.
apps/mail/hooks/driver/use-delete.ts (1)
Learnt from: retrogtx
PR: Mail-0/Zero#1468
File: apps/server/src/trpc/routes/mail.ts:386-391
Timestamp: 2025-06-27T04:59:29.731Z
Learning: In apps/server/src/trpc/routes/mail.ts, the attachment processing logic conditionally handles mixed attachment types - it preserves existing File-like objects with arrayBuffer methods while only converting serialized attachments that need processing through toAttachmentFiles.
apps/mail/lib/hotkeys/thread-display-hotkeys.tsx (1)
Learnt from: retrogtx
PR: Mail-0/Zero#1328
File: apps/mail/lib/hotkeys/mail-list-hotkeys.tsx:202-209
Timestamp: 2025-06-18T17:26:50.918Z
Learning: In apps/mail/lib/hotkeys/mail-list-hotkeys.tsx, the switchCategoryByIndex function using hardcoded indices for category hotkeys does not break when users reorder categories, contrary to the theoretical index-shifting issue. The actual implementation has constraints or mechanisms that prevent hotkey targeting issues.
apps/mail/components/mail/thread-subject.tsx (1)
Learnt from: retrogtx
PR: Mail-0/Zero#1328
File: apps/mail/lib/hotkeys/mail-list-hotkeys.tsx:202-209
Timestamp: 2025-06-18T17:26:50.918Z
Learning: In apps/mail/lib/hotkeys/mail-list-hotkeys.tsx, the switchCategoryByIndex function using hardcoded indices for category hotkeys does not break when users reorder categories, contrary to the theoretical index-shifting issue. The actual implementation has constraints or mechanisms that prevent hotkey targeting issues.
apps/mail/components/navigation.tsx (1)
Learnt from: danteissaias
PR: Mail-0/Zero#902
File: apps/mail/components/connection/add.tsx:77-77
Timestamp: 2025-05-07T16:55:46.513Z
Learning: For the "Upgrade" link in AddConnectionDialog, using a proper <button> element instead of a <span> with onClick is recognized as an accessibility improvement but was deferred as out of scope in PR #902 (CSS variables PR).
apps/mail/app/(routes)/settings/appearance/page.tsx (1)
Learnt from: snehendu098
PR: Mail-0/Zero#1323
File: apps/mail/lib/themes/theme-utils.ts:318-318
Timestamp: 2025-06-24T06:22:58.753Z
Learning: In the Mail-0/Zero theme system (apps/mail/lib/themes/theme-utils.ts), when color themes are being applied, all color values come in HSL format, so there's no need for additional format validation when converting colors with hslToHex().
apps/mail/components/mail/select-all-checkbox.tsx (1)
Learnt from: retrogtx
PR: Mail-0/Zero#1328
File: apps/mail/lib/hotkeys/mail-list-hotkeys.tsx:202-209
Timestamp: 2025-06-18T17:26:50.918Z
Learning: In apps/mail/lib/hotkeys/mail-list-hotkeys.tsx, the switchCategoryByIndex function using hardcoded indices for category hotkeys does not break when users reorder categories, contrary to the theoretical index-shifting issue. The actual implementation has constraints or mechanisms that prevent hotkey targeting issues.
apps/mail/components/mail/render-labels.tsx (1)
Learnt from: retrogtx
PR: Mail-0/Zero#1328
File: apps/mail/lib/hotkeys/mail-list-hotkeys.tsx:202-209
Timestamp: 2025-06-18T17:26:50.918Z
Learning: In apps/mail/lib/hotkeys/mail-list-hotkeys.tsx, the switchCategoryByIndex function using hardcoded indices for category hotkeys does not break when users reorder categories, contrary to the theoretical index-shifting issue. The actual implementation has constraints or mechanisms that prevent hotkey targeting issues.
apps/mail/lib/constants.tsx (2)
Learnt from: snehendu098
PR: Mail-0/Zero#1323
File: apps/mail/lib/themes/theme-utils.ts:318-318
Timestamp: 2025-06-24T06:22:58.753Z
Learning: In the Mail-0/Zero theme system (apps/mail/lib/themes/theme-utils.ts), when color themes are being applied, all color values come in HSL format, so there's no need for additional format validation when converting colors with hslToHex().
Learnt from: retrogtx
PR: Mail-0/Zero#1328
File: apps/mail/lib/hotkeys/mail-list-hotkeys.tsx:202-209
Timestamp: 2025-06-18T17:26:50.918Z
Learning: In apps/mail/lib/hotkeys/mail-list-hotkeys.tsx, the switchCategoryByIndex function using hardcoded indices for category hotkeys does not break when users reorder categories, contrary to the theoretical index-shifting issue. The actual implementation has constraints or mechanisms that prevent hotkey targeting issues.
apps/mail/lib/timezones.ts (2)
Learnt from: retrogtx
PR: Mail-0/Zero#1468
File: apps/server/src/trpc/routes/mail.ts:331-331
Timestamp: 2025-06-28T03:56:09.376Z
Learning: In apps/server/src/trpc/routes/mail.ts, the user indicated they are not using ISO format for the scheduleAt parameter, despite the frontend code showing toISOString() usage in the ScheduleSendPicker component.
Learnt from: retrogtx
PR: Mail-0/Zero#1622
File: apps/server/src/lib/email-verification.ts:189-189
Timestamp: 2025-07-05T05:27:24.592Z
Learning: During testing phases, debug logging should be kept active in apps/server/src/lib/email-verification.ts for BIMI validation and email verification debugging, even if it's verbose.
apps/mail/lib/email-utils.client.tsx (1)
Learnt from: retrogtx
PR: Mail-0/Zero#1328
File: apps/mail/lib/hotkeys/mail-list-hotkeys.tsx:202-209
Timestamp: 2025-06-18T17:26:50.918Z
Learning: In apps/mail/lib/hotkeys/mail-list-hotkeys.tsx, the switchCategoryByIndex function using hardcoded indices for category hotkeys does not break when users reorder categories, contrary to the theoretical index-shifting issue. The actual implementation has constraints or mechanisms that prevent hotkey targeting issues.
apps/mail/package.json (1)
Learnt from: JagjeevanAK
PR: Mail-0/Zero#1583
File: apps/docs/package.json:1-0
Timestamp: 2025-07-01T12:53:32.495Z
Learning: The Zero project prefers to handle dependency updates through automated tools like Dependabot rather than immediate manual updates, allowing for proper testing and validation through their established workflow.
apps/mail/hooks/use-mail-navigation.ts (2)
Learnt from: retrogtx
PR: Mail-0/Zero#1328
File: apps/mail/lib/hotkeys/mail-list-hotkeys.tsx:202-209
Timestamp: 2025-06-18T17:26:50.918Z
Learning: In apps/mail/lib/hotkeys/mail-list-hotkeys.tsx, the switchCategoryByIndex function using hardcoded indices for category hotkeys does not break when users reorder categories, contrary to the theoretical index-shifting issue. The actual implementation has constraints or mechanisms that prevent hotkey targeting issues.
Learnt from: retrogtx
PR: Mail-0/Zero#1354
File: apps/mail/components/ui/prompts-dialog.tsx:85-88
Timestamp: 2025-06-20T05:03:16.944Z
Learning: In React Hook Form, avoid using useEffect for form state synchronization when the values prop can handle reactive updates automatically. The values prop is specifically designed for this purpose and is more optimal than manual useEffect-based synchronization.
apps/mail/app/(routes)/settings/general/page.tsx (3)
Learnt from: retrogtx
PR: Mail-0/Zero#1468
File: apps/server/src/trpc/routes/mail.ts:331-331
Timestamp: 2025-06-28T03:56:09.376Z
Learning: In apps/server/src/trpc/routes/mail.ts, the user indicated they are not using ISO format for the scheduleAt parameter, despite the frontend code showing toISOString() usage in the ScheduleSendPicker component.
Learnt from: retrogtx
PR: Mail-0/Zero#1328
File: apps/mail/lib/hotkeys/mail-list-hotkeys.tsx:202-209
Timestamp: 2025-06-18T17:26:50.918Z
Learning: In apps/mail/lib/hotkeys/mail-list-hotkeys.tsx, the switchCategoryByIndex function using hardcoded indices for category hotkeys does not break when users reorder categories, contrary to the theoretical index-shifting issue. The actual implementation has constraints or mechanisms that prevent hotkey targeting issues.
Learnt from: retrogtx
PR: Mail-0/Zero#1354
File: apps/mail/components/ui/prompts-dialog.tsx:85-88
Timestamp: 2025-06-20T05:03:16.944Z
Learning: In React Hook Form, avoid using useEffect for form state synchronization when the values prop can handle reactive updates automatically. The values prop is specifically designed for this purpose and is more optimal than manual useEffect-based synchronization.
apps/mail/app/(routes)/settings/connections/page.tsx (1)
Learnt from: danteissaias
PR: Mail-0/Zero#902
File: apps/mail/components/connection/add.tsx:77-77
Timestamp: 2025-05-07T16:55:46.513Z
Learning: For the "Upgrade" link in AddConnectionDialog, using a proper <button> element instead of a <span> with onClick is recognized as an accessibility improvement but was deferred as out of scope in PR #902 (CSS variables PR).
apps/server/src/lib/timezones.ts (1)
Learnt from: retrogtx
PR: Mail-0/Zero#1468
File: apps/server/src/trpc/routes/mail.ts:331-331
Timestamp: 2025-06-28T03:56:09.376Z
Learning: In apps/server/src/trpc/routes/mail.ts, the user indicated they are not using ISO format for the scheduleAt parameter, despite the frontend code showing toISOString() usage in the ScheduleSendPicker component.
apps/mail/components/party.tsx (3)
Learnt from: retrogtx
PR: Mail-0/Zero#1328
File: apps/mail/lib/hotkeys/mail-list-hotkeys.tsx:202-209
Timestamp: 2025-06-18T17:26:50.918Z
Learning: In apps/mail/lib/hotkeys/mail-list-hotkeys.tsx, the switchCategoryByIndex function using hardcoded indices for category hotkeys does not break when users reorder categories, contrary to the theoretical index-shifting issue. The actual implementation has constraints or mechanisms that prevent hotkey targeting issues.
Learnt from: retrogtx
PR: Mail-0/Zero#1468
File: apps/server/src/trpc/routes/mail.ts:386-391
Timestamp: 2025-06-27T04:59:29.731Z
Learning: In apps/server/src/trpc/routes/mail.ts, the attachment processing logic conditionally handles mixed attachment types - it preserves existing File-like objects with arrayBuffer methods while only converting serialized attachments that need processing through toAttachmentFiles.
Learnt from: retrogtx
PR: Mail-0/Zero#1468
File: apps/server/src/trpc/routes/mail.ts:331-331
Timestamp: 2025-06-28T03:56:09.376Z
Learning: In apps/server/src/trpc/routes/mail.ts, the user indicated they are not using ISO format for the scheduleAt parameter, despite the frontend code showing toISOString() usage in the ScheduleSendPicker component.
apps/mail/components/create/editor.colors.tsx (2)
Learnt from: snehendu098
PR: Mail-0/Zero#1323
File: apps/mail/lib/themes/theme-utils.ts:318-318
Timestamp: 2025-06-24T06:22:58.753Z
Learning: In the Mail-0/Zero theme system (apps/mail/lib/themes/theme-utils.ts), when color themes are being applied, all color values come in HSL format, so there's no need for additional format validation when converting colors with hslToHex().
Learnt from: retrogtx
PR: Mail-0/Zero#1328
File: apps/mail/lib/hotkeys/mail-list-hotkeys.tsx:202-209
Timestamp: 2025-06-18T17:26:50.918Z
Learning: In apps/mail/lib/hotkeys/mail-list-hotkeys.tsx, the switchCategoryByIndex function using hardcoded indices for category hotkeys does not break when users reorder categories, contrary to the theoretical index-shifting issue. The actual implementation has constraints or mechanisms that prevent hotkey targeting issues.
apps/mail/hooks/use-optimistic-actions.ts (1)
Learnt from: retrogtx
PR: Mail-0/Zero#1328
File: apps/mail/lib/hotkeys/mail-list-hotkeys.tsx:202-209
Timestamp: 2025-06-18T17:26:50.918Z
Learning: In apps/mail/lib/hotkeys/mail-list-hotkeys.tsx, the switchCategoryByIndex function using hardcoded indices for category hotkeys does not break when users reorder categories, contrary to the theoretical index-shifting issue. The actual implementation has constraints or mechanisms that prevent hotkey targeting issues.
apps/mail/components/mail/navbar.tsx (1)
Learnt from: retrogtx
PR: Mail-0/Zero#1328
File: apps/mail/lib/hotkeys/mail-list-hotkeys.tsx:202-209
Timestamp: 2025-06-18T17:26:50.918Z
Learning: In apps/mail/lib/hotkeys/mail-list-hotkeys.tsx, the switchCategoryByIndex function using hardcoded indices for category hotkeys does not break when users reorder categories, contrary to the theoretical index-shifting issue. The actual implementation has constraints or mechanisms that prevent hotkey targeting issues.
apps/server/src/lib/services.ts (1)
Learnt from: retrogtx
PR: Mail-0/Zero#1468
File: apps/server/src/trpc/routes/mail.ts:331-331
Timestamp: 2025-06-28T03:56:09.376Z
Learning: In apps/server/src/trpc/routes/mail.ts, the user indicated they are not using ISO format for the scheduleAt parameter, despite the frontend code showing toISOString() usage in the ScheduleSendPicker component.
apps/mail/app/(full-width)/contributors.tsx (1)
Learnt from: retrogtx
PR: Mail-0/Zero#1328
File: apps/mail/lib/hotkeys/mail-list-hotkeys.tsx:202-209
Timestamp: 2025-06-18T17:26:50.918Z
Learning: In apps/mail/lib/hotkeys/mail-list-hotkeys.tsx, the switchCategoryByIndex function using hardcoded indices for category hotkeys does not break when users reorder categories, contrary to the theoretical index-shifting issue. The actual implementation has constraints or mechanisms that prevent hotkey targeting issues.
apps/mail/components/ui/gauge.tsx (1)
Learnt from: snehendu098
PR: Mail-0/Zero#1323
File: apps/mail/lib/themes/theme-utils.ts:318-318
Timestamp: 2025-06-24T06:22:58.753Z
Learning: In the Mail-0/Zero theme system (apps/mail/lib/themes/theme-utils.ts), when color themes are being applied, all color values come in HSL format, so there's no need for additional format validation when converting colors with hslToHex().
apps/mail/lib/utils.ts (3)
Learnt from: retrogtx
PR: Mail-0/Zero#1468
File: apps/server/src/trpc/routes/mail.ts:331-331
Timestamp: 2025-06-28T03:56:09.376Z
Learning: In apps/server/src/trpc/routes/mail.ts, the user indicated they are not using ISO format for the scheduleAt parameter, despite the frontend code showing toISOString() usage in the ScheduleSendPicker component.
Learnt from: retrogtx
PR: Mail-0/Zero#1468
File: apps/server/src/trpc/routes/mail.ts:386-391
Timestamp: 2025-06-27T04:59:29.731Z
Learning: In apps/server/src/trpc/routes/mail.ts, the attachment processing logic conditionally handles mixed attachment types - it preserves existing File-like objects with arrayBuffer methods while only converting serialized attachments that need processing through toAttachmentFiles.
Learnt from: snehendu098
PR: Mail-0/Zero#1323
File: apps/mail/lib/themes/theme-utils.ts:318-318
Timestamp: 2025-06-24T06:22:58.753Z
Learning: In the Mail-0/Zero theme system (apps/mail/lib/themes/theme-utils.ts), when color themes are being applied, all color values come in HSL format, so there's no need for additional format validation when converting colors with hslToHex().
apps/mail/app/(routes)/mail/[folder]/page.tsx (3)
Learnt from: retrogtx
PR: Mail-0/Zero#1468
File: apps/server/src/trpc/routes/mail.ts:386-391
Timestamp: 2025-06-27T04:59:29.731Z
Learning: In apps/server/src/trpc/routes/mail.ts, the attachment processing logic conditionally handles mixed attachment types - it preserves existing File-like objects with arrayBuffer methods while only converting serialized attachments that need processing through toAttachmentFiles.
Learnt from: retrogtx
PR: Mail-0/Zero#1328
File: apps/mail/lib/hotkeys/mail-list-hotkeys.tsx:202-209
Timestamp: 2025-06-18T17:26:50.918Z
Learning: In apps/mail/lib/hotkeys/mail-list-hotkeys.tsx, the switchCategoryByIndex function using hardcoded indices for category hotkeys does not break when users reorder categories, contrary to the theoretical index-shifting issue. The actual implementation has constraints or mechanisms that prevent hotkey targeting issues.
Learnt from: retrogtx
PR: Mail-0/Zero#1468
File: apps/server/src/trpc/routes/mail.ts:331-331
Timestamp: 2025-06-28T03:56:09.376Z
Learning: In apps/server/src/trpc/routes/mail.ts, the user indicated they are not using ISO format for the scheduleAt parameter, despite the frontend code showing toISOString() usage in the ScheduleSendPicker component.
apps/mail/app/(routes)/settings/labels/page.tsx (2)
Learnt from: retrogtx
PR: Mail-0/Zero#1468
File: apps/server/src/trpc/routes/mail.ts:331-331
Timestamp: 2025-06-28T03:56:09.376Z
Learning: In apps/server/src/trpc/routes/mail.ts, the user indicated they are not using ISO format for the scheduleAt parameter, despite the frontend code showing toISOString() usage in the ScheduleSendPicker component.
Learnt from: retrogtx
PR: Mail-0/Zero#1328
File: apps/mail/lib/hotkeys/mail-list-hotkeys.tsx:202-209
Timestamp: 2025-06-18T17:26:50.918Z
Learning: In apps/mail/lib/hotkeys/mail-list-hotkeys.tsx, the switchCategoryByIndex function using hardcoded indices for category hotkeys does not break when users reorder categories, contrary to the theoretical index-shifting issue. The actual implementation has constraints or mechanisms that prevent hotkey targeting issues.
apps/mail/components/labels/label-dialog.tsx (3)
Learnt from: danteissaias
PR: Mail-0/Zero#902
File: apps/mail/components/connection/add.tsx:77-77
Timestamp: 2025-05-07T16:55:46.513Z
Learning: For the "Upgrade" link in AddConnectionDialog, using a proper <button> element instead of a <span> with onClick is recognized as an accessibility improvement but was deferred as out of scope in PR #902 (CSS variables PR).
Learnt from: retrogtx
PR: Mail-0/Zero#1328
File: apps/mail/lib/hotkeys/mail-list-hotkeys.tsx:202-209
Timestamp: 2025-06-18T17:26:50.918Z
Learning: In apps/mail/lib/hotkeys/mail-list-hotkeys.tsx, the switchCategoryByIndex function using hardcoded indices for category hotkeys does not break when users reorder categories, contrary to the theoretical index-shifting issue. The actual implementation has constraints or mechanisms that prevent hotkey targeting issues.
Learnt from: snehendu098
PR: Mail-0/Zero#1323
File: apps/mail/lib/themes/theme-utils.ts:318-318
Timestamp: 2025-06-24T06:22:58.753Z
Learning: In the Mail-0/Zero theme system (apps/mail/lib/themes/theme-utils.ts), when color themes are being applied, all color values come in HSL format, so there's no need for additional format validation when converting colors with hslToHex().
apps/mail/app/(routes)/settings/categories/page.tsx (1)
Learnt from: retrogtx
PR: Mail-0/Zero#1328
File: apps/mail/lib/hotkeys/mail-list-hotkeys.tsx:202-209
Timestamp: 2025-06-18T17:26:50.918Z
Learning: In apps/mail/lib/hotkeys/mail-list-hotkeys.tsx, the switchCategoryByIndex function using hardcoded indices for category hotkeys does not break when users reorder categories, contrary to the theoretical index-shifting issue. The actual implementation has constraints or mechanisms that prevent hotkey targeting issues.
apps/mail/components/voice-button.tsx (1)
Learnt from: danteissaias
PR: Mail-0/Zero#902
File: apps/mail/components/connection/add.tsx:77-77
Timestamp: 2025-05-07T16:55:46.513Z
Learning: For the "Upgrade" link in AddConnectionDialog, using a proper <button> element instead of a <span> with onClick is recognized as an accessibility improvement but was deferred as out of scope in PR #902 (CSS variables PR).
apps/mail/components/create/email-composer.tsx (2)
Learnt from: retrogtx
PR: Mail-0/Zero#1328
File: apps/mail/lib/hotkeys/mail-list-hotkeys.tsx:202-209
Timestamp: 2025-06-18T17:26:50.918Z
Learning: In apps/mail/lib/hotkeys/mail-list-hotkeys.tsx, the switchCategoryByIndex function using hardcoded indices for category hotkeys does not break when users reorder categories, contrary to the theoretical index-shifting issue. The actual implementation has constraints or mechanisms that prevent hotkey targeting issues.
Learnt from: retrogtx
PR: Mail-0/Zero#1468
File: apps/server/src/trpc/routes/mail.ts:331-331
Timestamp: 2025-06-28T03:56:09.376Z
Learning: In apps/server/src/trpc/routes/mail.ts, the user indicated they are not using ISO format for the scheduleAt parameter, despite the frontend code showing toISOString() usage in the ScheduleSendPicker component.
apps/mail/components/onboarding.tsx (2)
Learnt from: retrogtx
PR: Mail-0/Zero#1328
File: apps/mail/lib/hotkeys/mail-list-hotkeys.tsx:202-209
Timestamp: 2025-06-18T17:26:50.918Z
Learning: In apps/mail/lib/hotkeys/mail-list-hotkeys.tsx, the switchCategoryByIndex function using hardcoded indices for category hotkeys does not break when users reorder categories, contrary to the theoretical index-shifting issue. The actual implementation has constraints or mechanisms that prevent hotkey targeting issues.
Learnt from: retrogtx
PR: Mail-0/Zero#1354
File: apps/mail/components/ui/prompts-dialog.tsx:85-88
Timestamp: 2025-06-20T05:03:16.944Z
Learning: In React Hook Form, avoid using useEffect for form state synchronization when the values prop can handle reactive updates automatically. The values prop is specifically designed for this purpose and is more optimal than manual useEffect-based synchronization.
apps/mail/components/mail/reply-composer.tsx (2)
Learnt from: retrogtx
PR: Mail-0/Zero#1328
File: apps/mail/lib/hotkeys/mail-list-hotkeys.tsx:202-209
Timestamp: 2025-06-18T17:26:50.918Z
Learning: In apps/mail/lib/hotkeys/mail-list-hotkeys.tsx, the switchCategoryByIndex function using hardcoded indices for category hotkeys does not break when users reorder categories, contrary to the theoretical index-shifting issue. The actual implementation has constraints or mechanisms that prevent hotkey targeting issues.
Learnt from: retrogtx
PR: Mail-0/Zero#1354
File: apps/mail/components/ui/prompts-dialog.tsx:85-88
Timestamp: 2025-06-20T05:03:16.944Z
Learning: In React Hook Form, avoid using useEffect for form state synchronization when the values prop can handle reactive updates automatically. The values prop is specifically designed for this purpose and is more optimal than manual useEffect-based synchronization.
apps/mail/app/(full-width)/hr.tsx (1)
Learnt from: retrogtx
PR: Mail-0/Zero#1468
File: apps/server/src/trpc/routes/mail.ts:331-331
Timestamp: 2025-06-28T03:56:09.376Z
Learning: In apps/server/src/trpc/routes/mail.ts, the user indicated they are not using ISO format for the scheduleAt parameter, despite the frontend code showing toISOString() usage in the ScheduleSendPicker component.
apps/mail/components/home/footer.tsx (1)
Learnt from: danteissaias
PR: Mail-0/Zero#618
File: apps/mail/components/mail/mail-iframe.tsx:12-12
Timestamp: 2025-04-07T20:46:11.697Z
Learning: In the Mail-0/Zero application, sender emails are guaranteed to be non-empty when passed to components that handle them, making additional empty string validation unnecessary.
apps/mail/lib/hotkeys/use-hotkey-utils.ts (1)
Learnt from: retrogtx
PR: Mail-0/Zero#1328
File: apps/mail/lib/hotkeys/mail-list-hotkeys.tsx:202-209
Timestamp: 2025-06-18T17:26:50.918Z
Learning: In apps/mail/lib/hotkeys/mail-list-hotkeys.tsx, the switchCategoryByIndex function using hardcoded indices for category hotkeys does not break when users reorder categories, contrary to the theoretical index-shifting issue. The actual implementation has constraints or mechanisms that prevent hotkey targeting issues.
apps/mail/lib/hotkeys/mail-list-hotkeys.tsx (1)
Learnt from: retrogtx
PR: Mail-0/Zero#1328
File: apps/mail/lib/hotkeys/mail-list-hotkeys.tsx:202-209
Timestamp: 2025-06-18T17:26:50.918Z
Learning: In apps/mail/lib/hotkeys/mail-list-hotkeys.tsx, the switchCategoryByIndex function using hardcoded indices for category hotkeys does not break when users reorder categories, contrary to the theoretical index-shifting issue. The actual implementation has constraints or mechanisms that prevent hotkey targeting issues.
apps/mail/components/create/editor.text-buttons.tsx (1)
Learnt from: retrogtx
PR: Mail-0/Zero#1328
File: apps/mail/lib/hotkeys/mail-list-hotkeys.tsx:202-209
Timestamp: 2025-06-18T17:26:50.918Z
Learning: In apps/mail/lib/hotkeys/mail-list-hotkeys.tsx, the switchCategoryByIndex function using hardcoded indices for category hotkeys does not break when users reorder categories, contrary to the theoretical index-shifting issue. The actual implementation has constraints or mechanisms that prevent hotkey targeting issues.
apps/mail/providers/voice-provider.tsx (1)
Learnt from: retrogtx
PR: Mail-0/Zero#1354
File: apps/mail/components/ui/prompts-dialog.tsx:85-88
Timestamp: 2025-06-20T05:03:16.944Z
Learning: In React Hook Form, avoid using useEffect for form state synchronization when the values prop can handle reactive updates automatically. The values prop is specifically designed for this purpose and is more optimal than manual useEffect-based synchronization.
apps/mail/components/create/create-email.tsx (2)
Learnt from: retrogtx
PR: Mail-0/Zero#1354
File: apps/mail/components/ui/prompts-dialog.tsx:85-88
Timestamp: 2025-06-20T05:03:16.944Z
Learning: In React Hook Form, avoid using useEffect for form state synchronization when the values prop can handle reactive updates automatically. The values prop is specifically designed for this purpose and is more optimal than manual useEffect-based synchronization.
Learnt from: retrogtx
PR: Mail-0/Zero#1468
File: apps/server/src/trpc/routes/mail.ts:386-391
Timestamp: 2025-06-27T04:59:29.731Z
Learning: In apps/server/src/trpc/routes/mail.ts, the attachment processing logic conditionally handles mixed attachment types - it preserves existing File-like objects with arrayBuffer methods while only converting serialized attachments that need processing through toAttachmentFiles.
apps/mail/hooks/use-threads.ts (1)
Learnt from: retrogtx
PR: Mail-0/Zero#1328
File: apps/mail/lib/hotkeys/mail-list-hotkeys.tsx:202-209
Timestamp: 2025-06-18T17:26:50.918Z
Learning: In apps/mail/lib/hotkeys/mail-list-hotkeys.tsx, the switchCategoryByIndex function using hardcoded indices for category hotkeys does not break when users reorder categories, contrary to the theoretical index-shifting issue. The actual implementation has constraints or mechanisms that prevent hotkey targeting issues.
apps/mail/components/context/command-palette-context.tsx (1)
Learnt from: retrogtx
PR: Mail-0/Zero#1328
File: apps/mail/lib/hotkeys/mail-list-hotkeys.tsx:202-209
Timestamp: 2025-06-18T17:26:50.918Z
Learning: In apps/mail/lib/hotkeys/mail-list-hotkeys.tsx, the switchCategoryByIndex function using hardcoded indices for category hotkeys does not break when users reorder categories, contrary to the theoretical index-shifting issue. The actual implementation has constraints or mechanisms that prevent hotkey targeting issues.
apps/mail/components/create/ai-chat.tsx (1)
Learnt from: retrogtx
PR: Mail-0/Zero#1328
File: apps/mail/lib/hotkeys/mail-list-hotkeys.tsx:202-209
Timestamp: 2025-06-18T17:26:50.918Z
Learning: In apps/mail/lib/hotkeys/mail-list-hotkeys.tsx, the switchCategoryByIndex function using hardcoded indices for category hotkeys does not break when users reorder categories, contrary to the theoretical index-shifting issue. The actual implementation has constraints or mechanisms that prevent hotkey targeting issues.
apps/server/src/lib/driver/google.ts (2)
Learnt from: retrogtx
PR: Mail-0/Zero#1468
File: apps/server/src/trpc/routes/mail.ts:386-391
Timestamp: 2025-06-27T04:59:29.731Z
Learning: In apps/server/src/trpc/routes/mail.ts, the attachment processing logic conditionally handles mixed attachment types - it preserves existing File-like objects with arrayBuffer methods while only converting serialized attachments that need processing through toAttachmentFiles.
Learnt from: retrogtx
PR: Mail-0/Zero#1468
File: apps/server/src/trpc/routes/mail.ts:331-331
Timestamp: 2025-06-28T03:56:09.376Z
Learning: In apps/server/src/trpc/routes/mail.ts, the user indicated they are not using ISO format for the scheduleAt parameter, despite the frontend code showing toISOString() usage in the ScheduleSendPicker component.
apps/mail/components/home/HomeContent.tsx (1)
Learnt from: retrogtx
PR: Mail-0/Zero#1328
File: apps/mail/lib/hotkeys/mail-list-hotkeys.tsx:202-209
Timestamp: 2025-06-18T17:26:50.918Z
Learning: In apps/mail/lib/hotkeys/mail-list-hotkeys.tsx, the switchCategoryByIndex function using hardcoded indices for category hotkeys does not break when users reorder categories, contrary to the theoretical index-shifting issue. The actual implementation has constraints or mechanisms that prevent hotkey targeting issues.
apps/mail/lib/elevenlabs-tools.ts (2)
Learnt from: retrogtx
PR: Mail-0/Zero#1468
File: apps/server/src/trpc/routes/mail.ts:331-331
Timestamp: 2025-06-28T03:56:09.376Z
Learning: In apps/server/src/trpc/routes/mail.ts, the user indicated they are not using ISO format for the scheduleAt parameter, despite the frontend code showing toISOString() usage in the ScheduleSendPicker component.
Learnt from: retrogtx
PR: Mail-0/Zero#1468
File: apps/server/src/trpc/routes/mail.ts:386-391
Timestamp: 2025-06-27T04:59:29.731Z
Learning: In apps/server/src/trpc/routes/mail.ts, the attachment processing logic conditionally handles mixed attachment types - it preserves existing File-like objects with arrayBuffer methods while only converting serialized attachments that need processing through toAttachmentFiles.
apps/mail/components/magicui/file-tree.tsx (1)
Learnt from: retrogtx
PR: Mail-0/Zero#1328
File: apps/mail/lib/hotkeys/mail-list-hotkeys.tsx:202-209
Timestamp: 2025-06-18T17:26:50.918Z
Learning: In apps/mail/lib/hotkeys/mail-list-hotkeys.tsx, the switchCategoryByIndex function using hardcoded indices for category hotkeys does not break when users reorder categories, contrary to the theoretical index-shifting issue. The actual implementation has constraints or mechanisms that prevent hotkey targeting issues.
apps/mail/components/ui/app-sidebar.tsx (1)
Learnt from: retrogtx
PR: Mail-0/Zero#1328
File: apps/mail/lib/hotkeys/mail-list-hotkeys.tsx:202-209
Timestamp: 2025-06-18T17:26:50.918Z
Learning: In apps/mail/lib/hotkeys/mail-list-hotkeys.tsx, the switchCategoryByIndex function using hardcoded indices for category hotkeys does not break when users reorder categories, contrary to the theoretical index-shifting issue. The actual implementation has constraints or mechanisms that prevent hotkey targeting issues.
apps/server/src/routes/chat.ts (1)
Learnt from: retrogtx
PR: Mail-0/Zero#1468
File: apps/server/src/trpc/routes/mail.ts:386-391
Timestamp: 2025-06-27T04:59:29.731Z
Learning: In apps/server/src/trpc/routes/mail.ts, the attachment processing logic conditionally handles mixed attachment types - it preserves existing File-like objects with arrayBuffer methods while only converting serialized attachments that need processing through toAttachmentFiles.
apps/mail/app/(routes)/settings/shortcuts/page.tsx (2)
Learnt from: retrogtx
PR: Mail-0/Zero#1328
File: apps/mail/lib/hotkeys/mail-list-hotkeys.tsx:202-209
Timestamp: 2025-06-18T17:26:50.918Z
Learning: In apps/mail/lib/hotkeys/mail-list-hotkeys.tsx, the switchCategoryByIndex function using hardcoded indices for category hotkeys does not break when users reorder categories, contrary to the theoretical index-shifting issue. The actual implementation has constraints or mechanisms that prevent hotkey targeting issues.
Learnt from: retrogtx
PR: Mail-0/Zero#1468
File: apps/server/src/trpc/routes/mail.ts:331-331
Timestamp: 2025-06-28T03:56:09.376Z
Learning: In apps/server/src/trpc/routes/mail.ts, the user indicated they are not using ISO format for the scheduleAt parameter, despite the frontend code showing toISOString() usage in the ScheduleSendPicker component.
apps/mail/components/mail/mail-list.tsx (1)
Learnt from: retrogtx
PR: Mail-0/Zero#1328
File: apps/mail/lib/hotkeys/mail-list-hotkeys.tsx:202-209
Timestamp: 2025-06-18T17:26:50.918Z
Learning: In apps/mail/lib/hotkeys/mail-list-hotkeys.tsx, the switchCategoryByIndex function using hardcoded indices for category hotkeys does not break when users reorder categories, contrary to the theoretical index-shifting issue. The actual implementation has constraints or mechanisms that prevent hotkey targeting issues.
apps/mail/providers/query-provider.tsx (1)
Learnt from: retrogtx
PR: Mail-0/Zero#1468
File: apps/server/src/trpc/routes/mail.ts:386-391
Timestamp: 2025-06-27T04:59:29.731Z
Learning: In apps/server/src/trpc/routes/mail.ts, the attachment processing logic conditionally handles mixed attachment types - it preserves existing File-like objects with arrayBuffer methods while only converting serialized attachments that need processing through toAttachmentFiles.
apps/mail/components/mail/thread-display.tsx (3)
Learnt from: retrogtx
PR: Mail-0/Zero#1328
File: apps/mail/lib/hotkeys/mail-list-hotkeys.tsx:202-209
Timestamp: 2025-06-18T17:26:50.918Z
Learning: In apps/mail/lib/hotkeys/mail-list-hotkeys.tsx, the switchCategoryByIndex function using hardcoded indices for category hotkeys does not break when users reorder categories, contrary to the theoretical index-shifting issue. The actual implementation has constraints or mechanisms that prevent hotkey targeting issues.
Learnt from: retrogtx
PR: Mail-0/Zero#1468
File: apps/server/src/trpc/routes/mail.ts:386-391
Timestamp: 2025-06-27T04:59:29.731Z
Learning: In apps/server/src/trpc/routes/mail.ts, the attachment processing logic conditionally handles mixed attachment types - it preserves existing File-like objects with arrayBuffer methods while only converting serialized attachments that need processing through toAttachmentFiles.
Learnt from: danteissaias
PR: Mail-0/Zero#458
File: apps/mail/lib/email-utils.ts:91-134
Timestamp: 2025-03-16T23:15:24.659Z
Learning: According to RFC 2369, when processing list-unsubscribe headers with multiple URLs, the client should use the leftmost protocol that it supports (process URLs from left to right).
apps/mail/components/setup-phone.tsx (1)
Learnt from: retrogtx
PR: Mail-0/Zero#1622
File: apps/server/src/lib/email-verification.ts:189-189
Timestamp: 2025-07-05T05:27:24.592Z
Learning: During testing phases, debug logging should be kept active in apps/server/src/lib/email-verification.ts for BIMI validation and email verification debugging, even if it's verbose.
apps/mail/components/mail/mail.tsx (2)
Learnt from: retrogtx
PR: Mail-0/Zero#1328
File: apps/mail/lib/hotkeys/mail-list-hotkeys.tsx:202-209
Timestamp: 2025-06-18T17:26:50.918Z
Learning: In apps/mail/lib/hotkeys/mail-list-hotkeys.tsx, the switchCategoryByIndex function using hardcoded indices for category hotkeys does not break when users reorder categories, contrary to the theoretical index-shifting issue. The actual implementation has constraints or mechanisms that prevent hotkey targeting issues.
Learnt from: snehendu098
PR: Mail-0/Zero#1323
File: apps/mail/lib/themes/theme-utils.ts:318-318
Timestamp: 2025-06-24T06:22:58.753Z
Learning: In the Mail-0/Zero theme system (apps/mail/lib/themes/theme-utils.ts), when color themes are being applied, all color values come in HSL format, so there's no need for additional format validation when converting colors with hslToHex().
apps/mail/components/mail/mail-display.tsx (3)
Learnt from: retrogtx
PR: Mail-0/Zero#1468
File: apps/server/src/trpc/routes/mail.ts:386-391
Timestamp: 2025-06-27T04:59:29.731Z
Learning: In apps/server/src/trpc/routes/mail.ts, the attachment processing logic conditionally handles mixed attachment types - it preserves existing File-like objects with arrayBuffer methods while only converting serialized attachments that need processing through toAttachmentFiles.
Learnt from: retrogtx
PR: Mail-0/Zero#1328
File: apps/mail/lib/hotkeys/mail-list-hotkeys.tsx:202-209
Timestamp: 2025-06-18T17:26:50.918Z
Learning: In apps/mail/lib/hotkeys/mail-list-hotkeys.tsx, the switchCategoryByIndex function using hardcoded indices for category hotkeys does not break when users reorder categories, contrary to the theoretical index-shifting issue. The actual implementation has constraints or mechanisms that prevent hotkey targeting issues.
Learnt from: danteissaias
PR: Mail-0/Zero#618
File: apps/mail/components/mail/mail-iframe.tsx:12-12
Timestamp: 2025-04-07T20:46:11.697Z
Learning: In the Mail-0/Zero application, sender emails are guaranteed to be non-empty when passed to components that handle them, making additional empty string validation unnecessary.
🧬 Code Graph Analysis (10)
apps/server/src/lib/auth.ts (1)
apps/server/src/db/index.ts (1)
createDb(7-11)
apps/mail/components/labels/label-dialog.tsx (2)
apps/mail/components/ui/dialog.tsx (1)
DialogTitle(115-115)apps/mail/lib/label-colors.ts (1)
LABEL_COLORS(1-8)
apps/mail/components/mail/reply-composer.tsx (4)
apps/mail/hooks/use-email-aliases.ts (1)
useEmailAliases(4-12)apps/mail/hooks/use-threads.ts (1)
useThread(63-113)apps/mail/hooks/use-drafts.ts (1)
useDraft(5-15)apps/mail/lib/utils.ts (1)
constructReplyBody(347-368)
apps/mail/providers/voice-provider.tsx (1)
apps/mail/lib/elevenlabs-tools.ts (1)
toolExecutors(15-353)
apps/mail/components/context/command-palette-context.tsx (1)
apps/server/src/trpc/routes/ai/search.ts (1)
generateSearchQuery(11-34)
apps/mail/lib/elevenlabs-tools.ts (1)
apps/mail/providers/query-provider.tsx (1)
trpcClient(88-105)
apps/server/src/lib/factories/outlook-subscription.factory.ts (1)
apps/server/src/lib/factories/base-subscription.factory.ts (2)
SubscriptionData(10-14)UnsubscriptionData(16-19)
apps/mail/components/magicui/file-tree.tsx (2)
apps/mail/components/icons/icons.tsx (2)
Folder(328-348)Bookmark(372-389)apps/mail/lib/utils.ts (1)
cn(51-51)
apps/mail/components/ui/app-sidebar.tsx (1)
apps/server/src/db/schema.ts (1)
session(30-48)
apps/mail/app/(routes)/settings/shortcuts/page.tsx (2)
apps/mail/lib/hotkeys/use-hotkey-utils.ts (2)
useShortcutCache(6-48)formatDisplayKeys(137-169)apps/mail/config/shortcuts.ts (1)
Shortcut(13-13)
🪛 markdownlint-cli2 (0.17.2)
.github/CONTRIBUTING.md
82-82: Bare URL used
(MD034, no-bare-urls)
🪛 Biome (1.9.4)
apps/mail/components/create/ai-chat.tsx
[error] 332-333: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
.oxlintrc.json
[error] 4-4: Expected a property but instead found '// Emit an error message when a call to alert() is found'.
Expected a property here.
(parse)
[error] 5-5: expected , but instead found "oxc/approx-constant"
Remove "oxc/approx-constant"
(parse)
[error] 5-5: Expected a property but instead found '// Show a warning when you write a number close to a known constant'.
Expected a property here.
(parse)
[error] 6-6: expected , but instead found "no-plusplus"
Remove "no-plusplus"
(parse)
[error] 6-6: Expected a property but instead found '// Allow using the ++ and -- operators'.
Expected a property here.
(parse)
[error] 7-7: expected , but instead found "no-useless-call"
Remove "no-useless-call"
(parse)
apps/mail/app/(routes)/settings/shortcuts/page.tsx
[error] 96-96: Shouldn't redeclare 'Shortcut'. Consider to delete it or rename it.
'Shortcut' is defined here:
(lint/suspicious/noRedeclare)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Cursor BugBot
🔇 Additional comments (140)
apps/server/src/routes/agent/orchestrator.ts (1)
3-3: Minor formatting cleanup looks good
Removal of the stray blank line keeps the import block tidy; no functional impact.apps/mail/components/motion-primitives/text-effect.tsx (2)
217-219: Good defensive programming improvement!The addition of nullish coalescing (
?? {}) before the type assertion prevents potential runtime errors whenvariants?.container?.visibleisundefinedornull. This ensures safer access to thetransitionproperty.
221-223: Consistent improvement for type safety.The same defensive programming pattern is applied here for accessing
delayChildren, maintaining consistency with thestaggerChildrenlogic above.apps/mail/components/ui/gauge.tsx (1)
12-13: Primitivestringtype annotation is the correct choice—good catch.
Switching from the boxedStringto the primitivestringavoids unwantednull/undefinedcoercions and matches the rest of the codebase.apps/server/src/lib/driver/utils.ts (2)
5-6: LGTM on dropping unusedenv/createDriverimports.The file no longer references either symbol, so removing them reduces dead code and tightens dependency boundaries.
5-6: Removal ofcreateDriverre-export is safe
I searched all imports and found no instances ofimport { createDriver }fromapps/server/src/lib/driver/utils.ts. The only remainingcreateDriverimports come directly from./driver, so nothing breaks. You can safely remove it.apps/mail/app/(routes)/settings/appearance/page.tsx (1)
113-113: Verify React Hook Form integration after removingfieldparameterRemoving the unused
fieldprop cleans up the code, but this deviates from the standard React Hook Form pattern wherefield.onChangeandfield.valuedrive state and validation. Please manually verify that:
- Form validation still triggers and errors display correctly.
- The theme selector updates form state as expected on change.
- Form state remains in sync (no stale or out-of-sync values).
- Accessibility attributes (e.g., ARIA roles/labels) are applied correctly.
apps/mail/components/create/image-compression-settings.tsx (1)
5-6: LGTM – unusedButtonimport successfully removedNo remaining references to
Buttonin this file, so the cleanup is safe.apps/mail/hooks/use-mail-navigation.ts (1)
1-2: Import list correctly pruned
useCommandPaletteanduseStatewere indeed unused; dropping them avoids dead code and trims bundle size.apps/mail/components/ui/sidebar-labels.tsx (1)
1-1: Import tidied – good
IConnectionwasn’t used; keeping the file leaner is 👍apps/mail/components/create/uploaded-file-icon.tsx (1)
2-2: Unused icon removed – fine
FileIconwasn’t referenced; removal is correct.apps/mail/components/create/slash-command.tsx (1)
1-8: LGTM! Good cleanup of unused imports.The removal of
CheckSquare,Code,ImageIcon, andTextQuoteimports is appropriate since these icons are not used in the suggestion items. The remaining imports are all actively used in the component.apps/mail/app/(routes)/settings/danger-zone/page.tsx (1)
18-18: LGTM! Appropriate navigation method for account deletion.The removal of
useNavigateis correct since the component useswindow.location.href = '/'on line 64 for navigation after account deletion. This approach is more suitable for this critical operation as it ensures a full page reload and complete state clearing.apps/mail/lib/timezones.ts (1)
6-8: LGTM! Good addition of error logging.Adding
console.error(error)in the catch block improves error visibility whenIntl.supportedValuesOf('timeZone')throws an error, while maintaining the function's fallback behavior of returningfalse.apps/mail/components/navigation.tsx (2)
1-8: LGTM! Good cleanup of unused import.The removal of
NavigationMenuLinkimport is appropriate since it's not used in the component.
253-260: LGTM! Good security enhancement for external link.Adding
rel="noreferrer"to the external link withtarget="_blank"is a security best practice that prevents the new page from accessing thewindow.openerproperty. The attribute formatting is also improved for clarity.apps/server/src/lib/driver/types.ts (1)
22-32: ParsedDraft generic removal is safe—no generic usages foundI searched across
.ts/.tsxfiles and confirmed there are noParsedDraft<T>references. Remaining uses import and consumeParsedDraftwithout generics:• apps/server/src/lib/driver/types.ts
- export interface ParsedDraft
- getDraft(id: string): Promise
• apps/mail/components/mail/mail-list.tsx
- import type { ParsedDraft }
- useDraft(...) as UseQueryResult
No further changes required—removal of the unused generic parameter is approved.
apps/mail/components/ui/ai-sidebar.tsx (1)
16-21: LGTM! Clean up of unused imports and variables.The removal of unused imports (
useSession,useChat) and unused destructured variables (viewMode,setViewMode) from theuseAISidebarhook improves code cleanliness and reduces bundle size. This aligns well with the broader cleanup effort mentioned in the PR objectives.apps/mail/components/setup-phone.tsx (1)
92-92: Good addition for error visibility.Adding console error logging in the catch block improves debugging and monitoring capabilities, which aligns with the broader error handling improvements across the codebase. This will help troubleshoot phone verification issues more effectively.
apps/mail/app/(routes)/settings/general/page.tsx (1)
170-170: Good improvement for error handling.Adding console error logging in the catch block enhances debugging capabilities for settings save operations. This follows the consistent pattern of error logging improvements across the codebase.
apps/server/src/lib/factories/base-subscription.factory.ts (1)
1-5: Excellent cleanup of unused imports.Removing unused imports (
AppContext,getContext,HonoContext,getZeroDB) while retaining the necessary ones (EProviders,defaultLabels) improves code cleanliness and reduces bundle size. This is consistent with the broader cleanup effort across the codebase.apps/server/src/lib/timezones.ts (1)
7-7: Good addition for debugging timezone validation.Adding console error logging in the catch block improves debugging capabilities for timezone validation failures, which can occur due to browser compatibility or environment differences. This follows the consistent error logging pattern across the codebase.
apps/server/src/lib/factories/google-subscription.factory.ts (2)
1-1: Good cleanup of unused import.Removing the unused
UnsubscriptionDatatype from the import statement helps reduce clutter and follows good practices.
37-37: Enhanced error logging improves debugging.Adding the error object to the console log provides more context for debugging JSON parsing failures, which will be helpful for troubleshooting.
apps/mail/components/mail/select-all-checkbox.tsx (1)
86-86: Good addition of error logging for debugging.Adding console.error in the catch block provides valuable debugging information while maintaining the existing user-facing error toast.
apps/mail/lib/hotkeys/mail-list-hotkeys.tsx (2)
11-11: Good import organization.Moving the import statement to group with other imports improves code organization and readability.
18-18: Cleaner destructuring pattern.Changing from
[{ }, items]to[, items]removes the unused empty object and makes the destructuring more explicit about what's being used.apps/mail/components/party.tsx (1)
8-36: Good cleanup of unused imports and constants.Removing the unused
funnelimport and debouncer constants (labelsDebouncer,threadsDebouncer,DEBOUNCE_DELAY) simplifies the code. The query invalidations now happen immediately when messages are received.However, ensure that removing the debouncing doesn't cause performance issues with rapid query invalidations in high-traffic scenarios.
apps/mail/components/context/command-palette-context.tsx (3)
32-39: LGTM: Import cleanup improves code clarity.The import reorganization removes unused command UI components, which aligns with the broader cleanup effort mentioned in the AI summary. The remaining imports are properly grouped and all appear to be used within the component.
200-202: LGTM: Simplified hook destructuring removes unused property.The removal of
isPendingfrom theuseMutationdestructuring is a good cleanup, assuming it's not used elsewhere in the component. ThemutateAsyncproperty is properly extracted and used throughout the component.
846-846: LGTM: Improved React key stability.Using
group.groupas the Fragment key instead of a numeric index is a good improvement that enhances React's reconciliation performance. String keys are more stable than array indices and help React identify which items have changed.apps/server/src/lib/driver/google.ts (3)
13-13: LGTM: Unused import removal.The
DeleteAllSpamResponsetype was correctly removed from the imports as it's not used anywhere in the file.
200-200: LGTM: Simplified count logic.Removing the fallback to
undefinedis correct sinceNumber()already converts falsy values to 0, which is more appropriate for a count field.
1175-1175: LGTM: Enhanced error logging.The explicit error logging for attachment retrieval failures improves debugging capabilities and maintains consistency with the codebase's error handling patterns.
apps/server/src/lib/factories/outlook-subscription.factory.ts (1)
11-11: LGTM: Proper unused parameter handling.Renaming parameters to underscore (
_) correctly indicates they are intentionally unused in these unimplemented methods, following TypeScript conventions and suppressing unused parameter warnings.Also applies to: 18-18, 24-24
apps/mail/components/magicui/file-tree.tsx (2)
201-313: LGTM: Component refactor simplifies structure.The refactor successfully:
- Removes unnecessary
forwardRefusage- Simplifies JSX structure by reordering elements logically
- Cleans up unused
colorprop- Improves click handler safety with null checks
- Maintains all existing functionality while reducing complexity
The component is now more readable and maintainable.
360-360: LGTM: Removed unused className prop.The cleanup of the unused
classNameprop in theCollapseButtoncomponent is consistent with the overall code cleanup efforts.apps/mail/components/ui/sheet.tsx (1)
3-3: LGTM: Unused import cleanup.The removal of the unused
Ximport fromlucide-reactis part of the broader cleanup effort to reduce unnecessary dependencies.apps/mail/app/(routes)/layout.tsx (1)
3-3: LGTM: Unused provider import cleanup.The removal of the unused
VoiceProviderimport aligns with the broader cleanup of voice-related provider usage across the codebase.apps/mail/components/pricing/comparision.tsx (1)
1-1: All<Check>usages removed – imports are clean
Ranrg '<Check' apps/mail/components/pricingand found no matches; it’s safe to remove theCheckimport.apps/mail/components/ui/dialog.tsx (1)
1-3: Stale icon import removed – ✅
Xis no longer referenced in this file, so dropping the import is safe and reduces bundle size.
No further action needed.apps/server/src/main.ts (1)
19-19: LGTM! Good cleanup of unused imports.The removal of
getZeroAgentandwithMcpAuthimports is appropriate since they're not used in this file.Also applies to: 27-27
apps/mail/app/(routes)/mail/layout.tsx (1)
3-3: LGTM! Good cleanup of unused imports.The removal of
VoiceProvider,useLoaderData, andRoutetype imports is appropriate since they're not used in this layout component.Also applies to: 6-7
apps/mail/app/(full-width)/terms.tsx (1)
8-16: LGTM - Clean import cleanup!The removal of unused
useNavigateandtoastimports along with their associated hook calls is excellent cleanup. This aligns perfectly with the PR's goal of removing unused code across the codebase.apps/server/src/services/writing-style-service.ts (1)
2-5: LGTM - Excellent import cleanup!Removing the unused
getContext,getZeroDB, andHonoContextimports streamlines the dependencies for this writing style service. This cleanup improves code maintainability without affecting functionality.apps/mail/app/(routes)/settings/connections/page.tsx (1)
13-13: LGTM - Good import cleanup!Removing the unused
PricingDialogimport is excellent cleanup that aligns with the broader effort to remove unused components.apps/mail/package.json (2)
86-86: LGTM - Good addition of oxlint dependency!Adding the
oxlintdependency supports the project's new linting infrastructure and aligns with the broader code quality improvements in this PR.
117-117: LGTM - Proper Vite plugin integration!Adding the
vite-plugin-oxlintdependency enables linting integration during the build process, which is excellent for maintaining code quality.apps/mail/hooks/use-notes.tsx (1)
4-9: LGTM! Clean removal of unused session dependency.The removal of
useSessionimport and its corresponding destructuring assignment is appropriate as the session data wasn't being used in the query logic. This aligns with the broader cleanup pattern mentioned in the AI summary.apps/mail/app/(routes)/mail/[folder]/page.tsx (2)
9-9: Excellent performance optimization using Set for membership checks.Converting
ALLOWED_FOLDERSfrom an array to a Set improves lookup performance from O(n) to O(1).
27-27: LGTM! Efficient membership check using Set.has().The change from
Array.includes()toSet.has()is more performant and aligns with the linting preferences mentioned in the AI summary.apps/mail/lib/email-utils.client.tsx (1)
78-78: Excellent improvement to React key stability.Using the actual text content as the key instead of the array index provides better reconciliation behavior and aligns with React best practices for stable keys.
apps/mail/components/create/editor.colors.tsx (2)
130-132: Great improvement to React key stability.Using the unique
nameproperty as the key instead of the array index provides better reconciliation behavior and follows React best practices.
155-157: LGTM! Consistent React key improvement.The same stable key improvement applied to highlight colors maintains consistency and improves rendering performance.
apps/mail/vite.config.ts (1)
5-5: LGTM! Clean integration of oxlint plugin.The oxlint plugin is properly imported and added to the Vite configuration, which aligns with the linting standardization effort across the project.
Also applies to: 17-17
apps/mail/app/(full-width)/privacy.tsx (1)
8-9: Good cleanup of unused imports.The removal of unused
useNavigateandtoastimports helps reduce bundle size and eliminates unnecessary dependencies in this component.Also applies to: 15-15
apps/mail/components/ui/recursive-folder.tsx (1)
3-3: Clean removal of unused imports.Good cleanup of unused imports and dependencies that were not being utilized in this component.
Also applies to: 9-9
apps/mail/providers/query-provider.tsx (1)
7-7: Good cleanup of unused imports.Removing unused
InfiniteDataimport and other unused dependencies helps keep the module lean and reduces bundle size.apps/mail/components/onboarding.tsx (2)
3-3: Good cleanup of unused import.Removing the unused
useMemoimport keeps the imports clean and focused on what's actually used in the component.
87-87: Excellent improvement to React keys.Replacing array index keys with
step.titleprovides stable, unique keys that improve React's reconciliation performance and prevent unnecessary re-renders when the list changes.Also applies to: 131-131
apps/mail/components/create/editor.text-buttons.tsx (1)
44-46: Great React key optimization!Switching from array index to
item.nameas the React key is a solid improvement. This provides stable, unique identifiers that won't cause reconciliation issues when items are reordered or modified.apps/mail/app/(routes)/settings/labels/page.tsx (1)
1-29: Excellent import cleanup!The systematic removal of unused imports (Dialog, Form components, icons, utilities, constants) streamlines the codebase and reduces bundle size. This aligns well with the broader cleanup effort across the PR.
apps/mail/app/(full-width)/contributors.tsx (4)
54-60: Excellent performance optimization!Converting
excludedUsernamesfrom an array to aSetimproves membership check performance from O(n) to O(1), especially beneficial as the excluded list grows.
144-144: Good state simplification!Using array destructuring to discard the unused state value while keeping the setter is clean and communicates intent clearly.
201-201: Consistent use of Set.has()!The updated membership checks using
.has()properly leverage the Set data structure optimization introduced earlier.Also applies to: 218-218
1013-1013: Good security practice!Adding
rel="noreferrer"to external links prevents referrer information leakage and is a recommended security practice.Also applies to: 1022-1022
apps/server/src/lib/auth.ts (3)
8-8: Good import cleanup!Retaining only the necessary
userimport (aliased as_user) and removing unused schema imports keeps the dependencies clean.
236-236: Efficient destructuring!Only extracting the
dbinstance fromcreateDband omitting the unusedconnvariable is appropriate and aligns with the cleanup effort.
287-287: Clean parameter removal!Removing the unused
ctxparameter from theonErrorcallback simplifies the function signature without affecting functionality.apps/mail/components/ui/nav-main.tsx (2)
3-3: Clean import optimization!Removing unused imports like
useConnectionsanduseNavigatewhile retaining only the necessaryuseActiveConnection,Link, anduseLocationreduces unnecessary dependencies and aligns with the component's actual usage.Also applies to: 6-6
58-60: Good code cleanup!The removal of unused hook calls and variables simplifies the component logic and removes unnecessary data fetching overhead.
apps/mail/components/mail/navbar.tsx (2)
23-25: LGTM: Improved React key stability.Using
link.titleas the key instead of array index is a React best practice that ensures stable component identity during re-renders and list modifications.
46-47: LGTM: Consistent key usage.Good consistency in using the same stable key approach for both collapsed and expanded navigation states.
apps/mail/components/create/email-composer.tsx (7)
36-36: LGTM: Removed unused import.Good cleanup removing the unused
useIsMobilehook import.
729-731: LGTM: Stable React keys for email chips.Using
863-865: LGTM: Consistent key usage in collapsed view.Good consistency using the same stable key approach for both editable and collapsed email chip displays.
948-950: LGTM: Stable keys for CC emails.Consistent application of stable keys for CC email chips.
1039-1041: LGTM: Stable keys for CC collapsed view.Consistent key usage across all CC email rendering modes.
1094-1096: LGTM: Stable keys for BCC emails.Consistent application of stable keys for BCC email chips.
1185-1187: LGTM: Stable keys for BCC collapsed view.Consistent key usage across all BCC email rendering modes. All email chip components now use stable keys.
apps/mail/components/ui/pricing-dialog.tsx (2)
7-7: LGTM: Cleaned up unused icon imports.Good removal of unused icon imports, keeping only the necessary
PurpleThickCheck.
11-13: LGTM: Cleaned up unused React imports.Good cleanup removing unused React hooks and utilities while maintaining proper code formatting.
apps/mail/hooks/use-threads.ts (3)
3-3: LGTM: Removed unused React Query imports.Good cleanup removing unused
useMutationanduseQueryClientimports.
19-19: LGTM: Simplified label destructuring.Good simplification by removing unused
setLabelsfrom the destructuring, keeping only what's needed.
63-63: LGTM: Simplified useThread hook signature.Removing the unused
historyIdparameter simplifies the hook API. The AI summary confirms this change is coordinated with updates in other components.apps/mail/lib/utils.ts (2)
1-1: LGTM - Unused import removed.The removal of the unused
formatimport from date-fns is a good cleanup.
347-395: AllconstructReplyBodyandconstructForwardBodycall sites have been updatedThe only usages in
apps/mail/components/mail/reply-composer.tsxnow pass exactly four arguments (formattedMessage, originalDate, originalSender, otherRecipients). No instances of a fifthquotedMessageargument remain, and no server-side invocations were found.apps/server/src/pipelines.effect.ts (4)
26-26: LGTM - Unused imports removed.Good cleanup of unused imports from the
effectpackage.
91-91: LGTM - Parameter destructuring simplified.The removal of unused
subscriptionNamefrom destructuring is a good cleanup.
727-734: Excellent performance improvement with Set usage.Converting
aiLabelIdsfrom an array to aSetand usingSet.has()instead ofArray.includes()provides better performance for membership checks, especially with larger datasets. This is a good optimization.
840-842: Disabled vectorization types confirmed
A global search found no references toVectorizeVectorMetadataorIThreadSummaryMetadataoutside this file. Commenting them out aligns with the vectorization feature being disabled—no further action is needed.apps/mail/hooks/use-optimistic-actions.ts (1)
4-4: LGTM - Import cleanup and spacing improvements.The removal of unused imports and improved spacing make the code cleaner and more maintainable.
Also applies to: 11-11, 45-45, 48-48
apps/mail/components/labels/label-dialog.tsx (4)
21-21: LGTM - Import organization improved.The reordering of imports enhances code readability.
Also applies to: 25-25
97-99: LGTM - JSX formatting improved.The multiline formatting of the DialogTitle makes the code more readable.
130-132: Excellent React key improvement.Changing the key from array index to
color.backgroundColoris a significant improvement. Using unique, stable identifiers as keys helps React optimize rendering and prevents potential issues with component state when the list order changes.
158-160: LGTM - Button label formatting improved.The multiline formatting of the conditional button label improves readability.
apps/mail/components/home/footer.tsx (2)
2-2: LGTM! Good cleanup of unused import.Removing the unused
useInViewimport helps reduce bundle size and improves code cleanliness.
129-138: Excellent security improvement!Adding
rel="noreferrer"to external links prevents referrer information leakage, which is a security best practice. This prevents the destination site from seeing where the user came from, protecting user privacy.Also applies to: 151-180, 198-207
apps/mail/app/(full-width)/pricing.tsx (1)
5-7: LGTM! Good cleanup of unused imports.Removing unused imports helps reduce bundle size and improves code maintainability. This aligns well with the broader cleanup effort across the codebase.
apps/mail/components/home/HomeContent.tsx (2)
29-29: LGTM! Good cleanup of unused imports.Removing unused imports (
TabsList,TabsTrigger,use) helps reduce bundle size and improves code maintainability.Also applies to: 37-37
1220-1231: Excellent improvement to React key usage!Using the query string as the key instead of array index is much better practice. This provides stable, unique keys that improve React's reconciliation algorithm and prevent issues when array order changes.
Also applies to: 1240-1251
apps/mail/components/mail/reply-composer.tsx (1)
16-16: LGTM! Good cleanup of unused imports and variables.Removing unused imports and destructured variables (
isLoadingfrom hooks) helps reduce code clutter and improves maintainability.Also applies to: 27-27, 33-33
apps/mail/providers/voice-provider.tsx (3)
1-1: LGTM! Good cleanup of unused import.Removing the unused
useEffectimport helps reduce bundle size and improves code maintainability.
45-64: Functional change in clientTools construction pattern.The change from object spread in reduce to direct mutation is functionally equivalent but changes the coding pattern. Both approaches produce the same result.
112-112: Confirmcontextis always defined or defaulted before spreadingWe found a single call site in
apps/mail/components/voice-button.tsxthat always passes acontextargument, but were unable to locate thestartConversationsignature to verify whethercontexthas a default value or is marked as required. Please ensure one of the following is true:
- The
startConversationfunction inapps/mail/providers/voice-provider.tsxdeclarescontextwith a default value (e.g.context: ContextType = {}),- Or all call sites always pass a non-undefined
contextparameter.If neither is guaranteed, consider reverting to
...(context || {})to avoid potential runtime errors whencontextisundefined.• Call site:
- apps/mail/components/voice-button.tsx:26 —
await startConversation(context);• Action:
- Verify the function signature or add a default parameter for
context.apps/mail/components/create/create-email.tsx (1)
1-1: LGTM! Good cleanup of unused imports and simplification.The changes effectively remove unused imports and simplify the component by focusing on the active connection via
useActiveConnection, eliminating the need for the broaderuseConnectionshook. This aligns well with the overall cleanup theme of the PR.Also applies to: 5-5, 13-13, 50-50
apps/mail/components/create/ai-chat.tsx (3)
93-95: LGTM! Improved React key usage.Using the query string as the key instead of the index is a good improvement for React's reconciliation algorithm, providing more stable component identity.
Also applies to: 108-110
323-327: LGTM! Good performance optimization using Set.Changing from array to Set for membership checks improves performance from O(n) to O(1) for the
.includes()to.has()operation.
331-336: LGTM! Better React key for tool responses.Using
part.toolInvocation.toolNameas the key instead of the index provides more stable component identity for React rendering.apps/mail/lib/hotkeys/use-hotkey-utils.ts (2)
6-6: LGTM! Good simplification of the hook interface.Removing the unused
userIdparameter simplifies the hook interface and aligns with the broader cleanup efforts in the PR.
99-105: LGTM! Improved performance with direct mutation.The refactoring to use direct mutation instead of the spread operator is more efficient and the explicit typing adds clarity to the code.
apps/server/src/routes/chat.ts (5)
32-32: LGTM! Good cleanup of unused imports and improved organization.The removal of unused imports and reorganization of import statements improves code cleanliness and maintainability.
Also applies to: 44-44, 47-47
353-353: LGTM! Good convention for unused parameters.Using
_as the parameter name clearly indicates it's intentionally unused, following common coding conventions.
463-463: LGTM! Improved error logging.Adding console.warn for JSON parse errors provides better visibility into invalid incoming messages while maintaining the silent handling behavior.
959-959: LGTM! Good naming convention for unused variables.Using
_pageCountclearly indicates the variable is intentionally unused, avoiding linting warnings while maintaining code clarity.
1548-1548: LGTM! Enhanced error logging in catch blocks.Adding console.error logging in the catch blocks provides better visibility into errors while maintaining the existing error handling flow.
Also applies to: 1578-1578, 1608-1608
apps/mail/lib/elevenlabs-tools.ts (2)
343-343: Good addition of error logging.Adding
console.error(error)improves debugging capabilities.
130-130: No callers todeleteEmaildetected
Searched for direct invocations oftoolExecutors.deleteEmail(...), dynamic bracket access (toolExecutors['deleteEmail']), and plaindeleteEmail(...)across all .ts/.js files—no matches found. Removing theparamsargument is safe.apps/mail/components/ui/nav-user.tsx (2)
143-149: Good defensive programming with fallback value.Adding the empty string fallback prevents potential runtime errors when both name and email are undefined.
263-267: Excellent security improvement.Adding
rel="noreferrer"to external Discord links prevents window.opener attacks and improves privacy.Also applies to: 486-490
apps/mail/components/ui/app-sidebar.tsx (2)
12-13: LGTM! Import simplifications look good.The removal of unused imports (
authClientfromuseSessionanduseReffrom React) properly cleans up the code without affecting functionality.
50-50: LGTM! Destructuring simplification is correct.The removal of unused properties from the
useSessiondestructuring is appropriate and maintains the requireddataproperty.apps/mail/components/mail/mail-list.tsx (5)
9-9: LGTM! Import cleanup looks comprehensive.The removal of unused React hooks (
useState,useQueryClient,useHotkeysContext, etc.) properly cleans up the imports while maintaining the necessary ones.
56-56: LGTM! Destructuring simplification is appropriate.Removing the unused setter from
useSearchValuedestructuring is correct since only the value is needed in this component.
60-60: LGTM! Hook signature simplification looks correct.The removal of the second argument from
useThreadcall aligns with the hook signature simplification mentioned in the AI summary.
234-234: LGTM! JSX formatting improvement.The indentation fix for the conditional class names improves code readability.
953-955: LGTM! VList pattern improvement.The change from passing a
childrenprop to using a child function component pattern is a React best practice that provides better performance and clarity.apps/mail/components/mail/mail-display.tsx (5)
33-33: LGTM! Import cleanup is consistent.The removal of unused imports (
getEmailLogo,Button,SearchIcon) aligns with the broader cleanup effort in this PR.
269-269: LGTM! Array initialization improvements.The change from
new Array(length)toArray(length)with explicitnumber[]typing improves TypeScript type safety and follows modern JavaScript practices.Also applies to: 384-384, 416-416, 461-461
640-640: LGTM! Null handling improvement.The change to
useThread(emailData.threadId ?? null)properly handles the case wherethreadIdmight be undefined, preventing potential runtime errors.
1140-1140: LGTM! Error handling improvement.Replacing the browser
alertwithtoast.errorprovides a much better user experience and is consistent with modern UI patterns.
1278-1280: LGTM! React key improvements.Using stable unique identifiers (
person.email,attachment.filename) instead of array indices as React keys is a best practice that improves rendering performance and prevents reconciliation issues.Also applies to: 1643-1644
apps/mail/components/mail/mail.tsx (4)
16-16: Import consolidation looks good.The icon imports have been properly consolidated into a single line, improving code organization.
753-753: Good simplification of the CategoryDropdown component.The early return pattern when in multi-select mode or outside inbox folder is clean and aligns with the removal of bulk selection features.
411-411: setThreadId Setter Removal VerifiedNo occurrences of
setThreadIdwere found in apps/mail/components/mail/mail.tsx after removing the setter. TreatingthreadIdas read-only is safe and won’t break functionality.
459-459: Confirm category setter removal is safeVerified that there are no remaining references to
setCategoryin apps/mail/components/mail/mail.tsx. Removing the setter aligns with the removed category management UI and won’t break this component.apps/mail/components/mail/thread-display.tsx (4)
179-179: Good optimization for attachment aggregation.Using
pushto mutate the accumulator array is more efficient than creating new arrays on each iteration.
671-671: Good UX improvement for print error handling.Replacing the browser alert with a toast notification provides better user experience and consistent error handling.
224-224: Math.max Usage Is Safe and Does Not Skip Index 0The guard
focusedIndex < items.length - 1ensuresfocusedIndex ≥ 0, sofocusedIndex + 1is always ≥ 1. In other words,Math.max(1, focusedIndex + 1)is effectively the same asfocusedIndex + 1here and does not skip the first item. You can safely ignore the proposed change.Likely an incorrect or invalid review comment.
976-977: No change needed: unsubscribe condition includes both properties
Verified in apps/mail/components/mail/thread-display.tsx (lines 976–977) that the dropdown menu condition still checks
emailData.latest?.listUnsubscribeemailData.latest?.listUnsubscribePostThis covers both RFC 2369 unsubscribe URLs, so the original concern is unfounded.
Likely an incorrect or invalid review comment.
apps/mail/lib/elevenlabs-tools.ts
Outdated
| await trpcClient.ai.webSearch.mutate({ | ||
| query: emailSummaryPrompt, | ||
| }); |
There was a problem hiding this comment.
Fix: The summarizeEmail function discards the API response.
The function calls trpcClient.ai.webSearch.mutate but doesn't use the response, then returns a hardcoded fake summary. This breaks the summarization feature.
Apply this diff to properly use the API response:
- await trpcClient.ai.webSearch.mutate({
+ const { text } = await trpcClient.ai.webSearch.mutate({
query: emailSummaryPrompt,
});
return {
success: true,
result: {
threadId: threadId,
subject: subject,
from: from,
senderName: senderName,
messageCount: messageCount,
hasUnread: thread.hasUnread,
- summary: 'this is a fake summary',
+ summary: text,
message: `Successfully summarized email thread: ${threadId}`,
},
};Also applies to: 338-339
🤖 Prompt for AI Agents
In apps/mail/lib/elevenlabs-tools.ts around lines 325 to 327 and also lines 338
to 339, the summarizeEmail function calls trpcClient.ai.webSearch.mutate but
discards its response and returns a hardcoded summary instead. To fix this,
capture the response from the mutate call and return the actual summary data
from it rather than a fake hardcoded string, ensuring the summarization feature
works correctly.
| // const askZeroMailbox = (connectionId: string) => | ||
| // tool({ | ||
| // description: 'Ask Zero a question about the mailbox', | ||
| // parameters: z.object({ | ||
| // question: z.string().describe('The question to ask Zero'), | ||
| // topK: z.number().describe('The number of results to return').max(9).min(1).default(3), | ||
| // }), | ||
| // execute: async ({ question, topK = 3 }) => { | ||
| // const embedding = await getEmbeddingVector(question, 'vectorize-load'); | ||
| // if (!embedding) { | ||
| // return { error: 'Failed to get embedding' }; | ||
| // } | ||
| // const threadResults = await env.VECTORIZE.query(embedding, { | ||
| // topK, | ||
| // returnMetadata: 'all', | ||
| // filter: { | ||
| // connection: connectionId, | ||
| // }, | ||
| // }); | ||
|
|
||
| if (!threadResults.matches.length) { | ||
| return { | ||
| response: [], | ||
| success: false, | ||
| }; | ||
| } | ||
| return { | ||
| response: threadResults.matches.map((e) => e.metadata?.['summary'] ?? 'no content'), | ||
| success: true, | ||
| }; | ||
| }, | ||
| }); | ||
| // if (!threadResults.matches.length) { | ||
| // return { | ||
| // response: [], | ||
| // success: false, | ||
| // }; | ||
| // } | ||
| // return { | ||
| // response: threadResults.matches.map((e) => e.metadata?.['summary'] ?? 'no content'), | ||
| // success: true, | ||
| // }; | ||
| // }, | ||
| // }); | ||
|
|
||
| const askZeroThread = (connectionId: string) => | ||
| tool({ | ||
| description: 'Ask Zero a question about a specific thread', | ||
| parameters: z.object({ | ||
| threadId: z.string().describe('The ID of the thread to ask Zero about'), | ||
| question: z.string().describe('The question to ask Zero'), | ||
| }), | ||
| execute: async ({ threadId, question }) => { | ||
| const response = await env.VECTORIZE.getByIds([threadId]); | ||
| if (!response.length) return { response: "I don't know, no threads found", success: false }; | ||
| const embedding = await getEmbeddingVector(question, 'vectorize-load'); | ||
| if (!embedding) { | ||
| return { error: 'Failed to get embedding' }; | ||
| } | ||
| const threadResults = await env.VECTORIZE.query(embedding, { | ||
| topK: 1, | ||
| returnMetadata: 'all', | ||
| filter: { | ||
| thread: threadId, | ||
| connection: connectionId, | ||
| }, | ||
| }); | ||
| const topThread = threadResults.matches[0]; | ||
| if (!topThread) return { response: "I don't know, no threads found", success: false }; | ||
| return { | ||
| response: topThread.metadata?.['summary'] ?? 'no content', | ||
| success: true, | ||
| }; | ||
| }, | ||
| }); | ||
| // const askZeroThread = (connectionId: string) => | ||
| // tool({ | ||
| // description: 'Ask Zero a question about a specific thread', | ||
| // parameters: z.object({ | ||
| // threadId: z.string().describe('The ID of the thread to ask Zero about'), | ||
| // question: z.string().describe('The question to ask Zero'), | ||
| // }), | ||
| // execute: async ({ threadId, question }) => { | ||
| // const response = await env.VECTORIZE.getByIds([threadId]); | ||
| // if (!response.length) return { response: "I don't know, no threads found", success: false }; | ||
| // const embedding = await getEmbeddingVector(question, 'vectorize-load'); | ||
| // if (!embedding) { | ||
| // return { error: 'Failed to get embedding' }; | ||
| // } | ||
| // const threadResults = await env.VECTORIZE.query(embedding, { | ||
| // topK: 1, | ||
| // returnMetadata: 'all', | ||
| // filter: { | ||
| // thread: threadId, | ||
| // connection: connectionId, | ||
| // }, | ||
| // }); | ||
| // const topThread = threadResults.matches[0]; | ||
| // if (!topThread) return { response: "I don't know, no threads found", success: false }; | ||
| // return { | ||
| // response: topThread.metadata?.['summary'] ?? 'no content', | ||
| // success: true, | ||
| // }; | ||
| // }, | ||
| // }); |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Remove commented-out code instead of leaving it in the codebase.
Large blocks of commented code for askZeroMailbox and askZeroThread should be removed. If these features need to be preserved for reference, consider:
- Moving them to documentation
- Creating a separate deprecated features file
- Using feature flags instead of commenting
If these tools are being permanently removed, delete the commented code. If temporarily disabled, add a comment explaining why and when they'll be re-enabled.
Also applies to: 393-394
🤖 Prompt for AI Agents
In apps/server/src/routes/agent/tools.ts between lines 42 and 104, remove the
large blocks of commented-out code for the askZeroMailbox and askZeroThread
tools. If these tools are no longer needed, delete the commented code entirely.
If they are temporarily disabled, replace the commented code with a clear
comment explaining why they are disabled and when they will be re-enabled. Avoid
leaving large commented code blocks in the codebase to keep it clean and
maintainable.
af5fb2f to
1124550
Compare
1124550 to
6d5d7a0
Compare
There was a problem hiding this comment.
Actionable comments posted: 0
🔭 Outside diff range comments (6)
apps/mail/components/create/editor.tsx (5)
64-64: Remove unusedhideToolbarprop.The
hideToolbarprop is defined in the interface but is not destructured or used anywhere in the component logic after the MenuBar removal.- hideToolbar?: boolean;
67-72: Simplify EditorState interface to only include used properties.The
openNode,openColor, andopenLinkproperties are no longer used after the MenuBar removal. OnlyopenAIis being destructured and used.interface EditorState { - openNode: boolean; - openColor: boolean; - openLink: boolean; openAI: boolean; }
74-78: Remove unused action types from EditorAction.The
TOGGLE_NODE,TOGGLE_COLOR, andTOGGLE_LINKactions are no longer needed after the MenuBar removal.type EditorAction = - | { type: 'TOGGLE_NODE'; payload: boolean } - | { type: 'TOGGLE_COLOR'; payload: boolean } - | { type: 'TOGGLE_LINK'; payload: boolean } | { type: 'TOGGLE_AI'; payload: boolean };
80-93: Simplify editorReducer to only handle AI toggle.The reducer cases for
TOGGLE_NODE,TOGGLE_COLOR, andTOGGLE_LINKare no longer needed after the MenuBar removal.function editorReducer(state: EditorState, action: EditorAction): EditorState { switch (action.type) { - case 'TOGGLE_NODE': - return { ...state, openNode: action.payload }; - case 'TOGGLE_COLOR': - return { ...state, openColor: action.payload }; - case 'TOGGLE_LINK': - return { ...state, openLink: action.payload }; case 'TOGGLE_AI': return { ...state, openAI: action.payload }; default: return state; } }
109-114: Simplify initial state to only include openAI.The initial state object should only include the
openAIproperty since the others are no longer used.const [state, dispatch] = useReducer(editorReducer, { - openNode: false, - openColor: false, - openLink: false, openAI: false, });apps/mail/components/create/ai-chat.tsx (1)
227-233: Remove unusedinputprop from component interface.The
inputprop is declared in theAIChatPropsinterface but is no longer destructured in the component function signature. This creates an inconsistency.Apply this fix to remove the unused prop:
export interface AIChatProps { messages: Message[]; - input: string; setInput: (input: string) => void; error?: Error; handleSubmit: (e: React.FormEvent<HTMLFormElement>) => void; status: string; stop: () => void; className?: string; onModelChange?: (model: string) => void; }
♻️ Duplicate comments (1)
apps/mail/components/create/editor.tsx (1)
14-26: Verify all imports are actually used.Based on the past review comments, these imports were flagged as potentially unused. However, reviewing the current code shows they are actually being used:
TiptapEditor: Used on lines 58, 117handleCommandNavigation: Used on line 278handleImageDrop: Used on line 291useReducer: Used on line 109TextSelection: Used on line 255cn: Used on line 296The imports appear to be correctly used in the current implementation.
🧹 Nitpick comments (2)
apps/mail/components/create/ai-chat.tsx (1)
332-333: Consider using optional chaining for safer property access.The static analysis tool suggests using optional chaining for safer property access.
Apply this improvement:
- part.toolInvocation && - part.toolInvocation.result && + part.toolInvocation?.result &&.github/CONTRIBUTING.md (1)
82-83: Helpful addition for contributor guidance!The linting instruction is a valuable addition that will help contributors maintain code quality. However, consider formatting the URL as a proper markdown link for better readability.
Apply this markdown formatting improvement:
- - Please lint using `pnpm dlx oxlint@latest` or by downloading an IDE extension here: https://oxc.rs/docs/guide/usage/linter.html#vscode-extension + - Please lint using `pnpm dlx oxlint@latest` or by downloading an [IDE extension](https://oxc.rs/docs/guide/usage/linter.html#vscode-extension)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (107)
.github/CONTRIBUTING.md(1 hunks).github/workflows/ci.yml(1 hunks).oxlintrc.json(1 hunks)apps/mail/app/(full-width)/contributors.tsx(6 hunks)apps/mail/app/(full-width)/hr.tsx(2 hunks)apps/mail/app/(full-width)/pricing.tsx(1 hunks)apps/mail/app/(full-width)/privacy.tsx(1 hunks)apps/mail/app/(full-width)/terms.tsx(1 hunks)apps/mail/app/(routes)/layout.tsx(1 hunks)apps/mail/app/(routes)/mail/[folder]/page.tsx(2 hunks)apps/mail/app/(routes)/mail/layout.tsx(1 hunks)apps/mail/app/(routes)/settings/appearance/page.tsx(1 hunks)apps/mail/app/(routes)/settings/categories/page.tsx(1 hunks)apps/mail/app/(routes)/settings/connections/page.tsx(2 hunks)apps/mail/app/(routes)/settings/danger-zone/page.tsx(2 hunks)apps/mail/app/(routes)/settings/general/page.tsx(3 hunks)apps/mail/app/(routes)/settings/labels/page.tsx(1 hunks)apps/mail/app/(routes)/settings/security/page.tsx(1 hunks)apps/mail/app/(routes)/settings/shortcuts/page.tsx(3 hunks)apps/mail/components/context/command-palette-context.tsx(5 hunks)apps/mail/components/context/label-sidebar-context.tsx(0 hunks)apps/mail/components/context/sidebar-context.tsx(0 hunks)apps/mail/components/create/ai-chat.tsx(3 hunks)apps/mail/components/create/create-email.tsx(2 hunks)apps/mail/components/create/editor-buttons.tsx(0 hunks)apps/mail/components/create/editor.colors.tsx(2 hunks)apps/mail/components/create/editor.link-selector.tsx(0 hunks)apps/mail/components/create/editor.node-selector.tsx(0 hunks)apps/mail/components/create/editor.text-buttons.tsx(1 hunks)apps/mail/components/create/editor.tsx(2 hunks)apps/mail/components/create/email-composer.tsx(7 hunks)apps/mail/components/create/image-compression-settings.tsx(1 hunks)apps/mail/components/create/selectors/link-selector.tsx(0 hunks)apps/mail/components/create/selectors/math-selector.tsx(0 hunks)apps/mail/components/create/selectors/node-selector.tsx(0 hunks)apps/mail/components/create/slash-command.tsx(1 hunks)apps/mail/components/create/toolbar.tsx(0 hunks)apps/mail/components/create/uploaded-file-icon.tsx(1 hunks)apps/mail/components/home/HomeContent.tsx(3 hunks)apps/mail/components/home/footer.tsx(6 hunks)apps/mail/components/icons/icons.tsx(1 hunks)apps/mail/components/labels/label-dialog.tsx(4 hunks)apps/mail/components/magicui/file-tree.tsx(3 hunks)apps/mail/components/mail/mail-display.tsx(9 hunks)apps/mail/components/mail/mail-list.tsx(5 hunks)apps/mail/components/mail/mail.tsx(4 hunks)apps/mail/components/mail/navbar.tsx(2 hunks)apps/mail/components/mail/note-panel.tsx(0 hunks)apps/mail/components/mail/render-labels.tsx(1 hunks)apps/mail/components/mail/reply-composer.tsx(3 hunks)apps/mail/components/mail/select-all-checkbox.tsx(1 hunks)apps/mail/components/mail/thread-display.tsx(9 hunks)apps/mail/components/mail/thread-subject.tsx(1 hunks)apps/mail/components/motion-primitives/text-effect.tsx(1 hunks)apps/mail/components/navigation.tsx(1 hunks)apps/mail/components/onboarding.tsx(3 hunks)apps/mail/components/party.tsx(2 hunks)apps/mail/components/pricing/comparision.tsx(1 hunks)apps/mail/components/setup-phone.tsx(1 hunks)apps/mail/components/ui/ai-sidebar.tsx(1 hunks)apps/mail/components/ui/app-sidebar.tsx(3 hunks)apps/mail/components/ui/dialog.tsx(1 hunks)apps/mail/components/ui/gauge.tsx(1 hunks)apps/mail/components/ui/nav-main.tsx(2 hunks)apps/mail/components/ui/nav-user.tsx(5 hunks)apps/mail/components/ui/pricing-dialog.tsx(1 hunks)apps/mail/components/ui/recursive-folder.tsx(1 hunks)apps/mail/components/ui/sheet.tsx(1 hunks)apps/mail/components/ui/sidebar-labels.tsx(1 hunks)apps/mail/components/voice-button.tsx(1 hunks)apps/mail/config/navigation.ts(0 hunks)apps/mail/hooks/driver/use-delete.ts(1 hunks)apps/mail/hooks/use-compose-editor.ts(0 hunks)apps/mail/hooks/use-mail-navigation.ts(1 hunks)apps/mail/hooks/use-notes.tsx(1 hunks)apps/mail/hooks/use-optimistic-actions.ts(2 hunks)apps/mail/hooks/use-threads.ts(3 hunks)apps/mail/lib/constants.tsx(1 hunks)apps/mail/lib/elevenlabs-tools.ts(3 hunks)apps/mail/lib/email-utils.client.tsx(1 hunks)apps/mail/lib/hotkeys/mail-list-hotkeys.tsx(1 hunks)apps/mail/lib/hotkeys/thread-display-hotkeys.tsx(1 hunks)apps/mail/lib/hotkeys/use-hotkey-utils.ts(2 hunks)apps/mail/lib/timezones.ts(1 hunks)apps/mail/lib/utils.ts(1 hunks)apps/mail/middleware.ts(0 hunks)apps/mail/package.json(2 hunks)apps/mail/providers/query-provider.tsx(1 hunks)apps/mail/providers/voice-provider.tsx(3 hunks)apps/mail/vite.config.ts(2 hunks)apps/server/src/lib/auth.ts(3 hunks)apps/server/src/lib/driver/google.ts(3 hunks)apps/server/src/lib/driver/microsoft.ts(0 hunks)apps/server/src/lib/driver/types.ts(1 hunks)apps/server/src/lib/driver/utils.ts(1 hunks)apps/server/src/lib/factories/base-subscription.factory.ts(1 hunks)apps/server/src/lib/factories/google-subscription.factory.ts(2 hunks)apps/server/src/lib/factories/outlook-subscription.factory.ts(1 hunks)apps/server/src/lib/server-utils.ts(1 hunks)apps/server/src/lib/services.ts(1 hunks)apps/server/src/lib/timezones.ts(1 hunks)apps/server/src/main.ts(1 hunks)apps/server/src/pipelines.effect.ts(4 hunks)apps/server/src/routes/agent/orchestrator.ts(1 hunks)apps/server/src/routes/agent/tools.ts(2 hunks)apps/server/src/routes/chat.ts(8 hunks)apps/server/src/services/writing-style-service.ts(1 hunks)
⛔ Files not processed due to max files limit (8)
- apps/server/src/trpc/routes/bimi.ts
- apps/server/src/trpc/routes/connections.ts
- apps/server/src/trpc/routes/label.ts
- apps/server/src/trpc/routes/mail.ts
- apps/server/src/trpc/routes/settings.ts
- apps/server/src/trpc/trpc.ts
- eslint.config.mjs
- scripts/seed-style/seeder.ts
💤 Files with no reviewable changes (14)
- apps/mail/components/context/sidebar-context.tsx
- apps/mail/components/create/toolbar.tsx
- apps/mail/components/context/label-sidebar-context.tsx
- apps/mail/config/navigation.ts
- apps/mail/hooks/use-compose-editor.ts
- apps/mail/components/create/selectors/math-selector.tsx
- apps/mail/components/mail/note-panel.tsx
- apps/mail/components/create/editor-buttons.tsx
- apps/mail/components/create/selectors/node-selector.tsx
- apps/server/src/lib/driver/microsoft.ts
- apps/mail/components/create/editor.node-selector.tsx
- apps/mail/components/create/editor.link-selector.tsx
- apps/mail/middleware.ts
- apps/mail/components/create/selectors/link-selector.tsx
✅ Files skipped from review due to trivial changes (12)
- apps/mail/app/(routes)/settings/security/page.tsx
- apps/mail/components/ui/sheet.tsx
- apps/mail/hooks/use-mail-navigation.ts
- apps/mail/components/ui/sidebar-labels.tsx
- apps/server/src/lib/driver/utils.ts
- apps/mail/components/pricing/comparision.tsx
- apps/mail/components/create/uploaded-file-icon.tsx
- apps/server/src/routes/agent/orchestrator.ts
- apps/mail/components/create/image-compression-settings.tsx
- apps/server/src/services/writing-style-service.ts
- apps/mail/app/(routes)/settings/labels/page.tsx
- apps/mail/components/ui/app-sidebar.tsx
🚧 Files skipped from review as they are similar to previous changes (76)
- apps/mail/app/(routes)/layout.tsx
- apps/mail/components/create/slash-command.tsx
- .github/workflows/ci.yml
- apps/mail/lib/hotkeys/thread-display-hotkeys.tsx
- apps/mail/components/ui/dialog.tsx
- apps/mail/app/(routes)/mail/layout.tsx
- apps/mail/app/(routes)/settings/danger-zone/page.tsx
- apps/mail/app/(routes)/mail/[folder]/page.tsx
- apps/mail/app/(routes)/settings/appearance/page.tsx
- apps/mail/lib/timezones.ts
- apps/mail/hooks/use-notes.tsx
- apps/server/src/lib/server-utils.ts
- apps/mail/app/(full-width)/terms.tsx
- apps/mail/lib/email-utils.client.tsx
- apps/mail/hooks/driver/use-delete.ts
- apps/mail/components/mail/render-labels.tsx
- apps/mail/components/navigation.tsx
- apps/mail/app/(routes)/settings/connections/page.tsx
- apps/mail/components/setup-phone.tsx
- apps/mail/components/onboarding.tsx
- apps/server/src/main.ts
- apps/mail/components/mail/select-all-checkbox.tsx
- apps/mail/components/ui/gauge.tsx
- apps/mail/components/party.tsx
- apps/server/src/lib/factories/base-subscription.factory.ts
- apps/mail/components/ui/pricing-dialog.tsx
- apps/server/src/lib/factories/google-subscription.factory.ts
- apps/mail/providers/query-provider.tsx
- apps/mail/components/mail/navbar.tsx
- apps/mail/vite.config.ts
- apps/mail/package.json
- apps/mail/components/create/editor.text-buttons.tsx
- apps/mail/lib/hotkeys/mail-list-hotkeys.tsx
- apps/mail/components/ui/recursive-folder.tsx
- apps/mail/app/(full-width)/hr.tsx
- apps/server/src/lib/timezones.ts
- apps/mail/components/mail/reply-composer.tsx
- apps/mail/app/(routes)/settings/categories/page.tsx
- apps/mail/components/ui/ai-sidebar.tsx
- apps/mail/app/(full-width)/pricing.tsx
- apps/mail/components/context/command-palette-context.tsx
- apps/mail/components/ui/nav-main.tsx
- apps/server/src/lib/services.ts
- apps/mail/components/create/create-email.tsx
- apps/mail/components/create/email-composer.tsx
- apps/mail/lib/hotkeys/use-hotkey-utils.ts
- apps/server/src/lib/driver/google.ts
- apps/server/src/lib/driver/types.ts
- apps/mail/hooks/use-threads.ts
- apps/mail/hooks/use-optimistic-actions.ts
- apps/mail/components/mail/thread-subject.tsx
- apps/mail/app/(full-width)/privacy.tsx
- apps/server/src/lib/auth.ts
- apps/mail/components/create/editor.colors.tsx
- apps/mail/lib/constants.tsx
- apps/mail/lib/utils.ts
- apps/server/src/pipelines.effect.ts
- apps/mail/app/(routes)/settings/general/page.tsx
- apps/mail/app/(routes)/settings/shortcuts/page.tsx
- apps/mail/app/(full-width)/contributors.tsx
- apps/mail/components/home/HomeContent.tsx
- apps/server/src/routes/chat.ts
- apps/mail/lib/elevenlabs-tools.ts
- apps/server/src/lib/factories/outlook-subscription.factory.ts
- apps/mail/components/voice-button.tsx
- apps/server/src/routes/agent/tools.ts
- apps/mail/components/home/footer.tsx
- apps/mail/components/ui/nav-user.tsx
- apps/mail/providers/voice-provider.tsx
- apps/mail/components/labels/label-dialog.tsx
- apps/mail/components/magicui/file-tree.tsx
- apps/mail/components/motion-primitives/text-effect.tsx
- apps/mail/components/mail/mail-display.tsx
- apps/mail/components/mail/mail-list.tsx
- apps/mail/components/mail/thread-display.tsx
- apps/mail/components/icons/icons.tsx
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: JagjeevanAK
PR: Mail-0/Zero#1583
File: apps/docs/package.json:1-0
Timestamp: 2025-07-01T12:53:32.495Z
Learning: The Zero project prefers to handle dependency updates through automated tools like Dependabot rather than immediate manual updates, allowing for proper testing and validation through their established workflow.
apps/mail/components/create/editor.tsx (1)
Learnt from: retrogtx
PR: Mail-0/Zero#1328
File: apps/mail/lib/hotkeys/mail-list-hotkeys.tsx:202-209
Timestamp: 2025-06-18T17:26:50.918Z
Learning: In apps/mail/lib/hotkeys/mail-list-hotkeys.tsx, the switchCategoryByIndex function using hardcoded indices for category hotkeys does not break when users reorder categories, contrary to the theoretical index-shifting issue. The actual implementation has constraints or mechanisms that prevent hotkey targeting issues.
apps/mail/components/mail/mail.tsx (2)
Learnt from: retrogtx
PR: Mail-0/Zero#1328
File: apps/mail/lib/hotkeys/mail-list-hotkeys.tsx:202-209
Timestamp: 2025-06-18T17:26:50.918Z
Learning: In apps/mail/lib/hotkeys/mail-list-hotkeys.tsx, the switchCategoryByIndex function using hardcoded indices for category hotkeys does not break when users reorder categories, contrary to the theoretical index-shifting issue. The actual implementation has constraints or mechanisms that prevent hotkey targeting issues.
Learnt from: snehendu098
PR: Mail-0/Zero#1323
File: apps/mail/lib/themes/theme-utils.ts:318-318
Timestamp: 2025-06-24T06:22:58.753Z
Learning: In the Mail-0/Zero theme system (apps/mail/lib/themes/theme-utils.ts), when color themes are being applied, all color values come in HSL format, so there's no need for additional format validation when converting colors with hslToHex().
apps/mail/components/create/ai-chat.tsx (1)
Learnt from: retrogtx
PR: Mail-0/Zero#1328
File: apps/mail/lib/hotkeys/mail-list-hotkeys.tsx:202-209
Timestamp: 2025-06-18T17:26:50.918Z
Learning: In apps/mail/lib/hotkeys/mail-list-hotkeys.tsx, the switchCategoryByIndex function using hardcoded indices for category hotkeys does not break when users reorder categories, contrary to the theoretical index-shifting issue. The actual implementation has constraints or mechanisms that prevent hotkey targeting issues.
🪛 markdownlint-cli2 (0.17.2)
.github/CONTRIBUTING.md
82-82: Bare URL used
(MD034, no-bare-urls)
🪛 Biome (1.9.4)
.oxlintrc.json
[error] 4-4: Expected a property but instead found '// Emit an error message when a call to alert() is found'.
Expected a property here.
(parse)
[error] 5-5: expected , but instead found "oxc/approx-constant"
Remove "oxc/approx-constant"
(parse)
[error] 5-5: Expected a property but instead found '// Show a warning when you write a number close to a known constant'.
Expected a property here.
(parse)
[error] 6-6: expected , but instead found "no-plusplus"
Remove "no-plusplus"
(parse)
[error] 6-6: Expected a property but instead found '// Allow using the ++ and -- operators'.
Expected a property here.
(parse)
[error] 7-7: expected , but instead found "no-useless-call"
Remove "no-useless-call"
(parse)
apps/mail/components/create/ai-chat.tsx
[error] 332-333: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Cursor BugBot
🔇 Additional comments (7)
apps/mail/components/create/ai-chat.tsx (2)
93-95: Excellent improvement to React key stability!Changing from index-based keys to using the query string itself as the key is a great practice. This ensures stable keys even if the array order changes, preventing unnecessary re-renders and maintaining component state correctly.
Also applies to: 108-110
323-327: Great performance optimization with Set usage!Converting
streamingToolsfrom an array to a Set and using.has()instead of.includes()provides better performance for membership checks (O(1) vs O(n)). The key change forToolResponsecomponents also improves React list stability.Also applies to: 334-336
.oxlintrc.json (1)
1-18: Comprehensive and well-configured linting setup!The oxlint configuration is excellent with a balanced set of rules that enforce:
- React best practices (
no-array-index-key, JSX optimizations)- Performance improvements (
prefer-set-has,prefer-array-find)- Code quality (
no-alert,no-useless-call)- Sensible rule exceptions (
no-plusplus: off,exhaustive-deps: off)The static analysis warnings from Biome about JSON comments are false positives since oxlint configuration files support comments, unlike standard JSON.
apps/mail/components/mail/mail.tsx (4)
16-29: Import cleanup looks good.The import statements have been properly organized and cleaned up, removing unused imports while maintaining the necessary ones for the simplified functionality.
56-56: Import organization is clean.The cn utility import has been properly placed and organized with appropriate spacing.
459-459: Ignore category setter removal in mail.tsx – no setter is used hereThe change in apps/mail/components/mail/mail.tsx only destructures the read‐only value from useQueryState('category', …) and never calls the setter. All existing setCategory calls come from other files (e.g. mail-list.tsx and mail-list-hotkeys.tsx), which each use their own hook instance. Removing the unused setter here will not break any functionality.
Likely an incorrect or invalid review comment.
411-411: ✅ Removing thethreadIdsetter in mail.tsx is safeWe searched apps/mail/components/mail/mail.tsx and confirmed there are no calls to
setThreadIdor any usages of the setter in that file. All programmatic updates to query state still occur in other components/hooks that retain their setters.
There was a problem hiding this comment.
Bug: Quoted Message Missing in Replies
The replyToMessage.decodedBody argument was commented out in constructForwardBody and constructReplyBody calls. This prevents the original message content from being included in replies and forwards, resulting in a functional regression where users no longer see the quoted message.
apps/mail/components/mail/reply-composer.tsx#L169-L178
Zero/apps/mail/components/mail/reply-composer.tsx
Lines 169 to 178 in 6d5d7a0
BugBot free trial expires on July 22, 2025
You have used $0.00 of your $50.00 spend limit so far. Manage your spend limit in the Cursor dashboard.
Was this report helpful? Give feedback by reacting with 👍 or 👎

Ran oxc (https://oxc.rs/docs/guide/usage/linter.html#vscode-extension) and fixed all the issues that came up, set it up to run as a PR check and added steps to the README.md asking users to use it.
Summary by CodeRabbit
New Features
Bug Fixes
Refactor
Chores
Documentation
Style