Skip to content

Commit dcc2177

Browse files
authored
Re-add copy link button (#7127)
This reverts commit cf079a4.
1 parent 75e8400 commit dcc2177

3 files changed

Lines changed: 8 additions & 1 deletion

File tree

src/github/issueOverview.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,8 @@ export class IssueOverviewPanel<TItem extends IssueModel = IssueModel> extends W
321321
return this.addAssigneeYourself(message);
322322
case 'pr.add-assignee-copilot':
323323
return this.addAssigneeCopilot(message);
324+
case 'pr.copy-prlink':
325+
return this.copyItemLink();
324326
case 'pr.copy-vscodedevlink':
325327
return this.copyVscodeDevLink();
326328
case 'pr.openOnGitHub':

webviews/common/context.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ export class PRContext {
3535

3636
public openChanges = () => this.postMessage({ command: 'pr.open-changes' });
3737

38+
public copyPrLink = () => this.postMessage({ command: 'pr.copy-prlink' });
39+
3840
public copyVscodeDevLink = () => this.postMessage({ command: 'pr.copy-vscodedevlink' });
3941

4042
public cancelCodingAgent = (event: TimelineEvent): Promise<CancelCodingAgentReply> => this.postMessage({ command: 'pr.cancel-coding-agent', args: event });

webviews/components/header.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ function Title({ title, titleHTML, number, url, inEditMode, setEditMode, setCurr
103103
}
104104

105105
function ButtonGroup({ isCurrentlyCheckedOut, canEdit, isIssue, repositoryDefaultBranch, setEditMode }) {
106-
const { refresh, copyVscodeDevLink, openChanges } = useContext(PullRequestContext);
106+
const { refresh, copyPrLink, copyVscodeDevLink, openChanges } = useContext(PullRequestContext);
107107

108108
return (
109109
<div className="button-group">
@@ -121,6 +121,9 @@ function ButtonGroup({ isCurrentlyCheckedOut, canEdit, isIssue, repositoryDefaul
121121
<button title="Rename" onClick={setEditMode} className="secondary small-button">
122122
Rename
123123
</button>
124+
<button title="Copy GitHub pull request link" onClick={copyPrLink} className="secondary small-button">
125+
Copy Link
126+
</button>
124127
<button title="Copy vscode.dev link for viewing this pull request in VS Code for the Web" onClick={copyVscodeDevLink} className="secondary small-button">
125128
Copy vscode.dev Link
126129
</button>

0 commit comments

Comments
 (0)