Skip to content

Conversation

@ameer2468
Copy link
Contributor

@ameer2468 ameer2468 commented Aug 20, 2025

This PR: Fixes onboarding redirect to dashboard. Also includes minor tweaks.

Summary by CodeRabbit

  • New Features

    • Onboarding now requires first and last name, with clearer submission states and direct redirect to the dashboard on success.
    • OTP verification button shows a loading spinner during verification.
  • Bug Fixes

    • Prevented unintended redirects from the dashboard for authenticated users with incomplete profiles.
    • Ensured onboarding and dashboard reflect updates immediately after onboarding.
    • Stopped Upgrade modal buttons from accidentally submitting forms.
  • Style

    • Minor class/order adjustments across OTP inputs and layout; no visual changes intended.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 20, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Removed the onboarding redirect from dashboard, simplified login/OTP UI, updated onboarding to use window.location.replace and a new POST helper, added route revalidation in the onboarding API, and adjusted UpgradeModal button types/keys.

Changes

Cohort / File(s) Summary of changes
Onboarding flow updates
apps/web/app/(org)/onboarding/Onboarding.tsx, apps/web/app/api/settings/onboarding/route.ts, apps/web/app/(org)/dashboard/caps/page.tsx, apps/web/components/UpgradeModal.tsx
Onboarding now posts via a new helper and navigates with window.location.replace; requires firstName and lastName; shows upgrade modal based on response; API adds revalidatePath for /onboarding and /dashboard; removed dashboard onboarding redirect guard; set button type="button" and adjusted list keys in UpgradeModal.
Auth login/OTP UI tweaks
apps/web/app/(org)/login/form.tsx, apps/web/app/(org)/verify-otp/form.tsx
Simplified email login text, removed restart flow; minor class/key adjustments; added spinner to Verify button in OTP form.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor U as User
  participant OB as Onboarding UI
  participant API as POST /api/settings/onboarding
  participant Cache as next/cache

  U->>OB: Submit firstName, lastName
  OB->>API: POST { firstName, lastName }
  API->>API: Process onboarding
  API->>Cache: revalidatePath("/onboarding")
  API->>Cache: revalidatePath("/dashboard")
  API-->>OB: { isMemberOfOrganization: boolean }

  alt isMemberOfOrganization == true
    OB->>OB: window.location.replace("/dashboard")
  else
    OB->>OB: showUpgradeModal()
    Note over OB: Skip in modal uses window.location.replace("/dashboard")
  end

  rect rgba(230,250,230,0.5)
  note right of OB: Errors show "Failed to complete onboarding"
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

codex

Poem

Little paw on the submit key—hop!
Names in tow, I bounce non-stop.
If I’m in the org, to Dashboard I glide;
Else, an Upgrade burrow opens wide.
Revalidate trails where I once trod—
Spinner twirls, and onward I plod.
Thump-thump—ship it, by rabbit’s nod! 🐇✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between a4bd7d3 and 8ebae93.

📒 Files selected for processing (6)
  • apps/web/app/(org)/dashboard/caps/page.tsx (0 hunks)
  • apps/web/app/(org)/login/form.tsx (1 hunks)
  • apps/web/app/(org)/onboarding/Onboarding.tsx (4 hunks)
  • apps/web/app/(org)/verify-otp/form.tsx (4 hunks)
  • apps/web/app/api/settings/onboarding/route.ts (2 hunks)
  • apps/web/components/UpgradeModal.tsx (4 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-onboarding-redirect

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@ameer2468 ameer2468 merged commit 923acdf into main Aug 20, 2025
13 checks passed
@ameer2468 ameer2468 deleted the fix-onboarding-redirect branch August 20, 2025 14:24
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.

2 participants