Skip to content

Commit a48a1b0

Browse files
committed
fix(web): copy PR numbers with hash prefix
1 parent 0c859db commit a48a1b0

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

‎apps/web/src/components/pullRequest/PullRequestDetailPanel.tsx‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import {
2222
ArrowUpRightIcon,
2323
BookOpenIcon,
2424
CircleDotIcon,
25+
CopyIcon,
2526
ChevronDownIcon,
2627
ExternalLinkIcon,
2728
FileDiffIcon,
@@ -741,7 +742,7 @@ export function PullRequestDetailPanel({
741742
command === "pullRequest.copyUrl"
742743
? (detail?.url ?? matchingListEntry?.url)
743744
: command === "pullRequest.copyNumber"
744-
? String(reference.number)
745+
? `#${reference.number}`
745746
: null;
746747
if (!value) return;
747748
event.preventDefault();
@@ -2134,7 +2135,8 @@ export function PullRequestDetailPanel({
21342135
{shortcutLabelForCommand(keybindings, "pullRequest.copyUrl")}
21352136
</MenuShortcut>
21362137
</MenuItem>
2137-
<MenuItem onClick={() => copyReference(String(reference.number), "PR number")}>
2138+
<MenuItem onClick={() => copyReference(`#${reference.number}`, "PR number")}>
2139+
<CopyIcon className="size-3.5" />
21382140
Copy PR number
21392141
<MenuShortcut>
21402142
{shortcutLabelForCommand(keybindings, "pullRequest.copyNumber")}

‎docs/user/keybindings.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ in Settings.
2424
## Copy pull request references
2525

2626
With a PR open in the right panel or on the Pull Requests page, use `mod+shift+k`
27-
to copy its URL and `mod+shift+y` to copy its number without a `#` prefix.
27+
to copy its URL and `mod+shift+y` to copy its number with a `#` prefix.
2828
Both shortcuts can be changed in Settings. They copy the selected PR and leave
2929
terminal input alone.
3030

0 commit comments

Comments
 (0)