The best way to control Claude Code, Codex and more from any computer or phone
Fix flash of 'Initialize git' when switching branch/worktree
branchesQuery.data is undefined while loading, so isRepo defaulted to false — briefly showing the init button even for worktrees. Now defaults to true while loading (only shows init when the query actually returns isRepo: false). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Julius Marminge committed
Feb 11, 2026 at 15:41 UTC
cf66f53a5559be6f0117118e07793acf35ea170b
1 file changed
+3
-1
apps/web/src/components/BranchToolbar.tsx
+3
-1
@@ -37,7 +37,9 @@ export default function BranchToolbar({ envMode, onEnvModeChange, envLocked }: B
37
});
38
39
const branches = branchesQuery.data?.branches ?? [];
40
- const isRepo = branchesQuery.data?.isRepo ?? false;
40
+ // Default to true while loading — showing "Initialize git" during a fetch is wrong,
41
+ // and worktrees are inherently git repos.
42
+ const isRepo = branchesQuery.data?.isRepo ?? !branchesQuery.isLoading;
43
44
// ── Mutations ─────────────────────────────────────────────────────────
45