Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThe changes update label mention formatting across the application, replacing quoted label syntax with a new bracketed format ( Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant UI_Component
participant MentionUtils
User->>UI_Component: Views example prompt
UI_Component->>MentionUtils: convertLabelsToDisplay(prompt)
MentionUtils-->>UI_Component: Prompt with labels as "Label"
UI_Component-->>User: Renders formatted example
sequenceDiagram
participant Editor
participant LabelMentionParser
Editor->>LabelMentionParser: Parse label mention @[Label]
alt Label exists
LabelMentionParser-->>Editor: Create mention node with label ID
else Label missing
LabelMentionParser-->>Editor: Create mention node with placeholder ID and label name
end
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
|
Claude finished @elie222's task —— View job Pull Request Review
|
|
Claude finished @elie222's task —— View job Pull Request Review
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
apps/web/app/(app)/[emailAccountId]/assistant/RulesPrompt.tsx (1)
18-18: Consider using type-only import for TypeScript type.The import appears to be for a TypeScript type based on the
SaveRulesPromptBodynaming convention.-import type { SaveRulesPromptBody } from "@/utils/actions/rule.validation"; +import type { SaveRulesPromptBody } from "@/utils/actions/rule.validation";Wait, this already appears to be a type-only import. The change looks correct as-is.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
apps/web/app/(app)/[emailAccountId]/assistant/RulesPrompt.tsx(5 hunks)apps/web/app/(app)/[emailAccountId]/assistant/examples.ts(12 hunks)apps/web/app/(app)/onboarding/OnboardingEmailAssistant.tsx(2 hunks)apps/web/components/assistant-chat/examples-dialog.tsx(2 hunks)apps/web/components/editor/extensions/LabelMention.tsx(1 hunks)apps/web/utils/mention.test.ts(2 hunks)apps/web/utils/mention.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
apps/web/**/*.{ts,tsx}
Instructions used from:
Sources:
📄 CodeRabbit Inference Engine
- apps/web/CLAUDE.md
apps/web/app/**/*
Instructions used from:
Sources:
📄 CodeRabbit Inference Engine
- apps/web/CLAUDE.md
apps/web/**/*.tsx
Instructions used from:
Sources:
📄 CodeRabbit Inference Engine
- apps/web/CLAUDE.md
**/*.tsx
Instructions used from:
Sources:
📄 CodeRabbit Inference Engine
- .cursor/rules/data-fetching.mdc
- .cursor/rules/form-handling.mdc
**/*.{ts,tsx}
Instructions used from:
Sources:
📄 CodeRabbit Inference Engine
- .cursor/rules/form-handling.mdc
🧠 Learnings (5)
apps/web/app/(app)/onboarding/OnboardingEmailAssistant.tsx (8)
Learnt from: CR
PR: elie222/inbox-zero#0
File: .cursor/rules/form-handling.mdc:0-0
Timestamp: 2025-07-03T12:02:53.001Z
Learning: Applies to **/*.{ts,tsx} : Use descriptive error messages
Learnt from: CR
PR: elie222/inbox-zero#0
File: .cursor/rules/gmail-api.mdc:0-0
Timestamp: 2025-06-23T12:26:14.189Z
Learning: Always use wrapper functions from the utils folder (e.g., apps/web/utils/gmail/message.ts) to interact with provider APIs, ensuring maintainability and easier future provider support.
Learnt from: CR
PR: elie222/inbox-zero#0
File: apps/web/CLAUDE.md:0-0
Timestamp: 2025-07-03T12:02:16.137Z
Learning: Applies to apps/web/**/*.tsx : Follow consistent naming conventions (PascalCase for components)
Learnt from: CR
PR: elie222/inbox-zero#0
File: apps/web/CLAUDE.md:0-0
Timestamp: 2025-07-03T12:02:16.137Z
Learning: Applies to apps/web/**/*.tsx : Use shadcn/ui components when available
Learnt from: elie222
PR: elie222/inbox-zero#537
File: apps/web/app/(app)/[emailAccountId]/clean/onboarding/page.tsx:30-34
Timestamp: 2025-07-08T13:14:07.449Z
Learning: The clean onboarding page in apps/web/app/(app)/[emailAccountId]/clean/onboarding/page.tsx is intentionally Gmail-specific and should show an error for non-Google email accounts rather than attempting to support multiple providers.
Learnt from: CR
PR: elie222/inbox-zero#0
File: apps/web/CLAUDE.md:0-0
Timestamp: 2025-07-03T12:02:16.137Z
Learning: Applies to apps/web/**/*.tsx : Prefer functional components with hooks
Learnt from: CR
PR: elie222/inbox-zero#0
File: apps/web/CLAUDE.md:0-0
Timestamp: 2025-07-03T12:02:16.137Z
Learning: Applies to apps/web/**/*.tsx : Ensure responsive design with mobile-first approach
Learnt from: CR
PR: elie222/inbox-zero#0
File: apps/web/CLAUDE.md:0-0
Timestamp: 2025-07-03T12:02:16.137Z
Learning: Applies to apps/web/**/*.{ts,tsx} : Format code with Prettier
apps/web/components/assistant-chat/examples-dialog.tsx (2)
Learnt from: CR
PR: elie222/inbox-zero#0
File: .cursor/rules/form-handling.mdc:0-0
Timestamp: 2025-07-03T12:02:53.001Z
Learning: Applies to **/*.{ts,tsx} : Use descriptive error messages
Learnt from: CR
PR: elie222/inbox-zero#0
File: apps/web/CLAUDE.md:0-0
Timestamp: 2025-07-03T12:02:16.137Z
Learning: Applies to apps/web/**/*.tsx : Use shadcn/ui components when available
apps/web/utils/mention.test.ts (2)
Learnt from: CR
PR: elie222/inbox-zero#0
File: .cursor/rules/llm-test.mdc:0-0
Timestamp: 2025-06-23T12:26:27.693Z
Learning: When writing tests for LLM-related functionality in TypeScript (e.g., in 'apps/web/__tests__/*.test.ts'), always create helper functions for common test data to ensure consistency and reduce duplication.
Learnt from: CR
PR: elie222/inbox-zero#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-06-23T12:27:30.570Z
Learning: When mocking Prisma in Vitest, import the Prisma mock from '@/utils/__mocks__/prisma', mock '@/utils/prisma', and clear all mocks in a beforeEach hook to ensure test isolation.
apps/web/app/(app)/[emailAccountId]/assistant/examples.ts (1)
Learnt from: CR
PR: elie222/inbox-zero#0
File: .cursor/rules/llm.mdc:0-0
Timestamp: 2025-06-23T12:26:36.694Z
Learning: System prompts and user prompts should always be kept separate: the system prompt defines the LLM's role and task, while the user prompt provides data and context.
apps/web/app/(app)/[emailAccountId]/assistant/RulesPrompt.tsx (16)
Learnt from: CR
PR: elie222/inbox-zero#0
File: .cursor/rules/cursor-rules.mdc:0-0
Timestamp: 2025-07-03T12:02:24.598Z
Learning: Applies to .cursor/rules/*.mdc : Cursor rule files must use markdown formatting for main content, including step-by-step instructions, code examples, and guidelines
Learnt from: CR
PR: elie222/inbox-zero#0
File: .cursor/rules/form-handling.mdc:0-0
Timestamp: 2025-07-03T12:02:53.001Z
Learning: Applies to **/*.{ts,tsx} : Use descriptive error messages
Learnt from: CR
PR: elie222/inbox-zero#0
File: .cursor/rules/cursor-rules.mdc:0-0
Timestamp: 2025-07-03T12:02:24.598Z
Learning: Applies to .cursor/rules/*.mdc : Make Cursor rule file names descriptive of the rule's purpose
Learnt from: CR
PR: elie222/inbox-zero#0
File: .cursor/rules/hooks.mdc:0-0
Timestamp: 2025-06-23T12:26:16.769Z
Learning: For data fetching in custom React hooks, prefer using the useSWR hook. The custom hook should typically wrap useSWR, handle the API endpoint URL, and return the data, loading state, error state, and potentially the mutate function from SWR.
Learnt from: CR
PR: elie222/inbox-zero#0
File: .cursor/rules/page-structure.mdc:0-0
Timestamp: 2025-06-23T12:26:47.630Z
Learning: In deeply nested React components within the Next.js app directory, use the SWR library to fetch data via API instead of loading data directly in the component.
Learnt from: CR
PR: elie222/inbox-zero#0
File: .cursor/rules/hooks.mdc:0-0
Timestamp: 2025-06-23T12:26:16.769Z
Learning: Custom React hooks should encapsulate reusable stateful logic, especially for data fetching or complex UI interactions.
Learnt from: CR
PR: elie222/inbox-zero#0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-06-23T12:26:59.468Z
Learning: Use SWR for data fetching in deeply nested components in Next.js App Router projects to enable efficient client-side data fetching and caching.
Learnt from: CR
PR: elie222/inbox-zero#0
File: .cursor/rules/ui-components.mdc:0-0
Timestamp: 2025-06-23T12:27:33.499Z
Learning: When fetching data from an API in a Next.js React application, use the `swr` package for GET requests to the server. This provides built-in caching, revalidation, and error handling.
Learnt from: CR
PR: elie222/inbox-zero#0
File: apps/web/CLAUDE.md:0-0
Timestamp: 2025-07-03T12:02:16.137Z
Learning: Applies to apps/web/**/*.tsx : Prefer functional components with hooks
Learnt from: CR
PR: elie222/inbox-zero#0
File: .cursor/rules/hooks.mdc:0-0
Timestamp: 2025-06-23T12:26:16.769Z
Learning: Each custom React hook should have a single responsibility and be kept as simple as possible.
Learnt from: CR
PR: elie222/inbox-zero#0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-06-23T12:26:59.468Z
Learning: For components with onClick handlers in Next.js App Router, ensure they are client components by including the 'use client' directive at the top of the file.
Learnt from: elie222
PR: elie222/inbox-zero#485
File: apps/web/app/(landing)/login/page.tsx:41-43
Timestamp: 2025-06-05T09:49:12.168Z
Learning: In Next.js App Router, components that use the `useSearchParams` hook require a Suspense boundary to handle the asynchronous nature of search parameter access. The Suspense wrapper is necessary and should not be removed when a component uses useSearchParams.
Learnt from: CR
PR: elie222/inbox-zero#0
File: apps/web/CLAUDE.md:0-0
Timestamp: 2025-07-03T12:02:16.137Z
Learning: Applies to apps/web/**/*.tsx : Use shadcn/ui components when available
Learnt from: CR
PR: elie222/inbox-zero#0
File: .cursor/rules/form-handling.mdc:0-0
Timestamp: 2025-07-03T12:02:53.001Z
Learning: Applies to **/*.tsx : Validate form inputs before submission
Learnt from: aryanprince
PR: elie222/inbox-zero#210
File: apps/web/app/(app)/stats/NewsletterModal.tsx:2-4
Timestamp: 2024-08-23T11:37:26.779Z
Learning: `MoreDropdown` is a React component and `useUnsubscribeButton` is a custom React hook, and they should not be imported using `import type`.
Learnt from: CR
PR: elie222/inbox-zero#0
File: .cursor/rules/ui-components.mdc:0-0
Timestamp: 2025-06-23T12:27:33.499Z
Learning: For form text inputs in React using Shadcn UI, use the `Input` component with `registerProps` from a form library (such as react-hook-form) and pass any validation errors to the `error` prop.
🧬 Code Graph Analysis (3)
apps/web/app/(app)/onboarding/OnboardingEmailAssistant.tsx (1)
apps/web/utils/mention.ts (1)
convertLabelsToDisplay(14-16)
apps/web/components/assistant-chat/examples-dialog.tsx (1)
apps/web/utils/mention.ts (1)
convertLabelsToDisplay(14-16)
apps/web/utils/mention.test.ts (1)
apps/web/utils/mention.ts (1)
convertLabelsToDisplay(14-16)
⏰ 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: claude-review
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (29)
apps/web/utils/mention.ts (3)
7-8: Good refactoring to use the new parser-based approach.The change from regex-based replacement to using the
processMentionshelper provides better handling of nested brackets and complex mention syntax.
10-16: Well-designed inverse function for UI display.The
convertLabelsToDisplayfunction provides a clean way to convert mentions to a user-friendly quoted format. The implementation is concise and leverages the same robust parsing logic.
21-61: Robust bracket-matching implementation.The
processMentionshelper function correctly handles nested brackets by maintaining a bracket count. The logic properly handles edge cases like unmatched brackets and processes the string character by character.The implementation is well-structured with clear comments and proper error handling for malformed mentions.
apps/web/components/assistant-chat/examples-dialog.tsx (2)
21-21: Correct import of the new utility function.The import follows the established path alias pattern using
@/utils/mention.
148-148: Proper application of display formatting.The
convertLabelsToDisplayfunction is correctly applied to transform mention labels from@[Label]format to"Label"format for better UI readability.apps/web/app/(app)/onboarding/OnboardingEmailAssistant.tsx (2)
33-33: Consistent import pattern.The import follows the established path alias pattern and maintains consistency with other files using the same utility.
131-131: Consistent UI formatting across components.The application of
convertLabelsToDisplayensures consistent mention formatting across the onboarding flow, aligning with the same pattern used in other UI components.apps/web/components/editor/extensions/LabelMention.tsx (2)
184-185: Clear documentation of the behavioral change.The comment explains why the parsing now allows mentions even when labels don't exist, providing good context for future maintainers.
186-200: Logical enhancement to support missing labels.The modification allows the editor to handle mentions gracefully even when the referenced label doesn't exist in the labels array. This is particularly useful for examples and templates where labels might not be created yet.
The implementation correctly:
- Uses optional chaining (
label?.id)- Provides fallback values (
placeholder-${labelName})- Maintains the same token structure regardless of label existence
apps/web/utils/mention.test.ts (2)
2-2: Import updated correctly.The import statement properly includes the new
convertLabelsToDisplayfunction alongside the existing import.
114-210: Comprehensive test coverage for the new function.The test suite for
convertLabelsToDisplayis thorough and covers:
- Basic single and multiple mention transformations
- Edge cases like empty strings and text without mentions
- Special characters, numbers, and symbols in labels
- Malformed and nested bracket scenarios
- Multiline text handling
- Preservation of non-mention @ symbols
The tests mirror the existing test structure for
convertMentionsToLabels, ensuring consistency and maintainability. The expected outputs correctly show the transformation from@[Label]to"Label"format.apps/web/app/(app)/[emailAccountId]/assistant/examples.ts (14)
25-26: LGTM! Consistent label format standardization.The systematic replacement of quoted label syntax with the new bracketed format (
@[Label]) is well-executed and consistent across all prompt entries.
31-46: Consistent format conversion across example prompts.All label mentions have been properly converted to the new
@[Label]format, maintaining consistency with the overall label mention system update.
52-57: Consistent format conversion in persona-specific prompts.The founder persona prompts correctly follow the new label mention format, ensuring consistency across all persona types.
72-83: Proper format conversion in influencer persona prompts.The influencer-specific prompts have been updated to use the new bracketed label format consistently, including in multi-line template strings.
93-101: Consistent label format in realtor persona prompts.All realtor-specific prompts properly implement the new
@[Label]format, maintaining consistency with the system-wide update.
112-124: Consistent format conversion in investor persona prompts.The investor persona prompts have been systematically updated to use the new bracketed label format across all entries.
141-149: Consistent format conversion in developer persona prompts.All developer-specific prompts correctly use the new
@[Label]format, maintaining consistency with the broader system update.
159-167: Consistent format conversion in designer persona prompts.The designer persona prompts have been properly updated to use the new bracketed label format throughout.
177-188: Consistent format conversion in sales persona prompts.All sales-specific prompts correctly implement the new
@[Label]format, ensuring consistency across the entire system.
198-205: Consistent format conversion in marketer persona prompts.The marketer persona prompts have been systematically updated to use the new bracketed label format.
215-226: Consistent format conversion in support persona prompts.All support-specific prompts correctly follow the new
@[Label]format, maintaining consistency with the system-wide update.
236-254: Consistent format conversion in recruiter persona prompts.The recruiter persona prompts have been properly updated to use the new bracketed label format across all entries.
263-270: Consistent format conversion in student persona prompts.All student-specific prompts correctly implement the new
@[Label]format, ensuring consistency with the broader system update.
279-279: Consistent format conversion in outreach persona prompts.The outreach persona prompt has been updated to use the new bracketed label format consistently.
apps/web/app/(app)/[emailAccountId]/assistant/RulesPrompt.tsx (4)
5-5: Good addition of help icon for user guidance.The
HelpCircleIconimport supports the new tooltip functionality that provides helpful formatting instructions to users.
27-27: Good integration of label display conversion utility.The
convertLabelsToDisplayimport enables proper conversion of the new bracketed label format back to user-friendly display format.
219-253: Excellent user experience enhancement with formatting tooltip.The tooltip provides clear, helpful guidance on formatting options with proper visual styling and good UX patterns. The use of
font-monoand color coding makes the formatting instructions easy to understand.
380-382: Proper integration of label display conversion.The
convertLabelsToDisplayfunction correctly converts the new bracketed label format (@[Label]) back to user-friendly quoted format for display in the examples, ensuring consistency with the overall label mention system update.

Summary by CodeRabbit
New Features
Improvements
@[Label]) for consistency.Tests