Skip to content

[Bugfix #1170] vscode: group headers no longer surface builder-scoped context-menu entries#1172

Merged
amrmelsayed merged 7 commits into
mainfrom
builder/bugfix-1170
Jul 13, 2026
Merged

[Bugfix #1170] vscode: group headers no longer surface builder-scoped context-menu entries#1172
amrmelsayed merged 7 commits into
mainfrom
builder/bugfix-1170

Conversation

@amrmelsayed

Copy link
Copy Markdown
Collaborator

Summary

Right-clicking a group header in the Agents tree (architect / phase / area axis) surfaced 7 builder-scoped context-menu entries (Open Builder, View Diff, Open/Run Worktree Window/Folder/Setup/Dev, Stop Dev) that have no target on a header. Selecting any of them silently no-ops because the command handlers narrow via instanceof BuilderTreeItem and a group header fails the check. This PR stops the entries from ever displaying for group headers.

Root Cause

packages/vscode/src/views/area-group-tree-item.ts built the header contextValue as `${kind}-group`. For BuilderGroupTreeItem (kind='builder') that yields builder-group. The 7 offending menu entries in package.json gate on the regex /^(builder|blocked-builder|awaiting-builder)-/, which matches any string starting with builder- — including builder-group. So a group header slipped the guard.

The 3 protocol-scoped entries (viewSpec/Plan/ReviewFile) already avoid this because they append a protocol-suffix requirement ((spir|aspir|air|pir)) that builder-group fails.

Fix

One-line change: flip the template to `group-${kind}`. Group headers become group-builder / group-backlog, neither of which matches the family regexes. No package.json changes; the 7 regexes stay as-is and now correctly exclude headers. The id prefix (line 33, drives expansion-state persistence) is intentionally left unchanged.

Per the issue's out-of-scope note, this addresses the root cause more directly than tightening each of the 7 regexes with a protocol enumeration (which would regress when new protocols land, e.g. tick).

Test Plan

New regression test packages/vscode/src/__tests__/group-header-context-value.test.ts:

  • Instantiates the real AreaGroupTreeItem and reads its contextValue (so a revert to ${kind}-group is caught — a hardcoded string wouldn't be).
  • Asserts each of the 7 builder-scoped menu regexes (extracted from package.json) rejects the builder and backlog group-header contextValues.
  • Asserts the regexes still match a real builder row (builder-bugfix) to guard against over-tightening.

Verified the test fails without the fix (8 failures when source reverted to ${kind}-group) and passes with it. Full suite: 566 tests pass; porch check build + tests green.

Grep confirmed no existing assertion referenced the old builder-group literal, so no test updates were needed.

Fixes #1170

…er menu regexes

Flip AreaGroupTreeItem contextValue from `${kind}-group` to `group-${kind}`
so a builder group header is `group-builder` (was `builder-group`), which no
longer matches the `/^(builder|blocked-builder|awaiting-builder)-/` when-clause
regexes gating the seven builder-scoped Agents-tree context-menu entries. The
menu no longer surfaces dead entries on group headers.

[Bugfix #1170] Test: pin that group-header contextValue is rejected by the
seven builder-scoped menu regexes, derived from the real AreaGroupTreeItem.
@amrmelsayed amrmelsayed merged commit b3c29d5 into main Jul 13, 2026
6 checks passed
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: Agents tree group headers surface builder-scoped context-menu entries (contextValue collision)

1 participant