From bbcf9ba9db15ad02d98c417e3f5566ff2dedf4b7 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Fri, 27 Feb 2026 14:49:27 -0800 Subject: [PATCH] Show pending approvals in sidebar thread status - derive pending approvals from thread activities and label status as "Pending Approval" - remove `isolate` class from chat `SidebarInset` containers --- apps/web/src/components/Sidebar.tsx | 13 ++++++++++--- apps/web/src/routes/_chat.$threadId.tsx | 4 ++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/apps/web/src/components/Sidebar.tsx b/apps/web/src/components/Sidebar.tsx index b348836e17545ea397d0c1c397c6d54a773d7582..e3b6579c4a5d852122bab85efebd9470ed263c6f 100644 --- a/apps/web/src/components/Sidebar.tsx +++ b/apps/web/src/components/Sidebar.tsx @@ -15,6 +15,7 @@ import { newCommandId, newProjectId, newThreadId } from "../lib/utils"; import { useStore } from "../store"; import { isChatNewLocalShortcut, isChatNewShortcut } from "../keybindings"; import { type Thread } from "../types"; +import { derivePendingApprovals } from "../session-logic"; import { gitRemoveWorktreeMutationOptions } from "../lib/gitReactQuery"; import { serverConfigQueryOptions } from "../lib/serverReactQuery"; import { readNativeApi } from "../nativeApi"; @@ -50,7 +51,7 @@ function formatRelativeTime(iso: string): string { } interface ThreadStatusPill { - label: "Working" | "Connecting" | "Completed" | "Awaiting response"; + label: "Working" | "Connecting" | "Completed" | "Pending Approval"; colorClass: string; dotClass: string; pulse: boolean; @@ -76,7 +77,7 @@ function hasUnseenCompletion(thread: Thread): boolean { function threadStatusPill(thread: Thread, hasPendingApprovals: boolean): ThreadStatusPill | null { if (hasPendingApprovals) { return { - label: "Awaiting response", + label: "Pending Approval", colorClass: "text-amber-600 dark:text-amber-300/90", dotClass: "bg-amber-500 dark:bg-amber-300/90", pulse: false, @@ -158,7 +159,13 @@ export default function Sidebar() { const [newCwd, setNewCwd] = useState(""); const [isPickingFolder, setIsPickingFolder] = useState(false); const [isAddingProject, setIsAddingProject] = useState(false); - const pendingApprovalByThreadId = useMemo(() => new Map(), []); + const pendingApprovalByThreadId = useMemo(() => { + const map = new Map(); + for (const thread of state.threads) { + map.set(thread.id, derivePendingApprovals(thread.activities).length > 0); + } + return map; + }, [state.threads]); const handleNewThread = useCallback( ( diff --git a/apps/web/src/routes/_chat.$threadId.tsx b/apps/web/src/routes/_chat.$threadId.tsx index 7f9faa08b9f9566581196d06556773ff24d33a39..41472f5ecc321f1372aa204b3a0dd219dfc6b90d 100644 --- a/apps/web/src/routes/_chat.$threadId.tsx +++ b/apps/web/src/routes/_chat.$threadId.tsx @@ -179,7 +179,7 @@ function ChatThreadRouteView() { if (!shouldUseDiffSheet) { return ( <> - + @@ -189,7 +189,7 @@ function ChatThreadRouteView() { return ( <> - + -- 2.54.0