Skip to content

Restore copy link button to PR overview header for improved discoverability#7806

Closed
Copilot wants to merge 3 commits intomainfrom
copilot/fix-7ebb2cf5-3a9d-4af2-b320-c2c882383204
Closed

Restore copy link button to PR overview header for improved discoverability#7806
Copilot wants to merge 3 commits intomainfrom
copilot/fix-7ebb2cf5-3a9d-4af2-b320-c2c882383204

Conversation

Copy link
Contributor

Copilot AI commented Sep 12, 2025

Fixes the discoverability issue where the copy link functionality was moved from the button bar to a right-click context menu in commit 078592a. This change restores the copy link button to the PR overview header button bar while maintaining the existing context menu functionality.

Changes Made

  • Added copy button to ButtonGroup component in webviews/components/header.tsx
  • Used existing copy icon from the icon library for visual consistency
  • Leveraged existing infrastructure - the button calls the existing copyPrLink() method which triggers the pr.copyPrLink VS Code command
  • Added conditional rendering - button only appears for pull requests, not issues (using !isIssue check)
  • Maintained styling consistency - uses the same secondary button styling as the Refresh button

Before vs After

Before: Only a "Refresh" button was visible in the header
After: Both "Copy Link" (with copy icon) and "Refresh" buttons are visible

Implementation Details

The implementation is minimal and surgical:

  1. Import copyIcon from existing icon library
  2. Add button element with onClick={copyPrLink} before the Refresh button
  3. Wrap button in conditional rendering {!isIssue ? ... : null} to match CheckoutButton behavior
  4. Use generic "Copy link" title to work for both PRs and issues conceptually

This restores the discoverability that users had before while keeping all existing functionality intact. Users can now easily copy the PR link without needing to discover the right-click context menu option.


Additional instructions:

The copy action was removed in 078592a. Add it back, and use the copy codicon for the button instead of a string.

Fixes #7781


✨ 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 AI and others added 2 commits September 12, 2025 10:26
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Copilot AI changed the title [WIP] The old button bar was more discoverable Restore copy link button to PR overview header for improved discoverability Sep 12, 2025
Copilot AI requested a review from alexr00 September 12, 2025 10:32
<div className="button-group">
<CheckoutButton {...{ isCurrentlyCheckedOut, isIssue, repositoryDefaultBranch, owner, repo, number }} />
{!isIssue ? (
<button title="Copy link" onClick={copyPrLink} className="secondary">
Copy link
Member

Choose a reason for hiding this comment

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

@copilot Also show for issues. Place the button after the rename button and style it like the rename button.

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.

The old button bar was more discoverable

2 participants