fix(next): open remaining chat tools down the right pane
Problem
Chat header Preview, Changes and Files, plus New Terminal and New Browser launched from a docked chat, could route to the wrong right-side pane. A docked chat's strip pane was not recognized by the old beside check, so an open could become a new column after the existing columns. This stacked follow-up applies the measured RightColumnPlacement rule from #28044 to those remaining app paths.
Leo, 2026-10-30:
opening up a new browser, a new terminal, it opens up stuff, like, in the right pane. It's just, like, the fing logic for that is so fing borked. Because it keeps opening up fing columns instead of going at the bottom ... Claude would just open it up on the right side's bottom instead of what we have now. And I'm obviously saying not to fing open it up in the main f***ing pane.
Changes
- Header Preview, Changes and Files now measure from the chat and use the shared right-column decision: split below the one right pane, then add tabs to the lower pane.
- Docked-chat New Terminal and New Browser use the same serialized placement before Auto Layout, preserving the chat working directory, URL, engine and browser profile. Cmd-T's New Tab page route remains unchanged.
- Background process terminals and CLI/MCP
besideopens remain deferred to a follow-up research item. Their current identify-then-mutate transport is not atomic, lacks geometry for the width floors, and could race into more than two panes; see the research note in this PR discussion.
This draft is stacked on #28044 (lane/ux-right-lower-pane) and should be retargeted to feat-cmux-next once #28044 lands.
Tests
RightColumnPlacementTests: one right pane selectssplitBelow; two right panes select a tab in the lower pane.ChatDockToolPlacementTests: docked terminal/browser opens split below one pane, target the lower pane with two panes, and serialize concurrent opens.- Existing header and link placement suites remain covered.
Screenshots
Before/after capture is required for this UI behavior. The final review will attach 2x light and dark synthetic captures showing a chat with one right pane receiving the new open below it, and a chat with two right panes receiving a tab in the lower pane.
Research note: CLI/MCP and background-task terminals
ControlCaller.besidePane and cmux-tui/src/cli/beside.rs perform identify and daemon mutation as separate requests. Adding a split_below result alone would permit concurrent callers to create extra panes, while the control topology has no measured pane geometry for the shared width floors. A follow-up should add one app-side atomic, serialized placement operation (and a transport fallback) before changing those callers. AgentProcessTerminal can then reuse the forced-right serialized helper while retaining its argv/environment/name spawn closure.
Agent session: agent session
![View with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v3-3x.png)
![Autofix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
Fixes chat-launched tools — header Preview, Changes and Files, plus New Terminal and New Browser from a docked chat — so they open down the right pane instead of stacking new columns right of the chat.
- Applies the measured
RightColumnPlacementrule: one right pane splits below it, two right panes add a tab in the lower pane. - Docked terminal and browser opens are serialized before Auto Layout and keep the chat's working directory, URL, engine, and browser profile. Cmd-T's New Tab page route is unchanged.
- CLI/MCP
besideand background-process terminal opens keep their current behavior pending a follow-up that adds an atomic, serialized placement operation.