Skip to content

feat(browser): move a tab between this computer and a paired server from the ⋯ menu - #47957

Merged
AmoabaKelvin merged 1 commit into
mainfrom
feat/browser-move-tab-across-devices
Nov 24, 2026
Merged

AmoabaKelvin merged 1 commit into
mainfrom
feat/browser-move-tab-across-devices

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

ELI5

A page from a paired server either runs on this computer ("This device") or runs on the server and is streamed here. Until now you could only pick that for new pages, in Settings. Now the ⋯ menu on any server page has one item that moves just that tab to the other side: "Open on this computer" on a streamed page, "Open on build-box" (the server's name) on a This-device page.

Files Added Deleted Net
Test 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​150 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​150
Prod 35 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​671 $\color{#cf222e}{\Huge{\mathbf{−}}}$​76 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​595

What Changed

  • New ⋯ item, placed above "Open in default browser", with the approved copy and tooltip ("Opens this address in a new tab on the other side and closes this one. You may need to sign in again."). It opens the same address in the same server profile on the other side, in the source tab's spot in the strip, makes it the active tab, then closes the moved page on its server (tab close --page, so a server tab holding other pages keeps them). History and page state don't carry over. Each side keeps its own cookie jar for that profile, so nothing about logins crosses.

  • Hidden for blank tabs and anything without a web address, for local workspaces (only the two server-page toolbars mount it), on the web client and orcad SSH deployments (they can't host pages), when the server lacks the client-hosting or screencast capability the destination needs, and for pinned tabs (closing a pinned tab asks first, possibly on the server's own screen).

  • The old tab stays open in these cases:

    • it is pinned;
    • it was still loading when the move started, or it navigated while the move ran;
    • it showed a non-web address, which would open blank on the other side.

    Unsent notes ask first, as any close does. If the server refuses the close, the existing "Couldn't close this page…" toast says so.

  • Failure copy: "Couldn't open this page on this computer." and the existing "Couldn't open this page on the remote host. Check the connection and try again." The old tab stays open when the move fails.

  • DevTools for a streamed page: move it to this computer, then use "Open browser devtools".

  • "Reopen on server" (the This-device failure card and the stream error toast) now calls the same move, so it closes the failed tab once the server copy opens. A pinned tab is left open.

  • Mechanism: browser.tabCreate already takes a placement. A new 'client' placement preference, used only by this move, skips the Settings › Browser choice but still needs the server's client-hosting capabilities and a desktop device scope. If the new page doesn't land client-placed, the move closes it and fails instead of quietly making another streamed tab. The new tab is staged after the source tab. On the server it is put in the source's group (move-to-group) and given this strip's order (reorder), both sent to the page's own server, before the source closes.

  • Relaunch/reconnect: pages this desktop placed here now keep being re-hosted after a relaunch or server restart even when Settings › Browser says Server (streamed). Without this, a moved page showed "Client-hosted browser unavailable" after a relaunch. Ownership is a local placedHere flag on the page's handle. It is set only after this desktop's own client-placed create, kept across server republishes, and dropped when the server re-places the page or the handle goes. It is saved with the page as remoteBrowserPagePlacedHere. A server's placement claim never sets it.

  • moveWebRuntimeSessionTab now requires its owning runtime instead of falling back to the focused one. Its only caller already passed it. The focus-read ratchet baseline drops by 2.

Page ids: the moved page gets a new page id on the server, and the old id is closed. Agents' tab list shows one tab either way. An agent holding the old id gets browser_tab_not_found, the same as after any close.

Why

Mockup 2 of the remote browser round, approved as shown. Creating a new page and closing the old one reuses the existing create/close paths and the server's own placement checks. Migrating a live page between two different browser engines can't carry its state anyway, and the copy says so.

Linked Issue

None. This is the approved round-2 mockup ("Move one tab between this computer and the server"). No issue tracks it.

Visual Proof

Before (main): streamed page, no way to move it or open DevTools · This-device page

menuStreamedToday menuDeviceToday

After (hidden e2e build, paired to a headless serve named build-box): streamed page · This-device page

menu-streamed menu-this-device

The page moved back to this computer now has "Open browser devtools" · A pinned tab offers no move

menu-after-back menu-pinned

bravo, moved to the server, streams in the same strip spot between alpha and charlie:

streamed-after-move

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below
  • Every added test fails without this change and avoids the test anti-patterns

macOS, real paired runtime: a hidden e2e client paired to a headless orca serve (scratch Playwright spec, not committed), with three This-device tabs alpha/bravo/charlie:

  • bravo → server through the real ⋯ click: the strip stays alpha, bravo (streamed, active, new page id), charlie. The client's webview count goes 3 → 2, and the old page's host element is gone.
  • Settings › Browser switched to Server (streamed), bravo → this computer: back to a This-device page in the same spot, with "Open browser devtools" in its menu.
  • A pinned tab has no move item. Once unpinned it moves.
  • charlie and bravo → server: the server's own session tab order is alpha, bravo, charlie. The client has 0 webviews left.
  • Desktop relaunch with Server (streamed) still set: the moved This-device page comes back hosted here.
  • Mutation runs: without the server reorder the server order ends alpha, charlie, bravo. Without the relaunch rule the moved page has no webview after relaunch. Both fail the spec.
  • Unit tests for the two security boundaries: the 'client' preference never bypasses capabilities or a phone scope, and recovery skips the setting only for pages this desktop placed, never for a server's claim. Both fail with their guard removed.
  • Linux and Windows: no platform-specific code. Covered by CI.

Performance

None measurable. The ⋯ item mounts only while the menu is open, and its selectors are O(hosts). A move is one browser.tabCreate (plus the existing snapshot refresh), two layout RPCs for the server order, and the normal close. From click to the new tab placed and the old one gone took 348–366 ms on loopback (hidden e2e build). The old tab goes through the normal close path, which releases its webview or stream: the e2e saw the webview count fall to 0.

Risk

Level: Medium

  • Who can trigger it: only the person, through the ⋯ item or the Reopen on server button. No new RPC. The 'client' preference travels only renderer → main IPC on this desktop. Agents keep their tab create placement rules. A server's browser.clientHost.request still uses the setting. A server can't flip the setting by claiming a page is client-placed: only this desktop's own record counts.
  • Nothing crosses between machines except the page's address, which the server already has for its own pages. Cookies, storage and history stay on their side.
  • Older server: a server without client hosting hides "Open on this computer". A server without screencast hides "Open on {host}". An older desktop ignores the new saved-session field.
  • Known and unchanged: after a desktop relaunch, server tabs created from this desktop can show twice in the strip. This also happens on main for a plain new streamed tab (checked as a control in the same run). Pins on server browser tabs don't persist on paired clients (Browser & editor tab pin/color not persisted on remote-server (Orca server) worktrees #5729).
  • Back out: plain revert. A revert leaves the saved remoteBrowserPagePlacedHere flag unread.

AI Disclosure

Review

Codex release gate, fourteen rounds, last on this head: NO P0 OR P1. Fixed along the way:

  • the relaunch override trusting a peer's placement or host id
  • the server group/order for the moved tab, including servers that open new tabs in their active split
  • the order RPC going to the page's own server
  • the pinned-close prompt on a server
  • closing pages a server tab held besides the moved one
  • closing a source that navigated mid-move (now an address/load-start latch, and a source still loading is kept)
  • reporting success when the close or the client landing failed
  • a stale saved placed-here flag (covered by a persistence test)

CodeRabbit findings fixed: failure-safe ordering, the non-web address case, the live pin recheck, the multi-page source, and queued recovery for a busy preparation. Ownership now lives on the handle, which replaces the record-eviction concern.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance

SSH workspaces don't use client hosting, so the item never shows there. The phone isn't changed.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • I stated the risk: what could break, for whom, and how to back it out
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review
Walkthrough

The change adds browser page moves between client and server placements. The move workflow validates URLs, creates a destination tab, attempts to preserve server tab order, and applies safeguards before closing the source tab. It also records desktop-placed pages for persistence and recovery, adds move actions to browser toolbars, and adds translations. Session-tab moves now require an explicit environment ID.

Merge Risk: Low · previous review 1912d

Moving a page between this computer and the server mostly works, and failures leave the original tab open. Edge cases remain. A server re-placement during a move can still close the source tab, and a failed source close can leave two copies of the page while reporting success. Some restart-recovery ownership details are also not yet confirmed. These are worth fixing but are not severe.

Pre-merge checks: Passed 3 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Description check Warning The description is thorough and covers nearly every required template section. It has a plain-language ELI5, a detailed What Changed section with the mechanism, a Why section, a Visual Proof section w… 1) Add a linked issue, or confirm the author is a StablyAI maintainer. If the author is a maintainer, state that explicitly so the reviewer can see the exception applies. 2) Fill in the AI Disclosure section, stating whether an AI model was…
Passed Passed checks: 3 passed

Check name Status Explanation
Title check Passed The title names the main change: a feature that moves a browser tab between this computer and a paired server from the ⋯ menu. The changeset adds a new ⋯ menu move item, the move logic, the 'client' p…
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.
Full details: Title check

Explanation

The title names the main change: a feature that moves a browser tab between this computer and a paired server from the ⋯ menu. The changeset adds a new ⋯ menu move item, the move logic, the 'client' placement preference, and the removal of the old reopen-on-server helper. The title is specific and uses the conventional commit form.

Full details: Description check

Explanation

The description is thorough and covers nearly every required template section. It has a plain-language ELI5, a detailed What Changed section with the mechanism, a Why section, a Visual Proof section with before/after images, a Testing section with manual steps and checkboxes, a Performance section with measurements, a Risk section with a level and back-out plan, and a completed checklist. The Linked Issue section says there is no issue, and the author gives a reason. For an outside contributor, the template says a PR will be ignored without an actual linked issue, so this is a gap. The AI Disclosure section is empty. The template says to fill it in unless the author is a StablyAI team member, and the author's membership is not stated. The Notes section also restates the required list without adding detail.

Resolution

  1. Add a linked issue, or confirm the author is a StablyAI maintainer. If the author is a maintainer, state that explicitly so the reviewer can see the exception applies. 2) Fill in the AI Disclosure section, stating whether an AI model was used and which one, or state that the author is an internal contributor. 3) Optionally, replace the restated Notes line with specific notes on security, cross-platform, SSH, mobile, and backward-compatibility impact.
  • Autofix · 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

@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: 6

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5aad3a87-a278-49de-9eb2-63569dd36e24
Commits

Reviewing files that changed from the base of the PR and between e0b5678 and 9f29716.

Files selected for processing: 36

  • config/focus-setting-read-baseline.txt
  • src/renderer/src/components/browser-pane/assemble-chrome/client-hosted/client-hosted-browser-page-stand-in.tsx
  • src/renderer/src/components/browser-pane/assemble-chrome/client-hosted/client-hosted-browser-page-toolbar.tsx
  • src/renderer/src/components/browser-pane/assemble-chrome/client-hosted/client-hosted-browser-unavailable-notice.tsx
  • src/renderer/src/components/browser-pane/assemble-chrome/toolbar/browser-toolbar-menu-dropdown.tsx
  • src/renderer/src/components/browser-pane/navigate/device-move/browser-page-device-move-copy.ts
  • src/renderer/src/components/browser-pane/navigate/device-move/browser-page-device-move-item.tsx
  • src/renderer/src/components/browser-pane/navigate/device-move/browser-page-device-move.ts
  • src/renderer/src/components/browser-pane/navigate/reopen-on-server/ReopenBrowserPageOnServerButton.tsx
  • src/renderer/src/components/browser-pane/navigate/reopen-on-server/browser-reopen-on-server.ts
  • src/renderer/src/components/browser-pane/stream-remote/remote-browser-page-toolbar.tsx
  • src/renderer/src/components/browser-pane/stream-remote/remote-browser-page-viewport.tsx
  • src/renderer/src/i18n/locales/de.json
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/pt.json
  • src/renderer/src/i18n/locales/ru.json
  • src/renderer/src/i18n/locales/tr.json
  • src/renderer/src/i18n/locales/zh-Hant.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/lib/workspace/creation/surface-policy/client-creation-action-policy.ts
  • src/renderer/src/lib/workspace/persistence/workspace-session-browser-tabs.ts
  • src/renderer/src/runtime/browser/client-hosting/desktop-placed-client-pages.ts
  • src/renderer/src/runtime/browser/client-hosting/restored-client-hosted-browser-host-attach.test.ts
  • src/renderer/src/runtime/browser/client-hosting/restored-client-hosted-browser-host-attach.ts
  • src/renderer/src/runtime/browser/creation/web-runtime-browser-creation.ts
  • src/renderer/src/runtime/web-session-tabs-sync/actions/web-runtime-session-tab-move.ts
  • src/renderer/src/store/slices/browser/hosts/browser-host-state.ts
  • src/shared/browser/client-hosting/browser-client-host-placement.ts
  • src/shared/browser/client-hosting/browser-client-hosting-eligibility.test.ts
  • src/shared/browser/client-hosting/browser-client-hosting-eligibility.ts
  • src/shared/browser/workspaces/browser-workspace-types.ts
  • src/shared/workspace-session/workspace-session-browser-schema.ts
Files with no reviewable changes: 2

  • config/focus-setting-read-baseline.txt
  • src/renderer/src/components/browser-pane/navigate/reopen-on-server/browser-reopen-on-server.ts

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

"Couldn't open this page on the remote host. Check the connection and try again."
)
)
void moveBrowserPageAcrossDevices({

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.

Minor · Functional Correctness · Quick win

Keep server tab ordering best-effort so a reorder failure cannot abort the move.

keepServerTabOrder runs after the destination tab is created. Its two moveWebRuntimeSessionTab calls have no error handling. If either call rejects, the rejection escapes moveBrowserPageAcrossDevices before closeMovedSourceTab runs. The source tab stays open, and the button reports a failure. A retry then creates a second server tab for the same page. The code comment already states that ordering is cosmetic and that the move still completes. Catch the ordering failure and log it, so the move reports success after the destination opens.

Suggested fix

     if (createdRemotePageId) {
-      await keepServerTabOrder(worktreeId, environmentId, createdRemotePageId)
+      try {
+        await keepServerTabOrder(worktreeId, environmentId, createdRemotePageId)
+      } catch (error) {
+        console.warn('[browser-device-move] keeping server tab order failed:', error)
+      }
     }

@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: 1

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4e4c9d4b-b064-4f1b-9b4c-9106adc57b85
Commits

Reviewing files that changed from the base of the PR and between 9f29716 and ce5abf7.

Files selected for processing: 3

  • src/renderer/src/components/browser-pane/navigate/device-move/browser-page-device-move.ts
  • src/renderer/src/runtime/browser/client-hosting/desktop-placed-client-pages.ts
  • src/renderer/src/runtime/browser/client-hosting/restored-client-hosted-browser-host-attach.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.

Comment on lines +13 to +14
if (placedPageKeys.size > PRUNE_ABOVE) {
pruneClosedPages()

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.

Minor · Data Integrity & Integration · Quick win

Record the new client page only after its returned ID has a live handle.

Line 120 records created.browserPageId before any handle carries that ID. When the record set already holds 1024 entries, pruneClosedPages runs inside that same call, sees no live handle for the new key, and deletes it. Nothing re-adds the key later. The page then fails isDesktopPlacedClientPage, and the persisted placement flag is not written for it. After relaunch, this desktop does not re-host the page locally.

Move the recordDesktopPlacedClientPage call so that it runs after the returned page ID has a handle in the store. Keep it before any workspace persistence reads placement. Do not change the pruning rule, which must keep records of live pages.

@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: 4

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

Minor · Clear the stored placement marker before it is rebuilt… · workspace-session-browser-tabs.ts:53

src/renderer/src/lib/workspace/persistence/workspace-session-browser-tabs.ts:53
Minor · Data Integrity & Integration · Quick win

Clear the stored placement marker before it is rebuilt from ownership.

The builder keeps the page's existing remoteBrowserPagePlacedHere value. persistedRemoteBrowserPageIdentity writes the marker only when the handle has placedHere. It does not remove a marker when ownership is absent. browserPageEqual also ignores this field, so a snapshot that changes only the marker does not replace the stored page. A page can therefore save remoteBrowserPagePlacedHere: true after its handle lost placedHere. On relaunch, browser-host-state.ts turns that marker back into placedHere: true, which can restore ownership that reconciliation removed.

Persist the marker only from current ownership. Clear the copied value before the identity helper runs, so the helper can set it again only when clientHosted && placedHere holds. This applies when the handle is missing as well as when it lacks placedHere.

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fc851d99-f223-446e-9129-c70cb089135d
Commits

Reviewing files that changed from the base of the PR and between ce5abf7 and 9fe7c55.

Files selected for processing: 8

  • src/renderer/src/components/browser-pane/navigate/device-move/browser-page-device-move.ts
  • src/renderer/src/lib/workspace/persistence/workspace-session-browser-tabs.ts
  • src/renderer/src/runtime/browser/client-hosting/restored-client-hosted-browser-host-attach.test.ts
  • src/renderer/src/runtime/browser/client-hosting/restored-client-hosted-browser-host-attach.ts
  • src/renderer/src/runtime/browser/creation/web-runtime-browser-creation.ts
  • src/renderer/src/runtime/web-session-tabs-sync/snapshots/apply-browser-records.ts
  • src/renderer/src/store/slices/browser/browser-slice-contract.ts
  • src/renderer/src/store/slices/browser/hosts/browser-host-state.ts

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

}
// A file or other non-web address opened blank on the other side; keep the original.
if (source && addressSurvivesMove(args.url)) {
closeMovedSourceTab(worktreeId, source, browserPageId, args.url)

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.

Major · Functional Correctness · Quick win

Require the moved page to stay client-placed before the source closes.

An explicit 'client' move checks placement only before browser.tabCreate. The materialization check at web-runtime-browser-creation.ts:181-216 ignores the handle's placement. If the host re-places the page to server before materialization completes, creation still returns success. The caller then closes the source at browser-page-device-move.ts:117-118, and the requested client destination is not reached.

The required behavior is that an explicit 'client' move does not close its source unless the created page is client-placed. A server placement must fail the move, as the PR description requires. Enforce this after materialization, using the handle's placement. Choose where the check lives. Either the creation path rejects the result, or the caller checks before closing the source. The inspected code does not establish which option the repository intends.

}
// Materialized rows belong to the snapshot; later failures must not unwind them as staging.
if (placement.kind === 'client') {
markDesktopPlacedClientPage(environmentId, created.browserPageId)

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.

Minor · Stability & Availability · Heavy lift

Keep desktop placement on pages that reach the frames during handover.

When the frame handover completes creation, markDesktopPlacedClientPage runs after materialization. A handed-over page can have no page handle yet, and then the helper records nothing. The staged stagedClientHosted flag does not fill the gap. Session persistence does not read it, and the materialized handle does not carry it forward.

After relaunch, the page can lose its desktop-placed marker. Under Settings set to Server, the restore check that uses that marker (hasOwnClientHostedPage) can then fail to keep this page on the desktop. The page then falls back to server hosting.

Require the desktop-placed marker to survive frame handover. It must be recorded on the page handle that persists, or in another durable store that the restore path reads.

@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: 1

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

Minor · Reorder after the move replays the strip order captured before… · browser-page-device-move.ts:227

src/renderer/src/components/browser-pane/navigate/device-move/browser-page-device-move.ts:227
Minor · Functional Correctness · Quick win

Reorder after the move replays the strip order captured before it.

group.tabOrder is read from the store before the awaited move-to-group call, then sent unchanged in the reorder call. If the user reorders tabs while move-to-group is pending, the stale order overwrites that change on the server, and the stale order is also recorded as local reorder intent. Read the group order after move-to-group resolves, and send that order. Alternatively, skip the reorder when the order changed during the wait. Either way, the reorder must not use the order captured before the await.

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3095a673-c1a2-4752-af06-fae6000c69b2
Commits

Reviewing files that changed from the base of the PR and between 9fe7c55 and eb6ee80.

Files selected for processing: 1

  • src/renderer/src/components/browser-pane/navigate/device-move/browser-page-device-move.ts

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

}
// Close the page itself on its server, as `tab close --page` does: a server tab holding
// other pages keeps them, and the strip drops this row when the server publishes it.
void captureRuntimeEnvironmentCall(environmentId)({

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.

Minor · Functional Correctness · Quick win

Keep move deduplication active until source closure completes.

If browser.tabClose is pending, the source row remains available. This detached call lets the move return and remove movingPageIds before that row disappears. A second click then creates another destination page.

Return and await the close operation. Keep the registration through confirmation and source-row reconciliation. Release it when closure completes, fails, or is canceled.

@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

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cec89030-dec6-4272-8c14-a8bbd2ef2151
Commits

Reviewing files that changed from the base of the PR and between eb6ee80 and 1912d64.

Files selected for processing: 2

  • src/renderer/src/components/browser-pane/navigate/device-move/browser-page-device-move.ts
  • src/renderer/src/runtime/browser/creation/web-runtime-browser-creation.ts

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

Comment on lines +132 to +133
if (source && navigation && addressSurvivesMove(args.url)) {
await closeMovedSourcePage(worktreeId, environmentId, source, browserPageId, navigation)

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.

Minor · Functional Correctness · Quick win

Re-check the destination placement before closing the source.

The placement check at lines 114-122 runs before keepServerTabOrder awaits its requests. A host snapshot can change the destination to server placement during that wait. The function then closes the source and returns true, although the client move was not kept. The source tab closes, and the moved page stays open on the server.

Run the same destination placement check after the last await and before the source close. A destination that is server-placed at that point must fail the move. The source then stays open, as the move contract requires.

Suggested fix

--- "a/src/renderer/src/components/browser-pane/navigate/device-move/browser-page-device-move.ts"
+++ "b/src/renderer/src/components/browser-pane/navigate/device-move/browser-page-device-move.ts"
@@ -128,8 +128,17 @@
         console.warn('[browser-device-move] keeping the server tab order failed:', error)
       }
     }
     // A file or other non-web address opened blank on the other side; keep the original.
+    if (
+      args.destination === 'client' &&
+      createdRemotePageId &&
+      findRemotePageHandle(useAppStore.getState(), environmentId, createdRemotePageId)?.placement
+        ?.kind === 'server'
+    ) {
+      await closeRemotePage(environmentId, worktreeId, createdRemotePageId)
+      return false
+    }
     if (source && navigation && addressSurvivesMove(args.url)) {
       await closeMovedSourcePage(worktreeId, environmentId, source, browserPageId, navigation)
     }
     return true

…rom the ⋯ menu

The ⋯ menu on a server's page gets one item above "Open in default
browser": "Open on this computer" on a streamed page and "Open on
{host}" on a This-device page. It opens the same address in the same
server profile on the other side, in the source tab's strip spot (and
the server's group and order), then closes the moved page on its server.
The old tab stays when pinned, loading, navigated mid-move, or showing a
non-web address. "Reopen on server" uses the same move.

A 'client' placement preference lets this explicit move skip the
Settings › Browser choice, never the server's capabilities or a phone.
Pages this desktop itself placed keep being re-hosted after a relaunch
or server contact whatever that setting says, via a local placed-here
flag on the page handle that a server's snapshot never sets.
@AmoabaKelvin
AmoabaKelvin force-pushed the feat/browser-move-tab-across-devices branch from 0de2979 to d2e08e6 Compare November 24, 2026 03:25
@AmoabaKelvin
AmoabaKelvin merged commit 6627dcf into main Nov 24, 2026
57 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