Repository navigation
fix(terminal): show a host-created setup split in the window that holds its tab - #28105
Conversation
…ds its tab (STA-9417) Main only revealed a split of a saved tab when its copy of the window's graph listed the source pane. That copy lags the tab the create reveal just added, so the window never drew the setup split and its first-activation sweep left the setup terminal with no pane or minted a second tab for it. Reveal unless the window's graph shows the source pane running a different terminal, and reject a split into an unknown tab before the window switches workspace.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: 🔵 Low · up to
|
|
E2E at 4273a68 (base 7154e90):
|
ELI5
A workspace's setup script can be set to run in a split beside the workspace's first terminal. Suppose the workspace was created from the command line while you were looking at another one. The first time you opened it, the split was often missing: the setup script ran with nowhere to show it, or it showed up as an extra tab. Now the window shows the split where it belongs.
What Changed
Before: Run
orca worktree create(setup mode "split", without opening the workspace). Then open the new workspace. Often you saw one terminal and no setup pane, while the setup script kept running unseen. On macOS you could instead get a second tab showing the same setup terminal, so one terminal was in two places.After: You see one tab with two panes, with the setup output in the second pane.
Mechanism. The app's main process creates both terminals and tells the window about each one. For the split, it only did so when its copy of the window's view already listed the first pane. That copy is updated after the window adds the tab, so it is usually behind. Main skipped telling the window, and the window never drew the split. When the workspace was later opened, the window's "give every running terminal a place" pass found the setup terminal. It either left it out or made a new tab for it.
orca-runtime-split-pty-backed-terminal.ts: main now always tells the window about a split of a saved tab. The one exception is when its copy of the window's view shows that pane running a different terminal. That is the case the old check really guarded against, and it is kept.terminal-presentation-ipc-bridge.ts: if the window does not have the tab, it refuses the split before doing anything else. Before, a split that asked to be shown switched the window to that workspace and only then refused.Behaviour change: a command-line split into a tab the window holds but has not opened yet now shows in that tab. If the split asks to be activated, the window switches to that workspace, as it already does for a tab that is open.
Why
The window already handles a split of a tab it has not opened (the existing unit test for that case passes). Only main's decision to tell it was wrong.
Alternatives considered:
Linked Issue
STA-9417
Visual Proof
N/A: the end-to-end layout check
setup-split-first-activationcovers this flow on Linux and macOS: one tab, two panes, setup output visible. Its four known-failure entries are removed, so the run below fails if the bug comes back.Testing
Unit:
orca-runtime-terminal-split-authority.test.ts: a split of a saved tab the window's view has not listed is still sent to the window.setup-split-activation-single-owner.test.ts: a split into a tab the window lacks is refused without switching workspace.src/main/runtimeandhooks/ipc-eventssuites pass (11,906 tests).pnpm tcand the changed-code quality check pass.E2E: the three layout-oracle specs as a targeted run, plus the full suite compared with main at the same base (runs listed in a comment).
Cross-platform, SSH, mobile: the Windows setup runner, WSL and SSH command building are untouched. A remote host has no window to tell, and paired clients already got the split through the session stream. Nothing changes on the wire.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Review
Agent skill upstream boundary
Notes
Ensure no issues in: Security, Cross-platoform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)