From 8b9304ca7c764ed092046800c5cf753d84816d6c Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Sun, 5 Apr 2026 12:27:06 -0700 Subject: [PATCH] Keep SidebarThreadRow hooks ordered before early return - Compute git status inputs before the null guard - Preserve hook order while rendering thread rows --- apps/web/src/components/Sidebar.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/web/src/components/Sidebar.tsx b/apps/web/src/components/Sidebar.tsx index 65db68e7f8..78b8326af5 100644 --- a/apps/web/src/components/Sidebar.tsx +++ b/apps/web/src/components/Sidebar.tsx @@ -297,13 +297,13 @@ function SidebarThreadRow(props: SidebarThreadRowProps) { (state) => selectThreadTerminalState(state.terminalStateByThreadId, props.threadId).runningTerminalIds, ); + const gitCwd = thread?.worktreePath ?? props.projectCwd; + const gitStatus = useGitStatus(thread?.branch !== null ? gitCwd : null); if (!thread) { return null; } - const gitCwd = thread.worktreePath ?? props.projectCwd; - const gitStatus = useGitStatus(thread.branch !== null ? gitCwd : null); const isActive = props.routeThreadId === thread.id; const isSelected = props.selectedThreadIds.has(thread.id); const isHighlighted = isActive || isSelected;