From b59330d50653f11050442b4f9eefdaa3c2a7128e Mon Sep 17 00:00:00 2001 From: Hardik Vora <42842779+vorahardik7@users.noreply.github.com> Date: Fri, 14 Nov 2025 21:24:50 -0800 Subject: feat: add inline confirmation for chat deletion (#581) --- apps/web/components/header.tsx | 65 +++++++++++++++++++++++++++++++++--------- 1 file changed, 52 insertions(+), 13 deletions(-) (limited to 'apps') diff --git a/apps/web/components/header.tsx b/apps/web/components/header.tsx index 1448588e..d50e4517 100644 --- a/apps/web/components/header.tsx +++ b/apps/web/components/header.tsx @@ -14,6 +14,8 @@ import { Gauge, HistoryIcon, Trash2, + X, + Check, } from "lucide-react" import { DropdownMenuContent, @@ -62,6 +64,9 @@ export function Header({ onAddMemory }: { onAddMemory?: () => void }) { const { selectedProject } = useProject() const pathname = usePathname() const [isDialogOpen, setIsDialogOpen] = useState(false) + const [confirmingDeleteId, setConfirmingDeleteId] = useState( + null, + ) const [mcpModalOpen, setMcpModalOpen] = useState(false) const [mcpInitialClient, setMcpInitialClient] = useState<"mcp-url" | null>( null, @@ -159,6 +164,9 @@ export function Header({ onAddMemory }: { onAddMemory?: () => void }) { if (open) { analytics.chatHistoryViewed() } + if (!open) { + setConfirmingDeleteId(null) + } }} > @@ -196,6 +204,7 @@ export function Header({ onAddMemory }: { onAddMemory?: () => void }) { setCurrentChatId(c.id) router.push(`/chat/${c.id}`) setIsDialogOpen(false) + setConfirmingDeleteId(null) }} className={cn( "flex items-center justify-between rounded-md px-3 py-2 outline-none w-full text-left", @@ -219,19 +228,49 @@ export function Header({ onAddMemory }: { onAddMemory?: () => void }) { Last updated {formatRelativeTime(c.lastUpdated)} - + {confirmingDeleteId === c.id ? ( +
+ + +
+ ) : ( + + )} ) })} -- cgit v1.2.3