Repository navigation
The window shows tab, title, move and divider changes only from main's update, never drawing them itself (dark, layout-owner build only) - #31257
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)
…lies it or adopts main's group id (dark, layout-owner build only) On main's answer the window only selects the moved tab in its new group, a view choice the frame does not carry. While main's stream is down it still moves the tab itself, as the frame sync's closed-stream rule says, but under its own group id: the reopened stream's snapshot redraws main's copy. The three switch-on census files for tab moves now pass without a switch mock: the context menu's move routes to the tab bar's move, the drag hook's pane-column split goes to main in a layout-owner build, and the tab bar's own move is pinned on a paired server's workspace. A new frame test pins each move through main and its frame.
…frame alone; the window no longer applies them again (dark, layout-owner build only)
… and an in-tab pane move shows from main's frame; the ratio hold is gone (dark, layout-owner build only)
…ut from the window
…s-removed # Conflicts: # src/renderer/src/runtime/workspace-layout-frame-pending.ts # src/renderer/src/runtime/workspace-layout-frame-tab-props.test.ts
…while main's stream is down the reconnect's snapshot shows them (dark, layout-owner build only)
…s the user selected since; main's answer no longer selects it (L120, dark, layout-owner build only)
…o new layout writer is added (L120)
…s snapshot that shows the move (L120)
…ow writes only titles left to it as today, and the rename test checks the phone graph republishes (dark, layout-owner build only)
…hat path holds another, so the window snaps back to main's ratios; a drag back to main's ratio before it answers is sent too (dark, layout-owner build only)
…review and counts a use
…hem without an assertion
…he tab-move tests exit clean and a wrong selection still fails (dark, layout-owner build only)
… builds; only the generated title differs
…tle replaces it, so a second prompt while main's stream is down no longer renames the tab (dark, layout-owner build only)
…s-removed # Conflicts: # src/renderer/src/store/terminals/terminal-tab-layout-owner-actions.ts # src/shared/rpc-contract/workspace-layout-params.ts
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: 🔵 Low · up to
|
There was a problem hiding this comment.
🧹 Nitpick comments: 1
src/renderer/src/components/floating-terminal/floating-workspace-tab-reorder.test.ts: 1
115-125: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAssert the frame result for the floating workspace.
getFloatingWorkspaceOperationRoutemapsFLOATING_TERMINAL_WORKTREE_IDto the local host, andsendLayoutApplysends the command to main. Theapplypath indropTabThroughLayoutOwnerrelies on main’s frame instead of changing local order. This test only checks thatmoveTabwas sent, so it can pass without detecting a missing floating-workspace frame. Add a frame-backed order assertion for this workspace.
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
d05e1659-bb57-4923-9a85-122400657b09
📒 Files selected for processing: 60
config/renderer-layout-writer-baseline.txtsrc/main/persistence/terminal-topology/terminal-layout-rename-tabs.test.tssrc/main/runtime/rpc/methods/workspace-layout-apply.test.tssrc/renderer/src/components/floating-terminal/floating-workspace-tab-reorder.test.tssrc/renderer/src/components/tab-bar/SortableTabContextMenu.test.tsxsrc/renderer/src/components/tab-bar/TabBar.context-menu.test.tssrc/renderer/src/components/tab-bar/tab-bar-layout-owner-props.test.tssrc/renderer/src/components/tab-bar/tab-bar-layout-owner-props.tssrc/renderer/src/components/tab-bar/tab-move-to-pane-column.test.tssrc/renderer/src/components/tab-group/tab-group-layout-owner-commands.test.tssrc/renderer/src/components/tab-group/tab-group-layout-owner-commands.tssrc/renderer/src/components/tab-group/tab-moves-drawn-from-frames.test.tssrc/renderer/src/components/tab-group/useTabDragSplit.test.tssrc/renderer/src/components/terminal-pane/terminal-layout-title-persist.test.tsxsrc/renderer/src/components/terminal-pane/terminal-pane-layout-owner-gestures.test.tssrc/renderer/src/components/terminal-pane/terminal-pane-layout-owner-gestures.tssrc/renderer/src/components/terminal-pane/use-host-pane-title-sync.test.tssrc/renderer/src/components/terminal-pane/use-host-pane-title-sync.tssrc/renderer/src/components/terminal-pane/use-terminal-pane-layout-persistence.tssrc/renderer/src/hooks/ipc-events/terminal-pane-title-ipc-bridge.tssrc/renderer/src/hooks/useIpcEvents-agent-status-snapshot-hydration.test.tssrc/renderer/src/lib/launch-agent-background-session-launch-parity.test.tssrc/renderer/src/lib/worktree-creation-background-mount.test.tssrc/renderer/src/runtime/divider-ratio-refusal.test.tssrc/renderer/src/runtime/generated-tab-titles-send.tssrc/renderer/src/runtime/layout-apply-send.test.tssrc/renderer/src/runtime/layout-apply-send.tssrc/renderer/src/runtime/layout-changes-during-stream-outage.test.tssrc/renderer/src/runtime/layout-owner-pane-intents.tssrc/renderer/src/runtime/pane-titles-drawn-from-frames.test.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-held-tabs.test.tssrc/renderer/src/runtime/workspace-layout-frame-operations.test.tssrc/renderer/src/runtime/workspace-layout-frame-sync.tssrc/renderer/src/runtime/workspace-layout-frame-tab-props.test.tssrc/renderer/src/store/slices/agent-status-batch.test.tssrc/renderer/src/store/slices/recently-closed-tabs.test.tssrc/renderer/src/store/slices/store-terminal-tab-changes-layout-owner.test.tssrc/renderer/src/store/slices/tab-view-mode.test.tssrc/renderer/src/store/slices/tabs/moved-tab-selection.tssrc/renderer/src/store/slices/tabs/tabs-drop-actions.tssrc/renderer/src/store/slices/tabs/tabs-focus-actions.tssrc/renderer/src/store/slices/tabs/tabs-label-actions.tssrc/renderer/src/store/slices/tabs/tabs-slice-contract.tssrc/renderer/src/store/slices/terminal-tab-title-batch.test.tssrc/renderer/src/store/terminals/structured-chat-tab-rename.test.tssrc/renderer/src/store/terminals/tab-change-through-layout-owner.tssrc/renderer/src/store/terminals/terminal-tab-layout-owner-actions.tssrc/shared/rpc-contract/workspace-layout-params.tssrc/shared/rpc-contract/workspace-layout-ratio-params.tssrc/shared/rpc-contract/workspace-layout-rename-tabs-params.tssrc/shared/workspace-layout/split-ratio-intents.tssrc/shared/workspace-layout/workspace-layout-command-types.tssrc/shared/workspace-layout/workspace-layout-commands.test.tssrc/shared/workspace-layout/workspace-layout-commands.tssrc/shared/workspace-layout/workspace-layout-group-commands.tssrc/shared/workspace-layout/workspace-layout-pane-commands.tssrc/shared/workspace-layout/workspace-layout-ratio-commands.test.tssrc/shared/workspace-layout/workspace-layout-tab-commands.ts
💤 Files with no reviewable changes: 2
- src/shared/workspace-layout/workspace-layout-commands.test.ts
- src/renderer/src/store/slices/tabs/tabs-slice-contract.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
…'s frame, not its reply (dark, layout-owner build only)
ELI5
In the layout-owner build, the window used to draw some of its own changes twice: once itself, and again when main's update arrived. Tab renames, colors, pins, view mode, pane titles, tab moves and divider drags all worked like that. Now the window asks main and draws only what main sends back, so there is one copy of the truth. Divider drags send just the ratios that moved, and main refuses a drag aimed at a divider that has since changed, instead of moving the wrong one.
What Changed
Users see nothing different in shipped builds (the switch is off). With the switch on:
ratios: [{path, ratio, split}]instead of the whole tree.shownByFramesis deleted. The local stream reconnects within 1 to 30 s, and its snapshot redraws every workspace. The older local draws for split, close and create (L173) are untouched.replaceExisting. Before, a second agent prompt made during a stream outage could overwrite the first title.Owner-visible (switch on only):
Left for later tracks (not deleted here):
withMainTerminalFacts(L184) needs D1's main-first creates.Why
These were the window-side copies of decisions main already makes. Each copy is a second writer that can disagree with main, and that is where the switch-on bugs came from. The alternatives were keeping the local draws behind a "stream is down" check, or keeping the window's whole-tree ratio form. Both keep a second writer; the first also fights main's answer when the stream returns.
Compatibility:
layout.applygoes only from a window to its own main, which is the same build, and a paired server's workspaces are answeredhost_not_owned. The newratios,splitandreplaceExistingfields are optional, the old ratio forms are still accepted, and an older host's schema strips unknown fields.Linked Issue
N/A (layout-owner plan, step E2b; follows #31152).
Visual Proof
N/A: dark change; the switch is off in shipped builds and the switch-off bundle has no behaviour change (below).
Testing
replaceExistingis set.launchAgentOfextraction,changePaneTitlereordering that keeps the same order of effects), import-alias renames and commit stamps.ci-static-gate(every static-analysis step inpr.yml) passes. The switch-on main runtime and persistence tests have the same failures at this head and at the merge base.Review
One independent review, then two reviews of the fixes.
Agent skill upstream boundary
Notes
Remote and SSH: paired-server workspaces keep today's path (guard test passes). Folder workspaces use the same commands.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)