Repository navigation
feat(vscode): add codev.referencePRInArchitect inline action on PR rows - #1044
Merged
Merged
Conversation
…R rows Mirrors codev.referenceIssueInArchitect for the Pull Requests sidebar. Injects #<pr-number> "<title> " into the architect prompt buffer via the existing buildArchitectReferenceInjection plumbing. - PullRequestTreeItem subclass carries prId/prTitle for typed command args - package.json: command declaration ($(mention) icon), palette hiding, inline menu entry - extension.ts: command handler registered alongside referenceIssueInArchitect - 11 unit tests covering declaration, wiring, palette, handler, injection format
7 tasks
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
Implements #1043: adds a
codev.referencePRInArchitectcommand that mirrors the existingcodev.referenceIssueInArchitectbacklog action for the Pull Requests sidebar.PullRequestTreeItem— new typed subclass ofvscode.TreeItem(inpull-requests.ts) that carriesprIdandprTitleas typed fields, so the command handler can read them viainstanceof(same pattern asBacklogTreeItem).package.json— declarescodev.referencePRInArchitectwith$(mention)icon, hides it from the command palette (when: false), and adds aview/item/contextinline entry atinline@1scoped toview == codev.pullRequests && viewItem == pull-request.extension.ts— registers the handler: guards oninstanceof PullRequestTreeItem, opens the architect terminal, and callsbuildArchitectReferenceInjection(prId, prTitle)— reusing the shared injection helper from vscode: backlog → architect reference should include the issue title alongside the id #808.Behavior
Clicking the
$(mention)inline icon on a PR row injects#<pr-number> "<title> "into the architect's prompt buffer without pressing Enter, leaving the cursor ready for the user's next word. Architect terminal opens automatically if not already open. Falls back to#<id>if title is unavailable (same as the backlog action's fallback).Tests
11 unit tests in
src/__tests__/reference-pr-in-architect.test.ts:package.jsonwith$(mention)iconreferenceIssueInArchitect)view/item/contextinline entry targetscodev.pullRequests/pull-requestatinline@1backlog-itemrowswhen: false)extension.tsregisters the command and callsbuildArchitectReferenceInjectioninstanceof PullRequestTreeItem#42 "Fix the thing"#42All 304 pre-existing tests continue to pass.
Review
This is a small, fully-specified feature add (3 files changed, ~55 LOC) that mirrors an established well-tested pattern. No architectural decisions needed. Implementation stayed within scope.
Lessons
PullRequestTreeItemsubclass pattern followsBacklogTreeItemexactly and stays clean.buildArchitectReferenceInjectionhelper being unit-testable without VS Code mocking is a good design pattern to maintain.