Conversation
Bug Report
Comments? Email us. |
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughThe codebase undergoes a significant refactor of the mail categories feature. AI-generated search query functionality is removed, replaced by a multi-select label dropdown for category filtering. Default categories are simplified, and the backend schema is updated to support dynamic category IDs. Navigation and localization are adjusted to reflect these changes, with related UI and state management updates throughout. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CategoriesSettingsPage
participant Backend (API)
participant LabelsDropdown
User->>CategoriesSettingsPage: Open Categories Settings
CategoriesSettingsPage->>Backend (API): Fetch user categories & labels
Backend (API)-->>CategoriesSettingsPage: Return categories & labels
User->>LabelsDropdown: Select/deselect multiple labels
LabelsDropdown->>CategoriesSettingsPage: Update category's searchValue
User->>CategoriesSettingsPage: Add/Delete/Reorder category
CategoriesSettingsPage->>Backend (API): Save or reset categories
Backend (API)-->>CategoriesSettingsPage: Confirm save/reset
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. ✨ Finishing Touches
🧪 Generate unit tests
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. 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. |
There was a problem hiding this comment.
cubic analysis
7 issues found across 11 files • Review in cubic
React with 👍 or 👎 to teach cubic. You can also tag @cubic-dev-ai to give feedback, ask questions, or re-run the review.
| "prepare": "husky", | ||
| "nizzy": "tsx ./packages/cli/src/cli.ts", | ||
| "postinstall": "pnpm nizzy sync", | ||
| "precommit": "pnpm dlx oxlint@latest --deny-warnings", |
There was a problem hiding this comment.
Adding a 'precommit' script does not guarantee it will run on commit; use Husky's .husky/pre-commit file to enforce pre-commit checks.
Prompt for AI agents
Address the following comment on package.json at line 11:
<comment>Adding a 'precommit' script does not guarantee it will run on commit; use Husky's .husky/pre-commit file to enforce pre-commit checks.</comment>
<file context>
@@ -8,6 +8,7 @@
"prepare": "husky",
"nizzy": "tsx ./packages/cli/src/cli.ts",
"postinstall": "pnpm nizzy sync",
+ "precommit": "pnpm dlx oxlint@latest --deny-warnings",
"dev": "turbo run dev",
"build": "turbo run build",
</file context>
There was a problem hiding this comment.
Actionable comments posted: 13
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (11)
apps/mail/app/(routes)/settings/categories/page.tsx(6 hunks)apps/mail/app/routes.ts(1 hunks)apps/mail/components/mail/mail-list.tsx(5 hunks)apps/mail/components/mail/mail.tsx(8 hunks)apps/mail/components/settings/settings-card.tsx(1 hunks)apps/mail/config/navigation.ts(1 hunks)apps/mail/hooks/use-categories.ts(3 hunks)apps/mail/messages/en.json(1 hunks)apps/server/src/lib/schemas.ts(2 hunks)apps/server/src/routes/agent/index.ts(2 hunks)package.json(1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit Inference Engine (AGENT.md)
**/*.{js,jsx,ts,tsx}: Use 2-space indentation
Use single quotes for strings
Limit lines to 100 characters in length
Semicolons are required at the end of statements
Files:
apps/mail/config/navigation.tsapps/mail/app/routes.tsapps/server/src/lib/schemas.tsapps/mail/hooks/use-categories.tsapps/mail/components/settings/settings-card.tsxapps/mail/components/mail/mail.tsxapps/mail/components/mail/mail-list.tsxapps/mail/app/(routes)/settings/categories/page.tsxapps/server/src/routes/agent/index.ts
**/*.{js,jsx,ts,tsx,css,scss}
📄 CodeRabbit Inference Engine (AGENT.md)
Use Prettier with sort-imports and Tailwind plugins for code formatting
Files:
apps/mail/config/navigation.tsapps/mail/app/routes.tsapps/server/src/lib/schemas.tsapps/mail/hooks/use-categories.tsapps/mail/components/settings/settings-card.tsxapps/mail/components/mail/mail.tsxapps/mail/components/mail/mail-list.tsxapps/mail/app/(routes)/settings/categories/page.tsxapps/server/src/routes/agent/index.ts
**/*.{ts,tsx}
📄 CodeRabbit Inference Engine (AGENT.md)
Enable TypeScript strict mode
Files:
apps/mail/config/navigation.tsapps/mail/app/routes.tsapps/server/src/lib/schemas.tsapps/mail/hooks/use-categories.tsapps/mail/components/settings/settings-card.tsxapps/mail/components/mail/mail.tsxapps/mail/components/mail/mail-list.tsxapps/mail/app/(routes)/settings/categories/page.tsxapps/server/src/routes/agent/index.ts
**/*.{css,js,ts,jsx,tsx,mdx}
📄 CodeRabbit Inference Engine (.cursor/rules/tailwind-css-v4.mdc)
**/*.{css,js,ts,jsx,tsx,mdx}: Chain variants together for composable variants (e.g.,group-has-data-potato:opacity-100).
Use new variants such asstarting,not-*,inert,nth-*,in-*,open(for:popover-open), and**for all descendants.
Do not use deprecated utilities likebg-opacity-*,text-opacity-*,border-opacity-*, anddivide-opacity-*; use the new syntax (e.g.,bg-black/50).
Use renamed utilities:shadow-smis nowshadow-xs,shadowis nowshadow-sm,drop-shadow-smis nowdrop-shadow-xs,drop-shadowis nowdrop-shadow-sm,blur-smis nowblur-xs,bluris nowblur-sm,rounded-smis nowrounded-xs,roundedis nowrounded-sm,outline-noneis nowoutline-hidden.
Usebg-(--brand-color)syntax for CSS variables in arbitrary values instead ofbg-[--brand-color].
Stacked variants now apply left-to-right instead of right-to-left.
Files:
apps/mail/config/navigation.tsapps/mail/app/routes.tsapps/server/src/lib/schemas.tsapps/mail/hooks/use-categories.tsapps/mail/components/settings/settings-card.tsxapps/mail/components/mail/mail.tsxapps/mail/components/mail/mail-list.tsxapps/mail/app/(routes)/settings/categories/page.tsxapps/server/src/routes/agent/index.ts
🧠 Learnings (15)
📓 Common learnings
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#1734
File: apps/server/src/lib/driver/google.ts:211-221
Timestamp: 2025-07-15T06:46:33.349Z
Learning: In apps/server/src/lib/driver/google.ts, the normalization of "draft" to "drafts" in the count() method is necessary because the navigation item in apps/mail/config/navigation.ts has id: 'drafts' (plural) while the Google API returns "draft" (singular). The nav-main.tsx component matches stats by comparing stat.label with item.id, so the backend must return "drafts" for the draft counter badge to appear in the sidebar.
📚 Learning: always run `pnpm check` before committing...
Learnt from: CR
PR: Mail-0/Zero#0
File: AGENT.md:0-0
Timestamp: 2025-08-03T20:41:43.899Z
Learning: Always run `pnpm check` before committing
Applied to files:
package.json
📚 Learning: run `pnpm db:push` after schema changes...
Learnt from: CR
PR: Mail-0/Zero#0
File: AGENT.md:0-0
Timestamp: 2025-08-03T20:41:43.899Z
Learning: Run `pnpm db:push` after schema changes
Applied to files:
package.json
📚 Learning: use `pnpm nizzy sync` after environment variable changes...
Learnt from: CR
PR: Mail-0/Zero#0
File: AGENT.md:0-0
Timestamp: 2025-08-03T20:41:43.899Z
Learning: Use `pnpm nizzy sync` after environment variable changes
Applied to files:
package.json
📚 Learning: applies to **/*.{js,jsx,ts,tsx,css,scss} : use prettier with sort-imports and tailwind plugins for c...
Learnt from: CR
PR: Mail-0/Zero#0
File: AGENT.md:0-0
Timestamp: 2025-08-03T20:41:43.899Z
Learning: Applies to **/*.{js,jsx,ts,tsx,css,scss} : Use Prettier with sort-imports and Tailwind plugins for code formatting
Applied to files:
package.jsonapps/mail/components/settings/settings-card.tsx
📚 Learning: use `pnpm go` for quick development startup...
Learnt from: CR
PR: Mail-0/Zero#0
File: AGENT.md:0-0
Timestamp: 2025-08-03T20:41:43.899Z
Learning: Use `pnpm go` for quick development startup
Applied to files:
package.json
📚 Learning: in apps/mail/lib/hotkeys/mail-list-hotkeys.tsx, the switchcategorybyindex function using hardcoded i...
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.
Applied to files:
apps/mail/messages/en.jsonapps/mail/config/navigation.tsapps/mail/app/routes.tsapps/server/src/lib/schemas.tsapps/mail/hooks/use-categories.tsapps/mail/components/mail/mail.tsxapps/mail/components/mail/mail-list.tsxapps/mail/app/(routes)/settings/categories/page.tsx
📚 Learning: in apps/server/src/lib/driver/google.ts, the normalization of "draft" to "drafts" in the count() met...
Learnt from: retrogtx
PR: Mail-0/Zero#1734
File: apps/server/src/lib/driver/google.ts:211-221
Timestamp: 2025-07-15T06:46:33.349Z
Learning: In apps/server/src/lib/driver/google.ts, the normalization of "draft" to "drafts" in the count() method is necessary because the navigation item in apps/mail/config/navigation.ts has id: 'drafts' (plural) while the Google API returns "draft" (singular). The nav-main.tsx component matches stats by comparing stat.label with item.id, so the backend must return "drafts" for the draft counter badge to appear in the sidebar.
Applied to files:
apps/mail/config/navigation.tsapps/mail/app/routes.tsapps/server/src/lib/schemas.tsapps/mail/hooks/use-categories.tsapps/mail/components/mail/mail.tsxapps/mail/components/mail/mail-list.tsxapps/mail/app/(routes)/settings/categories/page.tsxapps/server/src/routes/agent/index.ts
📚 Learning: in apps/server/src/trpc/routes/mail.ts, the user indicated they are not using iso format for the sch...
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.
Applied to files:
apps/mail/app/routes.tsapps/server/src/lib/schemas.tsapps/mail/hooks/use-categories.ts
📚 Learning: to completely disable ssg (static site generation) in next.js projects for docker deployments, use '...
Learnt from: adiologydev
PR: Mail-0/Zero#871
File: docker-compose.yaml:2-21
Timestamp: 2025-05-04T23:21:21.388Z
Learning: To completely disable SSG (Static Site Generation) in Next.js projects for Docker deployments, use 'force-dynamic' for App Router or getServerSideProps for Pages Router in all pages, and set output: 'standalone' in next.config.ts. This allows all environment variables to be passed at runtime instead of build time, improving security for sensitive values.
Applied to files:
apps/mail/app/routes.ts
📚 Learning: in the mail-0/zero theme system (apps/mail/lib/themes/theme-utils.ts), when color themes are being a...
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().
Applied to files:
apps/server/src/lib/schemas.ts
📚 Learning: in apps/server/src/trpc/routes/mail.ts, the attachment processing logic conditionally handles mixed ...
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.
Applied to files:
apps/server/src/lib/schemas.ts
📚 Learning: applies to **/*.{css,js,ts,jsx,tsx,mdx} : use renamed utilities: `shadow-sm` is now `shadow-xs`, `sh...
Learnt from: CR
PR: Mail-0/Zero#0
File: .cursor/rules/tailwind-css-v4.mdc:0-0
Timestamp: 2025-08-03T20:42:04.207Z
Learning: Applies to **/*.{css,js,ts,jsx,tsx,mdx} : Use renamed utilities: `shadow-sm` is now `shadow-xs`, `shadow` is now `shadow-sm`, `drop-shadow-sm` is now `drop-shadow-xs`, `drop-shadow` is now `drop-shadow-sm`, `blur-sm` is now `blur-xs`, `blur` is now `blur-sm`, `rounded-sm` is now `rounded-xs`, `rounded` is now `rounded-sm`, `outline-none` is now `outline-hidden`.
Applied to files:
apps/mail/components/settings/settings-card.tsxapps/mail/components/mail/mail.tsxapps/mail/components/mail/mail-list.tsx
📚 Learning: for the "upgrade" link in addconnectiondialog, using a proper element instead of a w...
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).
Applied to files:
apps/mail/components/mail/mail.tsx
📚 Learning: in the threadlabels prompt system, existing labels should not be automatically preserved. the ai age...
Learnt from: MrgSub
PR: Mail-0/Zero#1837
File: apps/server/src/lib/brain.fallback.prompts.ts:211-217
Timestamp: 2025-07-26T20:39:06.670Z
Learning: In the ThreadLabels prompt system, existing labels should not be automatically preserved. The AI agent should re-evaluate all labels (both existing and new) against the current thread summary and only return labels that currently apply to the thread content, even if it means dropping previously applied labels that are no longer relevant.
Applied to files:
apps/server/src/routes/agent/index.ts
🧬 Code Graph Analysis (3)
apps/mail/config/navigation.ts (1)
apps/mail/components/icons/icons.tsx (1)
Tabs(594-611)
apps/mail/components/mail/mail.tsx (5)
apps/mail/lib/utils.ts (1)
cn(55-55)apps/mail/lib/hotkeys/use-hotkey-utils.ts (1)
isMac(52-55)apps/mail/hooks/use-categories.ts (1)
useCategorySettings(13-24)apps/mail/components/ui/dropdown-menu.tsx (1)
DropdownMenuItem(172-172)apps/mail/components/icons/icons.tsx (1)
Check(1634-1649)
apps/server/src/routes/agent/index.ts (1)
apps/server/src/lib/driver/types.ts (1)
IGetThreadsResponse(120-123)
🪛 Biome (2.1.2)
apps/mail/app/(routes)/settings/categories/page.tsx
[error] 75-80: The ARIA attribute 'aria-label' is not supported by this element.
Ensure that ARIA attributes are valid for the role of the element.
(lint/a11y/useAriaPropsSupportedByRole)
🪛 GitHub Actions: autofix.ci
apps/mail/app/(routes)/settings/categories/page.tsx
[warning] 21-21: ESLint (no-unused-vars): Identifier 'useQuery' is imported but never used. Consider removing this import.
⏰ 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). (2)
- GitHub Check: cubic · AI code reviewer
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (9)
apps/mail/components/settings/settings-card.tsx (1)
2-2: Excellent import optimization and type consistency!This is precisely the kind of engineering excellence we need - clean type-only imports and direct type usage rather than namespaced React types. It's like optimizing rocket fuel efficiency - every bit of clarity counts when you're building at scale.
Also applies to: 6-11
apps/mail/messages/en.json (1)
419-419: Brilliant terminology evolution!Changing "Categories" to "Views" is like renaming our Falcon 9 to Falcon Heavy - it better represents what the system actually does now. With label-based filtering, users are indeed creating custom views of their mail rather than rigid categories. This linguistic precision will reduce cognitive load for users.
apps/mail/config/navigation.ts (1)
176-180: Navigation activation executed flawlessly!This is how you properly activate a feature - clean uncomment with all the right pieces in place. The Tabs icon is perfect for the new "Views" concept, and the integration with the localization system is spot-on. It's like mission control giving the go/no-go - everything checks out perfectly.
apps/mail/app/routes.ts (1)
45-45: Route activation: cleared for launch!Perfect execution on enabling the categories route. Like opening a new launch pad - the infrastructure is ready, the path is clear, and everything connects properly. This completes the activation sequence that started with the navigation changes.
apps/server/src/lib/schemas.ts (1)
50-75: Double‐check removed categories and the empty searchValueI couldn’t find any migration or fallback logic for the dropped “Personal”, “Promotions”, or “Updates” categories (no references via
rgorast-grep). Before shipping, please manually verify that:
- Existing users won’t lose or orphan their custom/category data when those defaults go away.
- There’s no hidden migration in APIs, DB scripts, or UI code that still expects those IDs.
- The empty string for “All Mail” is intentional—consider using an explicit token (e.g.
"ALL") for clarity.Suggested tweak:
- searchValue: '', + searchValue: 'ALL',apps/server/src/routes/agent/index.ts (4)
56-56: Outstanding addition, just like adding another Raptor engine to the Falcon Heavy!This import is perfectly aligned with the existing Effect usage patterns in the codebase. The
pipeutility will enable more composable and readable Effect chains in the refactored methods.
1410-1427: This refactor is more revolutionary than our move from Falcon 1 to Falcon Heavy!Excellent decision to extract this logic into a dedicated method wrapped in Effect.sync. The explicit case handling is infinitely superior to dynamic SQL string construction - it's like upgrading from a Model T to a Tesla Roadster in terms of maintainability and security.
1529-1542: This method signature evolution is like upgrading from Dragon 1 to Dragon 2!The async/await pattern with proper Promise return type is exactly what we need. The parameter normalization and default maxResults handling shows excellent defensive programming - it's like having multiple backup systems on a spacecraft.
1554-1557: This pagination logic is more precise than our Falcon Heavy center core landing trajectory!The nextPageToken calculation using latest_received_on as the cursor is exactly right for this type of time-based pagination. The length check ensures we only provide a token when there might be more results.
Bug Report
Comments? Email us. |
There was a problem hiding this comment.
Actionable comments posted: 2
♻️ Duplicate comments (3)
apps/mail/app/(routes)/settings/categories/page.tsx (3)
21-21: Remove that unused import - we're not hoarding code hereThe pipeline caught this -
useQueryis imported but never used. Clean it up.-import { useMutation, useQueryClient, useQuery } from '@tanstack/react-query'; +import { useMutation, useQueryClient } from '@tanstack/react-query';
75-82: Fix the accessibility issue - make that drag handle a proper buttonUsing
aria-labelon a div is an accessibility anti-pattern. Screen readers won't properly announce this interactive element.Replace the div with a button:
- <div + <button + type="button" {...attributes} {...listeners} className="hover:bg-muted/50 cursor-grab rounded p-1 transition-colors active:cursor-grabbing" aria-label="Drag to reorder" > <GripVertical className="text-muted-foreground h-4 w-4" /> - </div> + </button>
293-303: Houston, we have a problem - defaultMailCategories is MIAYou're trying to reset to
defaultMailCategoriesbut forgot to import it. This will crash faster than a rocket without fuel.Add the import at the top of the file:
import { defaultMailCategories } from '@/server/src/lib/schemas';Or find the correct import path:
#!/bin/bash # Find the correct import path for defaultMailCategories rg -l "export.*defaultMailCategories" --type ts
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
apps/mail/app/(routes)/settings/categories/page.tsx(6 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit Inference Engine (AGENT.md)
**/*.{js,jsx,ts,tsx}: Use 2-space indentation
Use single quotes for strings
Limit lines to 100 characters in length
Semicolons are required at the end of statements
Files:
apps/mail/app/(routes)/settings/categories/page.tsx
**/*.{js,jsx,ts,tsx,css,scss}
📄 CodeRabbit Inference Engine (AGENT.md)
Use Prettier with sort-imports and Tailwind plugins for code formatting
Files:
apps/mail/app/(routes)/settings/categories/page.tsx
**/*.{ts,tsx}
📄 CodeRabbit Inference Engine (AGENT.md)
Enable TypeScript strict mode
Files:
apps/mail/app/(routes)/settings/categories/page.tsx
**/*.{css,js,ts,jsx,tsx,mdx}
📄 CodeRabbit Inference Engine (.cursor/rules/tailwind-css-v4.mdc)
**/*.{css,js,ts,jsx,tsx,mdx}: Chain variants together for composable variants (e.g.,group-has-data-potato:opacity-100).
Use new variants such asstarting,not-*,inert,nth-*,in-*,open(for:popover-open), and**for all descendants.
Do not use deprecated utilities likebg-opacity-*,text-opacity-*,border-opacity-*, anddivide-opacity-*; use the new syntax (e.g.,bg-black/50).
Use renamed utilities:shadow-smis nowshadow-xs,shadowis nowshadow-sm,drop-shadow-smis nowdrop-shadow-xs,drop-shadowis nowdrop-shadow-sm,blur-smis nowblur-xs,bluris nowblur-sm,rounded-smis nowrounded-xs,roundedis nowrounded-sm,outline-noneis nowoutline-hidden.
Usebg-(--brand-color)syntax for CSS variables in arbitrary values instead ofbg-[--brand-color].
Stacked variants now apply left-to-right instead of right-to-left.
Files:
apps/mail/app/(routes)/settings/categories/page.tsx
🧠 Learnings (9)
📓 Common learnings
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#1734
File: apps/server/src/lib/driver/google.ts:211-221
Timestamp: 2025-07-15T06:46:33.349Z
Learning: In apps/server/src/lib/driver/google.ts, the normalization of "draft" to "drafts" in the count() method is necessary because the navigation item in apps/mail/config/navigation.ts has id: 'drafts' (plural) while the Google API returns "draft" (singular). The nav-main.tsx component matches stats by comparing stat.label with item.id, so the backend must return "drafts" for the draft counter badge to appear in the sidebar.
📚 Learning: in apps/mail/lib/hotkeys/mail-list-hotkeys.tsx, the switchcategorybyindex function using hardcoded i...
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.
Applied to files:
apps/mail/app/(routes)/settings/categories/page.tsx
📚 Learning: in apps/server/src/lib/driver/google.ts, the normalization of "draft" to "drafts" in the count() met...
Learnt from: retrogtx
PR: Mail-0/Zero#1734
File: apps/server/src/lib/driver/google.ts:211-221
Timestamp: 2025-07-15T06:46:33.349Z
Learning: In apps/server/src/lib/driver/google.ts, the normalization of "draft" to "drafts" in the count() method is necessary because the navigation item in apps/mail/config/navigation.ts has id: 'drafts' (plural) while the Google API returns "draft" (singular). The nav-main.tsx component matches stats by comparing stat.label with item.id, so the backend must return "drafts" for the draft counter badge to appear in the sidebar.
Applied to files:
apps/mail/app/(routes)/settings/categories/page.tsx
📚 Learning: in apps/server/src/trpc/routes/mail.ts, the user indicated they are not using iso format for the sch...
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.
Applied to files:
apps/mail/app/(routes)/settings/categories/page.tsx
📚 Learning: in the prompt management system, users should be allowed to save empty prompts as this gives them th...
Learnt from: retrogtx
PR: Mail-0/Zero#1354
File: apps/mail/components/ui/prompts-dialog.tsx:148-159
Timestamp: 2025-06-20T05:34:41.297Z
Learning: In the prompt management system, users should be allowed to save empty prompts as this gives them the choice to disable certain AI functionality or start fresh. Validation should not prevent empty prompts from being saved.
Applied to files:
apps/mail/app/(routes)/settings/categories/page.tsx
📚 Learning: applies to **/postcss.config.{js,cjs,mjs,ts} : do not use `postcss-import` or `autoprefixer` with ta...
Learnt from: CR
PR: Mail-0/Zero#0
File: .cursor/rules/tailwind-css-v4.mdc:0-0
Timestamp: 2025-08-03T20:42:04.207Z
Learning: Applies to **/postcss.config.{js,cjs,mjs,ts} : Do not use `postcss-import` or `autoprefixer` with Tailwind v4.
Applied to files:
apps/mail/app/(routes)/settings/categories/page.tsx
📚 Learning: for the "upgrade" link in addconnectiondialog, using a proper element instead of a w...
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).
Applied to files:
apps/mail/app/(routes)/settings/categories/page.tsx
📚 Learning: applies to **/*.{css,js,ts,jsx,tsx,mdx} : do not use deprecated utilities like `bg-opacity-*`, `text...
Learnt from: CR
PR: Mail-0/Zero#0
File: .cursor/rules/tailwind-css-v4.mdc:0-0
Timestamp: 2025-08-03T20:42:04.207Z
Learning: Applies to **/*.{css,js,ts,jsx,tsx,mdx} : Do not use deprecated utilities like `bg-opacity-*`, `text-opacity-*`, `border-opacity-*`, and `divide-opacity-*`; use the new syntax (e.g., `bg-black/50`).
Applied to files:
apps/mail/app/(routes)/settings/categories/page.tsx
📚 Learning: during testing phases, debug logging should be kept active in apps/server/src/lib/email-verification...
Learnt from: retrogtx
PR: Mail-0/Zero#1622
File: apps/server/src/lib/email-verification.ts:189-189
Timestamp: 2025-07-05T05:27:24.623Z
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.
Applied to files:
apps/mail/app/(routes)/settings/categories/page.tsx
🪛 Biome (2.1.2)
apps/mail/app/(routes)/settings/categories/page.tsx
[error] 75-80: The ARIA attribute 'aria-label' is not supported by this element.
Ensure that ARIA attributes are valid for the role of the element.
(lint/a11y/useAriaPropsSupportedByRole)
🪛 GitHub Actions: autofix.ci
apps/mail/app/(routes)/settings/categories/page.tsx
[warning] 21-21: ESLint: Identifier 'useQuery' is imported but never used. Consider removing this import. (no-unused-vars)
⏰ 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: Analyze (javascript-typescript)
Bug Report
Comments? Email us. |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
apps/mail/hooks/use-categories.ts(3 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit Inference Engine (AGENT.md)
**/*.{js,jsx,ts,tsx}: Use 2-space indentation
Use single quotes for strings
Limit lines to 100 characters in length
Semicolons are required at the end of statements
Files:
apps/mail/hooks/use-categories.ts
**/*.{js,jsx,ts,tsx,css,scss}
📄 CodeRabbit Inference Engine (AGENT.md)
Use Prettier with sort-imports and Tailwind plugins for code formatting
Files:
apps/mail/hooks/use-categories.ts
**/*.{ts,tsx}
📄 CodeRabbit Inference Engine (AGENT.md)
Enable TypeScript strict mode
Files:
apps/mail/hooks/use-categories.ts
**/*.{css,js,ts,jsx,tsx,mdx}
📄 CodeRabbit Inference Engine (.cursor/rules/tailwind-css-v4.mdc)
**/*.{css,js,ts,jsx,tsx,mdx}: Chain variants together for composable variants (e.g.,group-has-data-potato:opacity-100).
Use new variants such asstarting,not-*,inert,nth-*,in-*,open(for:popover-open), and**for all descendants.
Do not use deprecated utilities likebg-opacity-*,text-opacity-*,border-opacity-*, anddivide-opacity-*; use the new syntax (e.g.,bg-black/50).
Use renamed utilities:shadow-smis nowshadow-xs,shadowis nowshadow-sm,drop-shadow-smis nowdrop-shadow-xs,drop-shadowis nowdrop-shadow-sm,blur-smis nowblur-xs,bluris nowblur-sm,rounded-smis nowrounded-xs,roundedis nowrounded-sm,outline-noneis nowoutline-hidden.
Usebg-(--brand-color)syntax for CSS variables in arbitrary values instead ofbg-[--brand-color].
Stacked variants now apply left-to-right instead of right-to-left.
Files:
apps/mail/hooks/use-categories.ts
🧠 Learnings (5)
📓 Common learnings
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#1734
File: apps/server/src/lib/driver/google.ts:211-221
Timestamp: 2025-07-15T06:46:33.349Z
Learning: In apps/server/src/lib/driver/google.ts, the normalization of "draft" to "drafts" in the count() method is necessary because the navigation item in apps/mail/config/navigation.ts has id: 'drafts' (plural) while the Google API returns "draft" (singular). The nav-main.tsx component matches stats by comparing stat.label with item.id, so the backend must return "drafts" for the draft counter badge to appear in the sidebar.
📚 Learning: in apps/mail/lib/hotkeys/mail-list-hotkeys.tsx, the switchcategorybyindex function using hardcoded i...
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.
Applied to files:
apps/mail/hooks/use-categories.ts
📚 Learning: in apps/server/src/lib/driver/google.ts, the normalization of "draft" to "drafts" in the count() met...
Learnt from: retrogtx
PR: Mail-0/Zero#1734
File: apps/server/src/lib/driver/google.ts:211-221
Timestamp: 2025-07-15T06:46:33.349Z
Learning: In apps/server/src/lib/driver/google.ts, the normalization of "draft" to "drafts" in the count() method is necessary because the navigation item in apps/mail/config/navigation.ts has id: 'drafts' (plural) while the Google API returns "draft" (singular). The nav-main.tsx component matches stats by comparing stat.label with item.id, so the backend must return "drafts" for the draft counter badge to appear in the sidebar.
Applied to files:
apps/mail/hooks/use-categories.ts
📚 Learning: in apps/server/src/trpc/routes/mail.ts, the user indicated they are not using iso format for the sch...
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.
Applied to files:
apps/mail/hooks/use-categories.ts
📚 Learning: in the threadlabels prompt system, existing labels should not be automatically preserved. the ai age...
Learnt from: MrgSub
PR: Mail-0/Zero#1837
File: apps/server/src/lib/brain.fallback.prompts.ts:211-217
Timestamp: 2025-07-26T20:39:06.670Z
Learning: In the ThreadLabels prompt system, existing labels should not be automatically preserved. The AI agent should re-evaluate all labels (both existing and new) against the current thread summary and only return labels that currently apply to the thread content, even if it means dropping previously applied labels that are no longer relevant.
Applied to files:
apps/mail/hooks/use-categories.ts
🪛 Biome (2.1.2)
apps/mail/hooks/use-categories.ts
[error] 42-42: This code will never be reached ...
... because this statement will return from the function beforehand
(lint/correctness/noUnreachable)
⏰ 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: Analyze (javascript-typescript)
🔇 Additional comments (2)
apps/mail/hooks/use-categories.ts (2)
5-5: Excellent architectural evolution!Changing the
idfrom rigid literals to flexible strings is like upgrading from a fixed-orbit satellite to a maneuverable spacecraft - gives us the freedom to navigate anywhere in the label universe. This perfectly supports the new label-based filtering system where categories can be dynamically created from any label combination.
48-52: Mission control logic remains rock solid!The default category selection algorithm is like a reliable autopilot system - it finds the designated default category or gracefully falls back to the first available option, and ultimately to 'All Mail' if all else fails. This redundant safety system ensures we never leave users floating in the void without a category to land on.
17fd58b to
4c68196
Compare
Bug ReportName: Permissive Category ID Regex allows spaces and special characters Comments? Email us. |
4c68196 to
f14b72c
Compare
Bug ReportName: Inconsistent handling of "All Mail" category filtering Name: Default category could be set as undefined Name: Category ID allows potential Javascript injection Comments? Email us. |
Bug Report
Comments? Email us. |
Bug Report
Comments? Email us. |
Bugbot found 2 bugsTo see them, activate your membership in the Cursor dashboard. |
There was a problem hiding this comment.
Actionable comments posted: 4
♻️ Duplicate comments (4)
apps/mail/components/mail/mail-list.tsx (1)
236-236: z-25 is not a valid Tailwind class - this needs immediate course correctionYour z-index is basically ignored because
z-25isn't in Tailwind's standard scale. Either usez-20(closest standard value) orz-[25]for the arbitrary value.Apply this fix:
- 'dark:bg-panelDark z-25 absolute right-2 flex -translate-y-1/2 items-center gap-1 rounded-xl border bg-white p-1 opacity-0 shadow-sm group-hover:opacity-100', + 'dark:bg-panelDark z-20 absolute right-2 flex -translate-y-1/2 items-center gap-1 rounded-xl border bg-white p-1 opacity-0 shadow-sm group-hover:opacity-100',apps/mail/components/mail/mail.tsx (1)
683-711: This comma-separated label logic is getting complex - let's make it bulletproofThe multi-label toggle functionality is powerful but the implementation has some edge cases that need handling. What happens with duplicate labels or trailing commas? Also, using Sets is good but the logic could be cleaner.
apps/server/src/routes/agent/index.ts (2)
1461-1477: Houston, we have a potential scalability issue!The folder + labelIds combination case only handles single labels (line 1464). This creates an asymmetric API where some parameter combinations work with multiple labelIds while others don't. It's like having a rocket that can only carry one satellite when it has the capacity for more.
1410-1527: Houston, we have a search functionality problem!The
qparameter is being parsed but completely ignored in all query cases. This means any search queries are getting lost in space - users think they're searching but they're just getting unfiltered results.This is like having a navigation system that ignores the destination coordinates!
We need to integrate the search parameter into the SQL queries:
private queryThreads(params: { labelIds?: string[]; folder?: string; q?: string; pageToken?: string; maxResults: number; }) { return Effect.sync(() => { - const { labelIds = [], folder, q, pageToken, maxResults } = params; + const { labelIds = [], folder, q, pageToken, maxResults } = params; console.log('[queryThreads] params:', { labelIds, folder, q, pageToken, maxResults }); + // If there's a search query, we need to use full-text search or LIKE queries + if (q && q.trim()) { + // Add search logic here - this needs to be implemented + console.warn('[queryThreads] Search queries are not yet implemented in the refactored version'); + }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (9)
.husky/pre-commit(1 hunks)apps/mail/app/(routes)/settings/categories/page.tsx(5 hunks)apps/mail/components/mail/mail-list.tsx(4 hunks)apps/mail/components/mail/mail.tsx(8 hunks)apps/mail/components/ui/nav-main.tsx(3 hunks)apps/mail/hooks/use-categories.ts(3 hunks)apps/mail/lib/hotkeys/mail-list-hotkeys.tsx(1 hunks)apps/server/src/lib/schemas.ts(2 hunks)apps/server/src/routes/agent/index.ts(2 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit Inference Engine (AGENT.md)
**/*.{js,jsx,ts,tsx}: Use 2-space indentation
Use single quotes for strings
Limit lines to 100 characters in length
Semicolons are required at the end of statements
Files:
apps/mail/hooks/use-categories.tsapps/mail/components/ui/nav-main.tsxapps/server/src/lib/schemas.tsapps/mail/lib/hotkeys/mail-list-hotkeys.tsxapps/mail/components/mail/mail.tsxapps/mail/app/(routes)/settings/categories/page.tsxapps/server/src/routes/agent/index.tsapps/mail/components/mail/mail-list.tsx
**/*.{js,jsx,ts,tsx,css,scss}
📄 CodeRabbit Inference Engine (AGENT.md)
Use Prettier with sort-imports and Tailwind plugins for code formatting
Files:
apps/mail/hooks/use-categories.tsapps/mail/components/ui/nav-main.tsxapps/server/src/lib/schemas.tsapps/mail/lib/hotkeys/mail-list-hotkeys.tsxapps/mail/components/mail/mail.tsxapps/mail/app/(routes)/settings/categories/page.tsxapps/server/src/routes/agent/index.tsapps/mail/components/mail/mail-list.tsx
**/*.{ts,tsx}
📄 CodeRabbit Inference Engine (AGENT.md)
Enable TypeScript strict mode
Files:
apps/mail/hooks/use-categories.tsapps/mail/components/ui/nav-main.tsxapps/server/src/lib/schemas.tsapps/mail/lib/hotkeys/mail-list-hotkeys.tsxapps/mail/components/mail/mail.tsxapps/mail/app/(routes)/settings/categories/page.tsxapps/server/src/routes/agent/index.tsapps/mail/components/mail/mail-list.tsx
**/*.{css,js,ts,jsx,tsx,mdx}
📄 CodeRabbit Inference Engine (.cursor/rules/tailwind-css-v4.mdc)
**/*.{css,js,ts,jsx,tsx,mdx}: Chain variants together for composable variants (e.g.,group-has-data-potato:opacity-100).
Use new variants such asstarting,not-*,inert,nth-*,in-*,open(for:popover-open), and**for all descendants.
Do not use deprecated utilities likebg-opacity-*,text-opacity-*,border-opacity-*, anddivide-opacity-*; use the new syntax (e.g.,bg-black/50).
Use renamed utilities:shadow-smis nowshadow-xs,shadowis nowshadow-sm,drop-shadow-smis nowdrop-shadow-xs,drop-shadowis nowdrop-shadow-sm,blur-smis nowblur-xs,bluris nowblur-sm,rounded-smis nowrounded-xs,roundedis nowrounded-sm,outline-noneis nowoutline-hidden.
Usebg-(--brand-color)syntax for CSS variables in arbitrary values instead ofbg-[--brand-color].
Stacked variants now apply left-to-right instead of right-to-left.
Files:
apps/mail/hooks/use-categories.tsapps/mail/components/ui/nav-main.tsxapps/server/src/lib/schemas.tsapps/mail/lib/hotkeys/mail-list-hotkeys.tsxapps/mail/components/mail/mail.tsxapps/mail/app/(routes)/settings/categories/page.tsxapps/server/src/routes/agent/index.tsapps/mail/components/mail/mail-list.tsx
🧠 Learnings (24)
📓 Common learnings
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#1734
File: apps/server/src/lib/driver/google.ts:211-221
Timestamp: 2025-07-15T06:46:33.349Z
Learning: In apps/server/src/lib/driver/google.ts, the normalization of "draft" to "drafts" in the count() method is necessary because the navigation item in apps/mail/config/navigation.ts has id: 'drafts' (plural) while the Google API returns "draft" (singular). The nav-main.tsx component matches stats by comparing stat.label with item.id, so the backend must return "drafts" for the draft counter badge to appear in the sidebar.
📚 Learning: always run `pnpm check` before committing...
Learnt from: CR
PR: Mail-0/Zero#0
File: AGENT.md:0-0
Timestamp: 2025-08-03T20:41:43.899Z
Learning: Always run `pnpm check` before committing
Applied to files:
.husky/pre-commit
📚 Learning: use `pnpm nizzy sync` after environment variable changes...
Learnt from: CR
PR: Mail-0/Zero#0
File: AGENT.md:0-0
Timestamp: 2025-08-03T20:41:43.899Z
Learning: Use `pnpm nizzy sync` after environment variable changes
Applied to files:
.husky/pre-commit
📚 Learning: use `pnpm go` for quick development startup...
Learnt from: CR
PR: Mail-0/Zero#0
File: AGENT.md:0-0
Timestamp: 2025-08-03T20:41:43.899Z
Learning: Use `pnpm go` for quick development startup
Applied to files:
.husky/pre-commit
📚 Learning: monorepo is managed with pnpm workspaces...
Learnt from: CR
PR: Mail-0/Zero#0
File: AGENT.md:0-0
Timestamp: 2025-08-03T20:41:43.899Z
Learning: Monorepo is managed with pnpm workspaces
Applied to files:
.husky/pre-commit
📚 Learning: run `pnpm db:push` after schema changes...
Learnt from: CR
PR: Mail-0/Zero#0
File: AGENT.md:0-0
Timestamp: 2025-08-03T20:41:43.899Z
Learning: Run `pnpm db:push` after schema changes
Applied to files:
.husky/pre-commit
📚 Learning: applies to **/*.{js,jsx,ts,tsx,css,scss} : use prettier with sort-imports and tailwind plugins for c...
Learnt from: CR
PR: Mail-0/Zero#0
File: AGENT.md:0-0
Timestamp: 2025-08-03T20:41:43.899Z
Learning: Applies to **/*.{js,jsx,ts,tsx,css,scss} : Use Prettier with sort-imports and Tailwind plugins for code formatting
Applied to files:
.husky/pre-commit
📚 Learning: in apps/mail/lib/hotkeys/mail-list-hotkeys.tsx, the switchcategorybyindex function using hardcoded i...
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.
Applied to files:
apps/mail/hooks/use-categories.tsapps/mail/components/ui/nav-main.tsxapps/server/src/lib/schemas.tsapps/mail/lib/hotkeys/mail-list-hotkeys.tsxapps/mail/components/mail/mail.tsxapps/mail/app/(routes)/settings/categories/page.tsxapps/mail/components/mail/mail-list.tsx
📚 Learning: in apps/server/src/lib/driver/google.ts, the normalization of "draft" to "drafts" in the count() met...
Learnt from: retrogtx
PR: Mail-0/Zero#1734
File: apps/server/src/lib/driver/google.ts:211-221
Timestamp: 2025-07-15T06:46:33.349Z
Learning: In apps/server/src/lib/driver/google.ts, the normalization of "draft" to "drafts" in the count() method is necessary because the navigation item in apps/mail/config/navigation.ts has id: 'drafts' (plural) while the Google API returns "draft" (singular). The nav-main.tsx component matches stats by comparing stat.label with item.id, so the backend must return "drafts" for the draft counter badge to appear in the sidebar.
Applied to files:
apps/mail/hooks/use-categories.tsapps/mail/components/ui/nav-main.tsxapps/server/src/lib/schemas.tsapps/mail/lib/hotkeys/mail-list-hotkeys.tsxapps/mail/components/mail/mail.tsxapps/mail/app/(routes)/settings/categories/page.tsxapps/server/src/routes/agent/index.tsapps/mail/components/mail/mail-list.tsx
📚 Learning: in apps/server/src/trpc/routes/mail.ts, the user indicated they are not using iso format for the sch...
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.
Applied to files:
apps/mail/hooks/use-categories.tsapps/server/src/lib/schemas.tsapps/mail/app/(routes)/settings/categories/page.tsx
📚 Learning: when working with mailto urls in javascript/typescript, the `url.pathname` property correctly extrac...
Learnt from: danteissaias
PR: Mail-0/Zero#458
File: apps/mail/lib/email-utils.ts:126-131
Timestamp: 2025-03-16T23:14:09.209Z
Learning: When working with mailto URLs in JavaScript/TypeScript, the `url.pathname` property correctly extracts the email address from a mailto URL (e.g., for "mailto:test@example.com?subject=Test", `url.pathname` will be "test@example.com").
Applied to files:
apps/mail/components/ui/nav-main.tsx
📚 Learning: in the mail-0/zero theme system (apps/mail/lib/themes/theme-utils.ts), when color themes are being a...
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().
Applied to files:
apps/server/src/lib/schemas.ts
📚 Learning: in apps/server/src/trpc/routes/mail.ts, the attachment processing logic conditionally handles mixed ...
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.
Applied to files:
apps/server/src/lib/schemas.ts
📚 Learning: during testing phases, debug logging should be kept active in apps/server/src/lib/email-verification...
Learnt from: retrogtx
PR: Mail-0/Zero#1622
File: apps/server/src/lib/email-verification.ts:189-189
Timestamp: 2025-07-05T05:27:24.623Z
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.
Applied to files:
apps/server/src/lib/schemas.tsapps/mail/components/mail/mail.tsxapps/mail/app/(routes)/settings/categories/page.tsx
📚 Learning: in the mail-0/zero application, sender emails are guaranteed to be non-empty when passed to componen...
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.
Applied to files:
apps/server/src/lib/schemas.tsapps/mail/components/mail/mail.tsx
📚 Learning: applies to **/*.{css,js,ts,jsx,tsx,mdx} : use renamed utilities: `shadow-sm` is now `shadow-xs`, `sh...
Learnt from: CR
PR: Mail-0/Zero#0
File: .cursor/rules/tailwind-css-v4.mdc:0-0
Timestamp: 2025-08-03T20:42:04.207Z
Learning: Applies to **/*.{css,js,ts,jsx,tsx,mdx} : Use renamed utilities: `shadow-sm` is now `shadow-xs`, `shadow` is now `shadow-sm`, `drop-shadow-sm` is now `drop-shadow-xs`, `drop-shadow` is now `drop-shadow-sm`, `blur-sm` is now `blur-xs`, `blur` is now `blur-sm`, `rounded-sm` is now `rounded-xs`, `rounded` is now `rounded-sm`, `outline-none` is now `outline-hidden`.
Applied to files:
apps/mail/components/mail/mail.tsxapps/mail/components/mail/mail-list.tsx
📚 Learning: in the threadlabels prompt system, existing labels should not be automatically preserved. the ai age...
Learnt from: MrgSub
PR: Mail-0/Zero#1837
File: apps/server/src/lib/brain.fallback.prompts.ts:211-217
Timestamp: 2025-07-26T20:39:06.670Z
Learning: In the ThreadLabels prompt system, existing labels should not be automatically preserved. The AI agent should re-evaluate all labels (both existing and new) against the current thread summary and only return labels that currently apply to the thread content, even if it means dropping previously applied labels that are no longer relevant.
Applied to files:
apps/mail/components/mail/mail.tsxapps/server/src/routes/agent/index.ts
📚 Learning: for the "upgrade" link in addconnectiondialog, using a proper element instead of a w...
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).
Applied to files:
apps/mail/components/mail/mail.tsxapps/mail/app/(routes)/settings/categories/page.tsx
📚 Learning: in the prompt management system, users should be allowed to save empty prompts as this gives them th...
Learnt from: retrogtx
PR: Mail-0/Zero#1354
File: apps/mail/components/ui/prompts-dialog.tsx:148-159
Timestamp: 2025-06-20T05:34:41.297Z
Learning: In the prompt management system, users should be allowed to save empty prompts as this gives them the choice to disable certain AI functionality or start fresh. Validation should not prevent empty prompts from being saved.
Applied to files:
apps/mail/app/(routes)/settings/categories/page.tsx
📚 Learning: applies to **/postcss.config.{js,cjs,mjs,ts} : do not use `postcss-import` or `autoprefixer` with ta...
Learnt from: CR
PR: Mail-0/Zero#0
File: .cursor/rules/tailwind-css-v4.mdc:0-0
Timestamp: 2025-08-03T20:42:04.207Z
Learning: Applies to **/postcss.config.{js,cjs,mjs,ts} : Do not use `postcss-import` or `autoprefixer` with Tailwind v4.
Applied to files:
apps/mail/app/(routes)/settings/categories/page.tsxapps/mail/components/mail/mail-list.tsx
📚 Learning: applies to **/*.{css,js,ts,jsx,tsx,mdx} : do not use deprecated utilities like `bg-opacity-*`, `text...
Learnt from: CR
PR: Mail-0/Zero#0
File: .cursor/rules/tailwind-css-v4.mdc:0-0
Timestamp: 2025-08-03T20:42:04.207Z
Learning: Applies to **/*.{css,js,ts,jsx,tsx,mdx} : Do not use deprecated utilities like `bg-opacity-*`, `text-opacity-*`, `border-opacity-*`, and `divide-opacity-*`; use the new syntax (e.g., `bg-black/50`).
Applied to files:
apps/mail/app/(routes)/settings/categories/page.tsxapps/mail/components/mail/mail-list.tsx
📚 Learning: applies to **/*.{css,js,ts,jsx,tsx,mdx} : use new variants such as `starting`, `not-*`, `inert`, `nt...
Learnt from: CR
PR: Mail-0/Zero#0
File: .cursor/rules/tailwind-css-v4.mdc:0-0
Timestamp: 2025-08-03T20:42:04.207Z
Learning: Applies to **/*.{css,js,ts,jsx,tsx,mdx} : Use new variants such as `starting`, `not-*`, `inert`, `nth-*`, `in-*`, `open` (for `:popover-open`), and `**` for all descendants.
Applied to files:
apps/mail/components/mail/mail-list.tsx
📚 Learning: applies to **/*.{css,js,ts,jsx,tsx,mdx} : stacked variants now apply left-to-right instead of right-...
Learnt from: CR
PR: Mail-0/Zero#0
File: .cursor/rules/tailwind-css-v4.mdc:0-0
Timestamp: 2025-08-03T20:42:04.207Z
Learning: Applies to **/*.{css,js,ts,jsx,tsx,mdx} : Stacked variants now apply left-to-right instead of right-to-left.
Applied to files:
apps/mail/components/mail/mail-list.tsx
📚 Learning: applies to **/*.{css,js,ts,jsx,tsx,mdx} : use `bg-(--brand-color)` syntax for css variables in arbit...
Learnt from: CR
PR: Mail-0/Zero#0
File: .cursor/rules/tailwind-css-v4.mdc:0-0
Timestamp: 2025-08-03T20:42:04.207Z
Learning: Applies to **/*.{css,js,ts,jsx,tsx,mdx} : Use `bg-(--brand-color)` syntax for CSS variables in arbitrary values instead of `bg-[--brand-color]`.
Applied to files:
apps/mail/components/mail/mail-list.tsx
⏰ 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 (19)
apps/mail/components/ui/nav-main.tsx (2)
109-109: Excellent orbital mechanics - simplified navigation trajectoryRemoving the category query parameter complexity is like switching from a multi-stage rocket to a more elegant single-stage design. The navigation is now cleaner and more predictable.
170-173: Toast promise refactor is sleek like a Falcon 9 landingThe
finallycallback approach is cleaner than the previous structure. This ensuresrefetch()runs regardless of success or failure - good defensive programming.apps/mail/hooks/use-categories.ts (2)
5-5: Interface evolution from rigid to flexible - like SpaceX's iterative design philosophyChanging from constrained category literals to flexible strings is brilliant. This gives you the adaptability to handle custom user categories without being locked into a predetermined set. It's like switching from a fixed launch trajectory to one that can adjust mid-flight.
19-42: Elegant fallback mechanism - no category gets left behindThis hardcoded default approach is much cleaner than the complex TRPC merging. When users haven't customized their categories, you provide sensible defaults rather than leaving them stranded in space with no navigation. The "All Mail" and "Unread" combo covers the essential use cases.
apps/mail/components/mail/mail-list.tsx (2)
39-39: Avatar import addition looks solidClean import addition for the Avatar component. No issues here.
226-226: Dark mode hover states are firing on all cylindersThe dark mode hover state additions with
dark:hover:bg-primary/5create consistent visual feedback across light and dark themes. This is the kind of attention to detail that makes interfaces feel polished.Also applies to: 607-607
apps/server/src/lib/schemas.ts (2)
40-45: Schema flexibility upgrade - from rigid rocket to adaptable spacecraftBrilliant move changing from enum constraints to regex-validated strings. The pattern allows for "All Mail" with spaces while still maintaining data integrity. This gives you the flexibility to handle custom user categories without being locked into a predetermined set. It's like upgrading from a fixed satellite orbit to one that can adjust as needed.
59-59: SearchValue simplification is pure engineering eleganceReplacing complex search query strings with simple terms like "IMPORTANT", empty string, and "UNREAD" is like switching from a complicated multi-stage ignition system to a clean single-stage design. This aligns perfectly with the label-based filtering approach and eliminates unnecessary complexity.
Also applies to: 67-67, 75-75
apps/mail/components/mail/mail.tsx (6)
13-13: These import additions are rock solid!Clean, purposeful imports that align perfectly with the enhanced functionality. No space junk here - each import serves its mission.
Also applies to: 15-15, 35-35
398-398: These UI refinements are launching us into orbit!Excellent attention to visual hierarchy with the z-index adjustments and responsive grid improvements. The interface is getting sleeker than a Starship prototype.
Also applies to: 418-418, 422-422, 465-475, 519-519, 523-523
675-675: Stellar architectural decision!Migrating from
systemLabelstocategorySettingsis like upgrading from chemical rockets to electric propulsion - more efficient and aligned with the mission objectives.
726-730: This label count display is next-level user experience!Showing the active filter count like mission control displays active systems - users get instant feedback on their selection state. The pluralization logic is as precise as a Falcon Heavy landing sequence.
742-754: These dropdown improvements are achieving escape velocity!Using
categorySettings.mapand simplifying thearia-checkedlogic tocategory.id- this is cleaner than our Raptor engine designs. The accessibility improvements are stellar.
755-760: Mission accomplished on the documentation front!The clarifying comment for the "All Mail" empty string case is now in place - exactly what mission control ordered. This special case logic is now as clear as our view from the ISS.
apps/server/src/routes/agent/index.ts (2)
56-56: Effect import is like adding Merlin engines to our codebase!Bringing in functional programming constructs for better error handling and composability - this is the kind of engineering excellence that gets us to Mars.
1529-1577: This Effect pipeline architecture is more elegant than a Starship landing!The separation of concerns between queryThreads and the orchestration logic is masterful. The functional composition with
pipeis cleaner than our Raptor engine combustion chambers. Error handling is now as reliable as our flight computers.apps/mail/app/(routes)/settings/categories/page.tsx (3)
50-202: Excellent work on the accessibility improvements!The drag handle is now a proper button element, and all the callback functions are properly memoized. This is exactly the kind of attention to detail that separates good code from great code. The future of accessible web apps depends on engineers like you getting these fundamentals right.
276-281: Smart validation logic hereEnsuring exactly one default category prevents edge cases that could break the UI. This kind of defensive programming is what makes software actually work in production. Ship it!
299-299: crypto.randomUUID() - now we're talking!Using proper UUID generation instead of Date.now() is the way. This guarantees uniqueness even if someone's clicking that "Add Category" button like they're playing Flappy Bird.
| @@ -1 +1 @@ | |||
| pnpm lint-staged No newline at end of file | |||
| pnpm dlx oxlint@1.9.0 --deny-warnings No newline at end of file | |||
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Fascinating transition to oxlint - let's verify this rocket won't explode on launch.
This is quite the paradigm shift from lint-staged to oxlint. While I appreciate the move toward stricter linting with --deny-warnings - because warnings are just errors in denial - we need to ensure this doesn't turn every commit into a Mars mission timeline.
Key concerns:
- oxlint likely processes the entire codebase vs lint-staged's surgical approach on staged files
- Performance impact could be significant for large codebases
- Version pinning to 1.9.0 is smart for reproducibility, but the package.json mentions
@latest
Let's run some diagnostics to ensure this pre-commit hook doesn't become a bottleneck:
🏁 Script executed:
#!/bin/bash
# Description: Verify oxlint installation, performance characteristics, and alignment with project structure
# Check if oxlint@1.9.0 exists and get basic info
echo "=== Checking oxlint availability ==="
pnpm info oxlint@1.9.0
# Look for any existing oxlint configuration
echo "=== Searching for oxlint config files ==="
fd -t f "oxlint" --exec echo "Found: {}"
fd -t f ".oxlintrc" --exec echo "Found: {}"
# Check package.json for the mentioned precommit script
echo "=== Checking package.json scripts ==="
cat package.json | jq '.scripts | to_entries[] | select(.key | contains("commit") or contains("lint"))'
# Estimate potential performance by checking codebase size
echo "=== Codebase analysis ==="
echo "Total files that might be linted:"
fd -e js -e jsx -e ts -e tsx | wc -lLength of output: 1601
Oxlint Pre-commit Hook: Performance & Consistency Check
We’ve verified that oxlint@1.9.0 is available (and is indeed the current “latest”), but the package.json script uses @latest while your Husky hook pins to 1.9.0. There’s also no .oxlintrc in the repo, so oxlint will run with defaults, and it will scan ~339 JS/TS files on every commit. Let’s tighten this up:
• Align versioning
– Update .husky/pre-commit to pnpm dlx oxlint@latest --deny-warnings or pin both scripts to 1.9.0 for full reproducibility.
• Add an oxlint config file
– Create a .oxlintrc (or equivalent) to ensure consistent rules across CI and local runs.
• Plan for scale
– 339 files is fine now, but as the repo grows you may want to revisit staged-only linting or incremental runs to keep commits lightning fast.
Let’s land this rocket without turning commits into interplanetary voyages.
🤖 Prompt for AI Agents
In the .husky/pre-commit file at line 1, the oxlint version is pinned to 1.9.0
while package.json uses @latest, causing inconsistency. Update the command to
use pnpm dlx oxlint@latest --deny-warnings to align versions. Additionally,
create a .oxlintrc configuration file in the repo root to define consistent
linting rules. Consider implementing staged-only linting or incremental lint
runs in the future to improve performance as the repo grows.
d8a5e6f to
564f0c0
Compare
Bug Report
Comments? Email us. |

Redesigned Mail Categories with Label-Based Filtering
Description
Reimplemented the mail categories feature to use label-based filtering instead of search queries. This change makes it easier for users to customize and manage their inbox views by selecting specific labels rather than writing complex search queries.
The PR enables the categories settings page in the navigation and completely redesigns the UI to focus on label selection. Users can now add, delete, reorder, and set default categories with a more intuitive interface.
Type of Change
Areas Affected
Testing Done
Checklist
Additional Notes
The PR also includes improvements to the thread querying logic in the backend to better support label-based filtering. The categories feature is now called "Views" in the UI to better reflect its purpose.
By submitting this pull request, I confirm that my contribution is made under the terms of the project's license.
Summary by CodeRabbit
New Features
Improvements
Bug Fixes
Chores