Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

Copy link

Copilot AI commented Oct 6, 2025

问题描述 (Problem Description)

现在状态栏的 Active PR 按钮点击之后会进入 Webview 的 PR 页面,我想加一个在浏览器里面打开 PR 的支持。

Currently, when viewing an active PR in the Activity Bar, users could only interact with it through the webview. There was no quick way to open the PR directly in a browser from the Activity Bar view.

解决方案 (Solution)

Added a new "Open in Browser" button to the Active Pull Request webview in the Activity Bar. This button allows users to quickly open the current PR on GitHub in their default browser with a single click.

实现细节 (Implementation Details)

Changes made to /webviews/activityBarView/overview.tsx:

  • Created a new OpenInBrowserSection component that:

    • Uses the existing openOnGitHub() method from PullRequestContext
    • Implements a busy state to disable the button while the action is in progress
    • Provides a clear tooltip for better UX
  • Integrated the button into the Overview layout between the Status Checks and Exit sections

Technical Flow:

  1. User clicks "Open in Browser" button
  2. Calls existing openOnGitHub() method from context
  3. Sends 'pr.openOnGitHub' command to backend
  4. Backend handler (already existing in activityBarViewProvider.ts) opens PR URL in browser

UI 位置 (UI Placement)

The button is strategically placed in the review workflow:

[Add Comment Section]
↓
[Status Checks Section]  
↓
[Open in Browser] ← NEW
↓
[Exit Section]

This positioning makes sense because after reviewing status and adding comments, users may want to view the full PR on GitHub for additional actions.

优势 (Benefits)

  • Minimal changes: Only one file modified, leveraging existing infrastructure
  • Consistent UX: Follows existing button styling and patterns
  • User-friendly: Clear tooltip and disabled state during action
  • No breaking changes: Uses existing backend handlers

Fixes the issue by providing a convenient way to open PRs in browser directly from the Activity Bar view.

Original prompt

现在状态栏的 Active PR 按钮点击之后会进入 Webview 的 PR 页面,我想加一个在浏览器里面打开 PR 的支持


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI and others added 2 commits October 6, 2025 07:07
Co-authored-by: luoling8192 <44741987+luoling8192@users.noreply.github.com>
Co-authored-by: luoling8192 <44741987+luoling8192@users.noreply.github.com>
Copilot AI changed the title [WIP] 现在状态栏的 Active PR 按钮点击之后会进入 Webview 的 PR 页面,我想加一个在浏览器里面打开 PR 的支持 Add "Open in Browser" button to Active Pull Request view Oct 6, 2025
Copilot AI requested a review from luoling8192 October 6, 2025 07:14
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.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.