Keep SidebarThreadRow hooks ordered before early return

- Compute git status inputs before the null guard
- Preserve hook order while rendering thread rows
This commit is contained in:
Julius Marminge committed 2026-04-05 12:27:06 -07:00
1 parent 366182e825
commit 8b9304ca7c
1 file changed
+2 -2
+2 -2
View File
@@ -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;