fix(branch-selector): show loading state instead of "No branches"#1967
Merged
jonathanlab merged 2 commits intomainfrom May 1, 2026
Merged
fix(branch-selector): show loading state instead of "No branches"#1967jonathanlab merged 2 commits intomainfrom
jonathanlab merged 2 commits intomainfrom
Conversation
While the branch list is fetching, the dropdown previously rendered "No branches found." alongside the trigger spinner. Surface a dedicated "Loading branches…" row so the empty state only appears once the fetch completes. Generated-By: PostHog Code Task-Id: 322fe270-1290-4c9d-b505-1eed6961381f
Contributor
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
apps/code/src/renderer/features/git-interaction/components/BranchSelector.tsx:258-261
**Duplicated loading-row markup (OnceAndOnlyOnce)**
The new "Loading branches…" row (lines 258–261) has identical structure to the existing "Loading more (N)…" row at lines 251–254 — same `div` className, same `Spinner` props, same layout. Since both are in the same file, extracting a tiny shared helper keeps the pattern in one place and makes future style changes (e.g. icon size, padding) trivially consistent.
Consider extracting:
```tsx
function LoadingRow({ label }: { label: string }): JSX.Element {
return (
<div className="flex items-center gap-1 px-2 py-1.5 text-muted-foreground text-xs">
<Spinner size={12} className="animate-spin" />
{label}
</div>
);
}
```
Then replace both occurrences with `<LoadingRow label="Loading branches…" />` and `<LoadingRow label={\`Loading more (${branches.length})…\`} />`.
Reviews (1): Last reviewed commit: "fix(branch-selector): show loading state..." | Re-trigger Greptile |
Greptile review feedback: the "Loading branches…" and "Loading more (N)…" rows shared identical markup. Extract a small LoadingRow helper so future style changes only need to happen in one place. Generated-By: PostHog Code Task-Id: 322fe270-1290-4c9d-b505-1eed6961381f
jonathanlab
approved these changes
May 1, 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.
Summary
When the branch list in the branch selector is loading, the dropdown previously showed "No branches found." next to the trigger spinner — confusing UX implying the repo had no branches. This change surfaces a dedicated "Loading branches…" row while the fetch is in flight, so the empty state only appears once the query completes.
isLoadingflag from the local-modegetAllBranchesquery.branchListLoadingflag.<ComboboxEmpty>with a conditional that renders an inline spinner + "Loading branches…" row (mirroring the existing "Loading more (N)…" pattern) while loading and empty, falling back to "No branches found." otherwise so search filtering still works.Test plan
Generated-By: PostHog Code
Task-Id: 322fe270-1290-4c9d-b505-1eed6961381f