diff --git a/frontend/src/components/repo/BranchSwitcher.tsx b/frontend/src/components/repo/BranchSwitcher.tsx index a5e3aca5..a0104a7c 100644 --- a/frontend/src/components/repo/BranchSwitcher.tsx +++ b/frontend/src/components/repo/BranchSwitcher.tsx @@ -34,8 +34,8 @@ export function BranchSwitcher({ repoId, currentBranch, isWorktree, repoUrl, rep const { data: branches, isLoading: branchesLoading, refetch: refetchBranches } = useQuery({ queryKey: ["branches", repoId], queryFn: () => listBranches(repoId), - enabled: !!repoId, - staleTime: 1000 * 30, + enabled: false, + staleTime: Infinity, }); const activeBranch = branches?.current ?? currentBranch; @@ -63,7 +63,7 @@ export function BranchSwitcher({ repoId, currentBranch, isWorktree, repoUrl, rep }, }); - const showLoading = switchBranchMutation.isPending || branchesLoading; + const showLoading = switchBranchMutation.isPending || (branchesLoading && !branches); return ( <> @@ -110,7 +110,7 @@ export function BranchSwitcher({ repoId, currentBranch, isWorktree, repoUrl, rep ) : ( <> - {branchesLoading ? ( + {branchesLoading && !branches ? ( Loading branches... diff --git a/frontend/src/components/repo/RepoList.tsx b/frontend/src/components/repo/RepoList.tsx index cdceb5ff..92f8d648 100644 --- a/frontend/src/components/repo/RepoList.tsx +++ b/frontend/src/components/repo/RepoList.tsx @@ -130,8 +130,8 @@ export function RepoList() { return ( <> -
-
+
+
-
- {filteredRepos.length === 0 ? ( -
- -

- No repositories found matching "{searchQuery}" -

-
- ) : ( -
- {filteredRepos.map((repo) => ( - { - setRepoToDelete(id); - setDeleteDialogOpen(true); - }} - isDeleting={ - deleteMutation.isPending && repoToDelete === repo.id - } - isSelected={selectedRepos.has(repo.id)} - onSelect={handleSelectRepo} - /> - ))} -
- )} +
+
+ {filteredRepos.length === 0 ? ( +
+ +

+ No repositories found matching "{searchQuery}" +

+
+ ) : ( +
+ {filteredRepos.map((repo) => ( + { + setRepoToDelete(id); + setDeleteDialogOpen(true); + }} + isDeleting={ + deleteMutation.isPending && repoToDelete === repo.id + } + isSelected={selectedRepos.has(repo.id)} + onSelect={handleSelectRepo} + /> + ))} +
+ )} +