Add step to onboarding that we processed the last 20 emails#1030
Add step to onboarding that we processed the last 20 emails#1030
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. 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. WalkthroughAdds a new "Inbox Processed" onboarding step component, wires it into the onboarding step map and order, introduces ONBOARDING_PROCESS_EMAILS_COUNT = 20, and uses that constant when scheduling bulk inbox processing during onboarding and rule creation. Version bumped and an env var removed from docker-compose. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
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 |
Add an 'inboxProcessed' onboarding step in OnboardingContent.tsx that confirms processing the last 20 emailsAdd 📍Where to StartStart with Macroscope summarized 478f494. |
There was a problem hiding this comment.
This PR is being reviewed by Cursor Bugbot
Details
You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
apps/web/utils/actions/rule.ts
Outdated
| logger, | ||
| }), | ||
| ); | ||
| } |
There was a problem hiding this comment.
Bug: Bulk email processing runs on every rule creation
The bulkProcessInboxEmails call was added to createRuleAction, which is the general action for creating rules from the automation/rules UI. This means 20 emails will be processed every time any user creates a rule, not just during onboarding. The createRulesOnboardingAction already contains this bulk processing logic for onboarding. Based on the PR title, this processing was intended only for the onboarding flow, but placing it in createRuleAction causes it to run for all rule creations.
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
apps/web/app/(app)/[emailAccountId]/onboarding/OnboardingContent.tsx(2 hunks)apps/web/app/(app)/[emailAccountId]/onboarding/StepInboxProcessed.tsx(1 hunks)apps/web/app/(app)/[emailAccountId]/onboarding/steps.ts(2 hunks)apps/web/utils/actions/rule.ts(4 hunks)apps/web/utils/config.ts(1 hunks)version.txt(1 hunks)
🧰 Additional context used
📓 Path-based instructions (17)
apps/web/**/*.{ts,tsx}
📄 CodeRabbit inference engine (apps/web/CLAUDE.md)
apps/web/**/*.{ts,tsx}: Use TypeScript with strict null checks
Use@/path aliases for imports from project root
Use proper error handling with try/catch blocks
Format code with Prettier
Follow consistent naming conventions using PascalCase for components
Centralize shared types in dedicated type filesImport specific lodash functions rather than entire lodash library to minimize bundle size (e.g.,
import groupBy from 'lodash/groupBy')
Files:
apps/web/app/(app)/[emailAccountId]/onboarding/StepInboxProcessed.tsxapps/web/app/(app)/[emailAccountId]/onboarding/steps.tsapps/web/utils/config.tsapps/web/app/(app)/[emailAccountId]/onboarding/OnboardingContent.tsxapps/web/utils/actions/rule.ts
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]/onboarding/StepInboxProcessed.tsxapps/web/app/(app)/[emailAccountId]/onboarding/steps.tsapps/web/app/(app)/[emailAccountId]/onboarding/OnboardingContent.tsx
apps/web/**/*.tsx
📄 CodeRabbit inference engine (apps/web/CLAUDE.md)
apps/web/**/*.tsx: Follow tailwindcss patterns with prettier-plugin-tailwindcss for class sorting
Prefer functional components with hooks over class components
Use shadcn/ui components when available
Ensure responsive design with mobile-first approach
Use LoadingContent component for async data with loading and error states
Files:
apps/web/app/(app)/[emailAccountId]/onboarding/StepInboxProcessed.tsxapps/web/app/(app)/[emailAccountId]/onboarding/OnboardingContent.tsx
**/*.{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]/onboarding/StepInboxProcessed.tsxapps/web/app/(app)/[emailAccountId]/onboarding/steps.tsapps/web/utils/config.tsapps/web/app/(app)/[emailAccountId]/onboarding/OnboardingContent.tsxapps/web/utils/actions/rule.ts
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]/onboarding/StepInboxProcessed.tsxapps/web/app/(app)/[emailAccountId]/onboarding/steps.tsapps/web/app/(app)/[emailAccountId]/onboarding/OnboardingContent.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]/onboarding/StepInboxProcessed.tsxapps/web/app/(app)/[emailAccountId]/onboarding/steps.tsapps/web/utils/config.tsapps/web/app/(app)/[emailAccountId]/onboarding/OnboardingContent.tsxapps/web/utils/actions/rule.ts
**/*.{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]/onboarding/StepInboxProcessed.tsxapps/web/app/(app)/[emailAccountId]/onboarding/steps.tsapps/web/utils/config.tsapps/web/app/(app)/[emailAccountId]/onboarding/OnboardingContent.tsxapps/web/utils/actions/rule.ts
**/*.{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]/onboarding/StepInboxProcessed.tsxapps/web/app/(app)/[emailAccountId]/onboarding/steps.tsapps/web/utils/config.tsapps/web/app/(app)/[emailAccountId]/onboarding/OnboardingContent.tsxapps/web/utils/actions/rule.ts
**/*.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]/onboarding/StepInboxProcessed.tsxapps/web/app/(app)/[emailAccountId]/onboarding/OnboardingContent.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]/onboarding/StepInboxProcessed.tsxapps/web/app/(app)/[emailAccountId]/onboarding/steps.tsapps/web/utils/config.tsapps/web/app/(app)/[emailAccountId]/onboarding/OnboardingContent.tsxapps/web/utils/actions/rule.ts
**/*.{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]/onboarding/StepInboxProcessed.tsxapps/web/app/(app)/[emailAccountId]/onboarding/OnboardingContent.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]/onboarding/StepInboxProcessed.tsxapps/web/app/(app)/[emailAccountId]/onboarding/steps.tsapps/web/utils/config.tsversion.txtapps/web/app/(app)/[emailAccountId]/onboarding/OnboardingContent.tsxapps/web/utils/actions/rule.ts
**/*.{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]/onboarding/StepInboxProcessed.tsxapps/web/app/(app)/[emailAccountId]/onboarding/steps.tsapps/web/utils/config.tsapps/web/app/(app)/[emailAccountId]/onboarding/OnboardingContent.tsxapps/web/utils/actions/rule.ts
**/*.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/app/(app)/[emailAccountId]/onboarding/steps.tsapps/web/utils/config.tsapps/web/utils/actions/rule.ts
**/{server,api,actions,utils}/**/*.ts
📄 CodeRabbit inference engine (.cursor/rules/logging.mdc)
**/{server,api,actions,utils}/**/*.ts: UsecreateScopedLoggerfrom "@/utils/logger" for logging in backend code
Add thecreateScopedLoggerinstantiation at the top of the file with an appropriate scope name
Use.with()method to attach context variables only within specific functions, not on global loggers
For large functions with reused variables, usecreateScopedLogger().with()to attach context once and reuse the logger without passing variables repeatedly
Files:
apps/web/utils/config.tsapps/web/utils/actions/rule.ts
apps/web/utils/actions/**/*.ts
📄 CodeRabbit inference engine (apps/web/CLAUDE.md)
apps/web/utils/actions/**/*.ts: Usenext-safe-actionwithactionClientfor server actions with Zod schema validation
CallrevalidatePathin server actions after mutations to invalidate cache
apps/web/utils/actions/**/*.ts: Server actions must be located inapps/web/utils/actionsfolder
Server action files must start withuse serverdirective
Files:
apps/web/utils/actions/rule.ts
apps/web/utils/actions/*.ts
📄 CodeRabbit inference engine (.cursor/rules/fullstack-workflow.mdc)
apps/web/utils/actions/*.ts: Usenext-safe-actionwith Zod schemas for all server actions (create/update/delete mutations), storing validation schemas inapps/web/utils/actions/*.validation.ts
Server actions should use 'use server' directive and automatically receive authentication context (emailAccountId) from theactionClient
apps/web/utils/actions/*.ts: Create corresponding server action implementation files using the naming conventionapps/web/utils/actions/NAME.tswith 'use server' directive
Use 'use server' directive at the top of server action implementation files
Implement all server actions using thenext-safe-actionlibrary with actionClient, actionClientUser, or adminActionClient for type safety and validation
UseactionClientUserwhen only authenticated user context (userId) is needed
UseactionClientwhen both authenticated user context and a specific emailAccountId are needed, with emailAccountId bound when calling from the client
UseadminActionClientfor actions restricted to admin users
Add metadata with a meaningful action name using.metadata({ name: "actionName" })for Sentry instrumentation and monitoring
Use.schema()method with Zod validation schemas from corresponding.validation.tsfiles in next-safe-action configuration
Access context (userId, emailAccountId, etc.) via thectxobject parameter in the.action()handler
UserevalidatePathorrevalidateTagfrom 'next/cache' within server action handlers when mutations modify data displayed elsewhere
Files:
apps/web/utils/actions/rule.ts
🧠 Learnings (24)
📓 Common learnings
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.
📚 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]/onboarding/StepInboxProcessed.tsxapps/web/utils/config.tsapps/web/app/(app)/[emailAccountId]/onboarding/OnboardingContent.tsxapps/web/utils/actions/rule.ts
📚 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: Organize fullstack features following the structure: GET API route in `app/api/user/[feature]/route.ts`, validation schema in `utils/actions/[feature].validation.ts`, server actions in `utils/actions/[feature].ts`, SWR hook in `hooks/use[Feature]s.ts`, and form component in `components/[Feature]Form.tsx`
Applied to files:
apps/web/app/(app)/[emailAccountId]/onboarding/OnboardingContent.tsx
📚 Learning: 2025-11-25T14:40:00.833Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-11-25T14:40:00.833Z
Learning: Applies to **/*.test.{ts,tsx} : Use test helpers `getEmail`, `getEmailAccount`, and `getRule` from `@/__tests__/helpers` for mocking emails, accounts, and rules
Applied to files:
apps/web/app/(app)/[emailAccountId]/onboarding/OnboardingContent.tsxapps/web/utils/actions/rule.ts
📚 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]/onboarding/OnboardingContent.tsxapps/web/utils/actions/rule.ts
📚 Learning: 2025-11-25T14:39:27.909Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: .cursor/rules/security.mdc:0-0
Timestamp: 2025-11-25T14:39:27.909Z
Learning: Applies to **/app/api/**/*.ts : Use `withEmailAccount` middleware for operations scoped to a specific email account, including reading/writing emails, rules, schedules, or any operation using `emailAccountId`
Applied to files:
apps/web/utils/actions/rule.ts
📚 Learning: 2025-11-25T14:39:23.326Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: .cursor/rules/security.mdc:0-0
Timestamp: 2025-11-25T14:39:23.326Z
Learning: Applies to app/api/**/*.ts : Use `withEmailAccount` middleware for operations scoped to a specific email account (reading/writing emails, rules, schedules, etc.) - provides `emailAccountId`, `userId`, and `email` in `request.auth`
Applied to files:
apps/web/utils/actions/rule.ts
📚 Learning: 2025-11-25T14:37:56.430Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: .cursor/rules/llm-test.mdc:0-0
Timestamp: 2025-11-25T14:37:56.430Z
Learning: Applies to apps/web/__tests__/**/*.test.ts : Prefer using existing helpers from `@/__tests__/helpers.ts` (`getEmailAccount`, `getEmail`, `getRule`, `getMockMessage`, `getMockExecutedRule`) instead of creating custom test data helpers
Applied to files:
apps/web/utils/actions/rule.ts
📚 Learning: 2025-11-25T14:39:49.448Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: .cursor/rules/server-actions.mdc:0-0
Timestamp: 2025-11-25T14:39:49.448Z
Learning: Applies to apps/web/utils/actions/*.ts : Use `revalidatePath` or `revalidateTag` from 'next/cache' within server action handlers when mutations modify data displayed elsewhere
Applied to files:
apps/web/utils/actions/rule.ts
📚 Learning: 2025-11-25T14:36:18.416Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: apps/web/CLAUDE.md:0-0
Timestamp: 2025-11-25T14:36:18.416Z
Learning: Applies to apps/web/utils/actions/**/*.ts : Call `revalidatePath` in server actions after mutations to invalidate cache
Applied to files:
apps/web/utils/actions/rule.ts
📚 Learning: 2025-11-25T14:42:11.919Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-25T14:42:11.919Z
Learning: Applies to utils/**/*.{js,ts,jsx,tsx} : The `utils` folder contains core app logic such as Next.js Server Actions and Gmail API requests
Applied to files:
apps/web/utils/actions/rule.ts
📚 Learning: 2025-11-25T14:42:16.602Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-25T14:42:16.602Z
Learning: The `utils` folder contains core app logic such as Next.js Server Actions and Gmail API requests
Applied to files:
apps/web/utils/actions/rule.ts
📚 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 **/*{.action,.server}.{ts,tsx} : For mutating data, use Next.js server actions
Applied to files:
apps/web/utils/actions/rule.ts
📚 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/utils/actions/*.ts : Server actions should use 'use server' directive and automatically receive authentication context (`emailAccountId`) from the `actionClient`
Applied to files:
apps/web/utils/actions/rule.ts
📚 Learning: 2025-11-25T14:39:49.448Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: .cursor/rules/server-actions.mdc:0-0
Timestamp: 2025-11-25T14:39:49.448Z
Learning: Applies to apps/web/utils/actions/*.ts : Use 'use server' directive at the top of server action implementation files
Applied to files:
apps/web/utils/actions/rule.ts
📚 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: For mutating data, use Next.js server actions instead of SWR
Applied to files:
apps/web/utils/actions/rule.ts
📚 Learning: 2025-11-25T14:37:22.660Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: .cursor/rules/gmail-api.mdc:0-0
Timestamp: 2025-11-25T14:37:22.660Z
Learning: Applies to **/*.{ts,tsx} : Use wrapper functions for Gmail label operations from @/utils/gmail/label.ts instead of direct API calls
Applied to files:
apps/web/utils/actions/rule.ts
📚 Learning: 2025-11-25T14:37:22.660Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: .cursor/rules/gmail-api.mdc:0-0
Timestamp: 2025-11-25T14:37:22.660Z
Learning: Applies to apps/web/utils/gmail/**/*.{ts,tsx} : Always use wrapper functions from @/utils/gmail/ for Gmail API operations instead of direct provider API calls
Applied to files:
apps/web/utils/actions/rule.ts
📚 Learning: 2025-11-25T14:38:08.183Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: .cursor/rules/logging.mdc:0-0
Timestamp: 2025-11-25T14:38:08.183Z
Learning: Applies to **/{server,api,actions,utils}/**/*.ts : Use `createScopedLogger` from "@/utils/logger" for logging in backend code
Applied to files:
apps/web/utils/actions/rule.ts
📚 Learning: 2025-11-25T14:37:22.660Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: .cursor/rules/gmail-api.mdc:0-0
Timestamp: 2025-11-25T14:37:22.660Z
Learning: Applies to apps/web/utils/gmail/**/*.{ts,tsx} : Keep Gmail provider-specific implementation details isolated within the apps/web/utils/gmail/ directory
Applied to files:
apps/web/utils/actions/rule.ts
📚 Learning: 2025-11-25T14:37:22.660Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: .cursor/rules/gmail-api.mdc:0-0
Timestamp: 2025-11-25T14:37:22.660Z
Learning: Design Gmail wrapper functions to be provider-agnostic to support future email providers like Outlook and ProtonMail
Applied to files:
apps/web/utils/actions/rule.ts
📚 Learning: 2025-11-25T14:38:08.183Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: .cursor/rules/logging.mdc:0-0
Timestamp: 2025-11-25T14:38:08.183Z
Learning: Applies to **/{server,api,actions,utils}/**/*.ts : Add the `createScopedLogger` instantiation at the top of the file with an appropriate scope name
Applied to files:
apps/web/utils/actions/rule.ts
📚 Learning: 2025-11-25T14:37:22.660Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: .cursor/rules/gmail-api.mdc:0-0
Timestamp: 2025-11-25T14:37:22.660Z
Learning: Applies to **/*.{ts,tsx} : Use wrapper functions for Gmail message operations (get, list, batch, etc.) from @/utils/gmail/message.ts instead of direct API calls
Applied to files:
apps/web/utils/actions/rule.ts
📚 Learning: 2025-11-25T14:37:22.660Z
Learnt from: CR
Repo: elie222/inbox-zero PR: 0
File: .cursor/rules/gmail-api.mdc:0-0
Timestamp: 2025-11-25T14:37:22.660Z
Learning: Applies to **/*.{ts,tsx} : Use wrapper functions for Gmail thread operations from @/utils/gmail/thread.ts instead of direct API calls
Applied to files:
apps/web/utils/actions/rule.ts
🧬 Code graph analysis (2)
apps/web/app/(app)/[emailAccountId]/onboarding/StepInboxProcessed.tsx (7)
apps/web/components/PremiumAlert.tsx (1)
usePremium(15-54)apps/web/app/(app)/[emailAccountId]/onboarding/OnboardingWrapper.tsx (1)
OnboardingWrapper(3-22)apps/web/app/(app)/[emailAccountId]/onboarding/IconCircle.tsx (1)
IconCircle(82-99)apps/web/components/Typography.tsx (1)
TypographyP(129-129)apps/web/utils/config.ts (1)
ONBOARDING_PROCESS_EMAILS_COUNT(28-28)apps/web/utils/premium/index.ts (1)
isPremium(16-26)apps/web/app/(app)/[emailAccountId]/onboarding/ContinueButton.tsx (1)
ContinueButton(4-10)
apps/web/app/(app)/[emailAccountId]/onboarding/OnboardingContent.tsx (2)
apps/web/app/(app)/[emailAccountId]/onboarding/steps.ts (1)
STEP_KEYS(1-10)apps/web/app/(app)/[emailAccountId]/onboarding/StepInboxProcessed.tsx (1)
StepInboxProcessed(9-38)
⏰ 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). (5)
- GitHub Check: cubic · AI code reviewer
- GitHub Check: Jit Security
- GitHub Check: Cursor Bugbot
- GitHub Check: test
- GitHub Check: Review for correctness
🔇 Additional comments (6)
version.txt (1)
1-1: Version bump is self-contained and fineThe version update to
v2.21.8is isolated and consistent; no issues from a code perspective.apps/web/utils/config.ts (1)
26-28: Config constant for onboarding email count looks goodExporting
ONBOARDING_PROCESS_EMAILS_COUNT = 20is a clean way to share this limit between UI copy and backend processing; no changes needed.apps/web/app/(app)/[emailAccountId]/onboarding/steps.ts (1)
9-9: INBOX_PROCESSED step key integrates correctly into the flowAdding
STEP_KEYS.INBOX_PROCESSEDand inserting it afterCUSTOM_RULESinSTEP_ORDERkeepsgetStepNumbersemantics intact and aligns with the new onboarding step wiring.Also applies to: 20-21
apps/web/app/(app)/[emailAccountId]/onboarding/StepInboxProcessed.tsx (1)
1-38: StepInboxProcessed component matches the new onboarding UXThe component cleanly uses
ONBOARDING_PROCESS_EMAILS_COUNT,usePremium, and existing onboarding primitives to present the “Inbox Preview Ready” step, with copy consistent with the backend behavior (limited count,skipArchive: true). No changes required.apps/web/utils/actions/rule.ts (1)
91-104: Background bulk inbox processing is wired sensibly; please confirm provider behaviorScheduling
bulkProcessInboxEmailsviaafter()in bothcreateRuleAction(when an AI-enabled email account exists) andcreateRulesOnboardingAction, withmaxEmails: ONBOARDING_PROCESS_EMAILS_COUNTandskipArchive: true, aligns the backend behavior with the new onboarding step copy and keeps the work off the main request path. This looks good.One thing to double‑check: given earlier constraints around Gmail-specific onboarding flows, please confirm that
bulkProcessInboxEmailseither supports all providers you run onboarding for or is appropriately gated/fails safely for non-Google accounts so users don’t see the “processed last N emails” step when nothing can be processed.Based on learnings, please verify provider compatibility for this background processing and the corresponding onboarding step.
Also applies to: 430-437
apps/web/app/(app)/[emailAccountId]/onboarding/OnboardingContent.tsx (1)
13-13: New StepInboxProcessed is correctly integrated into the onboarding flowImporting
StepInboxProcessedand adding it tostepMapunderSTEP_KEYS.INBOX_PROCESSEDensures the new step participates in the existingSTEP_ORDER-driven progression without changing the surrounding navigation or completion logic.Also applies to: 69-70
There was a problem hiding this comment.
❌ The following Jit checks failed to run:
- secret-detection
- static-code-analysis-js
#jit_bypass_commit in this PR to bypass, Jit Admin privileges required.
More info in the Jit platform.
There was a problem hiding this comment.
1 issue found across 6 files
Prompt for AI agents (all 1 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]/onboarding/StepInboxProcessed.tsx">
<violation number="1" location="apps/web/app/(app)/[emailAccountId]/onboarding/StepInboxProcessed.tsx:1">
Add the missing "use client" directive before the imports so this hook-using component is treated as a client component; otherwise Next.js will throw when rendering it.</violation>
</file>
Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR
| @@ -0,0 +1,38 @@ | |||
| import { CheckCheckIcon } from "lucide-react"; | |||
There was a problem hiding this comment.
Add the missing "use client" directive before the imports so this hook-using component is treated as a client component; otherwise Next.js will throw when rendering it.
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]/onboarding/StepInboxProcessed.tsx, line 1:
<comment>Add the missing "use client" directive before the imports so this hook-using component is treated as a client component; otherwise Next.js will throw when rendering it.</comment>
<file context>
@@ -0,0 +1,38 @@
+import { CheckCheckIcon } from "lucide-react";
+import { PageHeading, TypographyP } from "@/components/Typography";
+import { IconCircle } from "@/app/(app)/[emailAccountId]/onboarding/IconCircle";
</file context>
| @@ -0,0 +1,38 @@ | |||
| import { CheckCheckIcon } from "lucide-react"; | |||
There was a problem hiding this comment.
StepInboxProcessed uses usePremium() (SWR client hook) but the file lacks the "use client" directive. Consider adding it as the first line so this renders as a Client Component and avoids the runtime error.
+"use client";
🚀 Reply to ask Macroscope to explain or update this suggestion.
👍 Helpful? React to give us feedback.
There was a problem hiding this comment.
❌ The following Jit checks failed to run:
- secret-detection
- static-code-analysis-js
#jit_bypass_commit in this PR to bypass, Jit Admin privileges required.
More info in the Jit platform.
Note
Adds an onboarding step showing inbox preview completion and triggers bulk processing of the last 20 emails using a shared config constant.
StepInboxProcessedcomponent to show inbox preview completion and prompt continue.OnboardingContent.tsxandsteps.ts(addedSTEP_KEYS.INBOX_PROCESSEDtoSTEP_ORDER).createRuleActionandcreateRulesOnboardingAction, callbulkProcessInboxEmailswithskipArchive: trueandmaxEmailsfromONBOARDING_PROCESS_EMAILS_COUNT.ONBOARDING_PROCESS_EMAILS_COUNT = 20inutils/configand replace hardcoded usages.Written by Cursor Bugbot for commit 0ede5c0. Configure here.
Summary by CodeRabbit
New Features
Chores
✏️ Tip: You can customize this high-level summary in your review settings.