Skip to content

fix(remote): move tabs into a split-off group on the server too - #26522

Merged
Jinwoo-H merged 3 commits into
mainfrom
fix/remote-tab-move-server-group
Oct 11, 2026
Merged

Jinwoo-H merged 3 commits into
mainfrom
fix/remote-tab-move-server-group

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​184 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​183
Prod 6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​65 $\color{#cf222e}{\Huge{\mathbf{−}}}$​17 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​48

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:

  • Whenever the desktop applies the server's tab list, it already records which server tab each desktop tab
    mirrors. It now also records which server group that tab sits in.
  • When moving a tab, the desktop names the server group that holds another tab of the target group.
  • It skips a server group that tabs outside the target group still record, which happens just after a split
    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:

    • the server group is recorded from the server's tab list;
    • a move into a split-off group names the server group;
    • a drag right after a split falls back instead of landing in the wrong group.

    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

  • Desktop only. No server or wire change. Local and SSH workspaces don't use this path.
  • Follow-up: the server answering {moved:true} for an unknown group is what hid this bug. Making it
    throw is a separate change; old desktops would only log a warning.

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
@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a7dbfbd7-fb6f-419d-a908-dbc3fb310c19

📥 Commits

Reviewing files that changed from the base of the PR and between 9911e09 and 05cd404.


You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4aab2332-456c-444d-a914-285a06131aa3


📥 Commits

Reviewing files that changed from the base of the PR and between f2fcc68 and 9911e09.



📒 Files selected for processing (1)
  • src/renderer/src/runtime/web-session-tabs-sync/state.ts


Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.




📝 Walkthrough
📝 Walkthrough

Walkthrough

Snapshot synchronization now stores host session group IDs alongside host tab ID mappings and exposes a resolver for those IDs. moveWebRuntimeSessionTab uses the mappings to select a host group for the move request, with the desktop target group ID as a fallback. Tests cover mapping updates across snapshots and moves into split groups with different or unchanged host group mappings.



Priority: ➖ Normal

Merge Risk: 🟡 Moderate · up to 9911e

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 | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 22.22% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 8 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: moving tabs into split-off server groups for remote workspaces.
Description check Passed The description is detailed and covers the required ELI5, changes, rationale, linked issue exception, visual proof, testing, and notes. It also explains the affected remote-workspace behavior and test…
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.



✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR


🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR

  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@coderabbitai coderabbitai 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.

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 62f97861-bb61-4eab-ad44-3709f9b5d39a
📥 Commits

Reviewing files that changed from the base of the PR and between 8ae5264 and f2fcc68.

📒 Files selected for processing (8)
  • src/renderer/src/runtime/web-runtime-session-tab-move.test.ts
  • src/renderer/src/runtime/web-runtime-session-tab-move.ts
  • src/renderer/src/runtime/web-session-tabs-sync-host-group-mapping.test.ts
  • src/renderer/src/runtime/web-session-tabs-sync.ts
  • src/renderer/src/runtime/web-session-tabs-sync/apply-preparation-unified.ts
  • src/renderer/src/runtime/web-session-tabs-sync/layout-groups.ts
  • src/renderer/src/runtime/web-session-tabs-sync/state.ts
  • src/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)

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.

🗄️ 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.

Comment on lines +72 to +74
.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

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.

🗄️ 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.

@Jinwoo-H

Jinwoo-H commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

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.

Jinwoo-H added a commit that referenced this pull request Oct 11, 2026
…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
@Jinwoo-H
Jinwoo-H merged commit b197bc6 into main Oct 11, 2026
37 checks passed
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