From 0864b39336a56fe5f7caaeb4313d107456017d87 Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Sun, 26 Oct 2025 01:01:42 +0200 Subject: [PATCH] panel actions --- frontend/src/detail/DetailPanel.jsx | 135 ++++++++++++++++++---------- frontend/src/styles.css | 55 +++++++++--- frontend/src/ui/icons.js | 32 +++++++ 3 files changed, 162 insertions(+), 60 deletions(-) diff --git a/frontend/src/detail/DetailPanel.jsx b/frontend/src/detail/DetailPanel.jsx index d83bc3f..2eae843 100644 --- a/frontend/src/detail/DetailPanel.jsx +++ b/frontend/src/detail/DetailPanel.jsx @@ -6,6 +6,9 @@ import { ArrowLeftIcon, ArrowRightIcon, ChevronsRightIcon, + AnalyzeIcon, + WindowMaximizeIcon, + TextScanIcon, } from '../ui/icons'; import { getTagColorStyle } from '../utils/colors'; import { formatFileSize } from '../utils/format'; @@ -308,6 +311,15 @@ const DetailPanel = ({ const selectedCount = selectedDocuments.length; const singleDoc = selectedCount === 1 ? selectedDocuments[0] : null; + const singleDownloadHref = useMemo(() => { + if (!singleDoc) return null; + const downloadPath = singleDoc.current_version?.download_path; + if (!downloadPath || !resolveApiPath) { + return null; + } + return resolveApiPath(downloadPath); + }, [singleDoc, resolveApiPath]); + const [titleEditDocId, setTitleEditDocId] = useState(null); const [titleDraft, setTitleDraft] = useState(''); const [titleSaving, setTitleSaving] = useState(false); @@ -712,9 +724,6 @@ const DetailPanel = ({ } const displayName = singleDoc.title || singleDoc.original_name; - const downloadHref = singleDoc.current_version?.download_path - ? resolveApiPath?.(singleDoc.current_version.download_path) - : null; const isEditingTitle = titleEditDocId === singleDoc.id; const sizeBytes = Number(singleDoc.current_version?.size_bytes) || 0; const sizeLabel = sizeBytes > 0 ? formatFileSize(sizeBytes) : '—'; @@ -864,44 +873,6 @@ const DetailPanel = ({ {singleDoc.original_name} -
- { - if (!downloadHref) { - event.preventDefault(); - } - }} - > - - Download - - - -
- {hasOcrAsset ? ( -
- -
- ) : null} ({ @@ -1081,17 +1052,13 @@ const DetailPanel = ({ showCount className="bulk-correspondents" /> - ); }; + const isBulkSelection = selectedCount > 1; + const showOcrAction = Boolean(singleDoc && hasOcrAsset); + return (