Skip to content

Add Open on GitHub action to PR editors - #8909

Merged
Alex Ross (alexr00) merged 3 commits into
mainfrom
copilot/fix-pr-viewer-open-in-browser
Aug 27, 2026
Merged

Add Open on GitHub action to PR editors#8909
Alex Ross (alexr00) merged 3 commits into
mainfrom
copilot/fix-pr-viewer-open-in-browser

Conversation

Copilot AI commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

PR editors can remain stuck loading, leaving no way to open the pull request externally.

PR editor stuck loading

Editor action

  • Adds the globe-based Open Pull Request on GitHub action to PR editor toolbars.
{
  "command": "pr.openPullRequestOnGitHub",
  "when": "activeWebviewPanelId == 'PullRequestOverview'"
}

Loading-safe URL resolution

  • Targets the active PR editor.
  • Uses the loaded PR URL when available.
  • While loading, reconstructs the URL from the retained PR identity and matching GitHub host, including GitHub Enterprise.
  • Fixes #332009

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Copilot AI changed the title [WIP] Add option to open PR viewer in external browser Add Open on GitHub action to PR editors Aug 27, 2026
@alexr00
Alex Ross (alexr00) marked this pull request as ready for review August 27, 2026 15:41
Copilot AI lite review requested due to automatic review settings August 27, 2026 15:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds an “Open Pull Request on GitHub” action to the PR overview editor toolbar and implements loading-safe URL resolution so users can open the PR externally even when the webview is stuck in a loading state.

Changes:

  • Added a new editor/title toolbar action (pr.openPullRequestOnGitHub) scoped to the PR overview webview.
  • Added PullRequestOverviewPanel.getCurrentPullRequestUrl() to return the loaded PR URL when available, or reconstruct it from retained PR identity + matching repository remote while loading.
  • Refactored the command handler so it can open the active PR editor’s URL (or fall back to choosing from active PRs).
Show a summary per file
File Description
src/test/github/pullRequestOverview.test.ts Adds coverage for resolving an active PR URL before the PR model finishes loading.
src/github/pullRequestOverview.ts Implements loading-safe URL resolution via getCurrentPullRequestUrl().
src/commands.ts Refactors the command to support editor-toolbar invocation and active-panel URL fallback.
package.json Contributes the PR editor toolbar action gated by activeWebviewPanelId == 'PullRequestOverview'.

Review details

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 4/4 changed files
  • Comments generated: 0
  • Review effort level: Lite

@alexr00
Alex Ross (alexr00) merged commit edc8a87 into main Aug 27, 2026
7 checks passed
@alexr00
Alex Ross (alexr00) deleted the copilot/fix-pr-viewer-open-in-browser branch August 27, 2026 15:57
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.

In-product PR viewer stuck. No way to open in external web browser

4 participants