Repository navigation
feat(layout): draw local and SSH layouts from main's layout stream behind the layout-owner build switch - #29221
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
…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.
… stream behind ORCA_LAYOUT_OWNER
…back to rebuilt workspaces
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to
|
ELI5
Today the window keeps its own copy of every workspace's tabs and panes and saves it to disk. The plan is for the app's background process to own that layout and for the window to just draw it. This PR adds the drawing half, but only in a special internal build. Normal builds do not include it.
What Changed
ORCA_LAYOUT_OWNER=main: after startup restore, the window subscribes to the background process's layout stream. It then draws local and SSH workspaces (git worktrees and folders) from those layout updates, using the existing frame-to-store builder (refactor(layout): build today's store slices from layout frames (inert) #29181).runtime/workspace-layout-frame-sync.tskeeps the latest layout per workspace.store/workspace-layout-frame-store-patch.tslays the rebuilt records over the store:Why
Linked Issue
Internal refactor plan (phase E2b), no issue.
Visual Proof
Hidden app (background launch), screenshots taken over the debugging protocol, normal build vs
ORCA_LAYOUT_OWNER=mainbuild.Split right then down. Normal build vs switch on:


Two tabs, quit, relaunch. Normal build vs switch on:


Testing
Layout parity journeys, run on the normal build and the switched-on build, then diffed. Journeys: create tab, split, close pane, close tab, reorder, drag out across restarts, CLI split, restart, folder workspace.
executionHostId: 'local'(the frame builder names every tab's host).sortOrderis renumbered.Workspace layout check on the switched-on build: 21/21 pass. It covers rename, CLI create/rename/close, paired clients, reload, quit, restart, cold and live daemon restart, sleep/resume, and folder workspaces.
Latency check on both builds, 10 samples, including three panes changing titles about 150 times a second in total. The switched-on build matches or beats the normal one, and main's event-loop p99 under titles is 3.3 ms vs 4.7 ms. Close pane is bimodal (about 25 or about 115 ms) on both builds.
Unit tests:
Rebuild cost with 400 tabs: 1.6 ms per structural update. Reading the view back is scoped to the changed workspaces (it was 10.7 ms before scoping).
Tested on macOS only.
I manually tested these changes locally
Automated tests added/updated
Review
Independent review, then a fix round, then a delta review: MERGE AS IS.
Agent skill upstream boundary
Notes
Checklist