[Bugfix #1170] vscode: group headers no longer surface builder-scoped context-menu entries#1172
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 BuilderTreeItemand 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.tsbuilt the headercontextValueas`${kind}-group`. ForBuilderGroupTreeItem(kind='builder') that yieldsbuilder-group. The 7 offending menu entries inpackage.jsongate on the regex/^(builder|blocked-builder|awaiting-builder)-/, which matches any string starting withbuilder-— includingbuilder-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)) thatbuilder-groupfails.Fix
One-line change: flip the template to
`group-${kind}`. Group headers becomegroup-builder/group-backlog, neither of which matches the family regexes. Nopackage.jsonchanges; the 7 regexes stay as-is and now correctly exclude headers. Theidprefix (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:AreaGroupTreeItemand reads itscontextValue(so a revert to${kind}-groupis caught — a hardcoded string wouldn't be).package.json) rejects the builder and backlog group-header contextValues.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 checkbuild + tests green.Grep confirmed no existing assertion referenced the old
builder-groupliteral, so no test updates were needed.Fixes #1170