Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
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. 📝 WalkthroughWalkthroughAdds timezone-aware date/time formatting utilities and integrates them into meeting-briefing prompt generation and delivery; updates tests for timezone behavior; changes sendBriefingEmail/buildPrompt signatures; and makes small UI updates (icon swaps and layout) and dialog close-on-success hooks in several settings components. Changes
Sequence Diagram(s)sequenceDiagram
%% Participants
participant Proc as processBriefings (process.ts)
participant Gen as buildPrompt (generate-briefing.ts)
participant Date as date utils (date.ts)
participant Send as sendBriefingEmail (send-briefing.ts)
participant Email as EmailService
Proc->>Gen: buildPrompt(briefingData, userTimezone)
Gen->>Date: formatDateTimeInUserTimezone(meeting.startTime, timezone)
Date-->>Gen: formatted meeting date/time
Gen-->>Proc: prompt (timezone-aware)
Proc->>Send: sendBriefingEmail(payload, userTimezone)
Send->>Date: formatTimeInUserTimezone(event.startTime, userTimezone)
Date-->>Send: formattedTime
Send->>Email: send email with formattedTime and prompt
Email-->>Send: delivery result
Send-->>Proc: result
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (6)
🚧 Files skipped from review as they are similar to previous changes (2)
🧰 Additional context used📓 Path-based instructions (16)**/*.{ts,tsx}📄 CodeRabbit inference engine (.cursor/rules/data-fetching.mdc)
Files:
apps/web/app/(app)/**/*.{ts,tsx}📄 CodeRabbit inference engine (.cursor/rules/page-structure.mdc)
Files:
**/*.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (.cursor/rules/prisma-enum-imports.mdc)
Files:
apps/web/**/*.{ts,tsx}📄 CodeRabbit inference engine (.cursor/rules/project-structure.mdc)
Files:
**/*.{tsx,ts}📄 CodeRabbit inference engine (.cursor/rules/ui-components.mdc)
Files:
**/*.{tsx,ts,css}📄 CodeRabbit inference engine (.cursor/rules/ui-components.mdc)
Files:
**/*.tsx📄 CodeRabbit inference engine (.cursor/rules/ui-components.mdc)
Files:
**/*.{js,jsx,ts,tsx}📄 CodeRabbit inference engine (.cursor/rules/ultracite.mdc)
Files:
**/*.{jsx,tsx}📄 CodeRabbit inference engine (.cursor/rules/ultracite.mdc)
Files:
!(pages/_document).{jsx,tsx}📄 CodeRabbit inference engine (.cursor/rules/ultracite.mdc)
Files:
**/*.{js,ts,jsx,tsx}📄 CodeRabbit inference engine (.cursor/rules/utilities.mdc)
Files:
apps/web/**/*.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (apps/web/CLAUDE.md)
Files:
apps/web/app/**/*.{ts,tsx}📄 CodeRabbit inference engine (apps/web/CLAUDE.md)
Files:
apps/web/**/*.{tsx,jsx}📄 CodeRabbit inference engine (apps/web/CLAUDE.md)
Files:
apps/web/**/*.{ts,tsx,js,jsx,json,css}📄 CodeRabbit inference engine (apps/web/CLAUDE.md)
Files:
**/*Form.{ts,tsx}📄 CodeRabbit inference engine (.cursor/rules/form-handling.mdc)
Files:
🧠 Learnings (11)📚 Learning: 2025-07-17T04:19:57.099ZApplied to files:
📚 Learning: 2025-11-25T14:38:56.992ZApplied to files:
📚 Learning: 2025-11-25T14:38:18.874ZApplied to files:
📚 Learning: 2025-11-25T14:38:23.265ZApplied to files:
📚 Learning: 2025-11-25T14:37:09.306ZApplied to files:
📚 Learning: 2025-11-25T14:42:08.869ZApplied to files:
📚 Learning: 2024-08-23T11:37:26.779ZApplied to files:
📚 Learning: 2025-12-21T12:21:37.794ZApplied to files:
📚 Learning: 2025-07-08T13:14:07.449ZApplied to files:
📚 Learning: 2025-12-21T12:21:37.794ZApplied to files:
📚 Learning: 2025-11-25T14:36:40.146ZApplied to files:
🧬 Code graph analysis (4)apps/web/app/(app)/[emailAccountId]/assistant/settings/DigestSetting.tsx (2)
apps/web/app/(app)/[emailAccountId]/settings/DigestSettingsForm.tsx (1)
apps/web/app/(app)/[emailAccountId]/assistant/settings/AboutSetting.tsx (2)
apps/web/app/(app)/[emailAccountId]/settings/AboutSectionForm.tsx (1)
⏰ 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). (4)
🔇 Additional comments (9)
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. Comment |
apps/web/utils/date.ts
Outdated
| export function formatInUserTimezone( | ||
| date: Date, | ||
| timezone: string | null | undefined, | ||
| formatString: string, | ||
| ): string { | ||
| const tz = timezone || DEFAULT_TIMEZONE; | ||
| const dateInTZ = new TZDate(date, tz); | ||
| return format(dateInTZ, formatString); |
There was a problem hiding this comment.
TZDate will throw on corrupted/legacy/non-IANA values since the only validation is z.string().min(1). Could we validate or catch exceptions to avoid breaking prompts/emails?
Finding type: Logical Bugs
There was a problem hiding this comment.
Commit 9d090ba addressed this comment by wrapping the TZDate creation in a try-catch block that catches exceptions from corrupted/legacy/non-IANA timezone values. When an invalid timezone is encountered, the code now logs the error and gracefully falls back to UTC instead of throwing an exception that could break prompts/emails.
There was a problem hiding this comment.
1 issue found across 4 files (changes from recent commits).
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="apps/web/app/(app)/[emailAccountId]/settings/DigestSettingsForm.tsx">
<violation number="1" location="apps/web/app/(app)/[emailAccountId]/settings/DigestSettingsForm.tsx:227">
P2: Missing `onSuccess` in `useCallback` dependency array. The `onSuccess` prop is used inside the `onSubmit` callback but is not listed in the dependency array `[rules, executeItems, executeSchedule]`. This will cause stale closure issues if the parent component provides a different `onSuccess` callback on re-render.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| toastSuccess({ | ||
| description: "Your digest settings have been updated!", | ||
| }); | ||
| onSuccess?.(); |
There was a problem hiding this comment.
P2: Missing onSuccess in useCallback dependency array. The onSuccess prop is used inside the onSubmit callback but is not listed in the dependency array [rules, executeItems, executeSchedule]. This will cause stale closure issues if the parent component provides a different onSuccess callback on re-render.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/web/app/(app)/[emailAccountId]/settings/DigestSettingsForm.tsx, line 227:
<comment>Missing `onSuccess` in `useCallback` dependency array. The `onSuccess` prop is used inside the `onSubmit` callback but is not listed in the dependency array `[rules, executeItems, executeSchedule]`. This will cause stale closure issues if the parent component provides a different `onSuccess` callback on re-render.</comment>
<file context>
@@ -224,6 +224,7 @@ export function DigestSettingsForm() {
toastSuccess({
description: "Your digest settings have been updated!",
});
+ onSuccess?.();
} catch {
toastError({
</file context>
✅ Addressed in 3ea9607
There was a problem hiding this comment.
Commit 3ea9607 addressed this comment by adding onSuccess to the useCallback dependency array. The dependency array was updated from [rules, executeItems, executeSchedule] to [rules, executeItems, executeSchedule, onSuccess], which resolves the stale closure issue that was identified.
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
apps/web/app/(app)/[emailAccountId]/settings/DigestSettingsForm.tsx (1)
173-236: AddonSuccessto theuseCallbackdependency array.The
onSuccesscallback is invoked at line 227 but is missing from the dependency array at line 235. This violates the React Hook exhaustive-deps rule and could lead to stale closures if the parent component changes the callback reference.🔎 Proposed fix
[rules, executeItems, executeSchedule], + [rules, executeItems, executeSchedule, onSuccess], );
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
apps/web/app/(app)/[emailAccountId]/assistant/settings/AboutSetting.tsxapps/web/app/(app)/[emailAccountId]/assistant/settings/DigestSetting.tsxapps/web/app/(app)/[emailAccountId]/settings/AboutSectionForm.tsxapps/web/app/(app)/[emailAccountId]/settings/DigestSettingsForm.tsx
🧰 Additional context used
📓 Path-based instructions (16)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/data-fetching.mdc)
**/*.{ts,tsx}: For API GET requests to server, use theswrpackage
Useresult?.serverErrorwithtoastErrorfrom@/components/Toastfor error handling in async operations
**/*.{ts,tsx}: Use wrapper functions for Gmail message operations (get, list, batch, etc.) from @/utils/gmail/message.ts instead of direct API calls
Use wrapper functions for Gmail thread operations from @/utils/gmail/thread.ts instead of direct API calls
Use wrapper functions for Gmail label operations from @/utils/gmail/label.ts instead of direct API calls
**/*.{ts,tsx}: For early access feature flags, create hooks using the naming conventionuse[FeatureName]Enabledthat return a boolean fromuseFeatureFlagEnabled("flag-key")
For A/B test variant flags, create hooks using the naming conventionuse[FeatureName]Variantthat define variant types, useuseFeatureFlagVariantKey()with type casting, and provide a default "control" fallback
Use kebab-case for PostHog feature flag keys (e.g.,inbox-cleaner,pricing-options-2)
Always define types for A/B test variant flags (e.g.,type PricingVariant = "control" | "variant-a" | "variant-b") and provide type safety through type casting
**/*.{ts,tsx}: Don't use primitive type aliases or misleading types
Don't use empty type parameters in type aliases and interfaces
Don't use this and super in static contexts
Don't use any or unknown as type constraints
Don't use the TypeScript directive @ts-ignore
Don't use TypeScript enums
Don't export imported variables
Don't add type annotations to variables, parameters, and class properties that are initialized with literal expressions
Don't use TypeScript namespaces
Don't use non-null assertions with the!postfix operator
Don't use parameter properties in class constructors
Don't use user-defined types
Useas constinstead of literal types and type annotations
Use eitherT[]orArray<T>consistently
Initialize each enum member value explicitly
Useexport typefor types
Use `impo...
Files:
apps/web/app/(app)/[emailAccountId]/assistant/settings/DigestSetting.tsxapps/web/app/(app)/[emailAccountId]/settings/AboutSectionForm.tsxapps/web/app/(app)/[emailAccountId]/assistant/settings/AboutSetting.tsxapps/web/app/(app)/[emailAccountId]/settings/DigestSettingsForm.tsx
apps/web/app/(app)/**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/page-structure.mdc)
apps/web/app/(app)/**/*.{ts,tsx}: Components for the page are either put inpage.tsx, or in theapps/web/app/(app)/PAGE_NAMEfolder
If we're in a deeply nested component we will useswrto fetch via API
If you need to useonClickin a component, that component is a client component and file must start withuse client
Files:
apps/web/app/(app)/[emailAccountId]/assistant/settings/DigestSetting.tsxapps/web/app/(app)/[emailAccountId]/settings/AboutSectionForm.tsxapps/web/app/(app)/[emailAccountId]/assistant/settings/AboutSetting.tsxapps/web/app/(app)/[emailAccountId]/settings/DigestSettingsForm.tsx
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (.cursor/rules/prisma-enum-imports.mdc)
Always import Prisma enums from
@/generated/prisma/enumsinstead of@/generated/prisma/clientto avoid Next.js bundling errors in client componentsImport Prisma using the project's centralized utility:
import prisma from '@/utils/prisma'
Files:
apps/web/app/(app)/[emailAccountId]/assistant/settings/DigestSetting.tsxapps/web/app/(app)/[emailAccountId]/settings/AboutSectionForm.tsxapps/web/app/(app)/[emailAccountId]/assistant/settings/AboutSetting.tsxapps/web/app/(app)/[emailAccountId]/settings/DigestSettingsForm.tsx
apps/web/**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/project-structure.mdc)
Import specific lodash functions rather than entire lodash library to minimize bundle size (e.g.,
import groupBy from 'lodash/groupBy')
apps/web/**/*.{ts,tsx}: Use TypeScript with strict null checks
Do not export types/interfaces that are only used within the same file. Export later if needed
Files:
apps/web/app/(app)/[emailAccountId]/assistant/settings/DigestSetting.tsxapps/web/app/(app)/[emailAccountId]/settings/AboutSectionForm.tsxapps/web/app/(app)/[emailAccountId]/assistant/settings/AboutSetting.tsxapps/web/app/(app)/[emailAccountId]/settings/DigestSettingsForm.tsx
**/*.{tsx,ts}
📄 CodeRabbit inference engine (.cursor/rules/ui-components.mdc)
**/*.{tsx,ts}: Use Shadcn UI and Tailwind for components and styling
Usenext/imagepackage for images
For API GET requests to server, use theswrpackage with hooks likeuseSWRto fetch data
For text inputs, use theInputcomponent withregisterPropsfor form integration and error handling
Files:
apps/web/app/(app)/[emailAccountId]/assistant/settings/DigestSetting.tsxapps/web/app/(app)/[emailAccountId]/settings/AboutSectionForm.tsxapps/web/app/(app)/[emailAccountId]/assistant/settings/AboutSetting.tsxapps/web/app/(app)/[emailAccountId]/settings/DigestSettingsForm.tsx
**/*.{tsx,ts,css}
📄 CodeRabbit inference engine (.cursor/rules/ui-components.mdc)
Implement responsive design with Tailwind CSS using a mobile-first approach
Files:
apps/web/app/(app)/[emailAccountId]/assistant/settings/DigestSetting.tsxapps/web/app/(app)/[emailAccountId]/settings/AboutSectionForm.tsxapps/web/app/(app)/[emailAccountId]/assistant/settings/AboutSetting.tsxapps/web/app/(app)/[emailAccountId]/settings/DigestSettingsForm.tsx
**/*.tsx
📄 CodeRabbit inference engine (.cursor/rules/ui-components.mdc)
**/*.tsx: Use theLoadingContentcomponent to handle loading states instead of manual loading state management
For text areas, use theInputcomponent withtype='text',autosizeTextareaprop set to true, andregisterPropsfor form integration
Files:
apps/web/app/(app)/[emailAccountId]/assistant/settings/DigestSetting.tsxapps/web/app/(app)/[emailAccountId]/settings/AboutSectionForm.tsxapps/web/app/(app)/[emailAccountId]/assistant/settings/AboutSetting.tsxapps/web/app/(app)/[emailAccountId]/settings/DigestSettingsForm.tsx
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/ultracite.mdc)
**/*.{js,jsx,ts,tsx}: Don't useaccessKeyattribute on any HTML element
Don't setaria-hidden="true"on focusable elements
Don't add ARIA roles, states, and properties to elements that don't support them
Don't use distracting elements like<marquee>or<blink>
Only use thescopeprop on<th>elements
Don't assign non-interactive ARIA roles to interactive HTML elements
Make sure label elements have text content and are associated with an input
Don't assign interactive ARIA roles to non-interactive HTML elements
Don't assigntabIndexto non-interactive HTML elements
Don't use positive integers fortabIndexproperty
Don't include "image", "picture", or "photo" in img alt prop
Don't use explicit role property that's the same as the implicit/default role
Make static elements with click handlers use a valid role attribute
Always include atitleelement for SVG elements
Give all elements requiring alt text meaningful information for screen readers
Make sure anchors have content that's accessible to screen readers
AssigntabIndexto non-interactive HTML elements witharia-activedescendant
Include all required ARIA attributes for elements with ARIA roles
Make sure ARIA properties are valid for the element's supported roles
Always include atypeattribute for button elements
Make elements with interactive roles and handlers focusable
Give heading elements content that's accessible to screen readers (not hidden witharia-hidden)
Always include alangattribute on the html element
Always include atitleattribute for iframe elements
AccompanyonClickwith at least one of:onKeyUp,onKeyDown, oronKeyPress
AccompanyonMouseOver/onMouseOutwithonFocus/onBlur
Include caption tracks for audio and video elements
Use semantic elements instead of role attributes in JSX
Make sure all anchors are valid and navigable
Ensure all ARIA properties (aria-*) are valid
Use valid, non-abstract ARIA roles for elements with ARIA roles
Use valid AR...
Files:
apps/web/app/(app)/[emailAccountId]/assistant/settings/DigestSetting.tsxapps/web/app/(app)/[emailAccountId]/settings/AboutSectionForm.tsxapps/web/app/(app)/[emailAccountId]/assistant/settings/AboutSetting.tsxapps/web/app/(app)/[emailAccountId]/settings/DigestSettingsForm.tsx
**/*.{jsx,tsx}
📄 CodeRabbit inference engine (.cursor/rules/ultracite.mdc)
**/*.{jsx,tsx}: Don't use unnecessary fragments
Don't pass children as props
Don't use the return value of React.render
Make sure all dependencies are correctly specified in React hooks
Make sure all React hooks are called from the top level of component functions
Don't forget key props in iterators and collection literals
Don't define React components inside other components
Don't use event handlers on non-interactive elements
Don't assign to React component props
Don't use bothchildrenanddangerouslySetInnerHTMLprops on the same element
Don't use dangerous JSX props
Don't use Array index in keys
Don't insert comments as text nodes
Don't assign JSX properties multiple times
Don't add extra closing tags for components without children
Use<>...</>instead of<Fragment>...</Fragment>
Watch out for possible "wrong" semicolons inside JSX elements
Make sure void (self-closing) elements don't have children
Don't usetarget="_blank"withoutrel="noopener"
Don't use<img>elements in Next.js projects
Don't use<head>elements in Next.js projects
Files:
apps/web/app/(app)/[emailAccountId]/assistant/settings/DigestSetting.tsxapps/web/app/(app)/[emailAccountId]/settings/AboutSectionForm.tsxapps/web/app/(app)/[emailAccountId]/assistant/settings/AboutSetting.tsxapps/web/app/(app)/[emailAccountId]/settings/DigestSettingsForm.tsx
!(pages/_document).{jsx,tsx}
📄 CodeRabbit inference engine (.cursor/rules/ultracite.mdc)
Don't use the next/head module in pages/_document.js on Next.js projects
Files:
apps/web/app/(app)/[emailAccountId]/assistant/settings/DigestSetting.tsxapps/web/app/(app)/[emailAccountId]/settings/AboutSectionForm.tsxapps/web/app/(app)/[emailAccountId]/assistant/settings/AboutSetting.tsxapps/web/app/(app)/[emailAccountId]/settings/DigestSettingsForm.tsx
**/*.{js,ts,jsx,tsx}
📄 CodeRabbit inference engine (.cursor/rules/utilities.mdc)
**/*.{js,ts,jsx,tsx}: Use lodash utilities for common operations (arrays, objects, strings)
Import specific lodash functions to minimize bundle size (e.g.,import groupBy from 'lodash/groupBy')
Files:
apps/web/app/(app)/[emailAccountId]/assistant/settings/DigestSetting.tsxapps/web/app/(app)/[emailAccountId]/settings/AboutSectionForm.tsxapps/web/app/(app)/[emailAccountId]/assistant/settings/AboutSetting.tsxapps/web/app/(app)/[emailAccountId]/settings/DigestSettingsForm.tsx
apps/web/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (apps/web/CLAUDE.md)
apps/web/**/*.{ts,tsx,js,jsx}: Use@/path aliases for imports from project root
Prefer self-documenting code over comments; use descriptive variable and function names instead of explaining intent with comments
Add helper functions to the bottom of files, not the top
All imports go at the top of files, no mid-file dynamic imports
Files:
apps/web/app/(app)/[emailAccountId]/assistant/settings/DigestSetting.tsxapps/web/app/(app)/[emailAccountId]/settings/AboutSectionForm.tsxapps/web/app/(app)/[emailAccountId]/assistant/settings/AboutSetting.tsxapps/web/app/(app)/[emailAccountId]/settings/DigestSettingsForm.tsx
apps/web/app/**/*.{ts,tsx}
📄 CodeRabbit inference engine (apps/web/CLAUDE.md)
Follow NextJS app router structure with (app) directory
Files:
apps/web/app/(app)/[emailAccountId]/assistant/settings/DigestSetting.tsxapps/web/app/(app)/[emailAccountId]/settings/AboutSectionForm.tsxapps/web/app/(app)/[emailAccountId]/assistant/settings/AboutSetting.tsxapps/web/app/(app)/[emailAccountId]/settings/DigestSettingsForm.tsx
apps/web/**/*.{tsx,jsx}
📄 CodeRabbit inference engine (apps/web/CLAUDE.md)
apps/web/**/*.{tsx,jsx}: Follow tailwindcss patterns with prettier-plugin-tailwindcss for class sorting
Prefer functional components with hooks in React
Use shadcn/ui components when available
Ensure responsive design with mobile-first approach in components
Follow consistent naming conventions using PascalCase for components
Use LoadingContent component for async data with loading and error states
Use React Hook Form with Zod validation for form handling
Useresult?.serverErrorwithtoastErrorandtoastSuccessfor error handling in forms
Files:
apps/web/app/(app)/[emailAccountId]/assistant/settings/DigestSetting.tsxapps/web/app/(app)/[emailAccountId]/settings/AboutSectionForm.tsxapps/web/app/(app)/[emailAccountId]/assistant/settings/AboutSetting.tsxapps/web/app/(app)/[emailAccountId]/settings/DigestSettingsForm.tsx
apps/web/**/*.{ts,tsx,js,jsx,json,css}
📄 CodeRabbit inference engine (apps/web/CLAUDE.md)
Format code with Prettier
Files:
apps/web/app/(app)/[emailAccountId]/assistant/settings/DigestSetting.tsxapps/web/app/(app)/[emailAccountId]/settings/AboutSectionForm.tsxapps/web/app/(app)/[emailAccountId]/assistant/settings/AboutSetting.tsxapps/web/app/(app)/[emailAccountId]/settings/DigestSettingsForm.tsx
**/*Form.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/form-handling.mdc)
**/*Form.{ts,tsx}: Use React Hook Form with Zod for validation in form components
Validate form inputs before submission
Show validation errors inline next to form fields
Files:
apps/web/app/(app)/[emailAccountId]/settings/AboutSectionForm.tsxapps/web/app/(app)/[emailAccountId]/settings/DigestSettingsForm.tsx
🧠 Learnings (10)
📚 Learning: 2025-07-17T04:19:57.099Z
Learnt from: edulelis
Repo: elie222/inbox-zero PR: 576
File: packages/resend/emails/digest.tsx:78-83
Timestamp: 2025-07-17T04:19:57.099Z
Learning: In packages/resend/emails/digest.tsx, the DigestEmailProps type uses `[key: string]: DigestItem[] | undefined | string | Date | undefined` instead of intersection types like `& Record<string, DigestItem[] | undefined>` due to implementation constraints. This was the initial implementation approach and cannot be changed to more restrictive typing.
Applied to files:
apps/web/app/(app)/[emailAccountId]/assistant/settings/DigestSetting.tsxapps/web/app/(app)/[emailAccountId]/settings/DigestSettingsForm.tsx
📚 Learning: 2025-11-25T14:38:56.992Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-11-25T14:38:56.992Z
Learning: Components with `onClick` handlers must be client components marked with the `use client` directive
Applied to files:
apps/web/app/(app)/[emailAccountId]/assistant/settings/DigestSetting.tsxapps/web/app/(app)/[emailAccountId]/assistant/settings/AboutSetting.tsx
📚 Learning: 2025-11-25T14:38:18.874Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: .cursor/rules/page-structure.mdc:0-0
Timestamp: 2025-11-25T14:38:18.874Z
Learning: Applies to apps/web/app/(app)/**/*.tsx : If you need to use `onClick` in a component, that component must be a client component and file must start with `use client` directive
Applied to files:
apps/web/app/(app)/[emailAccountId]/assistant/settings/DigestSetting.tsxapps/web/app/(app)/[emailAccountId]/assistant/settings/AboutSetting.tsx
📚 Learning: 2025-11-25T14:38:23.265Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: .cursor/rules/page-structure.mdc:0-0
Timestamp: 2025-11-25T14:38:23.265Z
Learning: Applies to apps/web/app/(app)/**/*.{ts,tsx} : If you need to use `onClick` in a component, that component is a client component and file must start with `use client`
Applied to files:
apps/web/app/(app)/[emailAccountId]/assistant/settings/DigestSetting.tsxapps/web/app/(app)/[emailAccountId]/assistant/settings/AboutSetting.tsx
📚 Learning: 2024-08-23T11:37:26.779Z
Learnt from: aryanprince
Repo: elie222/inbox-zero PR: 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`.
Applied to files:
apps/web/app/(app)/[emailAccountId]/assistant/settings/DigestSetting.tsxapps/web/app/(app)/[emailAccountId]/assistant/settings/AboutSetting.tsx
📚 Learning: 2025-11-25T14:37:09.306Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: .cursor/rules/fullstack-workflow.mdc:0-0
Timestamp: 2025-11-25T14:37:09.306Z
Learning: Applies to apps/web/components/**/*Form*.tsx : Handle form submission results using `result?.serverError` to show error toasts and `toastSuccess` to show success messages after server action completion
Applied to files:
apps/web/app/(app)/[emailAccountId]/settings/AboutSectionForm.tsxapps/web/app/(app)/[emailAccountId]/settings/DigestSettingsForm.tsx
📚 Learning: 2025-12-21T12:21:37.794Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: apps/web/CLAUDE.md:0-0
Timestamp: 2025-12-21T12:21:37.794Z
Learning: Applies to apps/web/**/*.{tsx,jsx} : Use `result?.serverError` with `toastError` and `toastSuccess` for error handling in forms
Applied to files:
apps/web/app/(app)/[emailAccountId]/settings/AboutSectionForm.tsx
📚 Learning: 2025-07-08T13:14:07.449Z
Learnt from: elie222
Repo: elie222/inbox-zero PR: 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.
Applied to files:
apps/web/app/(app)/[emailAccountId]/settings/AboutSectionForm.tsx
📚 Learning: 2025-12-21T12:21:37.794Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: apps/web/CLAUDE.md:0-0
Timestamp: 2025-12-21T12:21:37.794Z
Learning: Applies to apps/web/**/*.{tsx,jsx} : Use LoadingContent component for async data with loading and error states
Applied to files:
apps/web/app/(app)/[emailAccountId]/settings/AboutSectionForm.tsx
📚 Learning: 2025-11-25T14:36:40.146Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: .cursor/rules/data-fetching.mdc:0-0
Timestamp: 2025-11-25T14:36:40.146Z
Learning: Applies to **/*.{ts,tsx} : Use `result?.serverError` with `toastError` from `@/components/Toast` for error handling in async operations
Applied to files:
apps/web/app/(app)/[emailAccountId]/settings/AboutSectionForm.tsx
🧬 Code graph analysis (2)
apps/web/app/(app)/[emailAccountId]/settings/AboutSectionForm.tsx (1)
apps/web/components/LoadingContent.tsx (1)
LoadingContent(13-31)
apps/web/app/(app)/[emailAccountId]/assistant/settings/AboutSetting.tsx (2)
apps/web/components/SettingCard.tsx (1)
SettingCard(3-34)apps/web/app/(app)/[emailAccountId]/settings/AboutSectionForm.tsx (1)
AboutSection(42-58)
⏰ 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: Baz Reviewer
- GitHub Check: Macroscope - Correctness Check
🔇 Additional comments (3)
apps/web/app/(app)/[emailAccountId]/settings/AboutSectionForm.tsx (1)
42-87: LGTM! Clean implementation of optional success callback.The onSuccess callback pattern is well-implemented:
- Optional prop maintains backward compatibility
- Called after success toast but before mutation, allowing dialog closure
- Properly propagated through component hierarchy
apps/web/app/(app)/[emailAccountId]/assistant/settings/DigestSetting.tsx (1)
3-39: LGTM! Controlled dialog pattern correctly implemented.The conversion to a controlled dialog with success callback follows React best practices and aligns with the pattern used in AboutSetting.tsx.
apps/web/app/(app)/[emailAccountId]/assistant/settings/AboutSetting.tsx (1)
3-39: LGTM! Consistent controlled dialog implementation.The changes follow the same clean pattern as DigestSetting.tsx, converting to a controlled dialog with a success callback for proper state management.
| it("should handle legacy timezone abbreviations that TZDate supports", () => { | ||
| const result = formatTimeInUserTimezone(utcDate, "EST"); | ||
| // TZDate supports some legacy abbreviations like "EST" (UTC-5) | ||
| // 7 PM UTC = 2 PM EST | ||
| expect(result).toBe("2:00 PM"); | ||
| }); |
There was a problem hiding this comment.
TZDate only accepts canonical IANA zone names (per @date-fns/tz docs) or numeric offsets, not legacy abbreviations like "EST". Passing "EST" triggers the catch block, so formatTimeInUserTimezone falls back to UTC ("7:00 PM") instead of 2:00 PM, making this test fail and mismatching production behavior in environments where Intl rejects the shorthand.
| it("should handle legacy timezone abbreviations that TZDate supports", () => { | |
| const result = formatTimeInUserTimezone(utcDate, "EST"); | |
| // TZDate supports some legacy abbreviations like "EST" (UTC-5) | |
| // 7 PM UTC = 2 PM EST | |
| expect(result).toBe("2:00 PM"); | |
| }); |
Finding type: Logical Bugs
User description
Format meeting brief prompts and briefing emails in the user's timezone and make About/Digest settings dialogs close on successful save
Introduce timezone-aware formatting via
formatDateTimeInUserTimezoneandformatTimeInUserTimezonein prompt generation and email sending, and switch About/Digest settings dialogs to controlled components withonSuccess-driven close behavior.📍Where to Start
Start with
buildPromptin apps/web/utils/ai/meeting-briefs/generate-briefing.ts, then reviewformatMeetingForContextand the timezone utils in apps/web/utils/date.ts.📊 Macroscope summarized 3ea9607. 9 files reviewed, 3 issues evaluated, 3 issues filtered, 0 comments posted
🗂️ Filtered Issues
apps/web/app/(app)/[emailAccountId]/settings/DigestSettingsForm.tsx — 0 comments posted, 1 evaluated, 1 filtered
onSuccess?.()callback at line 227 will be called even whenexecuteItemsorexecuteSchedulefail. Theexecute()function fromuseAction(next-safe-action) does not throw on action errors—it handles them via theonErrorcallbacks instead. This meansPromise.all()will resolve successfully even when the underlying actions fail, causing the dialog to close andtoastSuccessto display alongside thetoastErrorfrom the individual action error handlers. [ Out of scope ]apps/web/utils/date.ts — 0 comments posted, 2 evaluated, 2 filtered
dateparameter passed toformatInUserTimezoneis an invalidDateobject (e.g.,new Date('invalid')), and ifTZDateorformatthrows for invalid dates, the fallback code at line 140-141 will fail with the same error since it uses the same invaliddate, causing an unhandled exception. [ Low confidence ]formatInUserTimezoneassumes all errors are timezone-related and attempts the sameformat()call with UTC. If the original error was caused by an invalidformatStringparameter, the fallbackformat(dateInUTC, formatString)on line 141 will also throw the same error, resulting in an unhandled exception escaping the function. [ Low confidence ]Generated description
Below is a concise technical summary of the changes proposed in this PR:
Implement timezone-aware date formatting across the application to ensure accurate display of event times in user-specific timezones within AI prompts and briefing emails. Refactor existing settings dialogs to operate as controlled components, enhancing UI state management and user experience, alongside minor visual updates to the onboarding flow.
AboutSettingandDigestSettingdialogs to be controlled components, passing anonSuccesscallback to their respective forms (AboutSectionForm,DigestSettingsForm) to manage dialog closure upon successful submission. Additionally, update theBriefsOnboardingcomponent by replacing an icon and adjusting styling for a minor visual enhancement.Modified files (5)
Latest Contributors(1)
date-fns-tzto correctly format event times based on the user's specified timezone. Integrate these utilities into the meeting brief generation process, ensuring that AI prompts and briefing emails display accurate local times, thereby resolving previous timezone discrepancies.Modified files (6)
Latest Contributors(1)