-
Notifications
You must be signed in to change notification settings - Fork 688
[WIP] Add capability to show PRs in picker #8235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
- Added QuickPick to show all open PRs when checking out - Allow filtering by number, title, or author in the picker - Support typing custom PR number or URL - Renamed command to "Checkout Pull Request..." - Import PRType for fetching all PRs Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Show most recent PRs first for better usability Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
- Properly dispose event listeners after promise resolves - Remove unrelated changes to proposed API file Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
- Handle case when user presses Enter with no selection - Make disposables optional to prevent undefined access Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Move QuickPick and event listener cleanup to finally block Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
src/commands.ts
Outdated
|
|
||
| // Fetch all open PRs | ||
| try { | ||
| const prs = await githubRepo.manager.getPullRequests(PRType.All, { fetchNextPage: false }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot We shouldn't use the getPullRequests method here, as it gets more info that just the number. Add a new graphql query and a new method getPullRequestNumbers, which just gets all the open pr numbers, titles, and authors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! Created a new PullRequestNumbers GraphQL query and getPullRequestNumbers() method that fetches only the PR number, title, and author. The command now uses this lightweight query instead of getPullRequests(). (commit a399622)
package.nls.json
Outdated
| "command.pr.showDiffSinceLastReview.title": "Show Changes Since Last Review", | ||
| "command.pr.showDiffAll.title": "Show All Changes", | ||
| "command.pr.checkoutByNumber.title": "Checkout Pull Request by Number", | ||
| "command.pr.checkoutByNumber.title": "Checkout Pull Request...", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot Don't change the title.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted the title change. It's back to "Checkout Pull Request by Number". (commit a399622)
- Created PullRequestNumbers query that fetches only number, title, and author - Added getPullRequestNumbers() method to GitHubRepository - Updated checkout command to use new lightweight query - Reverted title change in package.nls.json per feedback Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Checkout Pull Request by Number Enhancement
This PR improves the "Checkout Pull Request by Number" command to provide a better user experience:
Security Summary
No security vulnerabilities detected by CodeQL scanner.
Changes Per Feedback
PullRequestNumbersGraphQL query that fetches only PR number, title, and author (not full PR data)getPullRequestNumbers()method toGitHubRepositoryclassgetPullRequests()Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.