Cache branch names for faster target branch picker in Create PR view#8597
Merged
Cache branch names for faster target branch picker in Create PR view#8597
Conversation
Co-authored-by: ulugbekna <16353531+ulugbekna@users.noreply.github.com>
Co-authored-by: ulugbekna <16353531+ulugbekna@users.noreply.github.com>
Co-authored-by: ulugbekna <16353531+ulugbekna@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add caching support for branch names in new PR view
Cache branch names for faster target branch picker in Create PR view
Mar 17, 2026
alexr00
approved these changes
Mar 23, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Improves responsiveness of the Create PR target/base branch picker by warming and reusing an in-memory branch list cache so the picker can render immediately on subsequent opens.
Changes:
- Add an in-memory unprefixed branch list cache to
GitHubRepositorywith synchronous retrieval. - Update the Create PR branch picker to populate from cache immediately, then refresh from the API in the background.
- Trigger a non-blocking branch prefetch during Create PR view initialization to warm the cache.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/github/githubRepository.ts | Adds _branchesCache, getCachedBranches(), and populates the cache from listBranches() for unprefixed queries. |
| src/github/quickPicks.ts | Extracts buildBranchPickItems and adds cachedBranchPicks() for sync, cache-backed pick construction. |
| src/github/createPRViewProvider.ts | Prefetches branches on view init and uses cached branch picks for immediate quickpick display before background refresh. |
| src/@types/vscode.proposed.chatSessionsProvider.d.ts | Updates proposed API parameter naming/documentation for registerChatSessionContentProvider. |
lszomoru
approved these changes
Mar 25, 2026
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.
The target branch picker makes a full GraphQL paginated fetch on every open, causing noticeable delay. Branches should appear instantly on subsequent opens, and pre-fetching should warm the cache before the user even clicks.
Changes
GitHubRepository:listBranches()caches results for unprefixed (full list) queries.getCachedBranches()provides synchronous retrieval.changeRemoteAndBranch()now shows cached branch picks immediately, then refreshes in the background with fresh API data.getCreateParams()fires a non-blockinglistBranches()call for the base remote so the cache is warm by the time the user opens the picker.buildBranchPickItemshelper inquickPicks.tsshared by bothbranchPicks()(async, fetches) andcachedBranchPicks()(sync, cache-only).Flow
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
update.code.visualstudio.com/opt/hostedtoolcache/node/20.20.1/x64/bin/node node ./out/src/test/runTests.js(dns block)If you need me to access, download, or install something from one of these locations, you can either:
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.