Skip to content

Add step to onboarding that we processed the last 20 emails#1030

Merged
elie222 merged 2 commits intomainfrom
feat/processed-emails-step
Nov 28, 2025
Merged

Add step to onboarding that we processed the last 20 emails#1030
elie222 merged 2 commits intomainfrom
feat/processed-emails-step

Conversation

@elie222
Copy link
Copy Markdown
Owner

@elie222 elie222 commented Nov 28, 2025

Note

Adds an onboarding step showing inbox preview completion and triggers bulk processing of the last 20 emails using a shared config constant.

  • Onboarding (Frontend)
    • Add StepInboxProcessed component to show inbox preview completion and prompt continue.
    • Integrate new step into OnboardingContent.tsx and steps.ts (added STEP_KEYS.INBOX_PROCESSED to STEP_ORDER).
  • Rules/Processing (Backend)
    • After createRuleAction and createRulesOnboardingAction, call bulkProcessInboxEmails with skipArchive: true and maxEmails from ONBOARDING_PROCESS_EMAILS_COUNT.
  • Config
    • Introduce ONBOARDING_PROCESS_EMAILS_COUNT = 20 in utils/config and replace hardcoded usages.

Written by Cursor Bugbot for commit 0ede5c0. Configure here.

Summary by CodeRabbit

  • New Features

    • Added an "Inbox Preview Ready" onboarding step showing processed inbox email count
    • Shows an upgrade prompt for non‑premium users during this step
    • Onboarding now processes emails to populate the inbox preview
  • Chores

    • Version bumped to v2.21.8

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link
Copy Markdown

vercel bot commented Nov 28, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
inbox-zero Ready Ready Preview Nov 28, 2025 2:33pm

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Nov 28, 2025

Caution

Review failed

The pull request is closed.

Note

Other AI code review bot(s) detected

CodeRabbit 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.

Walkthrough

Adds 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

Cohort / File(s) Summary
Onboarding step system
apps/web/app/(app)/[emailAccountId]/onboarding/steps.ts
Added INBOX_PROCESSED to STEP_KEYS and inserted it into STEP_ORDER after CUSTOM_RULES.
Onboarding UI component
apps/web/app/(app)/[emailAccountId]/onboarding/StepInboxProcessed.tsx
New React component rendering "Inbox Preview Ready" with processed-email count, premium conditional copy, and a continue button that calls onNext.
Onboarding flow wiring
apps/web/app/(app)/[emailAccountId]/onboarding/OnboardingContent.tsx
Imported StepInboxProcessed and added a STEP_KEYS.INBOX_PROCESSED entry to the stepMap to render the new step.
Email processing logic
apps/web/utils/actions/rule.ts
Replaced hard-coded 20 with ONBOARDING_PROCESS_EMAILS_COUNT when calling bulk inbox processing; schedules bulk processing during rule creation/onboarding.
Configuration
apps/web/utils/config.ts
Added export const ONBOARDING_PROCESS_EMAILS_COUNT = 20;.
Infrastructure / config
docker-compose.yml
Removed SRH_TOKEN environment variable from serverless-redis-http service.
Release
version.txt
Bumped version from v2.21.7 to v2.21.8.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Inspect createRulesOnboardingAction in apps/web/utils/actions/rule.ts to confirm bulkProcessInboxEmails params (maxEmails, skipArchive) and scheduling behavior.
  • Verify UI text and premium-conditional rendering in StepInboxProcessed.tsx (uses usePremium()).
  • Confirm STEP_ORDER positioning and that onboarding navigation renders the new step correctly in OnboardingContent.tsx.
  • Quick check: docker-compose env removal has no downstream impact.

Possibly related PRs

Poem

🐰
I hopped through steps with ears held high,
Twenty mails glanced by my eye.
A checked circle nods, “All set, proceed,”
Onboarding finished — one small speed.
Inbox preview done — happy hopper deed! 🥕📬

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding a new onboarding step that displays information about processing the last 20 emails, which is implemented across the StepInboxProcessed component and supporting configuration changes.

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0ede5c0 and 478f494.

📒 Files selected for processing (2)
  • apps/web/utils/actions/rule.ts (2 hunks)
  • docker-compose.yml (0 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp bot commented Nov 28, 2025

Add an 'inboxProcessed' onboarding step in OnboardingContent.tsx that confirms processing the last 20 emails

Add STEP_KEYS.INBOX_PROCESSED to the onboarding flow and render StepInboxProcessed with conditional premium messaging; centralize the 20-email count via ONBOARDING_PROCESS_EMAILS_COUNT used by actions.rule.createRulesOnboardingAction and update config; remove SRH_TOKEN from docker-compose; bump version.

📍Where to Start

Start with stepMap and the new STEP_KEYS.INBOX_PROCESSED handling in OnboardingContent.tsx, then review StepInboxProcessed in StepInboxProcessed.tsx and the constant in utils/config.ts.


Macroscope summarized 478f494.

Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

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.

logger,
}),
);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Fix in Cursor Fix in Web

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b3b55e1 and 0ede5c0.

📒 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 files

Import 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.tsx
  • apps/web/app/(app)/[emailAccountId]/onboarding/steps.ts
  • apps/web/utils/config.ts
  • apps/web/app/(app)/[emailAccountId]/onboarding/OnboardingContent.tsx
  • apps/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.tsx
  • apps/web/app/(app)/[emailAccountId]/onboarding/steps.ts
  • apps/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.tsx
  • apps/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 the swr package
Use result?.serverError with toastError from @/components/Toast for 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 convention use[FeatureName]Enabled that return a boolean from useFeatureFlagEnabled("flag-key")
For A/B test variant flags, create hooks using the naming convention use[FeatureName]Variant that define variant types, use useFeatureFlagVariantKey() 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
Use as const instead of literal types and type annotations
Use either T[] or Array<T> consistently
Initialize each enum member value explicitly
Use export type for types
Use `impo...

Files:

  • apps/web/app/(app)/[emailAccountId]/onboarding/StepInboxProcessed.tsx
  • apps/web/app/(app)/[emailAccountId]/onboarding/steps.ts
  • apps/web/utils/config.ts
  • apps/web/app/(app)/[emailAccountId]/onboarding/OnboardingContent.tsx
  • apps/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 in page.tsx, or in the apps/web/app/(app)/PAGE_NAME folder
If we're in a deeply nested component we will use swr to fetch via API
If you need to use onClick in a component, that component is a client component and file must start with use client

Files:

  • apps/web/app/(app)/[emailAccountId]/onboarding/StepInboxProcessed.tsx
  • apps/web/app/(app)/[emailAccountId]/onboarding/steps.ts
  • apps/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/enums instead of @/generated/prisma/client to avoid Next.js bundling errors in client components

Import Prisma using the project's centralized utility: import prisma from '@/utils/prisma'

Files:

  • apps/web/app/(app)/[emailAccountId]/onboarding/StepInboxProcessed.tsx
  • apps/web/app/(app)/[emailAccountId]/onboarding/steps.ts
  • apps/web/utils/config.ts
  • apps/web/app/(app)/[emailAccountId]/onboarding/OnboardingContent.tsx
  • apps/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
Use next/image package for images
For API GET requests to server, use the swr package with hooks like useSWR to fetch data
For text inputs, use the Input component with registerProps for form integration and error handling

Files:

  • apps/web/app/(app)/[emailAccountId]/onboarding/StepInboxProcessed.tsx
  • apps/web/app/(app)/[emailAccountId]/onboarding/steps.ts
  • apps/web/utils/config.ts
  • apps/web/app/(app)/[emailAccountId]/onboarding/OnboardingContent.tsx
  • apps/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.tsx
  • apps/web/app/(app)/[emailAccountId]/onboarding/steps.ts
  • apps/web/utils/config.ts
  • apps/web/app/(app)/[emailAccountId]/onboarding/OnboardingContent.tsx
  • apps/web/utils/actions/rule.ts
**/*.tsx

📄 CodeRabbit inference engine (.cursor/rules/ui-components.mdc)

**/*.tsx: Use the LoadingContent component to handle loading states instead of manual loading state management
For text areas, use the Input component with type='text', autosizeTextarea prop set to true, and registerProps for form integration

Files:

  • apps/web/app/(app)/[emailAccountId]/onboarding/StepInboxProcessed.tsx
  • apps/web/app/(app)/[emailAccountId]/onboarding/OnboardingContent.tsx
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/ultracite.mdc)

**/*.{js,jsx,ts,tsx}: Don't use accessKey attribute on any HTML element
Don't set aria-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 the scope prop 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 assign tabIndex to non-interactive HTML elements
Don't use positive integers for tabIndex property
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 a title element 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
Assign tabIndex to non-interactive HTML elements with aria-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 a type attribute for button elements
Make elements with interactive roles and handlers focusable
Give heading elements content that's accessible to screen readers (not hidden with aria-hidden)
Always include a lang attribute on the html element
Always include a title attribute for iframe elements
Accompany onClick with at least one of: onKeyUp, onKeyDown, or onKeyPress
Accompany onMouseOver/onMouseOut with onFocus/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.tsx
  • apps/web/app/(app)/[emailAccountId]/onboarding/steps.ts
  • apps/web/utils/config.ts
  • apps/web/app/(app)/[emailAccountId]/onboarding/OnboardingContent.tsx
  • apps/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 both children and dangerouslySetInnerHTML props 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 use target="_blank" without rel="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.tsx
  • apps/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.tsx
  • apps/web/app/(app)/[emailAccountId]/onboarding/steps.ts
  • apps/web/utils/config.ts
  • version.txt
  • apps/web/app/(app)/[emailAccountId]/onboarding/OnboardingContent.tsx
  • apps/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.tsx
  • apps/web/app/(app)/[emailAccountId]/onboarding/steps.ts
  • apps/web/utils/config.ts
  • apps/web/app/(app)/[emailAccountId]/onboarding/OnboardingContent.tsx
  • apps/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's select option. 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. All findUnique/findFirst calls 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
All findMany queries 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.ts
  • apps/web/utils/config.ts
  • apps/web/utils/actions/rule.ts
**/{server,api,actions,utils}/**/*.ts

📄 CodeRabbit inference engine (.cursor/rules/logging.mdc)

**/{server,api,actions,utils}/**/*.ts: Use createScopedLogger from "@/utils/logger" for logging in backend code
Add the createScopedLogger instantiation 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, use createScopedLogger().with() to attach context once and reuse the logger without passing variables repeatedly

Files:

  • apps/web/utils/config.ts
  • apps/web/utils/actions/rule.ts
apps/web/utils/actions/**/*.ts

📄 CodeRabbit inference engine (apps/web/CLAUDE.md)

apps/web/utils/actions/**/*.ts: Use next-safe-action with actionClient for server actions with Zod schema validation
Call revalidatePath in server actions after mutations to invalidate cache

apps/web/utils/actions/**/*.ts: Server actions must be located in apps/web/utils/actions folder
Server action files must start with use server directive

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: Use next-safe-action with Zod schemas for all server actions (create/update/delete mutations), storing validation schemas in apps/web/utils/actions/*.validation.ts
Server actions should use 'use server' directive and automatically receive authentication context (emailAccountId) from the actionClient

apps/web/utils/actions/*.ts: Create corresponding server action implementation files using the naming convention apps/web/utils/actions/NAME.ts with 'use server' directive
Use 'use server' directive at the top of server action implementation files
Implement all server actions using the next-safe-action library with actionClient, actionClientUser, or adminActionClient for type safety and validation
Use actionClientUser when only authenticated user context (userId) is needed
Use actionClient when both authenticated user context and a specific emailAccountId are needed, with emailAccountId bound when calling from the client
Use adminActionClient for 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.ts files in next-safe-action configuration
Access context (userId, emailAccountId, etc.) via the ctx object parameter in the .action() handler
Use revalidatePath or revalidateTag from '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.tsx
  • apps/web/utils/config.ts
  • apps/web/app/(app)/[emailAccountId]/onboarding/OnboardingContent.tsx
  • 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: 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.tsx
  • apps/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.tsx
  • apps/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 fine

The version update to v2.21.8 is isolated and consistent; no issues from a code perspective.

apps/web/utils/config.ts (1)

26-28: Config constant for onboarding email count looks good

Exporting ONBOARDING_PROCESS_EMAILS_COUNT = 20 is 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 flow

Adding STEP_KEYS.INBOX_PROCESSED and inserting it after CUSTOM_RULES in STEP_ORDER keeps getStepNumber semantics 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 UX

The 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 behavior

Scheduling bulkProcessInboxEmails via after() in both createRuleAction (when an AI-enabled email account exists) and createRulesOnboardingAction, with maxEmails: ONBOARDING_PROCESS_EMAILS_COUNT and skipArchive: 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 bulkProcessInboxEmails either 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 flow

Importing StepInboxProcessed and adding it to stepMap under STEP_KEYS.INBOX_PROCESSED ensures the new step participates in the existing STEP_ORDER-driven progression without changing the surrounding navigation or completion logic.

Also applies to: 69-70

Copy link
Copy Markdown

@jit-ci jit-ci bot left a comment

Choose a reason for hiding this comment

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

❌ 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.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

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 &quot;use client&quot; 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";
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot Nov 28, 2025

Choose a reason for hiding this comment

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

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 &quot;use client&quot; 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 &quot;lucide-react&quot;;
+import { PageHeading, TypographyP } from &quot;@/components/Typography&quot;;
+import { IconCircle } from &quot;@/app/(app)/[emailAccountId]/onboarding/IconCircle&quot;;
</file context>
Fix with Cubic

@elie222 elie222 merged commit 32fb6a3 into main Nov 28, 2025
9 of 12 checks passed
@elie222 elie222 deleted the feat/processed-emails-step branch November 28, 2025 14:28
@@ -0,0 +1,38 @@
import { CheckCheckIcon } from "lucide-react";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown

@jit-ci jit-ci bot left a comment

Choose a reason for hiding this comment

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

❌ 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.

@coderabbitai coderabbitai bot mentioned this pull request Dec 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant