Repository navigation
The window applies each layout update record by record instead of rebuilding from its whole session (dark, layout-owner build only) - #31152
Conversation
…reading its session back (dark, layout-owner build only) A records frame no longer re-serializes the window's whole session and runs the Loader. Panes' terminal bindings and live titles apply alone, to the tabs the frame names; any other record builds only its own workspace's slices, with the view and facts read from the store. Only a workspace the store does not show from frames yet (startup, a reopened stream, a first visit, one sent whole) takes the full build. Tests install an apply check that, after every flush, compares the store with the full build for the same cache and pre-flush store; the shared layout-apply transport now sends main's records frames and fails a flush that differs.
…ack or running the Loader (test, layout-owner build only)
…ing generations, so it passes with the switch on (test only)
…type errors are gone (test only)
…ave's own writers, as the full build does (dark, layout-owner build only)
…anwhile (test, layout-owner build only)
… builds one in full, and the shared transport keeps a test's own check (test only)
…ld, and the shared transport restores only the check it installed (test only)
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
2fa91340-7646-4d41-a1ee-384da5e7d22a
📒 Files selected for processing: 20
config/e2e-typecheck-baseline.txtsrc/renderer/src/components/terminal-pane/pty-connection-test-store-state.tssrc/renderer/src/runtime/layout-apply-test-transport.test-fixture.tssrc/renderer/src/runtime/main-loaded-layout-frames.test-fixture.tssrc/renderer/src/runtime/workspace-layout-frame-apply-check.test-fixture.tssrc/renderer/src/runtime/workspace-layout-frame-apply-observer.tssrc/renderer/src/runtime/workspace-layout-frame-binding.test.tssrc/renderer/src/runtime/workspace-layout-frame-bindings.tssrc/renderer/src/runtime/workspace-layout-frame-builds.tssrc/renderer/src/runtime/workspace-layout-frame-changes.tssrc/renderer/src/runtime/workspace-layout-frame-held-tabs.test.tssrc/renderer/src/runtime/workspace-layout-frame-operations.test.tssrc/renderer/src/runtime/workspace-layout-frame-pane-trees.tssrc/renderer/src/runtime/workspace-layout-frame-pending.tssrc/renderer/src/runtime/workspace-layout-frame-records.test.tssrc/renderer/src/runtime/workspace-layout-frame-sync.test.tssrc/renderer/src/runtime/workspace-layout-frame-sync.tssrc/renderer/src/runtime/workspace-layout-frame-tab-props.test.tssrc/renderer/src/store/workspace-layout-frame-store-view.tstests/e2e/terminal-account-restart.unit.test.ts
💤 Files with no reviewable changes: 1
- config/e2e-typecheck-baseline.txt
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
…hout its panes' bindings or live titles (dark, layout-owner build only)
ELI5
In the layout-owner build, main sends the window a small update after each action, naming only the records that changed. Until now the window threw that detail away: for almost any update it saved its whole session to memory, re-read it, and rebuilt every tab and pane list from scratch. Now it applies each update record by record. A terminal reconnecting changes one pane, a rename changes one tab, and anything else rebuilds only the one workspace the update names, from what the window already holds.
What Changed
Users see nothing different in shipped builds (the switch is off). With the switch on:
workspace-layout-frame-store-view.ts), with no session save, no read-back and no loader.workspace-layout-frame-pending.ts), so a burst still shows in one store update.Measured on a 100-tab workspace, before -> after:
Design: per-workspace builds, not per-tab. A per-tab build would fork the restore builders' logic, and the costs above are well within budget. Per-tab builds are a non-goal unless profiling shows a hot spot.
Also in this PR (switch-on unit tests that were red on main):
tests/e2e/terminal-account-restart.unit.test.ts: its fake store lacked the per-pane binding generations main added in Main sends one layout update per action, with only what changed (dark, layout-owner build only) #31109. It now passes with the switch on, and its five old e2e type errors are fixed (no casts), so the e2e type-check baseline drops from 227 to 222.Why
The update already says exactly what changed; rebuilding everything from a read-back of the window's own session was the most expensive step left on the relaunch path, and it made every later piece (main starting terminals, editor tabs drawn from main) pay it too. Rejected alternatives:
Cold-launch title delay, explained (no fix here): on 2 of 24 switch-on cold launches, generated tab titles reached the store about 0.9 s after main sent them. Timeline from the slow run (ms relative to titles in the store): main sends the titles update -891; session ready -872; the window's startup render blocks it -871 to -39 (832 ms, the same size as in the switch-off build); titles in the store 0. The window was already applying updates; the update simply landed just before the startup render. The switch-off build sets titles locally, before that render, so it never shows this. This PR cuts the 39 ms tail (a tab-row update no longer runs the full build; a test pins one store update with no session read-back). Removing the race itself belongs to D2, where main derives generated titles so they are in main's snapshot before the window draws. Possible user-visible effect on a rare first launch: tab titles may show their default names for a frame or two before the generated titles appear.
Linked Issue
N/A (layout-owner plan, step E2a; follows #31109 and #31140).
Visual Proof
N/A: dark change; the switch is off in shipped builds and the switch-off bundle is unchanged (below).
Testing
workspace-layout-frame-operations.test.ts(rename, split, pane close, tab close, move, group change and editor open each apply without a full build; 100 binding updates take no full build; 100 titles make one store update with no session read-back or loader).workspace-layout-frame-apply-check.test-fixture.ts). It checks every workspace an update changed that was not fully rebuilt, chains to any check a test installs itself, passes in the 7 frame test files and the 37 files that use the shared transport (switch off and on), and caught two deliberate breakages.agent-generated-tab-title(8) andworktree-agent-activation-seam(1) are identical on the base commit and belong to later steps (D2 and D1b).pnpm tc,check:code-quality:changed, type-aware and plugin oxlint (import cycles),check:layout-writer-ratchets(no ratchet raised), and everyconfig/scripts/check-*.mjsstep CI's static analysis runs (15, including the e2e type-check ratchet at 222).Review
One independent review, then a review of the fixes.
Agent skill upstream boundary
Notes
Remote and SSH: the paired-server path is untouched (guard test passes). No message shapes change. Folder workspaces use the same per-workspace build.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)