Make onboarding responsive to MCP connection state - #810
Conversation
Reorder onboarding into three steps with discovery first, collapse the first two steps into details cards once an MCP client is connected, move the BYOK explainer below the starter packages, and drop the account footer links. Co-authored-by: Cursor <cursoragent@cursor.com>
The onboarding page only learned about a new MCP OAuth grant on load or navigation, so users watching the page while their client connected never saw the UI react. Poll the onboarding JSON endpoint every few seconds (visible tab, logged in, not yet connected) and apply the payload once a grant appears. Co-authored-by: Cursor <cursoragent@cursor.com>
📝 WalkthroughWalkthroughThe onboarding route polls for MCP authorization, applies refreshed onboarding state, renders completed steps as collapsible details, updates connected-state content, and shows sign-up or log-in links only for unauthenticated visitors. ChangesOnboarding flow
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Sequence Diagram(s)sequenceDiagram
participant Visitor
participant OnboardingRoute
participant OnboardingEndpoint
participant Document
Visitor->>OnboardingRoute: Open onboarding page
OnboardingRoute->>Document: Check visibility and current path
OnboardingRoute->>OnboardingEndpoint: Poll onboarding payload
OnboardingEndpoint-->>OnboardingRoute: Return MCP connection state
OnboardingRoute->>OnboardingRoute: Apply payload and render steps
OnboardingRoute-->>Visitor: Show connected or collapsible onboarding UI
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
|
🔎 Preview deployed: https://kody-pr-810.kody-a99.workers.dev Worker: Mocks:
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/worker/client/routes/onboarding.tsx`:
- Around line 155-176: Update pollForMcpConnection and its interval setup to
track an in-flight request with an isPolling lock, skipping ticks while a fetch
is pending and always releasing the lock afterward. Retain the existing guards
and clear the polling interval immediately when a successful payload reports
hasMcpClient, while also preserving abort cleanup.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 44dbc95f-5008-4e43-9fd8-46e8fc075588
📒 Files selected for processing (1)
packages/worker/client/routes/onboarding.tsx
Review feedback: track an in-flight flag so slow responses cannot overlap, and clear the interval after a grant is detected instead of ticking forever. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 6361f32. Configure here.
| <span mix={css(collapsedStepHintCss)}>Done — open to revisit</span> | ||
| </summary> | ||
| {input.children} | ||
| </details> |
There was a problem hiding this comment.
Discovery hash stays collapsed
Medium Severity
When hasMcpClient is true, the discovery step renders as a closed details element with id="discovery". Navigating to /onboarding#discovery (for example from the home page discovery link) scrolls to that element but leaves the prompt hidden until the user manually expands the card.
Reviewed by Cursor Bugbot for commit 6361f32. Configure here.


Summary
<details>cards ("Done — open to revisit") so only the starter packages remain expanded; while the page is open, it polls/onboarding.jsonevery 5s (visible tab, logged in, not yet connected) so the UI reacts without a refresh.Test plan
npm run typecheck,npm run lint,npm run format:checke2e/community-featured.spec.ts,e2e/invite-signup-verification.spec.tsMade with Cursor
System recap — composes existing primitives (low risk)
Mode: recap · Base:
main@24f871c6· Head:6361f328Classification: composes — no primitives added or changed; this PR rearranges the onboarding UI and polls an existing JSON endpoint.
Primitives touched
app-uiSystem map
The onboarding page in the browser app polls the existing onboarding JSON endpoint to detect a new MCP OAuth grant and collapses completed steps in place.
Legend: green = composes (wiring only) · amber = extended by this PR · red = new primitive · gray = context (unchanged, included only when an edge crosses it).
Before / after
Summary by CodeRabbit