Skip to content

[AIR #1108] vscode: open architect terminal on Agents-view group-header click#1109

Merged
amrmelsayed merged 4 commits into
mainfrom
builder/air-1108
Jun 28, 2026
Merged

[AIR #1108] vscode: open architect terminal on Agents-view group-header click#1109
amrmelsayed merged 4 commits into
mainfrom
builder/air-1108

Conversation

@amrmelsayed

Copy link
Copy Markdown
Collaborator

Closes #1108.

Summary

In the Agents view's architect-axis grouping mode, clicking an architect
group header (e.g. MAIN, VSCODE) now opens that architect's terminal,
matching the builder-row affordance. The chevron continues to toggle
expand/collapse independently (VS Code routes the row command and the chevron
gesture separately — the same pattern builder rows already use).

This removes the asymmetry where the architect-axis grouping made the architect
first-class, but its header was a less interactive surface than the builder
rows nested under it.

Changes

  • packages/vscode/src/views/builders.tsrootChildren() now sets
    item.command = { command: 'codev.openArchitectTerminal', title: 'Open Architect Terminal', arguments: [g.key] }
    on each group header only when the active grouping axis is architect
    (grouping.id === 'architect'). g.key is the architect name.
  • packages/vscode/src/__tests__/builders-architect-header-command.test.ts
    new unit tests.

Key decisions

  • Scoped to architect headers only. Stage (SPECIFY, …) and area
    (TOWER, …) headers name no launchable entity, so they stay command-less
    containers. The gate is grouping.id === 'architect', checked once per render.
  • main fold preserved. A null spawnedByArchitect folds into the main
    bucket in architectGrouping(); the main header therefore opens the main
    architect terminal (arguments: ['main']), consistent with the fold.
  • No command-handler change. codev.openArchitectTerminal already accepts
    the optional architect-name argument (Multi-architect feature is underbaked — gaps in lifecycle, persistence, and UX #786 Phase 6) and already handles a
    stale / not-found owner gracefully — it shows a No '<name>' architect found
    warning (the same path the Workspace > Architects right-click takes). So the
    stale-owner edge from the issue's scope notes needs no extra work here.
  • No package.json / menu changes. This is a row command (left-click),
    not a view/item/context menu entry, so no contribution-point wiring is
    needed.

Test plan

  • pnpm test:unit (vscode package): 43 files / 516 tests pass, including the
    4 new tests:
    • architect headers carry codev.openArchitectTerminal with the architect
      name as the argument;
    • a null spawnedByArchitect yields a main header that opens the main
      terminal;
    • stage headers carry no command;
    • area headers carry no command.
  • porch check: ✓ build ✓ tests.

Out of scope (per issue)

  • Right-click context menu on architect headers (e.g. "Open Worktree Folder").
  • Launch affordance from stage / area modes (Workspace > Architects remains the
    surface there).

…ents view

Architect-axis group headers in the Agents view now carry a
codev.openArchitectTerminal command (with the architect name as the
argument), so clicking the header body opens that architect's terminal,
matching the builder-row affordance. The chevron still toggles
expand/collapse independently. Stage/area headers stay command-less
containers. Null spawnedByArchitect folds into the main header per
architectGrouping().

Adds builders-architect-header-command.test.ts covering the command
presence/argument on architect headers and its absence on stage/area
headers.
@amrmelsayed

Copy link
Copy Markdown
Collaborator Author

Architect Review

Low-risk AIR PR. Verified the implementation independently against PR head.

Implementation

packages/vscode/src/views/builders.ts:295-318 — clean. The isArchitectAxis gate is computed once outside the groups.map(g => ...) loop, and the command is set on each group header only when the architect axis is active. Stage and area headers stay command-less. The inline comment names every scope note from #1108: chevron routes independently for expand/collapse, g.key is the architect name (null owners folded into main per architectGrouping), and stale-owner handling rides on codev.openArchitectTerminal's existing graceful-warn behaviour.

const isArchitectAxis = grouping.id === 'architect';
return groups.map(g => {
  const groupItem = new BuilderGroupTreeItem(...);
  if (isArchitectAxis) {
    groupItem.command = {
      command: 'codev.openArchitectTerminal',
      title: 'Open Architect Terminal',
      arguments: [g.key],
    };
  }
  ...
});

Test coverage

builders-architect-header-command.test.ts pins all four scope notes:

  • Architect headers carry the command — independently verified for main and a named sibling (vscode).
  • main fold for null spawnedByArchitect — a builder with null owner produces a main group header that opens main's terminal.
  • Stage headers have no command — pure grouping containers.
  • Area headers have no command — same, with two-area fixture to bypass the lone-Uncategorized flatten so real area headers actually render.

Mocks vscode per the established __tests__ pattern (matches builders-autoreveal.test.ts).

Risk and scope

17 net lines in builders.ts (7 of code + 6 of comment, plus the isArchitectAxis const above the loop), 169 lines of test. Exactly the "5-line wiring + small unit test" scope #1108 anticipated. No new dependencies, no API surface change, no migration. Build / unit / e2e all green per the builder's report.

Recommendation

APPROVE. Ready for the pr gate.


Architect review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vscode: clicking an architect group header in the Agents view should open that architect's terminal (parity with the builder-row click affordance)

1 participant