cmux NEXT: a lone chat's link opens only in the pane on the right, never first in the main pane
leo-named-fix
Leo (2026-11-03): "and also the browser/tab opening animation still plays on the main pane before going". Earlier (2026-10-21): "the opening up a new link from a given main pane without any other splits it plays the opening animation on the main window...".
What was wrong
From a lone agent chat, a link's tab is made unselected in the chat's pane and kept out of its strip (OutboundTab) while the chat docks left (MainPaneLayout.dockChat); the pane, holding the tab, then slides in from the right as the content handoff. PaneController.observe applies the workspace layout before the strip, so a tab that moved away leaves the strip in the same turn its new pane shows. Two other strip paths did not: syncStripFromStore (called by OutboundTab.finish when dockChat's wait for the moved chat hears the store, which can come before the pane's own observation) and tabItemChanged (a loading page's title/favicon change). Either could list and select the new tab while the layout still had the pane full width as the main pane, so its open played there first, and only the layout apply after it moved the pane to the right.
Fix
PaneController.layoutFirst(): when the record's tabs changed since the strip took them (stripIsStale), those two paths apply the workspace layout first (no-op when unchanged), then skip the strip apply if that apply tore the pane down. Nested calls from WorkspaceContentController.apply -> syncStaleStrips end at once (the tree is unchanged).
plans/cmux-next/arch-exceptions/dock-chat-strip-order.json: app_lines +8 (the helper and its doc comment), with the review receipt.
Prior art kept: #24577 (OutboundTab), #28127, #23969 / revert #24292 (the hold and its edge cases are untouched), the handoff motion (ChatDockLinkSplitMotionTests).
Risk
Normal. Touches when a strip sync applies the layout; the only new work is one LayoutMapping.map on a stale strip sync. No change to OutboundTab's hold rules or to the layout motion.
Verification
Red/green: swift test --filter DockChatStripOrderTests (commit a75a88efda6 is the test alone; the fix follows). Fleet results posted as a comment below.
Observed / Not run
- Observed: a correctness review (subagent) read the diff and gave SHIP at 7abad93c5af.
- Not run here: a DEV build run of the flow. The root cause comes from reading the code (observation order), not from a frame capture.
Changelog
- Fixed: a link opened from a lone agent chat no longer plays its tab-open animation in the main pane before it moves to the right pane.
Agent session: agent session
🤖 Generated with Claude Code
![Autofix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
A link opened from a lone agent chat now appears in the right pane only after the chat docks, instead of briefly opening in the full-width main pane.
- Strip syncs apply the workspace layout first when the pane’s tabs have changed.
- Adds a regression test for the dock-and-link handoff.