Repository navigation
Drag a pane out to a new tab through main (dark, build switch off by default) - #29351
Conversation
… through main behind ORCA_LAYOUT_OWNER A build made with ORCA_LAYOUT_OWNER=main registers layout.apply: main applies the window's layout command to the stored partition through the shared applyLayoutCommand, minting new ids. A user split then waits for main's answer and mounts the pane id main minted. Every other build substitutes 'window', so neither branch is compiled in.
A load-then-save rewrite also normalizes records the command never touched. The command's effect is now the diff between the save before and after it, written onto the stored partition record by record. A split whose main reply says a paired server holds the tab splits as today.
…d partitions reload to the command's result
…CA_LAYOUT_OWNER In a layout-owner build the window's pane close, title change and equalize go through layout.apply and the window shows main's answer. A window pane close keeps the legacy close's rules: the tab's last pane is refused, a pane restarted since main read the close is left alone, every partition holding the tab closes it, and the tab's remote session id follows the remaining pane. The rules sit behind a command field only layout.apply sets.
…ORCA_LAYOUT_OWNER Claude-Session: 10569c9a-a0a1-4fc9-8469-0edfb7aed125
Claude-Session: 10569c9a-a0a1-4fc9-8469-0edfb7aed125
…e drops main cannot take Claude-Session: 10569c9a-a0a1-4fc9-8469-0edfb7aed125
…oday Claude-Session: 10569c9a-a0a1-4fc9-8469-0edfb7aed125
…de-up profile state Claude-Session: 10569c9a-a0a1-4fc9-8469-0edfb7aed125
…row names a paired server The split switch point asked which host to route to with a helper that falls back to the focused server, so a focused server could claim a workspace whose row names no owner. Use the same owner test the tab mirror uses.
…yout/c1b-pane-ops # Conflicts: # src/renderer/src/components/terminal-pane/terminal-pane-split-through-layout-owner.test.ts # src/renderer/src/components/terminal-pane/terminal-pane-split-through-layout-owner.ts
…/c1b2-pane-gestures
…ed or failed splits and moves, ratios during a move, release guard - A pane main saved but the window could not mount (source pane or manager gone during the await) is closed again in main, so it does not come back on restart. - A split main refuses because its copy lacks the workspace, tab or pane, or a failed call, splits as today; a refused or failed move moves as today. - Divider ratios committed while a move is in flight wait for the window's move, then go to main. - The orcad bundle gets the ORCA_LAYOUT_OWNER define when the switch is on. - Packaging and the orcad template refuse ORCA_LAYOUT_OWNER=main and any output a dark build marked. - workspace-layout-record-patch.ts: no non-null assertions; plain comment for the map depth.
…throws, not just for splits - sendPaneCommandToLayoutOwner runs asToday for workspace/tab/pane_not_found and a thrown call, so close, rename and equalize fall back like split and move; a handler that throws no longer runs the fallback too. - A close main refuses as its last pane, while this window still has others, closes as today. - A move whose local step throws still releases held divider ratios. - Drop the orcad output marker: nothing read it; the template build refuses the switch itself.
# Conflicts: # src/main/persistence/loading-store/pty-binding-persistence.ts # src/main/persistence/terminal-topology/terminal-layout-apply.test.ts # src/main/persistence/terminal-topology/terminal-pane-admission.ts # src/main/runtime/orca-runtime.ts # src/main/runtime/rpc/methods/workspace-layout-apply.test.ts # src/renderer/src/components/terminal-pane/terminal-pane-split-with-inherited-cwd.test.ts # src/renderer/src/components/terminal-pane/terminal-pane-split-with-inherited-cwd.ts # src/shared/rpc-contract/workspace-layout-params.ts # src/shared/workspace-layout/workspace-layout-record-patch.test.ts # src/shared/workspace-layout/workspace-layout-record-patch.ts
… layout-owner files
…1b2-pane-gestures
…1c-dark-followups
…e checkout fixture
…layout-owner build switch In an ORCA_LAYOUT_OWNER=main build, the tab bar's rename, color and pin ask main's layout.apply first; the window then runs today's action. When main lacks the tab or the call fails the window acts as today; a paired server's workspace keeps today's path. Pinning a tab now also ends its preview in main's copy, as the tab bar's pin does. Other builds compile the switch out.
…in opens files Changing the shared pin command would change what a paired client's pin does in every build.
…ut.apply command touches its claim A legacy terminal row the load folds into a tab-bar tab stays stored as is. Closing the tab it repeats, or giving it a tab-bar entry by moving it, let the next load resolve the claim the other way: the row came back or took the other tab's terminal. Such a command now writes the row as the load had it; every other record still stays as stored.
…t.apply Group sizes have no tab, so they go to the workspace's routed partition.
…rminal pane folder Tab groups send through it too; it now also acts as today when main lacks the group.
…s, through main behind ORCA_LAYOUT_OWNER A tab drop and Move Tab to Split wait for main's answer and then show main's placement, with main's new group id; group divider sizes are drawn while dragging and saved by main when the drag ends. Closing an empty group needs no command: main never holds an empty group.
- Read a folded row's terminals with the loader's own claim rule, so rows sharing only an SSH session are covered too, and drop the row's remote session entry with it. - The record-patch test allows a folded row only in its loaded form. - A tab drag ends at once; main's answer shows the move after. - A lone group main moved whole is placed so only when this window's group is lone too.
A row's remote session entry is carried through load and save unchanged, so adopting it from the load changed nothing (the earlier commit's message overstated it).
closeTabs can now record each terminal tab it closes, or does not find, as closed for the given reason (pruned as a partition's records are), so a start that commits later is refused, as today's close records it. layout.apply takes one tab's close with the window's reason: main forces it in every holder partition, marks a user close's launches, stops no terminal (the window already did, sparing any another tab shares), and leaves a workspace it lacks to today's close. A sibling the load supplied that the close only renumbered is no longer written.
…A_LAYOUT_OWNER The window still closes the tab and stops its terminals itself; main records the close through layout.apply instead of the close intent, which stays for paired servers and when main lacks the workspace.
- The window's close sends through a store-free sender, so the store no longer imports itself. - Main marks a user close's launches by the terminal's own id. - A recorded close prunes the whole partition's close records, as today, not one workspace's.
… layout.apply behind ORCA_LAYOUT_OWNER
Main moved the layout.apply sender to runtime/layout-owner-command.ts: the tab-bar rename and props commands join its WindowLayoutCommand, and the params reuse main's OnTab.
Main split the layout.apply command type into runtime/layout-apply-send.ts: the tab-bar rename and props commands join it there.
…-detach (re-stack)
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to
|
ELI5
In a test-only build (switch
ORCA_LAYOUT_OWNER=main), dragging one pane of a split out into a new tab now goes through the background process's layout command path, like the other tab and pane changes. The background process decides the new tab's id and where it goes, and the window opens the tab under that id. Normal builds are unchanged.Stacked on #29327 (tab close through the background process).
What Changed
Normal builds: nothing. The one switch point in the drag-out compiles to today's code.
Test builds with the switch on, for a local or SSH workspace:
pty:moveLeafToNewTab).movePaneToNewTabthroughlayout.apply, with the terminal the pane shows and the target group and position. The background process:The shared pane move (
movePaneToNewTab) gains an option,windowDetach, that onlylayout.applysets. With it, the move follows today's desktop rules:Phones and the headless host do not set the option, so their pane move is unchanged.
Refactors with no behaviour change:
runtime/moved-pane-owner-rekey.ts, so both paths share it.pane-close-remote-session.tsis renamedpane-remote-session-follow.ts, since it now follows a moved pane too.Why
Linked Issue
Part of the layout single-owner plan (phase C2).
Visual Proof
N/A for shipped builds: no behaviour change with the switch off.
Switch on, hidden test app, real pointer drags of a pane's handle onto a tab strip:
movePaneToNewTabwith the pane's live terminal. The background process repliedok, tabId f56c472c…with that terminal. The new tab "Terminal 2" opened under that id, still showing the command typed before the drag.ok, tabId e528cf33…. The tab opened at the requested position in that group.Testing
Automated tests:
layout.apply, covering:End-to-end, switch on, built from this branch restacked onto the current pane-gesture branch (which includes
main's layout stream):drag-out-to-tab;drag-out-to-tabandrestart-restore.Switch off, built bundles (base #29327's head c7f51d3, with chunk hashes, minified names and the build commit normalized):
windowDetachbranches of the shared move, the cross-partition check and thelayout.applyparams and routing, which run only fromlayout.apply, registered only with the switch on;Checks run locally:
pnpm tc;src/main/persistence,src/main/runtime,src/main/ipc/pty,src/sharedand the renderer store, tab-group, terminal-pane and runtime folders: 3782 files passed. One fish-shell test fails because of this machine's fish config, and it touches nothing here.Review
Agent skill upstream boundary
Notes
SSH workspaces take the same path as local ones, including a pane held by both the local and SSH partitions. Paired-server workspaces keep today's message. Folder workspaces use the same command, and the oracle's folder scenario passes.
If the tab-creation PR (#29311) lands first, its create recorder will also send a create for the tab the window opens here. The background process already holds that tab, so it is a refused no-op, but the drag-out should skip it. I'll handle that in whichever PR lands second.
Temporary code (removed when main becomes the only layout writer, phase F unless noted): the drag-out switch point, the
windowDetachoption (folds intomovePaneToNewTabonce every caller uses the desktop rules), and the fallback to today's move message.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)