perf(code): make task composer repo/branch selectors feel instant#2196
Open
fercgomes wants to merge 1 commit into
Open
perf(code): make task composer repo/branch selectors feel instant#2196fercgomes wants to merge 1 commit into
fercgomes wants to merge 1 commit into
Conversation
The new-task composer's branch dropdown was empty until the user clicked it and the trigger button stayed blank in the meantime — the cloud-branches query was gated on the picker being open. Reopening also refetched from scratch because the infinite query had no staleTime. The local-branch query in BranchSelector behaved the same way: gated on `open`, despite being a fast local git call. - Fetch cloud branches as soon as a repo is selected. The first page includes `default_branch`, so the branch button shows `main`/`master` immediately and the dropdown opens against a warm cache. - Add `staleTime: 5 min` to both `useGithubBranches` and `useUserGithubBranches`, matching the repository hooks. - Drop the `open` gate on local branches and bump `staleTime` to 60s. - Remove the now-dead `isCloudBranchPickerOpen` state in TaskInput. Generated-By: PostHog Code Task-Id: 3359bdaf-6661-4001-beab-9ad6478f3e28
Contributor
|
Reviews (1): Last reviewed commit: "perf(code): make task composer repo/bran..." | Re-trigger Greptile |
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.
Summary
default_branch, so the branch button showsmain/masterimmediately and the dropdown opens against a warm cache.staleTime: 5 mintouseGithubBranchesanduseUserGithubBranchesso reopens within 5 min skip the network.opengate on the local-mode branches query inBranchSelector(it's a fast local git call) and bumpstaleTimeto 60s.isCloudBranchPickerOpenstate inTaskInput.Why
The branch dropdown was empty until the user clicked it, and the trigger button stayed blank until that round-trip returned. Reopening refetched from scratch because the infinite query had no
staleTime.Test plan
pnpm --filter code typecheckpasses