Repository navigation
fix(desktop): stop workspaces list from swapping to the new-workspace screen - #6361
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
💤 Files with no reviewable changes (3)
📝 WalkthroughWalkthroughThe dashboard no longer evaluates the new-workspace experiment or renders ChangesWorkspace dashboard rendering
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 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 |
There was a problem hiding this comment.
No issues found across 3 files
You’re at about 91% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.
Architecture diagram
sequenceDiagram
participant User as User
participant ListPage as V2WorkspacesPage
participant HostQuery as useHostWorkspaces (isReady)
participant Accessible as useAccessibleV2Workspaces
participant Session as Auth Session
participant Projects as useHostProjects
participant V2Hosts as v2Hosts/v2UsersHosts
participant Variant as useNewWorkspaceScreenVariant
participant EmptyScreen as NewWorkspaceEmptyScreen
participant List as V2WorkspacesList
User->>ListPage: Navigate to /v2-workspaces
ListPage->>HostQuery: Query host workspaces
ListPage->>Accessible: Subscribe to accessible workspaces
Note over Accessible: Join depends on multiple async sources
Accessible->>Session: Wait for activeOrganizationId/currentUserId
Accessible->>Projects: Wait for host project rows
Accessible->>V2Hosts: Wait for cloud-fallback collections
par Async settlement
HostQuery-->>ListPage: isReady = true
Session-->>Accessible: Session loaded
Projects-->>Accessible: Project rows arrived
V2Hosts-->>Accessible: Host collections loaded
end
Note over ListPage: Transient window: host query settled,<br/>join may still report zero rows
alt All dependencies settled
Accessible-->>ListPage: liveWorkspaces array
ListPage->>List: Render workspace list
List-->>User: Standard workspace board/list UI
else isReady but join still settling
Accessible-->>ListPage: Temporary empty array (false-empty)
Note over ListPage: Previously: this triggered empty-dashboard swap
ListPage->>Variant: Evaluate test variant flag
alt Variant = "test" (previous behavior)
Variant-->>ListPage: test arm
ListPage->>EmptyScreen: Swap to create screen (false flash)
EmptyScreen-->>User: Full-page new workspace UI
else Variant = "control" or not empty
ListPage->>List: Show standard empty state
end
end
Note over ListPage: FIX: Empty-dashboard swap removed entirely
alt Now: isReady + zero live workspaces
ListPage->>List: Show "No workspaces yet" empty state
List-->>User: Consistent empty list UI
end
Note over List: Standard empty state was already<br/>gated correctly inside V2WorkspacesList
🧹 Preview Cleanup CompleteThe following preview resources have been cleaned up:
Thank you for your contribution! 🎉 |
Problem
On the v2 workspaces list (
/v2-workspaces), users in thenew-workspace-screentest arm (or with the team override flag) sometimes land on the full-page new-workspace create screen instead of their list, even though they have plenty of workspaces.Root cause
The page swapped in
NewWorkspaceEmptyScreenwhenisReady && liveWorkspaces.length === 0under default filters. ButisReadyonly reflects host workspace-query settlement, while the rendered rows come from a join inuseAccessibleV2Workspacesthat also depends on:activeOrganizationId/currentUserId— rows are[]while it loads or refetches),useHostProjects(a workspace whose project row hasn't arrived is dropped by the join),v2Hosts/v2UsersHostscollections for cloud-fallback rows.So on cold boot / session refresh / org switch, the host query settles first, the join transiently reports zero rows, and the list gets replaced by the create screen — a false-empty flash that reads as a redirect.
Fix
Remove the empty-dashboard swap entirely: the list view never replaces itself with the create screen. A genuinely empty list now shows the standard "No workspaces yet" empty state, which was already correctly gated in
V2WorkspacesList.NewWorkspaceEmptyScreenhad no other consumers and is deleted.Note: this removes the "zero workspaces → dashboard IS the create screen" behavior that was part of the new-workspace-screen experiment's test arm. The test arm's page-instead-of-modal behavior (
DashboardNewWorkspaceModalredirecting store opens to/new-workspace) is untouched.Verification
bun run lintcleanapps/desktoptsc --noEmitcleanSummary by cubic
Stops the v2 workspaces list from switching to the full-page new-workspace screen during initial load. Truly empty lists now show the standard "No workspaces yet" state.
NewWorkspaceEmptyScreenand variant gating inpage.tsx./new-workspaceunchanged.Written for commit 3936e1d. Summary will update on new commits.
Summary by CodeRabbit