Add recently used branches tracking for PR creation#8300
Merged
Conversation
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
- Added RECENTLY_USED_BRANCHES state key and RecentlyUsedBranchesState interface - Added RECENTLY_USED_BRANCHES_COUNT setting key (default: 5, range: 0-20) - Added setting in package.json with localization - Implemented getRecentlyUsedBranches() and saveRecentlyUsedBranch() helper methods - Modified branchPicks() to show recently used branches at the top with separators - Added calls to save base branch when selected and when PR is created Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
- Extract getRecentlyUsedBranchesMaxCount() to avoid redundant config reads - Both getRecentlyUsedBranches() and saveRecentlyUsedBranch() now use the helper Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix branch selection issue for large repositories
Add recently used branches tracking for PR creation
Dec 11, 2025
alexr00
requested changes
Dec 12, 2025
package.json
Outdated
| "minimum": 1000, | ||
| "markdownDescription": "%githubPullRequests.branchListTimeout.description%" | ||
| }, | ||
| "githubPullRequests.recentlyUsedBranchesCount": { |
src/github/createPRViewProvider.ts
Outdated
Comment on lines
874
to
875
| // Filter to only include branches that exist in the current branch list | ||
| recentBranches = recentlyUsed.filter(recent => branchNames.includes(recent)); |
Contributor
Author
There was a problem hiding this comment.
Done. Recently used branches are now shown even if they weren't fetched in the current branch list. This ensures branches like 'develop' appear at the top even when the timeout cuts off the fetch. Commit 5c10ed4.
…n list - Remove recentlyUsedBranchesCount setting as requested - Hard-code limit to 10 branches instead of using configurable setting - Allow recently used branches even if they're not in the fetched branch list This ensures branches like 'develop' are shown even when timeout cuts off the list Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
alexr00
approved these changes
Dec 12, 2025
lszomoru
approved these changes
Dec 12, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Users with repositories containing thousands of branches couldn't find commonly used base branches (e.g.,
develop) because the branch list would timeout and be incomplete. Even when branches were fetched, scrolling through hundreds or thousands to find the right one was impractical.Changes
Workspace state tracking:
RECENTLY_USED_BRANCHESowner/repokeyEnhanced branch picker UI:
developappear even when timeout cuts off the branch listImplementation
Modified
BaseCreatePullRequestViewProvider.branchPicks()to show all recently used branches:Branches are saved in two locations:
processRemoteAndBranchResult()create()The existing
branchListTimeoutsetting remains available for users who want to fetch more branches within a longer timeout window.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.