diff --git a/apps/x/apps/renderer/src/components/sidebar-content.tsx b/apps/x/apps/renderer/src/components/sidebar-content.tsx index 262da148..51b95109 100644 --- a/apps/x/apps/renderer/src/components/sidebar-content.tsx +++ b/apps/x/apps/renderer/src/components/sidebar-content.tsx @@ -26,6 +26,15 @@ import { CollapsibleContent, CollapsibleTrigger, } from "@/components/ui/collapsible" +import { + Dialog, + DialogContent, + DialogDescription, + DialogFooter, + DialogHeader, + DialogTitle, +} from "@/components/ui/dialog" +import { Button } from "@/components/ui/button" import { Sidebar, SidebarContent, @@ -1004,6 +1013,8 @@ function TasksSection({ backgroundTasks?: BackgroundTaskItem[] selectedBackgroundTask?: string | null }) { + const [pendingDeleteRunId, setPendingDeleteRunId] = useState(null) + return ( @@ -1064,7 +1075,7 @@ function TasksSection({ className="shrink-0 hidden group-hover/chat-item:flex items-center justify-center text-muted-foreground hover:text-destructive transition-colors" onClick={(e) => { e.stopPropagation() - actions?.onDeleteRun(run.id) + setPendingDeleteRunId(run.id) }} aria-label="Delete chat" > @@ -1079,6 +1090,35 @@ function TasksSection({ )} + + {/* Delete confirmation dialog */} + { if (!open) setPendingDeleteRunId(null) }}> + + + Delete chat + + Are you sure you want to delete this chat? + + + + + + + + ) }