From a8e27d228e290a5a545a936d7871eb6dd1626c41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20P=C3=B6ttker?= Date: Sun, 10 May 2026 20:49:20 +0200 Subject: [PATCH] feat: add document thumbnail previews with tooltips to download and email dialogs --- .../src/pages/InboxDetailPage.tsx | 40 ++++++++++++++----- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/paperless-frontend/src/pages/InboxDetailPage.tsx b/paperless-frontend/src/pages/InboxDetailPage.tsx index 48ef39c..8c43a2a 100644 --- a/paperless-frontend/src/pages/InboxDetailPage.tsx +++ b/paperless-frontend/src/pages/InboxDetailPage.tsx @@ -533,10 +533,11 @@ interface DownloadSegmentsDialogProps { fileId: string; fileName: string; documents: DocumentSegment[]; + thumbUrls: Map; onClose: () => void; } -function DownloadSegmentsDialog({ open, fileId, fileName, documents, onClose }: DownloadSegmentsDialogProps) { +function DownloadSegmentsDialog({ open, fileId, fileName, documents, thumbUrls, onClose }: DownloadSegmentsDialogProps) { const [filenames, setFilenames] = useState([]); const [downloading, setDownloading] = useState(null); @@ -605,12 +606,20 @@ function DownloadSegmentsDialog({ open, fileId, fileName, documents, onClose }: >
{documents.map((doc, i) => { - const first = doc.pages[0]; - const last = doc.pages[doc.pages.length - 1]; - const range = first === last ? `Seite ${first}` : `Seiten ${first}–${last}`; + const thumbUrl = thumbUrls.get(doc.pages[0]); return (
- {range} + : null} + placement="right" + mouseEnterDelay={0.2} + > +
+ {thumbUrl + ? + : } +
+
@@ -640,10 +649,11 @@ interface SendEmailDialogProps { fileId: string; fileName: string; documents: DocumentSegment[]; + thumbUrls: Map; onClose: () => void; } -function SendEmailDialog({ open, fileId, fileName, documents, onClose }: SendEmailDialogProps) { +function SendEmailDialog({ open, fileId, fileName, documents, thumbUrls, onClose }: SendEmailDialogProps) { const [form] = Form.useForm(); const [submitting, setSubmitting] = useState(false); const [filenames, setFilenames] = useState([]); @@ -728,12 +738,20 @@ function SendEmailDialog({ open, fileId, fileName, documents, onClose }: SendEma
{documents.map((doc, i) => { - const first = doc.pages[0]; - const last = doc.pages[doc.pages.length - 1]; - const range = first === last ? `Seite ${first}` : `Seiten ${first}–${last}`; + const thumbUrl = thumbUrls.get(doc.pages[0]); return (
- {range} + : null} + placement="right" + mouseEnterDelay={0.2} + > +
+ {thumbUrl + ? + : } +
+
@@ -1566,6 +1584,7 @@ export default function InboxDetailPage() { fileId={file.id} fileName={file.name} documents={documents} + thumbUrls={thumbUrls} onClose={() => setDownloadDialogOpen(false)} /> setEmailDialogOpen(false)} />