Skip to content

Unified set up process and other clean up#993

Merged
elie222 merged 4 commits intomainfrom
feat/clean-up
Nov 20, 2025
Merged

Unified set up process and other clean up#993
elie222 merged 4 commits intomainfrom
feat/clean-up

Conversation

@elie222
Copy link
Owner

@elie222 elie222 commented Nov 20, 2025

Summary by CodeRabbit

  • Changes
    • Streamlined onboarding: fewer screens and a more focused flow with step-specific onboarding links.
    • Consolidated rules management into a single editor interface.
    • Cold Email Blocker: default tab set to "Test" and action link updated to go to Assistant rules.
    • Setup checklist: reply tracker option removed; completed checks are now interactive links.
    • Chore: version bumped.

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

@vercel
Copy link

vercel bot commented Nov 20, 2025

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

Project Deployment Preview Updated (UTC)
inbox-zero Ready Ready Preview Nov 20, 2025 0:08am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 20, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Removes multiple onboarding pages/components and the categorization-preferences API, deletes ColdEmailDialog, updates Rules.tsx to always open RuleDialog for edits, and introduces STEP_KEYS/getStepNumber for dynamic onboarding step navigation used across setup and automation pages.

Changes

Cohort / File(s) Summary
Onboarding Step Infrastructure
apps/web/app/(app)/[emailAccountId]/onboarding/OnboardingContent.tsx
Added STEP_KEYS, STEP_ORDER, and getStepNumber(); refactored step resolution to use a stepMap and STEP_ORDER.
Removed Onboarding Components & Pages
apps/web/app/(app)/[emailAccountId]/assistant/onboarding/CategoriesSetup.tsx, apps/web/app/(app)/[emailAccountId]/assistant/onboarding/ExampleDialog.tsx, apps/web/app/(app)/[emailAccountId]/assistant/onboarding/page.tsx, apps/web/app/(app)/[emailAccountId]/assistant/onboarding/completed/page.tsx, apps/web/app/(app)/[emailAccountId]/assistant/onboarding/draft-replies/page.tsx
Deleted the onboarding wizard files (category setup, example dialog, onboarding main page, completed page, draft-replies page) and their exported components.
Rules UI — Dialog Flow
apps/web/app/(app)/[emailAccountId]/assistant/Rules.tsx
Removed ColdEmailDialog import and its state; now opens RuleDialog in edit mode; updated "No rules" setup link to use getStepNumber(STEP_KEYS.LABELS).
Cold Email Blocker — Component Removal
apps/web/app/(app)/[emailAccountId]/cold-email-blocker/ColdEmailDialog.tsx
Deleted ColdEmailDialog component and its props/interface.
Cold Email Blocker — Content & Page tweaks
apps/web/app/(app)/[emailAccountId]/cold-email-blocker/ColdEmailContent.tsx, apps/web/app/(app)/[emailAccountId]/cold-email-blocker/page.tsx
Changed default tab to "test"; added MessageText; replaced settings link with "Go to Assistant Rules" button; consolidated PageHeader props.
Setup Flow & Links
apps/web/app/(app)/[emailAccountId]/setup/SetupContent.tsx
Removed isReplyTrackerConfigured prop from Checklist/SetupPageContent signatures and call-sites; added STEP_KEYS/getStepNumber imports; updated onboarding links to include step query; wrapped completed check indicator in Link.
Automation Page Navigation
apps/web/app/(app)/[emailAccountId]/automation/page.tsx
Replaced static onboarding redirect with /onboarding?step=<n> using getStepNumber(STEP_KEYS.LABELS).
API Route Removals
apps/web/app/api/user/categorization-preferences/route.ts, apps/web/app/api/user/setup-progress/route.ts
Removed categorization-preferences GET route and related types/helpers; removed reply-tracker cookie usage and replyTracker field from setup-progress response.
Version Bump
version.txt
Updated version from v2.20.11 to v2.20.12.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant RulesUI as Rules.tsx
    participant ColdDialog as ColdEmailDialog (removed)
    participant RuleDialog
    participant Onboarding as OnboardingContent

    rect `#f8f9fa`
    Note over User,ColdDialog: Old flow (prior to this PR)
    User->>RulesUI: Click "Edit Rule"
    RulesUI->>ColdDialog: Open ColdEmailDialog
    ColdDialog->>User: Show rule editor
    end

    rect `#eefaf1`
    Note over User,RuleDialog: New flow (this PR)
    User->>RulesUI: Click "Edit Rule"
    RulesUI->>RuleDialog: Open RuleDialog in edit mode
    RuleDialog->>User: Show rule editor
    end

    rect `#fff7e6`
    Note over User,Onboarding: Onboarding step navigation
    User->>RulesUI: Click "No rules" setup
    RulesUI->>Onboarding: getStepNumber(STEP_KEYS.LABELS)
    Onboarding-->>RulesUI: Return step number
    RulesUI->>User: Redirect to /onboarding?step=X
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

  • Check removal impact where onboarding components/pages were referenced elsewhere.
  • Verify no remaining imports or usages of ColdEmailDialog or the deleted categorization API/types.
  • Confirm getStepNumber mapping and STEP_ORDER match intended onboarding flow.
  • Review signature changes removing isReplyTrackerConfigured for all call-sites.

Possibly related PRs

Suggested reviewers

  • edulelis

"I hopped through code with nimble paws,
Removed some paths and mended flaws.
One dialog rules, steps numbered true,
Onboarding's tidy — carrot cake for you! 🥕"

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
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.
Title check ❓ Inconclusive The title 'Unified set up process and other clean up' is vague and overly broad. It references 'other clean up' without specifying what was cleaned up, making it difficult to understand the primary changes from a git history scan. Consider a more specific title that highlights the main change, such as 'Refactor onboarding flow and consolidate setup process' or 'Remove CategoriesSetup and ColdEmailDialog components'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

📜 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 fc7ec12 and 43c4377.

📒 Files selected for processing (1)
  • version.txt (1 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.

Copy link
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: 0

🧹 Nitpick comments (3)
apps/web/app/(app)/[emailAccountId]/cold-email-blocker/page.tsx (1)

11-11: Consider making description optional instead of passing an empty string

Passing description="" works, but it’s slightly unclear at the call‑site. If we expect headers without descriptions, you might let PageHeader treat an omitted/undefined description as “no subheading” and skip rendering it.

apps/web/app/(app)/[emailAccountId]/onboarding/OnboardingContent.tsx (1)

26-51: Centralized step metadata looks good; consider tightening typing & structure

The STEP_KEYS/STEP_ORDER + getStepNumber setup and the stepMapsteps derivation give you a nice single source of truth for onboarding steps; the clamping and onNext logic line up with it.

Two optional improvements:

  • Give stepMap an explicit type like Record<(typeof STEP_KEYS)[keyof typeof STEP_KEYS], () => JSX.Element> so TS enforces that every key has a renderer.
  • Since every entry in STEP_ORDER has a corresponding stepMap entry, filter(isDefined) is redundant and could be dropped once the type is tightened.

Overall, the refactor makes the onboarding flow more maintainable.

Also applies to: 63-94

apps/web/app/(app)/[emailAccountId]/setup/SetupContent.tsx (1)

23-26: Setup checklist integration with onboarding steps looks consistent

  • Using prefixPath(emailAccountId, \/onboarding?step=${getStepNumber(STEP_KEYS.LABELS)}`)` for the “Set up your Personal Assistant” step aligns this checklist with the unified onboarding step model.
  • Wrapping the completed check icon in a Link makes it easy to revisit a finished step without changing the incomplete-state behavior.
  • Calendar icon color tweak is purely visual and consistent with other blue accents.

Once you extract STEP_KEYS/getStepNumber into a shared non‑client module (see AutomationPage comment), this import can be pointed there, but otherwise the setup flow changes look solid.

Also applies to: 175-185, 260-263, 287-288

📜 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 1e8db57 and fc7ec12.

📒 Files selected for processing (14)
  • apps/web/app/(app)/[emailAccountId]/assistant/Rules.tsx (3 hunks)
  • apps/web/app/(app)/[emailAccountId]/assistant/onboarding/CategoriesSetup.tsx (0 hunks)
  • apps/web/app/(app)/[emailAccountId]/assistant/onboarding/ExampleDialog.tsx (0 hunks)
  • apps/web/app/(app)/[emailAccountId]/assistant/onboarding/completed/page.tsx (0 hunks)
  • apps/web/app/(app)/[emailAccountId]/assistant/onboarding/draft-replies/page.tsx (0 hunks)
  • apps/web/app/(app)/[emailAccountId]/assistant/onboarding/page.tsx (0 hunks)
  • apps/web/app/(app)/[emailAccountId]/automation/page.tsx (2 hunks)
  • apps/web/app/(app)/[emailAccountId]/cold-email-blocker/ColdEmailContent.tsx (2 hunks)
  • apps/web/app/(app)/[emailAccountId]/cold-email-blocker/ColdEmailDialog.tsx (0 hunks)
  • apps/web/app/(app)/[emailAccountId]/cold-email-blocker/page.tsx (1 hunks)
  • apps/web/app/(app)/[emailAccountId]/onboarding/OnboardingContent.tsx (2 hunks)
  • apps/web/app/(app)/[emailAccountId]/setup/SetupContent.tsx (4 hunks)
  • apps/web/app/api/user/categorization-preferences/route.ts (0 hunks)
  • apps/web/app/api/user/setup-progress/route.ts (0 hunks)
💤 Files with no reviewable changes (8)
  • apps/web/app/(app)/[emailAccountId]/assistant/onboarding/page.tsx
  • apps/web/app/api/user/setup-progress/route.ts
  • apps/web/app/(app)/[emailAccountId]/cold-email-blocker/ColdEmailDialog.tsx
  • apps/web/app/(app)/[emailAccountId]/assistant/onboarding/completed/page.tsx
  • apps/web/app/(app)/[emailAccountId]/assistant/onboarding/draft-replies/page.tsx
  • apps/web/app/(app)/[emailAccountId]/assistant/onboarding/ExampleDialog.tsx
  • apps/web/app/(app)/[emailAccountId]/assistant/onboarding/CategoriesSetup.tsx
  • apps/web/app/api/user/categorization-preferences/route.ts
🧰 Additional context used
🧠 Learnings (1)
📚 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]/automation/page.tsx
  • apps/web/app/(app)/[emailAccountId]/onboarding/OnboardingContent.tsx
  • apps/web/app/(app)/[emailAccountId]/cold-email-blocker/page.tsx
  • apps/web/app/(app)/[emailAccountId]/setup/SetupContent.tsx
🧬 Code graph analysis (6)
apps/web/app/(app)/[emailAccountId]/automation/page.tsx (1)
apps/web/app/(app)/[emailAccountId]/onboarding/OnboardingContent.tsx (2)
  • getStepNumber (46-51)
  • STEP_KEYS (26-34)
apps/web/app/(app)/[emailAccountId]/assistant/Rules.tsx (1)
apps/web/app/(app)/[emailAccountId]/onboarding/OnboardingContent.tsx (2)
  • getStepNumber (46-51)
  • STEP_KEYS (26-34)
apps/web/app/(app)/[emailAccountId]/onboarding/OnboardingContent.tsx (8)
apps/web/app/(app)/[emailAccountId]/onboarding/StepIntro.tsx (1)
  • StepIntro (11-58)
apps/web/app/(app)/[emailAccountId]/onboarding/StepFeatures.tsx (1)
  • StepFeatures (56-134)
apps/web/app/(app)/[emailAccountId]/onboarding/StepWho.tsx (1)
  • StepWho (24-201)
apps/web/app/(app)/[emailAccountId]/onboarding/StepCompanySize.tsx (1)
  • StepCompanySize (47-94)
apps/web/app/(app)/[emailAccountId]/onboarding/StepLabels.tsx (1)
  • StepLabels (10-56)
apps/web/app/(app)/[emailAccountId]/onboarding/StepDraft.tsx (1)
  • StepDraft (13-85)
apps/web/app/(app)/[emailAccountId]/onboarding/StepCustomRules.tsx (1)
  • StepCustomRules (10-56)
apps/web/utils/types.ts (1)
  • isDefined (12-14)
apps/web/app/(app)/[emailAccountId]/cold-email-blocker/ColdEmailContent.tsx (2)
apps/web/providers/EmailAccountProvider.tsx (1)
  • useAccount (79-89)
apps/web/components/Typography.tsx (1)
  • MessageText (128-128)
apps/web/app/(app)/[emailAccountId]/cold-email-blocker/page.tsx (1)
apps/web/components/PageHeader.tsx (1)
  • PageHeader (14-36)
apps/web/app/(app)/[emailAccountId]/setup/SetupContent.tsx (1)
apps/web/app/(app)/[emailAccountId]/onboarding/OnboardingContent.tsx (2)
  • getStepNumber (46-51)
  • STEP_KEYS (26-34)
⏰ 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: test
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (3)
apps/web/app/(app)/[emailAccountId]/cold-email-blocker/ColdEmailContent.tsx (1)

12-48: Cold email settings UX now correctly points to Rules

The new default tab, explanatory MessageText, and “Go to Assistant Rules” button all look consistent with the unified rules flow; prefixPath(emailAccountId, "/automation?tab=rules") matches the Automation page routing.

apps/web/app/(app)/[emailAccountId]/assistant/Rules.tsx (1)

65-68: Rules editing and onboarding CTA are now coherent with the new flow

Always using RuleDialog for “Edit manually” (with editMode: true) and routing the “Set up default rules” CTA to /onboarding?step=${getStepNumber(STEP_KEYS.LABELS)} keeps the rules experience consistent and leverages the new shared onboarding step metadata correctly.

Also applies to: 300-305, 473-477

apps/web/app/(app)/[emailAccountId]/automation/page.tsx (1)

21-24: Fix server → client import of onboarding step metadata

The review comment is accurate. Verification confirms that automation/page.tsx is a server component (uses cookies(), await prisma.rule.findFirst(), and redirect()—all server-only APIs—with no "use client" directive), while OnboardingContent.tsx begins with "use client".

The import of STEP_KEYS and getStepNumber from this client module on lines 21–24 violates Next.js server/client boundaries, and these imports are then used in the redirect call on lines 65–71.

The suggested refactor to extract these constants into a non-client shared module (e.g., onboarding/steps.ts) is the correct approach. No changes to the review are needed.

Copy link
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.

No issues found across 14 files

@elie222 elie222 merged commit a39d0ca into main Nov 20, 2025
9 of 11 checks passed
@elie222 elie222 deleted the feat/clean-up branch November 20, 2025 12:01
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

Comments