Conversation
…esh token is returned
|
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. 📝 WalkthroughWalkthroughA new Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Set Microsoft OAuth
|
There was a problem hiding this comment.
1 issue found across 6 files
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/components/ui/card.tsx">
<violation number="1" location="apps/web/components/ui/card.tsx:185">
P2: Wrapping `description` in a `<p>` tag may produce invalid HTML when `ReactNode` contains block-level elements. Consider using a `<div>` instead to safely accept any ReactNode, or document that only inline content should be passed.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
There was a problem hiding this comment.
Actionable comments posted: 1
Fix all issues with AI Agents 🤖
In @apps/web/components/ui/alert.tsx:
- Line 25: The deprecation note is incorrect because Alert (and its wrappers
AlertBasic, AlertWithButton, AlertError) are not compatible with ActionCard;
remove or revise the comment on Alert.tsx so it no longer claims ActionCard as a
drop-in replacement, and either (a) implement an ActionCard-compatible wrapper
that maps Alert variants (including "success") and optional icon/composition to
ActionCard's props (title/description and "green"/"blue"/"destructive" variants)
or (b) add a clear migration guide explaining the structural differences and
required refactor steps for AlertBasic/AlertWithButton/AlertError before marking
Alert deprecated.
🧹 Nitpick comments (1)
apps/web/components/ui/card.tsx (1)
161-172: Consider using a mapping object for better maintainability.The nested ternary operators work correctly, but a mapping object would improve scalability if more variants are added in the future.
🔎 Optional refactor using mapping objects
- const CardVariant = - variant === "blue" - ? CardBlue - : variant === "destructive" - ? CardRed - : CardGreen; - const iconColor = - variant === "blue" - ? "text-blue-600 dark:text-blue-400" - : variant === "destructive" - ? "text-red-600 dark:text-red-400" - : "text-green-600 dark:text-green-400"; + const variantConfig = { + green: { + Card: CardGreen, + iconColor: "text-green-600 dark:text-green-400", + }, + blue: { + Card: CardBlue, + iconColor: "text-blue-600 dark:text-blue-400", + }, + destructive: { + Card: CardRed, + iconColor: "text-red-600 dark:text-red-400", + }, + }; + const { Card: CardVariant, iconColor } = variantConfig[variant];
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
apps/web/app/(app)/[emailAccountId]/assistant/AllRulesDisabledBanner.tsxapps/web/app/(app)/[emailAccountId]/automation/page.tsxapps/web/app/(landing)/components/page.tsxapps/web/components/ui/alert.tsxapps/web/components/ui/card.tsxapps/web/utils/outlook/client.ts
🧰 Additional context used
📓 Path-based instructions (21)
**/*.{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/AllRulesDisabledBanner.tsxapps/web/components/ui/alert.tsxapps/web/utils/outlook/client.tsapps/web/components/ui/card.tsxapps/web/app/(landing)/components/page.tsxapps/web/app/(app)/[emailAccountId]/automation/page.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/AllRulesDisabledBanner.tsxapps/web/app/(app)/[emailAccountId]/automation/page.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/AllRulesDisabledBanner.tsxapps/web/components/ui/alert.tsxapps/web/utils/outlook/client.tsapps/web/components/ui/card.tsxapps/web/app/(landing)/components/page.tsxapps/web/app/(app)/[emailAccountId]/automation/page.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/AllRulesDisabledBanner.tsxapps/web/components/ui/alert.tsxapps/web/utils/outlook/client.tsapps/web/components/ui/card.tsxapps/web/app/(landing)/components/page.tsxapps/web/app/(app)/[emailAccountId]/automation/page.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/AllRulesDisabledBanner.tsxapps/web/components/ui/alert.tsxapps/web/utils/outlook/client.tsapps/web/components/ui/card.tsxapps/web/app/(landing)/components/page.tsxapps/web/app/(app)/[emailAccountId]/automation/page.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/AllRulesDisabledBanner.tsxapps/web/components/ui/alert.tsxapps/web/utils/outlook/client.tsapps/web/components/ui/card.tsxapps/web/app/(landing)/components/page.tsxapps/web/app/(app)/[emailAccountId]/automation/page.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/AllRulesDisabledBanner.tsxapps/web/components/ui/alert.tsxapps/web/components/ui/card.tsxapps/web/app/(landing)/components/page.tsxapps/web/app/(app)/[emailAccountId]/automation/page.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/AllRulesDisabledBanner.tsxapps/web/components/ui/alert.tsxapps/web/utils/outlook/client.tsapps/web/components/ui/card.tsxapps/web/app/(landing)/components/page.tsxapps/web/app/(app)/[emailAccountId]/automation/page.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/AllRulesDisabledBanner.tsxapps/web/components/ui/alert.tsxapps/web/components/ui/card.tsxapps/web/app/(landing)/components/page.tsxapps/web/app/(app)/[emailAccountId]/automation/page.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/AllRulesDisabledBanner.tsxapps/web/components/ui/alert.tsxapps/web/utils/outlook/client.tsapps/web/components/ui/card.tsxapps/web/app/(landing)/components/page.tsxapps/web/app/(app)/[emailAccountId]/automation/page.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/AllRulesDisabledBanner.tsxapps/web/components/ui/alert.tsxapps/web/utils/outlook/client.tsapps/web/components/ui/card.tsxapps/web/app/(landing)/components/page.tsxapps/web/app/(app)/[emailAccountId]/automation/page.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/AllRulesDisabledBanner.tsxapps/web/components/ui/alert.tsxapps/web/utils/outlook/client.tsapps/web/components/ui/card.tsxapps/web/app/(landing)/components/page.tsxapps/web/app/(app)/[emailAccountId]/automation/page.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/AllRulesDisabledBanner.tsxapps/web/app/(landing)/components/page.tsxapps/web/app/(app)/[emailAccountId]/automation/page.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/AllRulesDisabledBanner.tsxapps/web/components/ui/alert.tsxapps/web/components/ui/card.tsxapps/web/app/(landing)/components/page.tsxapps/web/app/(app)/[emailAccountId]/automation/page.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/AllRulesDisabledBanner.tsxapps/web/components/ui/alert.tsxapps/web/utils/outlook/client.tsapps/web/components/ui/card.tsxapps/web/app/(landing)/components/page.tsxapps/web/app/(app)/[emailAccountId]/automation/page.tsx
apps/web/components/**/*.tsx
📄 CodeRabbit inference engine (.cursor/rules/fullstack-workflow.mdc)
Use
LoadingContentcomponent to consistently handle loading and error states, passingloading,error, andchildrenpropsUse PascalCase for component file names (e.g.,
components/Button.tsx)
Files:
apps/web/components/ui/alert.tsxapps/web/components/ui/card.tsx
**/{pages,routes,components}/**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/gmail-api.mdc)
Never call Gmail API directly from routes or components - always use wrapper functions from the utils folder
Files:
apps/web/components/ui/alert.tsxapps/web/components/ui/card.tsxapps/web/app/(landing)/components/page.tsx
apps/web/components/ui/**/*.tsx
📄 CodeRabbit inference engine (.cursor/rules/project-structure.mdc)
Shadcn UI components are located in
components/uidirectory
Files:
apps/web/components/ui/alert.tsxapps/web/components/ui/card.tsx
**/*.ts
📄 CodeRabbit inference engine (.cursor/rules/security.mdc)
**/*.ts: ALL database queries MUST be scoped to the authenticated user/account by including user/account filtering in WHERE clauses to prevent unauthorized data access
Always validate that resources belong to the authenticated user before performing operations, using ownership checks in WHERE clauses or relationships
Always validate all input parameters for type, format, and length before using them in database queries
Use SafeError for error responses to prevent information disclosure. Generic error messages should not reveal internal IDs, logic, or resource ownership details
Only return necessary fields in API responses using Prisma'sselectoption. Never expose sensitive data such as password hashes, private keys, or system flags
Prevent Insecure Direct Object References (IDOR) by validating resource ownership before operations. AllfindUnique/findFirstcalls MUST include ownership filters
Prevent mass assignment vulnerabilities by explicitly whitelisting allowed fields in update operations instead of accepting all user-provided data
Prevent privilege escalation by never allowing users to modify system fields, ownership fields, or admin-only attributes through user input
AllfindManyqueries MUST be scoped to the user's data by including appropriate WHERE filters to prevent returning data from other users
Use Prisma relationships for access control by leveraging nested where clauses (e.g.,emailAccount: { id: emailAccountId }) to validate ownership
Files:
apps/web/utils/outlook/client.ts
**/{utils,helpers,lib}/**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/logging.mdc)
Logger should be passed as a parameter to helper functions instead of creating their own logger instances
Files:
apps/web/utils/outlook/client.ts
apps/web/**/*.{example,ts,json}
📄 CodeRabbit inference engine (apps/web/CLAUDE.md)
Add environment variables to
.env.example,env.ts, andturbo.json
Files:
apps/web/utils/outlook/client.ts
🧠 Learnings (11)
📚 Learning: 2025-12-17T02:38:41.499Z
Learnt from: elie222
Repo: elie222/inbox-zero PR: 1103
File: apps/web/utils/actions/rule.ts:447-457
Timestamp: 2025-12-17T02:38:41.499Z
Learning: In apps/web/utils/actions/rule.ts, revalidatePath is not needed for toggleAllRulesAction because rules data is fetched client-side using SWR, not server-side. Server-side cache revalidation is only needed when using Next.js server components or server-side data fetching.
Applied to files:
apps/web/app/(app)/[emailAccountId]/assistant/AllRulesDisabledBanner.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 shadcn/ui components when available
Applied to files:
apps/web/components/ui/alert.tsxapps/web/app/(landing)/components/page.tsxapps/web/app/(app)/[emailAccountId]/automation/page.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: Applies to apps/web/components/ui/**/*.tsx : Shadcn UI components are located in `components/ui` directory
Applied to files:
apps/web/components/ui/alert.tsxapps/web/app/(landing)/components/page.tsxapps/web/app/(app)/[emailAccountId]/automation/page.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} : Prefer functional components with hooks in React
Applied to files:
apps/web/components/ui/alert.tsx
📚 Learning: 2025-11-25T14:42:08.869Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2025-11-25T14:42:08.869Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Use semantic elements instead of role attributes in JSX
Applied to files:
apps/web/components/ui/alert.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: Applies to apps/web/app/(app)/*/page.tsx : Create new pages at `apps/web/app/(app)/PAGE_NAME/page.tsx` with components either colocated in the same folder or in `page.tsx`
Applied to files:
apps/web/app/(landing)/components/page.tsx
📚 Learning: 2025-11-25T14:40:15.063Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: .cursor/rules/ui-components.mdc:0-0
Timestamp: 2025-11-25T14:40:15.063Z
Learning: Applies to **/*.{tsx,ts} : Use Shadcn UI and Tailwind for components and styling
Applied to files:
apps/web/app/(landing)/components/page.tsx
📚 Learning: 2025-11-25T14:40:13.649Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: .cursor/rules/ui-components.mdc:0-0
Timestamp: 2025-11-25T14:40:13.649Z
Learning: Applies to **/*.{tsx,ts,jsx,js} : Use Shadcn UI and Tailwind for components and styling
Applied to files:
apps/web/app/(landing)/components/page.tsx
📚 Learning: 2025-11-25T14:36:36.276Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: .cursor/rules/data-fetching.mdc:0-0
Timestamp: 2025-11-25T14:36:36.276Z
Learning: Applies to **/*.{ts,tsx} : Import error and success toast utilities from '@/components/Toast' for displaying notifications
Applied to files:
apps/web/app/(landing)/components/page.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/**/*.tsx : Use `LoadingContent` component to consistently handle loading and error states, passing `loading`, `error`, and `children` props
Applied to files:
apps/web/app/(landing)/components/page.tsx
📚 Learning: 2025-11-25T14:38:07.606Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: .cursor/rules/llm.mdc:0-0
Timestamp: 2025-11-25T14:38:07.606Z
Learning: Applies to apps/web/utils/ai/**/*.ts : LLM feature functions must import from `zod` for schema validation, use `createScopedLogger` from `@/utils/logger`, `chatCompletionObject` and `createGenerateObject` from `@/utils/llms`, and import `EmailAccountWithAI` type from `@/utils/llms/types`
Applied to files:
apps/web/app/(app)/[emailAccountId]/automation/page.tsx
🧬 Code graph analysis (1)
apps/web/app/(app)/[emailAccountId]/assistant/AllRulesDisabledBanner.tsx (4)
apps/web/providers/EmailAccountProvider.tsx (1)
useAccount(79-89)apps/web/components/ui/card.tsx (1)
ActionCard(209-209)apps/web/utils/path.ts (1)
prefixPath(1-4)apps/web/app/(app)/[emailAccountId]/onboarding/steps.ts (2)
getStepNumber(23-28)STEP_KEYS(1-10)
⏰ 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). (3)
- GitHub Check: cubic · AI code reviewer
- GitHub Check: Baz Reviewer
- GitHub Check: test
🔇 Additional comments (9)
apps/web/app/(landing)/components/page.tsx (1)
76-97: LGTM! Good demonstration of ActionCard variants.The ActionCard usage correctly demonstrates all three variants (green, blue, destructive) with consistent props structure. This effectively showcases the new variant API for developers.
apps/web/components/ui/card.tsx (3)
109-122: LGTM! CardBlue follows the established pattern.The implementation is consistent with CardGreen, using appropriate blue color schemes for both light and dark modes.
124-137: LGTM! CardRed follows the established pattern.The implementation is consistent with CardGreen and CardBlue, using appropriate red color schemes for destructive actions in both light and dark modes.
139-196: LGTM! ActionCard refactor correctly implements variant support.The refactored ActionCard properly supports the three variants (green, blue, destructive) with appropriate card components and icon colors. The type change for
descriptionfromstringtostring | React.ReactNodeis a backward-compatible widening that adds flexibility.apps/web/app/(app)/[emailAccountId]/automation/page.tsx (1)
18-18: LGTM! Clean integration of the AllRulesDisabledBanner component.The banner is correctly imported and positioned prominently between the page header and tab navigation, making it highly visible when all rules are disabled. The component handles its own loading states and conditional rendering internally.
Also applies to: 108-108
apps/web/app/(app)/[emailAccountId]/assistant/AllRulesDisabledBanner.tsx (3)
1-14: LGTM! Imports are well-organized and follow project conventions.The component correctly uses the
"use client"directive and imports follow the project's path alias conventions.
15-24: Component logic correctly handles the "all rules disabled" state.The logic at Line 22 specifically checks for
rules.length > 0 && rules.every((rule) => !rule.enabled), which means the banner will only appear when:
- Rules exist (length > 0)
- All existing rules are disabled
This is the expected behavior—users with zero rules won't see this banner (they'll see other onboarding flows). The early returns efficiently prevent unnecessary rendering.
26-46: Theforce=trueparameter is properly handled in the onboarding flow.The ActionCard rendering correctly uses
force=trueto bypass the briefmymeeting redirect in the onboarding page. The parameter is defined in searchParams and used to skip the redirect condition when set, allowing normal onboarding to proceed. Navigation to the LABELS step is appropriate for rule configuration.apps/web/utils/outlook/client.ts (1)
247-247: Clarify that the prompt parameter controls user interaction, not refresh token issuance.The change to
"select_account consent"does force the consent screen to display, creating a UX trade-off where users see the consent screen on every authentication attempt. However, this prompt parameter does not ensure refresh token issuance. Refresh tokens are only issued when using flows that support them (e.g., Authorization Code) and when theoffline_accessscope is explicitly requested. The prompt value affects user interaction, not token issuance mechanism.Likely an incorrect or invalid review comment.
| export function AllRulesDisabledBanner() { | ||
| const { data: rules, isLoading } = useRules(); | ||
| const { emailAccountId } = useAccount(); | ||
|
|
||
| if (isLoading || !rules) return null; | ||
|
|
||
| const allRulesDisabled = | ||
| rules.length > 0 && rules.every((rule) => !rule.enabled); | ||
|
|
||
| if (!allRulesDisabled) return null; |
There was a problem hiding this comment.
AllRulesDisabledBanner now returns null while useRules is loading or when the API error prevents data from resolving, so there is no LoadingContent wrapper or error feedback. Per apps/web/CLAUDE.md (Loading & Error States), components that rely on SWR must surface explicit loading/error states via LoadingContent instead of silently hiding the UI, meaning users see nothing if the rules fetch fails.
Prompt for AI Agents:
In apps/web/app/(app)/[emailAccountId]/assistant/AllRulesDisabledBanner.tsx around lines
15-24, the AllRulesDisabledBanner component currently returns null when useRules is
loading or when rules failed to resolve, which silently hides the UI. Import and use the
shared LoadingContent component (or the app's standard loading/error UI) and refactor
the early-return logic: show LoadingContent while isLoading, show a LoadingContent or
explicit error message when !isLoading and rules is null/undefined (indicating a fetch
error), and only continue with the existing allRulesDisabled check/render when rules is
a resolved array. Ensure to preserve the existing behavior once rules are available.
Finding type: AI Coding Guidelines
User description
outlook: Force consent prompt for Microsoft OAuth
Ensures Microsoft returns a refresh token on re-authentication by combining select_account and consent prompts.
Generated description
Below is a concise technical summary of the changes proposed in this PR:
Modifies the
getLinkingOAuth2Urlfunction to include aconsentprompt, ensuring Microsoft returns a refresh token during re-authentication for Outlook users. This resolves issues where users re-authenticating after password changes would not receive a new refresh token.Latest Contributors(2)