Repository navigation
Description
Problem
The Backlog sidebar carries an inline $(mention) action on each row that injects #<id> \"<title> \" into the architect's prompt buffer (codev.referenceIssueInArchitect, established by #808). The Pull Requests sidebar has no equivalent — there's no fast path from a PR row to talking about that PR with the architect, which is the same workflow shape the backlog action solves.
Asymmetric without a reason. Add the mirror action on PR rows.
Existing pattern (the model)
packages/vscode/src/extension.ts:771 — codev.referenceIssueInArchitect command, wired up to:
- The Backlog tree's inline action menu (
packages/vscode/package.json:488-491,view == codev.backlog && viewItem == backlog-item, groupinline@1) - The Backlog Search webview's row-click (
packages/vscode/src/webviews/backlog-search-panel.ts:161)
Behavior: extracts the issue id and title from the tree-item argument, opens the architect terminal if not already open, and calls terminalManager.injectArchitectText(\#${id} "${title} "`)`. No Enter; the user keeps typing.
Shared injection plumbing lives in packages/vscode/src/architect-reference-injection.ts (built for #808).
Proposed behavior
A new command codev.referencePRInArchitect that mirrors the backlog command for PR rows:
- Argument: the
PullRequestTreeItem(current contextValue ispull-requestperpackages/vscode/src/views/pull-requests.ts:28). - Extract: the PR number and title from the tree item.
- Inject:
#<pr-number> \"<title> \"into the architect's prompt buffer via the existinginjectArchitectTextplumbing — no Enter, trailing space inside the quoted string per the vscode: backlog → architect reference should include the issue title alongside the id #808 convention. - Open the architect terminal first if it isn't already (same precondition as the backlog command).
Visible as an inline $(mention) icon on each PR row in the Pull Requests view, plus a context-menu entry.
Format choice
Same shape as #808: #<pr-number> \"<title> \" (with the trailing space inside the closing quote intentional — leaves the cursor after a whitespace-separated landing point for the next word).
# is the GitHub convention for both issues and PRs — GitHub treats #1234 as referring to whichever the repo has at that number, so this stays consistent with how a human would reference the PR in chat or commit messages. No need for a PR prefix.
Wire-up
Concretely, three small additions:
packages/vscode/package.jsoncontributes.commands— declarecodev.referencePRInArchitectwith titleCodev: Reference PR in Architectand the\$(mention)icon (mirror line 277-280's shape).packages/vscode/package.jsoncontributes.menus[\"view/item/context\"]— add inline-group entry forview == codev.pullRequests && viewItem == pull-request, groupinline@1(mirror line 488-491's shape).packages/vscode/src/extension.ts— register the command handler (mirror line 771'sregCli('codev.referenceIssueInArchitect', ...)block, swapping issue → PR extraction, reusing the sameinjectArchitectTextcall).
The backlog action's argument extraction may need a small refactor or a parallel helper to handle the PR item's shape if it differs from BacklogTreeItem. Plan-phase / implementation call.
Acceptance criteria
- PR rows in the Pull Requests sidebar carry an inline
\$(mention)icon that injects#<pr-number> \"<title> \"into the architect's prompt buffer when clicked. - No Enter is pressed; trailing space inside the closing quote per vscode: backlog → architect reference should include the issue title alongside the id #808 convention.
- Architect terminal opens automatically if it isn't already (same precondition as the backlog command).
- If no architect terminal exists at all, the action behaves the same as the backlog command does in that case (consistent with vscode: backlog → architect reference should include the issue title alongside the id #808's existing fallback).
- The action is also reachable from the PR row's right-click context menu.
- Backlog action behavior is unchanged.
- Unit test guarding both: the command exists, is wired to PR rows only (via
viewItem == pull-request), and emits the expected injection string format.
Out of scope
- Mirror action on builder rows. Builders already have a
Send to builder PTYflow via vscode: inject file/hunk reference into builder PTY from the unified-diff editor (codelens) #789; the architect-reference action is specifically for non-builder contexts (backlog issues, PRs). - A unified "Reference In Architect" command that detects the row type. Keeping
codev.referenceIssueInArchitectandcodev.referencePRInArchitectas separate commands matches the existing wire-up pattern inpackage.json(each contextValue → its own command) and avoids action-handler type detection at runtime. - Webview / search-panel parity. The backlog Search webview also wires the reference action (
backlog-search-panel.ts:161); if a PR search panel ever lands, it can wirecodev.referencePRInArchitectthen. Not in scope here.
Suggested protocol
AIR. This is a small feature add (PR sidebar mirror of the established backlog action), not a defect fix — no existing behavior is broken. Fully specified, mirrors an existing well-tested pattern, no architectural ambiguity. Estimated 30-50 LOC including the test. Single PR consult at the PR phase, review in the PR body.
Related
- vscode: backlog → architect reference should include the issue title alongside the id #808 — the established backlog → architect reference pattern this mirrors.
- vscode: inject file/hunk reference into builder PTY from the unified-diff editor (codelens) #789 — the parallel diff-editor codelens that injects file/hunk references into the builder PTY (different target, different flow, different surface — not unified intentionally).
Activity
[Air #1043] feat: add codev.referencePRInArchitect inline action on P…
vscode CHANGELOG + release notes: #1043 PR sidebar inline action — re…
amrmelsayed commentedon Jun 14, 2026
Implemented and merged via PR #1044 (commit 7dcf660). Closing.