fix: open existing Cloud workspace rows optimistically
Fixes #15724.
Clicking or pressing Return on an existing Cloud workspace row now admits and selects its local workspace immediately. The shared Cloud workspace creation coordinator owns the pending binding and loading/attach pane, then reconciles the row in place by stable machine/workspace/tab IDs. Existing terminal rows, explicit open-here/split, and drag/drop keep their destination-specific actions.
A failed, cancelled, stale, signed-out, or provider-invalidated open removes only its pending local admission and restores the prior selection. Repeated activation navigates to the pending or authoritative local workspace instead of creating another one. Display/browser-only Cloud workspaces use the same admission owner.
Focused coverage exercises immediate pending projection, attach reconciliation, repeated activation, click/Return action parity, rollback with selection preservation, and late callback fencing.
Changelog
Fixed: Existing Cloud workspace rows open their local workspace optimistically without duplicate or stale projections.
Validation
python3 scripts/verify-local.py --only swift-syntax --swift-changedpython3 scripts/verify-local.py --only test-wiring- Focused remote macOS test lane:
cmuxTests/CloudWorkspaceCreationSidebarTests(run dispatched for the final head; receipt will be added after completion)
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.
Summary by cubic
Clicking or pressing Return on an existing Cloud workspace row now admits and selects its local workspace immediately, before the remote attach finishes.
The shared creation coordinator owns the pending binding and loading pane, then reconciles the row in place by machine, workspace, and tab IDs. Terminal rows project the exact daemon tab first and then the group's remaining placements; display/browser-only workspaces project the whole group behind the same pane.
Behavior
- Repeated activation, including concurrent opens, navigates to the pending or already-bound local workspace instead of creating another.
- Failed, cancelled, stale, signed-out, or provider-invalidated opens remove only their pending local admission, restore the prior selection, and never resurrect on a late callback.
- Row-open failures surface classified diagnostics instead of raw error text.
- An existing-workspace open is refused when the workspace is already gone from the machine graph, so a stale row cannot reopen a removed identity.
- New workspace creates keep retry-on-conflict behavior; only existing-workspace opens roll back on error.
- Explicit open-here/split, drag/drop, terminal rows, and display/browser-only workspaces keep their destination-specific actions.
Focused coverage exercises click/Return parity, immediate pending projection, attach reconciliation, rollback with selection preservation, later-placement failure, repeat-after-completion reuse, and late callback fencing using native panes with a controllable attachment boundary.
Summary by CodeRabbit
- New Features
- Select a Cloud workspace row or press Return to open that workspace locally. When a terminal is available, it opens with the workspace.
- Repeated activation while a workspace is opening reuses the in-progress local workspace, and activating an already-open workspace reuses its existing local view.
- Bug Fixes
- If opening fails or is canceled, the partial local workspace is removed and the previous selection is restored.
- Opening is canceled if the workspace is no longer available in the current Cloud state.