Skip to content

fix(desktop): stop workspaces list from swapping to the new-workspace screen - #6361

Merged
saddlepaddle merged 2 commits into
mainfrom
fix-workspace-list-redire
Aug 12, 2026
Merged

saddlepaddle merged 2 commits into
mainfrom
fix-workspace-list-redire

Conversation

@saddlepaddle

@saddlepaddle saddlepaddle commented Aug 11, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

On the v2 workspaces list (/v2-workspaces), users in the new-workspace-screen test 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 NewWorkspaceEmptyScreen when isReady && liveWorkspaces.length === 0 under default filters. But isReady only reflects host workspace-query settlement, while the rendered rows come from a join in useAccessibleV2Workspaces that also depends on:

  • the auth session (activeOrganizationId / currentUserId — rows are [] while it loads or refetches),
  • useHostProjects (a workspace whose project row hasn't arrived is dropped by the join),
  • the v2Hosts / v2UsersHosts collections 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. NewWorkspaceEmptyScreen had 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 (DashboardNewWorkspaceModal redirecting store opens to /new-workspace) is untouched.

Verification

  • bun run lint clean
  • apps/desktop tsc --noEmit clean

Summary 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.

  • Bug Fixes
    • Removed the empty-dashboard swap so the list never replaces itself with the create screen.
    • Deleted NewWorkspaceEmptyScreen and variant gating in page.tsx.
    • Kept the test arm’s modal redirect to /new-workspace unchanged.

Written for commit 3936e1d. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Bug Fixes
    • Standardized the workspace dashboard experience by removing the alternate empty-screen flow.
    • The dashboard now consistently displays the standard header and workspace board or list content, including when no live workspaces are available.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 8d4b50f9-b5ed-4c5e-9b52-6ca5b6300569

📥 Commits

Reviewing files that changed from the base of the PR and between 1c95bf7 and 5c37630.

📒 Files selected for processing (3)
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspaces/components/NewWorkspaceEmptyScreen/NewWorkspaceEmptyScreen.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspaces/components/NewWorkspaceEmptyScreen/index.ts
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspaces/page.tsx
💤 Files with no reviewable changes (3)
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspaces/components/NewWorkspaceEmptyScreen/index.ts
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspaces/components/NewWorkspaceEmptyScreen/NewWorkspaceEmptyScreen.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspaces/page.tsx

📝 Walkthrough

Walkthrough

The dashboard no longer evaluates the new-workspace experiment or renders NewWorkspaceEmptyScreen. The component and its module re-export were removed.

Changes

Workspace dashboard rendering

Layer / File(s) Summary
Restore standard dashboard rendering
apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspaces/page.tsx, apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspaces/components/NewWorkspaceEmptyScreen/*
The dashboard removes the experiment and empty-dashboard branch. The unused empty-screen component and re-export are deleted.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title uses conventional commit format and clearly describes the main fix: preventing the workspaces list from switching to the new-workspace screen.
Description check ✅ Passed The description explains the problem, root cause, fix, behavioral impact, and verification results; it is mostly complete despite omitting the template checklist.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-workspace-list-redire

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

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

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Loading

Re-trigger cubic

@saddlepaddle
saddlepaddle merged commit c31514b into main Aug 12, 2026
11 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ⚠️ Neon database branch

Thank you for your contribution! 🎉

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.

1 participant