Skip to content

Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.

Show pending approvals in sidebar thread status

Julius Marmingebbcf9ba9db15
diff --git a/apps/web/src/components/Sidebar.tsx b/apps/web/src/components/Sidebar.tsx
index b348836e1..e3b6579c4 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<ThreadId, boolean>(), []);
+ const pendingApprovalByThreadId = useMemo(() => {
+ const map = new Map<ThreadId, boolean>();
+ 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 7f9faa08b..41472f5ec 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 (
<>
- <SidebarInset className="h-dvh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground isolate">
+ <SidebarInset className="h-dvh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground">
<ChatView threadId={threadId} />
</SidebarInset>
<DiffPanelInlineSidebar diffOpen={diffOpen} onCloseDiff={closeDiff} onOpenDiff={openDiff} />
@@ -189,7 +189,7 @@ function ChatThreadRouteView() {
return (
<>
- <SidebarInset className="h-dvh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground isolate">
+ <SidebarInset className="h-dvh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground">
<ChatView threadId={threadId} />
</SidebarInset>
<DiffPanelSheet diffOpen={diffOpen} onCloseDiff={closeDiff}>