Repository navigation
fix(remote): move tabs into a split-off group on the server too - #26522
Conversation
In a server workspace the desktop and the server mint different ids for a split-off group, so a drag into it named a group the server didn't know and was silently dropped. The desktop now names the server group that holds another tab of the target group, falling back to its own id as before. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Merge Risk: 🟡 Moderate · up to In remote workspaces, reordering the sole tab in a split group can fail, and rapid successive moves can place a tab in the wrong group. These affect the core tab-move workflow and should be fixed or explicitly accepted before merging. Pre-merge checks |
|
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
62f97861-bb61-4eab-ad44-3709f9b5d39a
📒 Files selected for processing (8)
src/renderer/src/runtime/web-runtime-session-tab-move.test.tssrc/renderer/src/runtime/web-runtime-session-tab-move.tssrc/renderer/src/runtime/web-session-tabs-sync-host-group-mapping.test.tssrc/renderer/src/runtime/web-session-tabs-sync.tssrc/renderer/src/runtime/web-session-tabs-sync/apply-preparation-unified.tssrc/renderer/src/runtime/web-session-tabs-sync/layout-groups.tssrc/renderer/src/runtime/web-session-tabs-sync/state.tssrc/renderer/src/runtime/web-session-tabs-sync/tracking-mappings.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
| // Why: a group this desktop split off has another id on the host, so name it by a tab it holds. | ||
| const targetHostGroupId = | ||
| (targetGroup?.tabOrder ?? []) | ||
| .filter((tabId) => tabId !== args.tabId) |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Use the moved tab’s host group for a reorder with no other host-backed tabs.
After a snapshot, a split-off group can have one mirrored tab and a host group ID that differs from its desktop group ID. A reorder of that tab excludes its only group mapping. The fallback then sends the desktop ID to session.tabs.move, so the reorder can fail with target_group_not_found. For reorder, consider the moved tab’s recorded group ID when no tab outside the target group records it.
| .find((groupId) => groupId !== null && !hostGroupIdsOutsideTarget.has(groupId)) ?? | ||
| // No server-known tab in the target group: the desktop id, unknown to the server, as before. | ||
| args.targetGroupId |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift
Do not treat an exclusive snapshot group ID as current after successive moves.
Suppose a snapshot places tabs X and Y in host group S. The desktop splits X into group G, then moves Y into G before another snapshot. Both tabs still record S, but no tab outside G records S. A subsequent move into G selects S instead of G. The server can reject that move or place the tab in the old group. Track the destination’s confirmed host group, or refresh its membership before using this exclusivity test. Add a test with successive moves before the next snapshot.
|
Heads-up from the terminal/tab layout rework (plan: one owner per machine for the tab layout; every window, phone and web client becomes a view that sends commands and draws updates). Under that plan, a server owns every tab in its workspaces (terminal, editor, browser), and the desktop's synced copy of a server's layout is frozen to bug fixes and later removed. This PR adds sync behaviour to the desktop's copy of a server's layout (moving tabs into a split-off group), so it will likely need to change or be replaced once the rework lands. Not blocking anything today; flagging so the direction is visible. |
…27381) The headless split and move-to-group handlers answered {moved:true} when the target group did not exist, hiding desktop/server group-id drift (#26522). They now refuse with target_group_not_found, as reorder already does. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
ELI5
In a workspace that runs on a remote Orca server, if you split a tab into its own group on the desktop
and then drag another tab into that group, the server never moved it. The desktop showed the tab in the
group, but the server, and anything reading from it like a paired phone, still had it in the old group.
This makes those drags reach the server.
What Changed
Before: when the desktop splits a tab into a new group in a server workspace, the desktop and the server
each create their own id for that group. A later drag into the group sent the desktop's id. The server's
move-to-group treats an unknown group as a no-op and still reports success, so nothing logged an error, and
the desktop and server drifted apart. A reorder inside that group failed with
target_group_not_found.After:
mirrors. It now also records which server group that tab sits in.
before the next server list arrives. In that case, and when the target group has no tab the server knows
about, it falls back to its own id, as before.
Why
Once a workspace has desktop groups, the desktop owns tab placement and never adopts the server's group
ids, so renaming a live desktop group to the server's id would touch layout, the active group and recent
tabs. Having the server return its new group id would need a new reply field and wouldn't help servers
already out there. Reading group membership from the last server list needs no wire change and works with
every server.
Linked Issue
N/A (maintainer)
Visual Proof
N/A. The visible effect is that the server's layout (and a paired phone's) now matches the desktop after the
drag; covered by an end-to-end test in the mobile mirror work.
Testing
Automated tests added/updated, or explained why not below
Unit tests:
Each fails without the fix.
Renderer tab-sync and move suites: 286 tests pass.
tsc(tc.web) and oxlint are clean.An end-to-end test reproduced the bug and passes with the fix. A real desktop drags into a split-off group,
and the server's layout is checked against the desktop's. The test lives with the mobile mirror tests
(feat(mobile): show and use the desktop's server workspaces on the phone #26501 stack), because it reads the layout through a paired phone.
Notes
{moved:true}for an unknown group is what hid this bug. Making itthrow is a separate change; old desktops would only log a warning.