Repository navigation
fix(app): a tab moved to a new pane leaves its old pane's strip in the same turn, so focus follows it at once - #31920
Conversation
…rn it shows beside the dock Ports the red test 16e0b97 of b760527 from cp/dogfood-v2-2-12-opt (dogfood v2.1: the first keys typed into a new terminal asked for from Home's dock were lost while the dock's strip still listed the moved tab). Run on feat first: feat's OutboundTab hold (#28127) keeps a tab Home's dock makes out of the dock's strip until it has moved, which may already cover this path.
… shows there The dogfood red test of b760527 (HomeDockNewTerminalFocusTests) passes on feat 3 of 3 (fleet step fd5c7591a5259c2e6904a199): feat's OutboundTab keeps a tab that Home's dock makes out of the dock's strip. Move Tab to New Split moves a tab that its pane already shows, with no such hold. This test checks that path: the first topology that shows the moved tab in its new pane no longer lists it in its old pane, focus follows it in that reduction, and focus never resolves to an empty pane.
…e same turn, so focus follows it at once Ports b760527 from cp/dogfood-v2-2-12-opt (dogfood-only fixes audit, row 10). A workspace's layout apply showed a moved tab in its new pane and sent the focus topology with the old pane's strip as it was, which still listed the tab until that pane's own strip observation ran in a later main-actor job. Focus waited for the tab to leave the old pane and did not follow it; keys typed then reached the window. On feat, Home's dock no longer shows this (OutboundTab, #28127, keeps a tab the dock makes out of its strip; the dogfood test HomeDockNewTerminalFocusTests passes on feat), but Move Tab to New Split does: MoveTabToNewSplitFocusTests is red on feat (fleet step 24f91a9c4ae78fd84ea0fb0d). The model now changes in one turn, under one topology (Chrome's rule: input sees the model as of its turn): - The workspace's apply brings every pane strip whose record's tabs changed since its last apply up to the store before it sends its one topology (`syncStaleStrips`). O(tabs of the workspace's panes), only on a layout change. - A pane whose own strip observation runs first applies the workspace's layout first (`applyLayoutIfChanged`, a no-op when the layout did not change), so the other order also moves the tab in one turn. App lines: StaticURL (a Foundation-only enum of fixed URLs) moves from CmuxNextApp to CmuxNextAppCore, so CmuxNextApp does not grow (app_lines ratchet).
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
Shipped in:
|
|
Found 2 test failures on Blacksmith runners: Failures
|
|
Review (independent review subagent): SHIP at e47f4f3 Read only. I did not compile or run tests. I read the diff against merge-base b5060b4, the dogfood original b760527, and the code paths around it. The head merges cleanly with the current origin/feat-cmux-next (the only later change to these files is #31837's one-line Correctness: no blocking findings
Non-blocking (follow-ups or nits)
Verdict: SHIP. Not run: compile, tests and a live tagged build. This review only read the code. |
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
Summary
Ports b760527 from cp/dogfood-v2-2-12-opt (dogfood-only fixes audit, row 10).
When a tab moved to a new pane, the workspace's layout apply showed it in its new pane and sent the focus topology while the old pane's strip still listed it. That strip changed only when the old pane's own strip observation ran, a main-actor job later. The first topology had the tab in both panes, so focus did not follow it in that turn; keys typed in that gap reached the window instead of the moved terminal.
On feat, Home's dock no longer shows this: feat's
OutboundTab(#28127) keeps a tab that the dock makes out of the dock's strip until it has moved, and the dogfood regression testHomeDockNewTerminalFocusTestspasses on feat 3 of 3 (fleet step fd5c7591a5259c2e6904a199). Move Tab to New Split (and other moves of a tab the pane already shows) still has the gap: the newMoveTabToNewSplitFocusTestsis red on feat.Now the model changes in one turn, under one topology (Chrome's rule: input sees the model as of its turn):
syncStaleStrips). O(tabs of the workspace's panes), only on a layout change.applyLayoutIfChanged, a no-op when the layout did not change), so the other order also moves the tab in one turn.No key hold and no wait.
App lines:
StaticURL(a Foundation-only enum of fixed URLs) moves from CmuxNextApp to CmuxNextAppCore with no change in behavior, so CmuxNextApp does not grow (app_lines ratchet).Testing
MoveTabToNewSplitFocusTests(new): one workspace, two terminal tabs in one pane,tab.moveToNewSplitof the second (origin user). The first topology that lists the moved tab in a new pane must no longer list it in the old pane; focus must follow it in that reduction; focus never resolves to an empty pane.HomeDockNewTerminalFocusTests,HomeDockOpensTests,PaidPlanUpgradeTests,CloudCreateWithoutAskingTests(the StaticURL users) pass.HomeDockNewTerminalFocusTests(the dogfood test, ported as is) passes on feat before the fix (step fd5c7591a5259c2e6904a199, 3 of 3) and with it.Observed / Not run
Observed: the red and green fleet steps above; the pre-push gate (no new violations, no arch-ratchet rise).
Not run: a live tagged build with typed keys right after Move Tab to New Split; a drag of a tab to a pane edge (it goes through the same layout and strip observation paths, read only).
Changelog
Fixed: After Move Tab to New Split, keys typed at once go to the moved terminal.
Proof
No capture: the change is in the same-turn focus order, not in what a frame shows.
Need help on this PR? Tag
@codesmith-botwith what you need.Summary by cubic
Fixes the gap where a tab moved to a new pane stayed listed in its old pane's strip until that pane's strip observation ran later, so the focus topology had the tab in both panes and keys typed in that turn reached the window instead of the moved terminal.
Now the model changes in one turn, under one topology: the workspace's layout apply syncs every stale pane strip before sending its one topology (
syncStaleStrips), and a pane whose own strip observation runs first applies the workspace's layout first (applyLayoutIfChanged, a no-op when unchanged).StaticURLmoves fromCmuxNextApptoCmuxNextAppCore, soCmuxNextAppdoes not grow (app_lines ratchet).MoveTabToNewSplitFocusTests(red on the base before the fix) and ports the dogfood regression testHomeDockNewTerminalFocusTests.Written for commit e47f4f3. Summary will update on new commits.