Skip to content

Commit 8acd7e9

Browse files
fix(code): keep repo and branch pickers open on empty search results (#1866)
1 parent 7103473 commit 8acd7e9

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

apps/code/src/renderer/features/folder-picker/components/GitHubRepoPicker.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,14 @@ export function GitHubRepoPicker({
9797
);
9898
}
9999

100-
if (repositories.length === 0 && !showInlineLoadingState) {
100+
const hasActiveRemoteSearch =
101+
remoteMode && (open || trimmedSearchQuery.length > 0);
102+
103+
if (
104+
repositories.length === 0 &&
105+
!showInlineLoadingState &&
106+
!hasActiveRemoteSearch
107+
) {
101108
return (
102109
<Button variant="outline" disabled size="sm">
103110
<GithubLogo size={16} weight="regular" style={{ flexShrink: 0 }} />

apps/code/src/renderer/features/git-interaction/components/BranchSelector.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export function BranchSelector({
102102
const branches = isCloudMode ? (cloudBranches ?? []) : localBranches;
103103
const effectiveLoading = loading || (isCloudMode && cloudBranchesLoading);
104104
const cloudStillLoading =
105-
isCloudMode && cloudBranchesLoading && branches.length === 0;
105+
isCloudMode && cloudBranchesLoading && branches.length === 0 && !open;
106106

107107
const checkoutMutation = useMutation(
108108
trpc.git.checkoutBranch.mutationOptions({

0 commit comments

Comments
 (0)