Skip to content

Comments

Align check:format script with format script scope and format unformatted files#1582

Closed
SinghaAnirban005 wants to merge 2 commits intoMail-0:stagingfrom
SinghaAnirban005:chore/script
Closed

Align check:format script with format script scope and format unformatted files#1582
SinghaAnirban005 wants to merge 2 commits intoMail-0:stagingfrom
SinghaAnirban005:chore/script

Conversation

@SinghaAnirban005
Copy link
Contributor

@SinghaAnirban005 SinghaAnirban005 commented Jul 1, 2025

Description

This PR updates the check:format script in package.json to align with the scope of the format script and formats remaining unformatted files
fixes #1580


Type of Change

Please delete options that are not relevant.

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

Areas Affected

Please check all that apply:

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

Testing Done

Describe the tests you've done:

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

Security Considerations

For changes involving data or authentication:

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

Checklist

  • I have read the CONTRIBUTING document
  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in complex areas
  • I have updated the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix/feature works
  • All tests pass locally
  • Any dependent changes are merged and published

Additional Notes

Previously, the formatting check ran on all files in the repo, including those outside the intended formatting scope.


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

    • Added image compression quality controls to the email attachment preview panel, allowing users to adjust image compression settings when composing emails.
    • Updated the privacy policy to clarify that the non-refundable policy applies to all premium subscription plans (monthly, annual, and enterprise).
  • Style

    • Improved formatting and consistency across various settings, mail, and UI components, including whitespace, indentation, and class name order.
    • Refined import statement organization for better code clarity.
  • Chores

    • Updated the formatting check script to target only TypeScript files within the "apps" directory.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 1, 2025

Walkthrough

This change applies extensive formatting and stylistic consistency updates across multiple files in the codebase. The primary adjustment is narrowing the check:format script in package.json to only target TypeScript and TSX files within the apps directory. The remaining changes focus on import order, whitespace, class name order, and JSX formatting, without modifying any logic or functionality.

Changes

File(s) Change Summary
package.json Restricts check:format script to only check formatting for apps/**/*.{ts,tsx} files and adds --log-level silent.
apps/mail/app/(auth)/login/error-message.tsx
apps/mail/app/(routes)/settings/[...settings]/page.tsx
apps/mail/app/(routes)/settings/labels/page.tsx
apps/mail/app/(routes)/settings/notifications/page.tsx
apps/mail/app/(routes)/settings/privacy/page.tsx
apps/mail/app/(routes)/settings/security/page.tsx
apps/mail/components/mail/mail-iframe.tsx
apps/mail/components/mail/thread-display.tsx
apps/mail/lib/hotkeys/mail-list-hotkeys.tsx
apps/mail/hooks/driver/use-delete.ts
apps/mail/hooks/use-categories.ts
apps/mail/components/ui/settings-content.tsx
apps/mail/components/ui/responsive-modal.tsx
apps/mail/components/home/HomeContent.tsx
apps/mail/providers/client-providers.tsx
apps/server/src/lib/brain.ts
apps/server/src/trpc/index.ts
apps/server/src/trpc/routes/ai/compose.ts
apps/server/src/trpc/routes/brain.ts
apps/server/src/trpc/routes/categories.ts
Reordered import statements for consistency and clarity; no logic or functional changes.
apps/mail/app/(full-width)/privacy.tsx Reformatted and expanded JSX for readability; added a new list item specifying non-refundable policy applies to all premium subscription plans.
apps/mail/app/(full-width)/terms.tsx Reordered CSS utility classes in back button container for consistent styling.
apps/mail/app/(routes)/settings/categories/page.tsx Reformatted imports, destructuring, class names, and callbacks for consistent style; no logic change.
apps/mail/components/ai-toggle-button.tsx
apps/mail/components/ui/button.tsx
apps/mail/components/ui/command.tsx
apps/mail/components/ui/navigation-menu.tsx
apps/mail/components/ui/sidebar.tsx
Reordered or reformatted className attributes for consistent CSS utility usage.
apps/mail/components/context/loading-context.tsx
apps/mail/components/mail/select-all-checkbox.tsx
apps/mail/hooks/use-hot-key.ts
Removed trailing whitespace or blank lines for code cleanliness.
apps/mail/components/create/email-composer.tsx Moved and added imports for image compression; added ImageCompressionSettings component to attachment UI.
apps/mail/components/home/footer.tsx
apps/mail/components/labels/label-dialog.tsx
Reformatted JSX for improved readability; no logic changes.
apps/mail/components/home/pixelated-bg.tsx Changed className attribute quotes from single to double quotes for consistency.
apps/mail/components/ui/prompts-dialog.tsx Added a newline at end of file.
apps/mail/lib/countries.ts
apps/mail/store/draftStates.ts
Changed double quotes to single quotes in string literals.
apps/mail/hooks/use-copy-to-clipboard.ts
apps/mail/hooks/use-geo-location.ts
Changed double quotes to single quotes in strings and imports; no logic change.
apps/mail/hooks/use-mail-navigation.ts Reformatted hotkey hook calls for readability; no logic change.
apps/mail/lib/image-compression.ts Minor whitespace, comma, and formatting changes; no logic change.
apps/server/src/lib/brain.fallback.prompts.ts Reformatted conditional template literal for clarity; logic unchanged.
apps/server/src/lib/notes-manager.ts Minor formatting correction in try statement.
apps/mail/types/speech-recognition.d.ts Formatting: added space in constructor and ensured newline at file end.

Sequence Diagram(s)

Not applicable: No functional or control flow changes were introduced.

Assessment against linked issues

Objective Addressed Explanation
Restrict check:format script to only check files under apps/**/*.{ts,tsx} (#1580)
Improve formatting consistency across various files as described in issue (#1580)

Assessment against linked issues: Out-of-scope changes

No out-of-scope changes detected.

Possibly related PRs

  • style: landing #1239: Both PRs adjust the order of CSS classes for back button positioning, though on different pages.
  • ui privacy email composer open #1265: Both PRs add and format the "Pricing and Refund Policy" section in privacy.tsx.
  • savign #919: Both PRs include reordering of imports and className attributes in HomeContent.tsx for formatting consistency.

Poem

A bunny hopped through lines of code,
Tidying imports, lightening the load.
Whitespace vanished, classes aligned,
Formatting harmony, perfectly timed.
Now check:format knows where to look—
Only in apps, not the whole book!
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d6774c1 and 35aeb4c.

📒 Files selected for processing (46)
  • apps/mail/app/(auth)/login/error-message.tsx (1 hunks)
  • apps/mail/app/(full-width)/privacy.tsx (3 hunks)
  • apps/mail/app/(full-width)/terms.tsx (1 hunks)
  • apps/mail/app/(routes)/settings/[...settings]/page.tsx (1 hunks)
  • apps/mail/app/(routes)/settings/categories/page.tsx (15 hunks)
  • apps/mail/app/(routes)/settings/labels/page.tsx (5 hunks)
  • apps/mail/app/(routes)/settings/notifications/page.tsx (1 hunks)
  • apps/mail/app/(routes)/settings/privacy/page.tsx (3 hunks)
  • apps/mail/app/(routes)/settings/security/page.tsx (3 hunks)
  • apps/mail/components/ai-toggle-button.tsx (1 hunks)
  • apps/mail/components/context/loading-context.tsx (1 hunks)
  • apps/mail/components/create/email-composer.tsx (4 hunks)
  • apps/mail/components/home/HomeContent.tsx (2 hunks)
  • apps/mail/components/home/footer.tsx (2 hunks)
  • apps/mail/components/home/pixelated-bg.tsx (1 hunks)
  • apps/mail/components/labels/label-dialog.tsx (3 hunks)
  • apps/mail/components/mail/mail-iframe.tsx (1 hunks)
  • apps/mail/components/mail/select-all-checkbox.tsx (2 hunks)
  • apps/mail/components/mail/thread-display.tsx (1 hunks)
  • apps/mail/components/ui/button.tsx (2 hunks)
  • apps/mail/components/ui/command.tsx (1 hunks)
  • apps/mail/components/ui/navigation-menu.tsx (1 hunks)
  • apps/mail/components/ui/prompts-dialog.tsx (1 hunks)
  • apps/mail/components/ui/responsive-modal.tsx (1 hunks)
  • apps/mail/components/ui/settings-content.tsx (1 hunks)
  • apps/mail/components/ui/sidebar.tsx (1 hunks)
  • apps/mail/hooks/driver/use-delete.ts (1 hunks)
  • apps/mail/hooks/use-categories.ts (2 hunks)
  • apps/mail/hooks/use-copy-to-clipboard.ts (1 hunks)
  • apps/mail/hooks/use-geo-location.ts (1 hunks)
  • apps/mail/hooks/use-hot-key.ts (1 hunks)
  • apps/mail/hooks/use-mail-navigation.ts (1 hunks)
  • apps/mail/lib/countries.ts (1 hunks)
  • apps/mail/lib/hotkeys/mail-list-hotkeys.tsx (1 hunks)
  • apps/mail/lib/image-compression.ts (3 hunks)
  • apps/mail/providers/client-providers.tsx (1 hunks)
  • apps/mail/store/draftStates.ts (2 hunks)
  • apps/mail/types/speech-recognition.d.ts (1 hunks)
  • apps/server/src/lib/brain.fallback.prompts.ts (1 hunks)
  • apps/server/src/lib/brain.ts (1 hunks)
  • apps/server/src/lib/notes-manager.ts (1 hunks)
  • apps/server/src/trpc/index.ts (1 hunks)
  • apps/server/src/trpc/routes/ai/compose.ts (2 hunks)
  • apps/server/src/trpc/routes/brain.ts (1 hunks)
  • apps/server/src/trpc/routes/categories.ts (1 hunks)
  • package.json (1 hunks)
✅ Files skipped from review due to trivial changes (12)
  • apps/server/src/trpc/routes/brain.ts
  • apps/mail/hooks/driver/use-delete.ts
  • apps/server/src/lib/notes-manager.ts
  • apps/mail/components/ui/settings-content.tsx
  • apps/mail/app/(routes)/settings/notifications/page.tsx
  • apps/server/src/trpc/routes/ai/compose.ts
  • apps/mail/components/home/footer.tsx
  • apps/mail/components/ai-toggle-button.tsx
  • apps/mail/app/(routes)/settings/labels/page.tsx
  • apps/server/src/lib/brain.fallback.prompts.ts
  • apps/server/src/lib/brain.ts
  • apps/mail/components/mail/thread-display.tsx
🚧 Files skipped from review as they are similar to previous changes (34)
  • apps/mail/components/context/loading-context.tsx
  • apps/mail/app/(auth)/login/error-message.tsx
  • apps/mail/app/(routes)/settings/[...settings]/page.tsx
  • apps/mail/types/speech-recognition.d.ts
  • apps/mail/hooks/use-copy-to-clipboard.ts
  • apps/mail/app/(routes)/settings/privacy/page.tsx
  • apps/server/src/trpc/index.ts
  • apps/mail/hooks/use-hot-key.ts
  • apps/mail/lib/countries.ts
  • apps/mail/components/ui/prompts-dialog.tsx
  • apps/mail/components/ui/responsive-modal.tsx
  • apps/mail/app/(full-width)/terms.tsx
  • apps/mail/providers/client-providers.tsx
  • apps/server/src/trpc/routes/categories.ts
  • apps/mail/components/mail/select-all-checkbox.tsx
  • apps/mail/lib/hotkeys/mail-list-hotkeys.tsx
  • apps/mail/hooks/use-geo-location.ts
  • apps/mail/components/mail/mail-iframe.tsx
  • apps/mail/app/(full-width)/privacy.tsx
  • apps/mail/hooks/use-categories.ts
  • package.json
  • apps/mail/store/draftStates.ts
  • apps/mail/components/ui/button.tsx
  • apps/mail/components/create/email-composer.tsx
  • apps/mail/app/(routes)/settings/security/page.tsx
  • apps/mail/lib/image-compression.ts
  • apps/mail/components/ui/navigation-menu.tsx
  • apps/mail/hooks/use-mail-navigation.ts
  • apps/mail/components/ui/sidebar.tsx
  • apps/mail/components/ui/command.tsx
  • apps/mail/app/(routes)/settings/categories/page.tsx
  • apps/mail/components/labels/label-dialog.tsx
  • apps/mail/components/home/HomeContent.tsx
  • apps/mail/components/home/pixelated-bg.tsx
✨ Finishing Touches
  • 📝 Generate Docstrings

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

Updates the check:format script scope to target only apps/**/*.{ts,tsx} files and applies comprehensive formatting across 40+ files to ensure consistent code style.

  • Modified package.json to restrict check:format script from checking all files ('.') to only TypeScript/TSX files in apps directory
  • Standardized import ordering across files, following a pattern of external packages first, followed by internal imports
  • Normalized Tailwind CSS class ordering for better maintainability in UI components
  • Fixed inconsistent quote styles, converting double quotes to single quotes where appropriate
  • Cleaned up whitespace, line endings, and indentation across multiple components

46 files reviewed, 6 comments
Edit PR Review Bot Settings | Greptile

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (8)
package.json (1)

18-21: Deduplicate Prettier glob to prevent future drift

Both format (line 18) and check:format (line 20) hard-code the same apps/**/*.{ts,tsx} glob. If the scope ever changes, there’s a real risk the two scripts diverge again.
A lightweight way to keep them in sync is to extract the glob into a helper script and reference it:

   "scripts": {
+    "prettier:glob": "apps/**/*.{ts,tsx}",
     "format": "prettier --write $(npm run -s prettier:glob) --log-level silent",
-    "check:format": "prettier --check apps/**/*.{ts,tsx}",
+    "check:format": "prettier --check $(npm run -s prettier:glob)",

(Or use PNPM’s --filter shorthand if preferred.)
This small DRY refactor eliminates duplication and guards against the issue #1580 regression re-appearing.

apps/mail/hooks/use-hot-key.ts (4)

11-18: Consolidate modifier-key bookkeeping to reduce repetition

The Alt* and Shift* key families are updated one‐by‐one. You can avoid duplication (and the risk of the two blocks diverging) by iterating over an array of the related key labels.

-      if (e.altKey) {
-        keyStates.set('Alt', true);
-        keyStates.set('AltLeft', true);
-        keyStates.set('AltRight', true);
-      }
+      ['Alt', 'AltLeft', 'AltRight'].forEach(k => keyStates.set(k, e.altKey));-      if (e.shiftKey) {
-        keyStates.set('Shift', true);
-        keyStates.set('ShiftLeft', true);
-        keyStates.set('ShiftRight', true);
-      }
+      ['Shift', 'ShiftLeft', 'ShiftRight'].forEach(k => keyStates.set(k, e.shiftKey));

Same idea applies in the keyup handler.
This trims nine individual set calls down to two loop iterations and keeps the two handlers symmetrical.

Also applies to: 20-24


26-27: Remove noisy console logging (or guard it behind DEBUG)

console.log('Key down …') and console.log('Key up …') fire on every key event, which can flood the console and degrade performance in production. Consider:

-      console.log('Key down:', e.key, 'Alt:', e.altKey, 'Shift:', e.shiftKey);
+      if (process.env.NODE_ENV !== 'production') {
+        // eslint-disable-next-line no-console
+        console.debug('Key down:', e.key, 'Alt:', e.altKey, 'Shift:', e.shiftKey);
+      }

Do the same for the keyup log.

Also applies to: 46-47


31-44: Use a loop in keyup to mirror the keydown refactor

If you adopt the array-based refactor above, apply the same pattern here to prevent copy-pasted lists from drifting.

-      if (e.key === 'Alt' || e.key === 'AltLeft' || e.key === 'AltRight') {
-        keyStates.set('Alt', false);
-        keyStates.set('AltLeft', false);
-        keyStates.set('AltRight', false);
-      }
+      if (['Alt', 'AltLeft', 'AltRight'].includes(e.key)) {
+        ['Alt', 'AltLeft', 'AltRight'].forEach(k => keyStates.set(k, false));
+      }

Repeat for the Shift family.


49-55: Clear the map instead of setting every entry to false

keyStates.clear() is O(n) with less code and avoids leaving redundant keys set to false.

-      keyStates.forEach((_, key) => {
-        keyStates.set(key, false);
-      });
+      keyStates.clear();

This also resets the map to its minimal footprint.

apps/server/src/trpc/routes/categories.ts (1)

4-6: Consider returning a copy of defaultMailCategories to prevent accidental mutation.

Because the same array instance is returned for every request, any consumer that (wrongly) mutates the result will mutate the shared singleton. A shallow clone is usually enough and costs virtually nothing.

-  defaults: publicProcedure.query(() => defaultMailCategories),
+  defaults: publicProcedure.query(() => [...defaultMailCategories]),

If nested objects might be mutated, use a deep clone instead.

apps/mail/hooks/use-copy-to-clipboard.ts (1)

7-11: Handle async clipboard errors for better UX

navigator.clipboard.writeText is asynchronous and can fail (e.g., if the user blocks clipboard access). Swallowing the promise may leave users unaware of failures. Consider handling the promise and surfacing an error toast.

-    navigator.clipboard.writeText(value);
-    setCopiedValue(id);
-    toast.success('Link copied to clipboard!');
+    navigator.clipboard.writeText(value)
+      .then(() => {
+        setCopiedValue(id);
+        toast.success('Link copied to clipboard!');
+      })
+      .catch(() => {
+        toast.error('Failed to copy link, please try again.');
+      });
apps/mail/hooks/use-categories.ts (1)

49-49: Missing terminal newline.

The file no longer ends with a newline character, which may violate some linters / POSIX tools expectations.

-export function useDefaultCategoryId(): string {
+export function useDefaultCategoryId(): string {
   …
 }
+
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f3b21a8 and f90538e.

📒 Files selected for processing (46)
  • apps/mail/app/(auth)/login/error-message.tsx (1 hunks)
  • apps/mail/app/(full-width)/privacy.tsx (3 hunks)
  • apps/mail/app/(full-width)/terms.tsx (1 hunks)
  • apps/mail/app/(routes)/settings/[...settings]/page.tsx (1 hunks)
  • apps/mail/app/(routes)/settings/categories/page.tsx (15 hunks)
  • apps/mail/app/(routes)/settings/labels/page.tsx (5 hunks)
  • apps/mail/app/(routes)/settings/notifications/page.tsx (1 hunks)
  • apps/mail/app/(routes)/settings/privacy/page.tsx (3 hunks)
  • apps/mail/app/(routes)/settings/security/page.tsx (3 hunks)
  • apps/mail/components/ai-toggle-button.tsx (1 hunks)
  • apps/mail/components/context/loading-context.tsx (1 hunks)
  • apps/mail/components/create/email-composer.tsx (4 hunks)
  • apps/mail/components/home/HomeContent.tsx (2 hunks)
  • apps/mail/components/home/footer.tsx (2 hunks)
  • apps/mail/components/home/pixelated-bg.tsx (1 hunks)
  • apps/mail/components/labels/label-dialog.tsx (3 hunks)
  • apps/mail/components/mail/mail-iframe.tsx (1 hunks)
  • apps/mail/components/mail/select-all-checkbox.tsx (3 hunks)
  • apps/mail/components/mail/thread-display.tsx (1 hunks)
  • apps/mail/components/ui/button.tsx (2 hunks)
  • apps/mail/components/ui/command.tsx (1 hunks)
  • apps/mail/components/ui/navigation-menu.tsx (1 hunks)
  • apps/mail/components/ui/prompts-dialog.tsx (1 hunks)
  • apps/mail/components/ui/responsive-modal.tsx (1 hunks)
  • apps/mail/components/ui/settings-content.tsx (1 hunks)
  • apps/mail/components/ui/sidebar.tsx (1 hunks)
  • apps/mail/hooks/driver/use-delete.ts (1 hunks)
  • apps/mail/hooks/use-categories.ts (2 hunks)
  • apps/mail/hooks/use-copy-to-clipboard.ts (1 hunks)
  • apps/mail/hooks/use-geo-location.ts (1 hunks)
  • apps/mail/hooks/use-hot-key.ts (1 hunks)
  • apps/mail/hooks/use-mail-navigation.ts (1 hunks)
  • apps/mail/lib/countries.ts (1 hunks)
  • apps/mail/lib/hotkeys/mail-list-hotkeys.tsx (1 hunks)
  • apps/mail/lib/image-compression.ts (3 hunks)
  • apps/mail/providers/client-providers.tsx (1 hunks)
  • apps/mail/store/draftStates.ts (2 hunks)
  • apps/mail/types/speech-recognition.d.ts (1 hunks)
  • apps/server/src/lib/brain.fallback.prompts.ts (1 hunks)
  • apps/server/src/lib/brain.ts (1 hunks)
  • apps/server/src/lib/notes-manager.ts (1 hunks)
  • apps/server/src/trpc/index.ts (1 hunks)
  • apps/server/src/trpc/routes/ai/compose.ts (2 hunks)
  • apps/server/src/trpc/routes/brain.ts (1 hunks)
  • apps/server/src/trpc/routes/categories.ts (1 hunks)
  • package.json (1 hunks)
🧰 Additional context used
🧠 Learnings (29)
apps/mail/hooks/use-categories.ts (4)
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.351Z
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.709Z
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#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/ai-toggle-button.tsx (2)
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.
apps/mail/hooks/driver/use-delete.ts (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.709Z
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.351Z
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/ui/responsive-modal.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-iframe.tsx (4)
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.
Learnt from: retrogtx
PR: Mail-0/Zero#1468
File: apps/server/src/trpc/routes/mail.ts:331-331
Timestamp: 2025-06-28T03:56:09.351Z
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.709Z
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/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/ui/settings-content.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/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/hooks/use-hot-key.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/store/draftStates.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/ui/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/mail/app/(routes)/settings/notifications/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#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/hooks/use-geo-location.ts (4)
Learnt from: retrogtx
PR: Mail-0/Zero#1468
File: apps/server/src/trpc/routes/mail.ts:331-331
Timestamp: 2025-06-28T03:56:09.351Z
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#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: dakdevs
PR: Mail-0/Zero#764
File: apps/mail/lib/ai.ts:50-51
Timestamp: 2025-04-25T08:33:16.956Z
Learning: In Next.js 15, the `headers()` function from 'next/headers' is asynchronous and requires using `await` when called, which is a breaking change from previous versions where it was synchronous.
Learnt from: dakdevs
PR: Mail-0/Zero#764
File: apps/mail/lib/ai.ts:50-51
Timestamp: 2025-04-25T08:33:16.956Z
Learning: In Next.js 15, the `headers()` function from 'next/headers' is asynchronous and requires using `await` when called, which is a breaking change from previous versions where it was synchronous.
apps/server/src/trpc/routes/ai/compose.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.351Z
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.709Z
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/ui/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/app/(routes)/settings/privacy/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.351Z
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: danteissaias
PR: Mail-0/Zero#618
File: apps/mail/components/mail/mail-iframe.tsx:0-0
Timestamp: 2025-04-07T20:46:04.726Z
Learning: In the Zero mail application, the "Trust Sender" button for external images is only shown when a sender is not already in the trusted senders list (`settings?.trustedSenders`). This is controlled by the condition `!imagesEnabled && !settings?.externalImages`, where `imagesEnabled` is based on `isTrustedSender || settings?.externalImages` and `isTrustedSender` is determined by `settings?.trustedSenders?.includes(senderEmail)`. This design pattern prevents duplicate entries in the trusted senders list.
apps/server/src/trpc/routes/categories.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.709Z
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.
apps/mail/components/labels/label-dialog.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: 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/labels/page.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:331-331
Timestamp: 2025-06-28T03:56:09.351Z
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: 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/security/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.351Z
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/(full-width)/privacy.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/navigation-menu.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/thread-display.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/app/(full-width)/terms.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: 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/lib/image-compression.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.709Z
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/create/email-composer.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.709Z
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/ui/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/hooks/use-mail-navigation.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/app/(routes)/settings/categories/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: 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).
🧬 Code Graph Analysis (4)
apps/server/src/trpc/routes/ai/compose.ts (1)
apps/server/src/lib/prompts.ts (1)
  • StyledEmailAssistantSystemPrompt (114-231)
apps/mail/components/ui/command.tsx (1)
apps/mail/components/icons/icons.tsx (1)
  • Search (1648-1663)
apps/server/src/trpc/routes/categories.ts (2)
apps/server/src/trpc/trpc.ts (2)
  • router (17-17)
  • publicProcedure (18-18)
apps/server/src/lib/schemas.ts (1)
  • defaultMailCategories (50-99)
apps/mail/app/(routes)/settings/categories/page.tsx (2)
apps/mail/components/icons/icons.tsx (1)
  • Sparkles (561-592)
apps/mail/hooks/use-categories.ts (1)
  • CategorySetting (6-13)
🔇 Additional comments (55)
apps/mail/components/ui/prompts-dialog.tsx (1)

224-224: Good POSIX-style fix

The final newline character is now present. 👍

apps/server/src/lib/notes-manager.ts (1)

19-19: Formatting consistency fix looks good

Adding a space after try aligns with the project's formatting rules. No functional impact.

apps/mail/types/speech-recognition.d.ts (1)

52-53: No-op formatting tweak LGTM

The added space after new is stylistic; type semantics remain unchanged. All good.

apps/server/src/lib/brain.ts (1)

3-3: Import order change is fine

Re-ordering keeps local imports grouped coherently and causes no side-effects. ✅

apps/server/src/trpc/routes/brain.ts (1)

2-2: Import shuffle acknowledged

Purely stylistic; behaviour is unaffected. Looks good.

apps/server/src/trpc/routes/ai/compose.ts (1)

8-11: No issues with the minor refactor

Import re-ordering and the extra trailing comma do not impact runtime behaviour. Implementation remains intact. 👍

Also applies to: 38-41

apps/server/src/lib/brain.fallback.prompts.ts (1)

223-227: Template literal reformat improves readability

Multi-line conditional is clearer; logic unchanged. Nice touch.

apps/server/src/trpc/index.ts (1)

4-4: Consistent route-import grouping

Moving categoriesRouter maintains a tidy import block. No functional change.

apps/server/src/trpc/routes/categories.ts (1)

1-2: Import re-ordering aligns with project conventions – good call.
No functional impact; keeps the barrel import (../trpc) grouped after third-party / shared-lib imports and matches the repo’s lint rules.

apps/mail/store/draftStates.ts (1)

1-13: Quote-style alignment looks good

Only stylistic changes were made; functionality remains intact.

apps/mail/lib/countries.ts (1)

2-30: No duplicate entries detected—ignore the duplicate warning

A search for all three-letter codes in apps/mail/lib/countries.ts shows each code appears only once. While ENG isn’t an ISO 3166-1 alpha-3 code alongside GBR, it isn’t duplicated in the list. If ENG is deliberately included for bespoke cookie-consent logic, no changes are needed; otherwise, review its purpose.

Likely an incorrect or invalid review comment.

apps/mail/hooks/use-geo-location.ts (1)

1-16: Stylistic quote change acknowledged

No functional impact; the hook remains client-safe by gating DOM access inside useEffect.

apps/mail/components/context/loading-context.tsx (1)

46-46: Whitespace cleanup only – LGTM.

No functional impact; keeping the diff noise minimal is appreciated.

apps/mail/hooks/use-categories.ts (1)

2-2: Import re-ordering looks consistent with project style.

Nothing else to flag.

apps/mail/hooks/driver/use-delete.ts (1)

3-3: Import shuffle acknowledged.

No behavioural change; good to merge.

apps/mail/providers/client-providers.tsx (1)

1-1: Duplicate import removed – nice catch.

Keeps the bundle lean and avoids potential circular-dep warnings.

apps/mail/components/ui/responsive-modal.tsx (1)

13-22: Import grouping improved.

Grouping Dialog imports together enhances readability; all good.

apps/mail/components/home/pixelated-bg.tsx (1)

30-30: Good formatting improvement

This change standardizes the quote usage and removes unnecessary trailing whitespace, improving code consistency without affecting functionality.

apps/mail/app/(full-width)/terms.tsx (1)

28-28: CSS class reordering looks good

This reordering of the CSS utility classes improves consistency without affecting the visual appearance or functionality of the back button positioning.

apps/mail/components/ui/navigation-menu.tsx (1)

138-138: Class-order tweak looks good

Purely stylistic Tailwind class re-ordering; behaviour in light/dark mode remains unchanged.

apps/mail/components/home/HomeContent.tsx (1)

34-35: Import re-ordering & whitespace cleanup LGTM

No functional impact; brings this file in line with the new formatting rules.

Also applies to: 124-124

apps/mail/components/mail/select-all-checkbox.tsx (1)

1-9: Imports & minor whitespace – OK

Re-ordering the imports (React first, local hooks next, utils last) and trimming a blank line improves readability without affecting behaviour.

Also applies to: 67-67

apps/mail/hooks/use-mail-navigation.ts (1)

199-207: Readable hotkey config 👍

Splitting the useHotkeys option objects onto multiple lines greatly improves scan-ability; no logic altered.

apps/mail/components/home/footer.tsx (1)

124-139: Footer JSX formatting only

Indentation and line-wrap adjustments—no functional changes detected.

apps/mail/app/(full-width)/privacy.tsx (3)

27-27: LGTM: CSS class reordering improves organization.

The reordering of CSS classes groups positioning-related classes together, which enhances readability and maintainability.


347-391: LGTM: JSX formatting improvements and content enhancement.

The reformatting of list items improves consistency and readability. The addition of the new list item (lines 382-385) clarifying that the policy applies to all premium subscription plans is a valuable content improvement that enhances user understanding.


399-412: LGTM: Consistent JSX formatting applied.

The formatting of these list items maintains consistency with the rest of the component and improves code readability.

apps/mail/components/ui/sidebar.tsx (1)

113-113: LGTM: CSS class reordering improves logical grouping.

Moving the transition-related classes (transition-all duration-300 ease-in-out) to precede the floating variant-specific classes creates better logical grouping of related CSS properties without affecting functionality.

apps/mail/components/ui/command.tsx (1)

49-50: LGTM: CSS class reordering enhances consistency.

The reordering of CSS classes in both the wrapper div and Search icon improves organization by grouping related properties together (layout, visual styling). This aligns with the consistent formatting approach across the codebase.

apps/mail/app/(auth)/login/error-message.tsx (1)

2-2: LGTM: Import reordering improves consistency.

Moving the m import above the useQueryState import aligns with the consistent import organization pattern established across the codebase.

apps/mail/app/(routes)/settings/notifications/page.tsx (1)

19-19: LGTM: Import reordering maintains logical organization.

Moving the Button import after the Switch import improves the logical grouping of UI component imports and maintains consistency with the formatting standards applied across the settings pages.

apps/mail/components/mail/thread-display.tsx (1)

46-46: Import re-ordering looks good

m is now grouped with other absolute (@/...) imports, matching the ordering convention used across the repo. No functional impact.

apps/mail/lib/hotkeys/mail-list-hotkeys.tsx (1)

11-11: Consistent import grouping

Moving m higher keeps all external/alias imports together and improves scan-ability.

apps/mail/components/ai-toggle-button.tsx (1)

17-17: Nit: class order only – fine as is

Re-ordering the border class after sizing/shape classes doesn’t change specificity and aligns with the rest of the codebase.

apps/mail/components/mail/mail-iframe.tsx (1)

9-9: Import location aligned

m was moved up to stay with other alias imports. No behaviour change.

apps/mail/app/(routes)/settings/[...settings]/page.tsx (1)

7-7: Minor import shuffle acknowledged

Import order realigned; nothing else changed.

apps/mail/components/ui/settings-content.tsx (1)

3-3: LGTM! Import reordering improves consistency.

The import reordering aligns with the formatting consistency objectives of this PR.

apps/mail/app/(routes)/settings/security/page.tsx (2)

14-14: LGTM! Import reordering improves organization.

The import reordering enhances code organization without affecting functionality.


69-72: LGTM! JSX indentation improves readability.

The improved indentation of localization function calls enhances code readability and maintains consistency.

Also applies to: 88-91

apps/mail/components/labels/label-dialog.tsx (2)

21-25: LGTM! Import organization enhanced.

The import reordering improves code organization and aligns with formatting standards.


97-99: LGTM! JSX formatting improves readability.

Breaking complex JSX expressions into multiple lines enhances code readability and maintainability.

Also applies to: 158-160

apps/mail/app/(routes)/settings/privacy/page.tsx (2)

19-22: LGTM! Import organization improved.

The import reordering enhances code organization and follows consistent formatting patterns.


90-93: LGTM! JSX indentation consistency enhanced.

The improved indentation of localization function calls maintains consistency and improves readability.

Also applies to: 110-113

apps/mail/app/(routes)/settings/labels/page.tsx (2)

32-35: LGTM! Import organization enhanced.

The import reordering improves code organization and maintains consistency with formatting standards.


66-66: LGTM! Whitespace and JSX formatting improved.

The whitespace adjustments and JSX formatting improvements enhance code consistency and readability.

Also applies to: 116-116, 150-150, 165-165

apps/mail/lib/image-compression.ts (1)

9-9: LGTM! Excellent formatting improvements.

The addition of trailing commas and strategic blank lines enhances code readability and maintainability. These changes follow TypeScript best practices and will make future diffs cleaner.

Also applies to: 17-17, 22-22, 27-27, 28-28, 32-32, 36-36, 42-42, 65-65, 73-73, 80-80, 83-83, 97-97, 103-103, 107-107, 113-113

apps/mail/components/ui/button.tsx (2)

48-60: LGTM! Improved parameter destructuring format.

The multi-line destructuring with trailing commas significantly improves readability for components with many props.


63-63: LGTM! Consistent formatting improvements.

The JSX spacing cleanup, CSS class reordering, and conditional rendering formatting enhance code consistency and readability.

Also applies to: 73-73, 76-78

apps/mail/components/create/email-composer.tsx (3)

19-19: LGTM! Well-organized import additions.

The new imports for image compression functionality (ImageCompressionSettings, ImageQuality, compressImages) and useIsMobile hook are properly organized and support the enhanced email composer features.

Also applies to: 23-23, 26-26, 33-33


193-196: LGTM! Improved calculation readability.

The multi-line formatting of the compression savings calculation enhances readability while maintaining the same logic.


343-343: LGTM! Consistent formatting improvements.

The added blank lines and reformatted dialog description text improve code structure and readability.

Also applies to: 350-350, 544-545

apps/mail/app/(routes)/settings/categories/page.tsx (4)

2-6: LGTM! Excellent import organization.

The systematic grouping and reorganization of imports significantly improves code readability. Related imports are now logically grouped together, making dependencies clearer.

Also applies to: 16-21, 22-41


66-68: LGTM! Consistent function formatting.

The multi-line destructuring and function parameter formatting enhances readability and follows TypeScript best practices.

Also applies to: 230-234, 249-255


79-80: LGTM! Systematic className reordering.

The consistent reordering of CSS classes throughout the component improves code maintainability and follows a logical pattern.

Also applies to: 83-83, 88-88, 91-91, 93-93, 97-97, 106-106, 112-112, 114-114, 121-121, 123-123, 126-126, 144-144, 154-154, 164-164, 186-186, 188-188, 309-309


267-267: LGTM! Strategic whitespace improvements.

The added blank lines and callback formatting enhance code structure and readability without affecting functionality.

Also applies to: 269-269, 337-337, 351-351

Comment on lines 1 to 10
import React, { useCallback, useMemo, useRef, useState } from 'react';
import { useSearchValue } from '@/hooks/use-search-value';
import { trpcClient } from '@/providers/query-provider';
import { cn } from '@/lib/utils';
import { useMail } from '@/components/mail/use-mail';
import { Checkbox } from '@/components/ui/checkbox';
import { useThreads } from '@/hooks/use-threads';
import { useParams } from 'react-router';
import { cn } from '@/lib/utils';
import { toast } from 'sonner';
import React, { useCallback, useMemo, useRef, useState, useEffect } from 'react';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a duplicate import of React in this file. The first import at line 1 includes { useCallback, useMemo, useRef, useState } from React, while line 9 imports React, { useCallback, useMemo, useRef, useState, useEffect }.

To fix this issue:

  1. Remove one of the duplicate imports
  2. If keeping the second import, ensure it includes all needed hooks (including useEffect)

Duplicate imports can cause confusion and potential issues during bundling.

Suggested change
import React, { useCallback, useMemo, useRef, useState } from 'react';
import { useSearchValue } from '@/hooks/use-search-value';
import { trpcClient } from '@/providers/query-provider';
import { cn } from '@/lib/utils';
import { useMail } from '@/components/mail/use-mail';
import { Checkbox } from '@/components/ui/checkbox';
import { useThreads } from '@/hooks/use-threads';
import { useParams } from 'react-router';
import { cn } from '@/lib/utils';
import { toast } from 'sonner';
import React, { useCallback, useMemo, useRef, useState, useEffect } from 'react';
import React, { useCallback, useMemo, useRef, useState, useEffect } from 'react';
import { useSearchValue } from '@/hooks/use-search-value';
import { trpcClient } from '@/providers/query-provider';
import { useMail } from '@/components/mail/use-mail';
import { Checkbox } from '@/components/ui/checkbox';
import { useThreads } from '@/hooks/use-threads';
import { useParams } from 'react-router';
import { cn } from '@/lib/utils';
import { toast } from 'sonner';

Spotted by Diamond (based on custom rules)

Is this helpful? React 👍 or 👎 to let us know.

@MrgSub
Copy link
Collaborator

MrgSub commented Jul 4, 2025

Not needed

@MrgSub MrgSub closed this Jul 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Several files in the repo have inconsistency in formatting

2 participants