You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
vscode: focusing a builder PTY tab silently reveals/expands the matching builder row in the tree #790
Today the click-row → focus-terminal direction is wired (see views/builders.ts:127), but the inverse isn't: activating a builder PTY tab (via Cmd+` cycle, terminal tab click, or any other path) does not update the Builders tree. The user is looking at a terminal and can't tell at a glance which row in the sidebar it corresponds to — especially with 3+ builders running, similar names, or after the accordion auto-collapsed something.
Current state
terminalManager.terminals (terminal-manager.ts:342) keys PTYs by a label/key that can be reversed to a builder id.
terminalManager.isCodevTerminalActive() already exists (extension.ts:127) — knows whether the active terminal is one of ours.
BuildersProvider exposes TreeView.reveal(...) (views/builders.ts:62–63); the accordion path uses it. The infrastructure is in place.
No window.onDidChangeActiveTerminal subscription currently drives the tree.
Proposed behavior
On extension activation, subscribe to vscode.window.onDidChangeActiveTerminal. Each fire:
If terminal is null → no-op.
Resolve the terminal to a builderId via terminalManager.terminals (matching by terminal reference; only entries with type === 'builder' count).
If no builder match → no-op. Dev/architect/shell terminals do not move the tree.
Find the corresponding builder TreeItem in BuildersProvider.
Call buildersView.reveal(item, { select: true, focus: false, expand: true }). Silent select — selection and expansion update, but focus stays where it is (so swapping to a builder terminal doesn't yank you out of the terminal pane).
Acceptance criteria
Activating a builder PTY tab updates the Builders tree selection to the matching row and expands it.
Focus is NOT stolen from the terminal pane (or wherever it was).
Architect, shell, and dev terminals do not move the tree.
Activating a non-Codev terminal does not change tree selection.
Works alongside the existing accordion mode without fighting it (the reveal call should cooperate, not double-collapse).
Activity