vscode-pull-request-github icon indicating copy to clipboard operation
vscode-pull-request-github copied to clipboard

Add "Reveal in File Explorer" context menu option for local PR files

Open Copilot opened this issue 2 months ago • 0 comments

PR file context menus only showed "Open File on GitHub", which isn't useful for locally available files. Users needed a way to reveal PR files in their OS file explorer, similar to SCM context menu functionality.

Changes

Command registration (src/commands.ts)

  • Added pr.revealFileInOS command that delegates to VS Code's built-in revealFileInOS
  • Constructs file path via vscode.Uri.joinPath(repository.rootUri, fileName)

Context value differentiation (src/view/treeNodes/fileChangeNode.ts)

  • GitFileChangeNode now appends :local suffix to distinguish from RemoteFileChangeNode
  • Suffix preserved across updateViewed() calls via _appendLocalSuffix() helper
  • Prevents duplicate suffixes with endsWith(':local') check

Menu configuration (package.json)

  • Added menu item at view/item/context group 0_open@1
  • Visibility: view =~ /(pr|prStatus):github/ && viewItem =~ /filechange.*:local/ && viewItem !~ /filechange:DELETE/
  • Hidden from command palette (context menu only)

Behavior

  • Appears for locally checked out PR files (modified/added)
  • Hidden for remote files (PR not checked out) and deleted files
  • Platform-aware: "Reveal in Finder" on macOS, "Reveal in File Explorer" elsewhere
Original prompt

This section details on the original issue you should resolve

<issue_title>Add "Reveal in Finder/Explorer" option on PR files</issue_title> <issue_description>It would be great to get additional actions for PR files like Reveal in Finder/Explorer like in the SCM context menu. Right now the only option is "Open in GitHub" which isn't really useful.

Image</issue_description>

Comments on the Issue (you are @copilot in this section)

@alexr00 Hey @miguelsolorio! For modified files, we could do that. For added files when you don't have the PR checked out, we don't have the file available locally to reveal in the explorer.
  • Fixes microsoft/vscode-pull-request-github#6899

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot avatar Dec 10 '25 16:12 Copilot