diff --git a/.automaker b/.automaker new file mode 120000 index 00000000..1455d4cc --- /dev/null +++ b/.automaker @@ -0,0 +1 @@ +/Users/webdevcody/Workspace/automaker/.automaker \ No newline at end of file diff --git a/apps/app/src/components/delete-all-archived-sessions-dialog.tsx b/apps/app/src/components/delete-all-archived-sessions-dialog.tsx new file mode 100644 index 00000000..34d5907a --- /dev/null +++ b/apps/app/src/components/delete-all-archived-sessions-dialog.tsx @@ -0,0 +1,58 @@ +"use client"; + +import { + Dialog, + DialogContent, + DialogDescription, + DialogFooter, + DialogHeader, + DialogTitle, +} from "@/components/ui/dialog"; +import { Button } from "@/components/ui/button"; +import { Trash2 } from "lucide-react"; + +interface DeleteAllArchivedSessionsDialogProps { + open: boolean; + onOpenChange: (open: boolean) => void; + archivedCount: number; + onConfirm: () => void; +} + +export function DeleteAllArchivedSessionsDialog({ + open, + onOpenChange, + archivedCount, + onConfirm, +}: DeleteAllArchivedSessionsDialogProps) { + return ( + + + + Delete All Archived Sessions + + Are you sure you want to delete all archived sessions? This action + cannot be undone. + {archivedCount > 0 && ( + + {archivedCount} session(s) will be deleted. + + )} + + + + + + + + + ); +} diff --git a/apps/app/src/components/session-manager.tsx b/apps/app/src/components/session-manager.tsx index 1f2c8b39..ce8b95a4 100644 --- a/apps/app/src/components/session-manager.tsx +++ b/apps/app/src/components/session-manager.tsx @@ -27,6 +27,7 @@ import type { SessionListItem } from "@/types/electron"; import { useKeyboardShortcutsConfig } from "@/hooks/use-keyboard-shortcuts"; import { getElectronAPI } from "@/lib/electron"; import { DeleteSessionDialog } from "@/components/delete-session-dialog"; +import { DeleteAllArchivedSessionsDialog } from "@/components/delete-all-archived-sessions-dialog"; // Random session name generator const adjectives = [ @@ -116,6 +117,7 @@ export function SessionManager({ ); const [isDeleteDialogOpen, setIsDeleteDialogOpen] = useState(false); const [sessionToDelete, setSessionToDelete] = useState(null); + const [isDeleteAllArchivedDialogOpen, setIsDeleteAllArchivedDialogOpen] = useState(false); // Check running state for all sessions const checkRunningSessions = async (sessionList: SessionListItem[]) => { @@ -314,6 +316,20 @@ export function SessionManager({ setSessionToDelete(null); }; + // Delete all archived sessions + const handleDeleteAllArchivedSessions = async () => { + const api = getElectronAPI(); + if (!api?.sessions) return; + + // Delete each archived session + for (const session of archivedSessions) { + await api.sessions.delete(session.id); + } + + await loadSessions(); + setIsDeleteAllArchivedDialogOpen(false); + }; + const activeSessions = sessions.filter((s) => !s.isArchived); const archivedSessions = sessions.filter((s) => s.isArchived); const displayedSessions = @@ -402,6 +418,22 @@ export function SessionManager({ )} + {/* Delete All Archived button - shown at the top of archived sessions */} + {activeTab === "archived" && archivedSessions.length > 0 && ( +
+ +
+ )} + {/* Session list */} {displayedSessions.map((session) => (
+ + {/* Delete All Archived Sessions Confirmation Dialog */} + ); }