Skip to content

Commit d269602

Browse files
Copilotalexr00
andcommitted
Sort PRs by number descending in picker
Show most recent PRs first for better usability Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
1 parent bfd57e5 commit d269602

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/commands.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1616,7 +1616,9 @@ ${contents}
16161616
// Fetch all open PRs
16171617
try {
16181618
const prs = await githubRepo.manager.getPullRequests(PRType.All, { fetchNextPage: false });
1619-
const prItems: (vscode.QuickPickItem & { pr: PullRequestModel })[] = prs.items.map(pr => ({
1619+
// Sort PRs by number in descending order (most recent first)
1620+
const sortedPRs = prs.items.sort((a, b) => b.number - a.number);
1621+
const prItems: (vscode.QuickPickItem & { pr: PullRequestModel })[] = sortedPRs.map(pr => ({
16201622
label: `#${pr.number}`,
16211623
description: pr.title,
16221624
detail: `by @${pr.author.login}`,

0 commit comments

Comments
 (0)