Skip to content

Commit cb1f343

Browse files
committed
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.
1 parent 82a50da commit cb1f343

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

apps/web/src/components/Sidebar.tsx

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -310,20 +310,6 @@ export default function Sidebar() {
310310
const setSelectionAnchor = useThreadSelectionStore((s) => s.setAnchor);
311311
const shouldBrowseForProjectImmediately = isElectron;
312312
const shouldShowProjectPathEntry = addingProject && !shouldBrowseForProjectImmediately;
313-
const pendingApprovalByThreadId = useMemo(() => {
314-
const map = new Map<ThreadId, boolean>();
315-
for (const thread of threads) {
316-
map.set(thread.id, derivePendingApprovals(thread.activities).length > 0);
317-
}
318-
return map;
319-
}, [threads]);
320-
const pendingUserInputByThreadId = useMemo(() => {
321-
const map = new Map<ThreadId, boolean>();
322-
for (const thread of threads) {
323-
map.set(thread.id, derivePendingUserInputs(thread.activities).length > 0);
324-
}
325-
return map;
326-
}, [threads]);
327313
const projectCwdById = useMemo(
328314
() => new Map(projects.map((project) => [project.id, project.cwd] as const)),
329315
[projects],
@@ -1509,9 +1495,9 @@ export default function Sidebar() {
15091495
const threadStatus = resolveThreadStatusPill({
15101496
thread,
15111497
hasPendingApprovals:
1512-
pendingApprovalByThreadId.get(thread.id) === true,
1498+
derivePendingApprovals(thread.activities).length > 0,
15131499
hasPendingUserInput:
1514-
pendingUserInputByThreadId.get(thread.id) === true,
1500+
derivePendingUserInputs(thread.activities).length > 0,
15151501
});
15161502
const prStatus = prStatusIndicator(
15171503
prByThreadId.get(thread.id) ?? null,

0 commit comments

Comments
 (0)