fix(next): reuse right-side browser and terminal panes

Merged
TE
6d ago
+135-38

Links and folder terminals opened beside a chat now reuse the right-column pane that already contains their kind. A terminal beside a browser, or a browser beside a terminal, still creates the lower split once; later opens reuse the matching pane.

Leo, 2026-10-31:

"imo in this case, just open it on the existing. you only need the rightmost botom auto split when there's a terminal that gets opened when there's already a browser, and vice versa"

This carries #29606 with its original commits and includes current base, including #29600's test-compilation repairs. The existing pure LinkOpenPlacement policy moves beside RightColumnPlacement in CmuxNextAgentPane, reducing the app target instead of adding routing logic there. No package dependencies change. Browser Cmd-click, chat links and folder terminals use the same decision.

Related: #29683 carries #28544 for Cmd-T focus and New Tab picks; #29682 carries #28633 for chat-header tools and docked terminal/browser opens. #28989 supplied the lower-right split behavior; #26603 is earlier overlapping work. Spec: leo-workspace design/pane-placement.md, with Leo's 2026-10-31 same-kind clarification above taking precedence over the older unconditional lower-split rule.

Validation:

  • git diff --check: passed.
  • python3 scripts/cmux-next/prepush-gate.py: passed; the app target shrinks.
  • Fleet Release compile: passed at 479c1b94af4bcf989485c16cefaba0ea494604cd (app and cmux-tui); the final head changes only the highlight documentation link and has identical native inputs, run. Portable Swift checks and the test-compile advisory also passed.
  • Focused fleet placement suites passed on stacked #29682 at 4d8d629bc547cbf56b32c8081ef5f4d9fdd98b68, including this head: RightColumnPlacementTests, LinkOpenPlacementTests, RightPanePlacementTests, HeaderChangesTests, HeaderPreviewTests, HeaderSplitOrderTests and HeaderSideTabsTests. Four display-only ChatDock tests skipped as advisory coverage.
  • Independent router review: SHIP at the final head, cd0cac78b10d8eb0dd5c62b21f5b1f8efb0e0de5 (gpt-6.1-sol xhigh). One nonblocking P2 follow-up, tracked in #29701: include session-local fallback WebKit tabs in browser-kind detection for older remote daemons.
  • The initial release-note validator failure (missing docs/try-it link) is repaired; the focused digest check passed on the fleet.

Risk: changes the destination of a new browser or folder-terminal tab when its kind already exists on the right. Tests cover same kind, mixed kinds, two panes, narrow widths and an empty right side. Other kinds keep the existing placement policy. No new timers, observers or animation loops. No after screenshots; these are follow-up evidence under the standing screenshot rule.

Agent session: agent session

šŸ¤– Generated with Claude Code