Skip to content

[Air #1743] feat: add codev.buildersClickExpands setting - #1744

Merged
amrmelsayed merged 8 commits into
mainfrom
builder/air-1743
Sep 28, 2026
Merged

amrmelsayed merged 8 commits into
mainfrom
builder/air-1743

Conversation

@amrmelsayed

Copy link
Copy Markdown
Collaborator

Summary

Adds a boolean setting codev.buildersClickExpands (default true, behavior unchanged) that controls whether a single click on a builder row in the Agents view expands the row (the changed-files list) in addition to opening the builder terminal. When off, the click only opens the terminal and leaves the row's expand state untouched; the chevron still toggles expand/collapse.

Closes #1743

What Changed

  • apps/vscode/package.json: new codev.buildersClickExpands boolean setting (default true), placed next to codev.buildersAutoCollapse / codev.buildersAutoReveal, with a description in the same voice.
  • apps/vscode/src/extension.ts: the codev.openBuilderRow handler now reads the setting at click time (like buildersAutoReveal, so no restart is needed) and delegates to the extracted decision core. codev.openBuilderById (terminal-link clicks) is untouched — it never expanded.
  • apps/vscode/src/views/builders.ts: added runBuilderRowClick(clickExpands, effects) next to AccordionGate — the pure decision core (always open the terminal; expand only when the setting is on; swallow a benign reveal error when the row is gone mid-cleanup). Also updated the row item.command comment so it no longer claims the click always expands.
  • apps/vscode/src/__tests__/builders-click-expands.test.ts: new unit tests.

Key Decisions

  • Extracted the handler body into runBuilderRowClick rather than testing the inline activate() closure — the same pattern the codebase already uses for click-behavior decisions (AccordionGate) and routing decisions (decideApprovalRelay). This makes the on/off branch unit-testable without activating the extension; the inline handler stays a thin wrapper that reads the config and injects the real effects.
  • Effect types are () => unknown / () => PromiseLike<unknown> because openBuilderByRoleOrId returns Promise<string | undefined> and reveal returns Thenable<void>; runBuilderRowClick only awaits them.
  • No title-bar toggle (out of scope per the issue) — settings UI is enough. Group/architect rows and the chevron path are unchanged.

Test Plan

  • Unit tests added (builders-click-expands.test.ts): terminal always opens; row expands only when the setting is on; terminal-first order; benign expand-error swallow; and accordion orthogonality (the chevron → onDidExpandElement → AccordionGate path is independent of the click setting, confirmed by test rather than assertion).
  • Build passes (pnpm build, pnpm check-types, pnpm lint — all clean).
  • All tests pass (full vscode unit suite: 84 files, 1030 tests green; porch checks: build + tests green).

Review Notes

  • The change is confined to package.json, the codev.openBuilderRow handler in extension.ts, and views/builders.ts — none of the pir-1566-fenced files.
  • The accordion (codev.buildersAutoCollapse) needed no change: it listens on onDidExpandElement, which the chevron fires independently of the row command. This is pinned by a test rather than asserted.

Add a boolean setting codev.buildersClickExpands (default true, behavior
unchanged) gating whether a single click on a builder row expands the row
in addition to opening its terminal. When off, the click only opens the
terminal and leaves the row's expand state untouched; the chevron still
toggles expand/collapse.

- package.json: new setting next to buildersAutoCollapse / buildersAutoReveal.
- extension.ts: codev.openBuilderRow reads the setting at click time and
  delegates to runBuilderRowClick.
- views/builders.ts: extract runBuilderRowClick decision core next to
  AccordionGate; update the row item.command comment.
- test: on/off branch, terminal-first order, benign expand-error swallow,
  and accordion orthogonality (chevron path unaffected).
…gonality test non-tautological

Address CMAP (codex REQUEST_CHANGES, claude nits) on PR #1744:
- Add a manifest invariant test asserting codev.buildersClickExpands is a
  declared boolean with default true, so a key typo can't leave the setting
  silently inert (precedent: contributes-review-queue.test.ts).
- Replace the tautological AccordionGate-in-isolation orthogonality tests with
  the one seam this feature owns: a disabled row click never calls expandRow
  (no reveal -> no onDidExpandElement), an enabled click does. AccordionGate's
  own coverage stays in builders-accordion.test.ts.
@amrmelsayed
amrmelsayed merged commit 095ce66 into main Sep 28, 2026
7 checks passed
@amrmelsayed
amrmelsayed deleted the builder/air-1743 branch September 28, 2026 22:22
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: setting to stop a builder-row click from expanding the row (codev.buildersClickExpands)

1 participant