Skip to content

Prioritize exact PR numbers in checkout picker - #8886

Draft
Alex Ross (alexr00) with Copilot wants to merge 6 commits into
mainfrom
copilot/fix-checkout-pr-by-number
Draft

Prioritize exact PR numbers in checkout picker#8886
Alex Ross (alexr00) with Copilot wants to merge 6 commits into
mainfrom
copilot/fix-checkout-pr-by-number

Conversation

Copilot AI commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

The checkout picker could rank a fuzzy title match above an exact PR number, preselecting the wrong pull request.

Changes

  • Matching: Preserve the #number title display while explicitly focusing the listed pull request whose number exactly matches the input. Clear that focus when the input is no longer an exact match.
  • Coverage: Add a regression test for the conflicting-number scenario and exact-number input variants.
const exactNumberMatch = findExactPullRequestNumberMatch(value, prItems);
quickPick.activeItems = exactNumberMatch ? [exactNumberMatch] : [];

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix checkout pull request by number to match exact PR Prioritize exact PR numbers in checkout picker Aug 11, 2026

@alexr00 Alex Ross (alexr00) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No need to break things into separate files like this.

@alexr00 Alex Ross (alexr00) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Don't add new files

@alexr00 Alex Ross (alexr00) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copilot, don't add those new files. Just modify existing files.

Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>

Copilot AI commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

Copilot, don't add those new files. Just modify existing files.

Addressed in 29f800e. The formatter and regression test now live in existing files, and both added files were removed.

@alexr00 Alex Ross (alexr00) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copilot Having just the number as the label is uglier. Is there a way to prioritize the number without changing the display?

Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>

Copilot AI commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

Copilot Having just the number as the label is uglier. Is there a way to prioritize the number without changing the display?

Implemented in 25bc922. The picker keeps the original #number title display and explicitly activates a listed PR when its number exactly matches the input.

@alexr00
Alex Ross (alexr00) marked this pull request as ready for review August 12, 2026 10:29
Copilot AI lite review requested due to automatic review settings August 12, 2026 10:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses an issue in the “Checkout Pull Request by Number” QuickPick where fuzzy matching could cause the wrong PR to be preselected when the typed value is an exact PR number but also appears in another PR title.

Changes:

  • Introduces findExactPullRequestNumberMatch and wires it into the checkout QuickPick to focus the exact PR-number match on value changes.
  • Adds a regression test covering the “digits in another PR title” scenario.
  • Adds QuickPick event subscription cleanup for the new onDidChangeValue handler.
Show a summary per file
File Description
src/commands.ts Adds exact-number matching helper and updates the checkout QuickPick to prioritize an exact PR-number match.
src/test/extension.test.ts Adds a regression test for the exact-number match helper.

Review details

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 2/2 changed files
  • Comments generated: 3
  • Review effort level: Lite

Comment thread src/commands.ts
Comment thread src/commands.ts
Comment thread src/test/extension.test.ts
@alexr00
Alex Ross (alexr00) marked this pull request as draft August 12, 2026 10:36
auto-merge was automatically disabled August 12, 2026 10:36

Pull request was converted to draft

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.

"Checkout Pull Request by Number" should match the exact PR number

3 participants