fix(desktop): stop auto-opting users into v2 + onboarding

Merged
SA
6mo ago
+0-82

Summary

  • Fresh installs were being auto-flipped to optInV2: true and then force-walked through the experimental /setup/* onboarding flow on first launch. Both behaviors are removed — v2 and onboarding are explicit-opt-in only via Settings → Experimental.
  • Deletes V2DefaultResolver, useIsFreshInstall, the isFreshInstall store field, the redirect block in _authenticated/layout.tsx, and the projects.hasAny / workspaces.hasAny tRPC procedures (all unused once the auto-flip is gone).
  • Preserves the v2 toggle and "Restart onboarding" action in Settings → Experimental, the full /setup/* route tree, and any persisted optInV2: true from users who explicitly toggled.

Test plan

  • Fresh install (clear v2-local-override-v2 localStorage): launches into v1 dashboard, no /setup/* redirect.
  • Existing v1 user (projects/workspaces in localdb, no persisted override): stays on v1.
  • User who toggled v2 on under Settings → Experimental: stays on v2 across launches, lands on the dashboard (not setup).
  • Settings → Experimental → "Restart onboarding" still walks through /setup/providers → ... when v2 is on.
  • Toggle v2 off in Experimental: surface flips back to v1 immediately.

Summary by cubic

Stops auto-opting fresh installs into v2 and removes the forced /setup/* onboarding. v2 and onboarding are now explicit opt-in via Settings → Experimental; all users land on the dashboard.

  • Bug Fixes

    • Removed first-launch redirect to /setup/* and the fresh-install auto-set of v2.
    • Kept existing optInV2 values in v2-local-override-v2 to avoid resetting explicit opt-ins; recently auto-flipped installs will remain on v2 unless toggled off.
  • Refactors

    • Deleted V2DefaultResolver, useIsFreshInstall, and the isFreshInstall field from the v2-local-override store.
    • Removed unused tRPC procedures projects.hasAny and workspaces.hasAny.

Summary by CodeRabbit

  • Refactor

    • Removed fresh-install detection and its initialization flow
    • Persisted workspace list now respects tab order
    • Local defaults state simplified to only store opt-in choice
    • Removed several unused internal query endpoints and re-exports
  • Bug Fix

    • Eliminated an onboarding redirect that relied on the removed fresh-install logic