Repository navigation
Conversation
…topo-c4-reconciler
…or every tab The pane reconciler ran only for web clients and remote-server tabs. It now runs for every tab, so a desktop window follows main's layout: - a leaf main dropped is detached, never killed, so a PTY main moved to another tab keeps one output owner; a pane still starting its PTY is kept until main binds it; - removals apply before insertions, and an inserted leaf with no PTY spawns through the normal mount; - divider ratios and orientation apply in place, so web and remote clients now follow desktop pane sizes; a divider mid-drag is left alone; - the write-back after insertions is gone.
10 of 12 tasks
Contributor
Author
|
Closing: the layout rework is being redesigned so the runtime holds the only copy of the layout and every window/client is a view. This branch is kept for reference. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
Since C3 the window keeps a copy of main's terminal layout, but the panes on screen still only changed when the window itself split or closed something. With this PR the panes on screen follow that copy. When main adds, removes or resizes a pane, the window does the same.
This is core step C4 of 7 in the terminal layout refactor. The core steps are reviewed as separate stacked PRs and merged together as one unit, so
mainnever gets a half-finished version. This PR is stacked on C3 (#26293) and also contains C1 (#26151) through a merge, because the window can only follow main's layout once main builds the same tree the window does (C1's placement).What Changed
Step 0, on C1's branch (#26151): when main builds a new tab from the window's placement, it no longer writes the spawn's working directory into
startupCwd. That field now comes only from the row the window sent. Before, it was harmless because the window's save overwrote it. Now that main's copy is the one the window shows, it would have addedstartupCwdto every tab. A tab with no placement row is unchanged.The pane reconciler now runs for every tab. Before, it ran only for web clients and for tabs on a remote Orca server (
isHostAuthoritativeLayout). That check and its gate are deleted. For each layout change it now:detachPaneForExternalMove, the same path drag-out uses). Detaching never kills the terminal, so a terminal main moved to another tab keeps exactly one owner of its output. A pane that is still starting its terminal (no transport yet, or a spawn still waiting for its id) is kept, because main hasn't bound it yet. The old rule waited for the pane's terminal to exit first, which only made sense when removing meant closing.applyLayoutGeometryfrom refactor(terminal): add in-place pane layout geometry apply (unused) #25671, which had no caller), without remounting panes and without reporting a layout change, so nothing is echoed back. A divider the user is dragging is left alone; the drag's end decides.The active pane is only reset when panes were added or removed, as before, so a title or ratio update never moves focus.
Named change: web and remote clients now follow desktop pane sizes. Because the same reconciler serves web clients and remote-server tabs, dragging a divider on the desktop now moves it on a paired web client too. Before, only a pane added or removed reached them (owner decision D-core-4).
Why
The core makes main the one owner of terminal layout. C3 put main's layout in the window's store; this step makes the panes on screen match it, which is what fixes the cases where the window and main disagreed (the split-right-down and CLI split shapes in C3's parity report). I reused the existing pieces instead of adding new ones: the existing insertion planner, the drag-out detach path for removal, and the B2-2 geometry apply. The pane-is-starting check reads the transport's existing
isConnectPending, so there is no new state.Alternatives I rejected:
Linked Issue
STA-9417 (fixed by the core as a unit).
Visual Proof
N/A. This is a stacked core step; the user-visible fix shows once C5 to C7 land. The parity check below records what this step changes.
Testing
pnpm tcpasses.pnpm run check:code-quality:changedpasses. Renderer, shared and persistence unit suites pass (the only failures are local-environment ones that also fail on C3: fish config,ORCA_BACKGROUND_LAUNCH,pg).terminal-mounted-layout-reconcile.test.ts(happy-dom, realPaneManager):terminal-live-layout-reconciliation.test.ts(the host-only predicate's tests are gone) andweb-session-split-pane-retirement-fences.test.ts(removal now waits for "starting", not for the terminal to exit).startupCwdonly from the window's row; a tab without placement keeps today's value.pnpm run test:e2e:terminal-layout-parity, background launch, base = the stack's main merge base80d45095d2ff): create-tab, split-right-down, close-pane, close-tab, reorder-panes, cli-split, restart-restore and folder-workspace are identical to main. ThestartupCwdand split-shape differences C3 reported are gone.Known gaps owned by later steps:
setLayoutwith itspublishSeq).