(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 */}
+
);
}