From cb1f343f6f558fe8c5e3e2344ef9df49be373c36 Mon Sep 17 00:00:00 2001 From: David Balderston Date: Wed, 11 Mar 2026 10:11:14 -0700 Subject: [PATCH] Use live thread activities for sidebar status pills Sidebar thread pills now derive pending-approval and pending-input state directly from each row's current activities instead of cached per-thread maps, so status badges stay in sync with active thread state. --- apps/web/src/components/Sidebar.tsx | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/apps/web/src/components/Sidebar.tsx b/apps/web/src/components/Sidebar.tsx index 8b68c3b804..5bb0b84f72 100644 --- a/apps/web/src/components/Sidebar.tsx +++ b/apps/web/src/components/Sidebar.tsx @@ -310,20 +310,6 @@ export default function Sidebar() { const setSelectionAnchor = useThreadSelectionStore((s) => s.setAnchor); const shouldBrowseForProjectImmediately = isElectron; const shouldShowProjectPathEntry = addingProject && !shouldBrowseForProjectImmediately; - const pendingApprovalByThreadId = useMemo(() => { - const map = new Map(); - for (const thread of threads) { - map.set(thread.id, derivePendingApprovals(thread.activities).length > 0); - } - return map; - }, [threads]); - const pendingUserInputByThreadId = useMemo(() => { - const map = new Map(); - for (const thread of threads) { - map.set(thread.id, derivePendingUserInputs(thread.activities).length > 0); - } - return map; - }, [threads]); const projectCwdById = useMemo( () => new Map(projects.map((project) => [project.id, project.cwd] as const)), [projects], @@ -1509,9 +1495,9 @@ export default function Sidebar() { const threadStatus = resolveThreadStatusPill({ thread, hasPendingApprovals: - pendingApprovalByThreadId.get(thread.id) === true, + derivePendingApprovals(thread.activities).length > 0, hasPendingUserInput: - pendingUserInputByThreadId.get(thread.id) === true, + derivePendingUserInputs(thread.activities).length > 0, }); const prStatus = prStatusIndicator( prByThreadId.get(thread.id) ?? null,