diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/CopilotPage.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/CopilotPage.tsx index 384c52dcc2..35b34890ce 100644 --- a/autogpt_platform/frontend/src/app/(platform)/copilot/CopilotPage.tsx +++ b/autogpt_platform/frontend/src/app/(platform)/copilot/CopilotPage.tsx @@ -56,7 +56,19 @@ export function CopilotPage() { > {!isMobile && }
- {isMobile && } + {isMobile && ( + { + const session = sessions.find((s) => s.id === sessionId); + if (session) { + handleDeleteClick(session.id, session.title); + } + }} + /> + )}
{isMobile && ( - <> - - !open && handleCancelDelete()} - onDoDelete={handleConfirmDelete} - /> - + + )} + {/* Delete confirmation dialog - rendered at top level for proper z-index on mobile */} + {isMobile && ( + !open && handleCancelDelete()} + onDoDelete={handleConfirmDelete} + /> )} ); diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/MobileDrawer/MobileDrawer.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/MobileDrawer/MobileDrawer.tsx index f8cf40d7e3..80ccfc9c03 100644 --- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/MobileDrawer/MobileDrawer.tsx +++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/MobileDrawer/MobileDrawer.tsx @@ -3,7 +3,7 @@ import { Button } from "@/components/atoms/Button/Button"; import { Text } from "@/components/atoms/Text/Text"; import { scrollbarStyles } from "@/components/styles/scrollbars"; import { cn } from "@/lib/utils"; -import { PlusIcon, SpinnerGapIcon, TrashIcon, X } from "@phosphor-icons/react"; +import { PlusIcon, SpinnerGapIcon, X } from "@phosphor-icons/react"; import { Drawer } from "vaul"; interface Props { @@ -11,15 +11,10 @@ interface Props { sessions: SessionSummaryResponse[]; currentSessionId: string | null; isLoading: boolean; - isDeleting?: boolean; onSelectSession: (sessionId: string) => void; onNewChat: () => void; onClose: () => void; onOpenChange: (open: boolean) => void; - onDeleteSession?: ( - sessionId: string, - title: string | null | undefined, - ) => void; } function formatDate(dateString: string) { @@ -52,12 +47,10 @@ export function MobileDrawer({ sessions, currentSessionId, isLoading, - isDeleting, onSelectSession, onNewChat, onClose, onOpenChange, - onDeleteSession, }: Props) { return ( @@ -95,52 +88,35 @@ export function MobileDrawer({

) : ( sessions.map((session) => ( -
onSelectSession(session.id)} className={cn( - "group relative flex w-full items-center rounded-lg transition-colors", + "w-full rounded-lg px-3 py-2.5 text-left transition-colors", session.id === currentSessionId ? "bg-zinc-100" : "hover:bg-zinc-50", )} > - - {onDeleteSession && ( - - )} -
+ + {formatDate(session.updated_at)} + +
+ )) )} diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/MobileHeader/MobileHeader.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/MobileHeader/MobileHeader.tsx index e0d6161744..b4b7636c81 100644 --- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/MobileHeader/MobileHeader.tsx +++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/MobileHeader/MobileHeader.tsx @@ -1,22 +1,46 @@ import { Button } from "@/components/atoms/Button/Button"; import { NAVBAR_HEIGHT_PX } from "@/lib/constants"; -import { ListIcon } from "@phosphor-icons/react"; +import { ListIcon, TrashIcon } from "@phosphor-icons/react"; interface Props { onOpenDrawer: () => void; + showDelete?: boolean; + isDeleting?: boolean; + onDelete?: () => void; } -export function MobileHeader({ onOpenDrawer }: Props) { +export function MobileHeader({ + onOpenDrawer, + showDelete, + isDeleting, + onDelete, +}: Props) { return ( - + + {showDelete && onDelete && ( + + )} + ); }