diff --git a/packages/extension/src/components/HistoryList.tsx b/packages/extension/src/components/HistoryList.tsx index 176633b..4597d83 100644 --- a/packages/extension/src/components/HistoryList.tsx +++ b/packages/extension/src/components/HistoryList.tsx @@ -1,8 +1,9 @@ -import { ArrowLeft, CheckCircle, RotateCcw, Trash2, XCircle } from 'lucide-react' +import { ArrowDownToLine, ArrowLeft, CheckCircle, RotateCcw, Trash2, XCircle } from 'lucide-react' import { useCallback, useEffect, useState } from 'react' import { Button } from '@/components/ui/button' import { type SessionRecord, clearSessions, deleteSession, listSessions } from '@/lib/db' +import { downloadHistoryExport } from '@/lib/history-export' function timeAgo(ts: number): string { const seconds = Math.floor((Date.now() - ts) / 1000) @@ -43,6 +44,11 @@ export function HistoryList({ setSessions((prev) => prev.filter((s) => s.id !== id)) } + const handleExport = (e: React.MouseEvent, session: SessionRecord) => { + e.stopPropagation() + downloadHistoryExport(session.task, session.createdAt, session.history) + } + const handleRerun = (e: React.MouseEvent, task: string) => { e.stopPropagation() onRerun(task) @@ -124,6 +130,15 @@ export function HistoryList({ > +