feat(desktop): re-enable v2 onboarding as non-blocking; drop worktree step

Closed
KI
4mo ago
+169-615

Summary

Re-enables the v2 onboarding flow for fresh v2 users (PR #4177 had removed the hard-gate redirect because it was trapping users). New behavior treats the redirect as advisory:

  • On first authenticated render: isV2CloudEnabled && v2Workspaces.length === 0 && !requiredComplete users land on /setup/<firstIncompleteStep>.
  • New onboarding-store fields:
    • skippedThisLaunch — in-memory only (omitted from partialize), set by Skip for now in the chrome dropdown or by navigating out of /setup via sidebar / cmd-K. Gate doesn't re-trap them this launch; they see onboarding again next launch.
    • dismissedForever — persisted, set by Don't show again. Cleared only by Settings → Experimental → Restart onboarding (reset()).
  • V1 isolation: V2OnboardingGate outer wrapper short-circuits when !isV2, so v1 users never instantiate the inner component (no live-queries on v2Workspaces, no store writes). Skip pill in OnboardingProgress is also wrapped in isV2 && as defense-in-depth for v1 users who URL-navigate to /setup/*.

Also drops the adopt-worktrees step from the onboarding flow entirely. project is now the terminal step and routes to /v2-workspaces on complete/skip, carrying the onboarding_finished telemetry the worktree step used to own. The whole /setup/adopt-worktrees route folder is deleted.

Test plan

  • Fresh v2 user (no workspaces, fresh onboarding state) → lands on /setup/providers on first authenticated render
  • Click Skip for now → lands on /workspace, gate doesn't re-fire this session; restart app → gate fires again
  • Click Don't show again → lands on /workspace, gate never re-fires; Settings → Experimental → Restart onboarding clears it
  • Navigate away from /setup via sidebar / cmd-K → implicit Skip for now (same as button), no ping-pong back to /setup
  • V1 user (no opt-in, pre-cutoff) → no redirect, no Skip pill in /setup if URL-accessed
  • V2 user completes project step (continue / select repo / skip) → lands on /v2-workspaces, onboarding_finished event fires with correct outcome
  • OnboardingProgress chrome shows 4 steps (no Worktrees pill)

Open in Stage

Summary by cubic

Re-enabled the v2 onboarding as a non-blocking gate and removed the Worktrees step. Fresh v2 users get a one-time redirect per launch to the next incomplete step, with options to skip or dismiss onboarding.

  • New Features

    • Advisory redirect: If v2 is enabled, there are no v2 workspaces, and required steps are incomplete, redirect to /setup/<firstIncompleteStep>. Leaving /setup counts as “Skip for now” for this launch.
    • Skip menu in onboarding chrome: “Skip for now” (session-only) and “Don’t show again” (persisted; reset via Settings → Experimental → Restart onboarding).
    • V1 isolation: Gate short-circuits for v1 users; no v2 live-queries/store writes; Skip pill hidden.
  • Refactors

    • Removed /setup/adopt-worktrees; Project is now the final step. On complete/skip, navigate to /v2-workspaces and emit onboarding_finished.
    • Onboarding store: added skippedThisLaunch (in-memory) and dismissedForever (persisted).
    • OnboardingProgress shows 4 steps (Worktrees removed).

Summary by CodeRabbit

  • New Features

    • Added skip options during onboarding: "Skip for now" to defer and "Don't show again" to permanently dismiss.
    • Implemented onboarding enforcement gate preventing progression until required steps are complete.
  • Refactor

    • Simplified onboarding flow by removing the worktrees adoption step.

Review Change Stack