From bbfef9a22d1c8259f2fc8acd252f0f3eeeda1994 Mon Sep 17 00:00:00 2001 From: Marcel Date: Thu, 26 Mar 2026 10:00:19 +0100 Subject: [PATCH] feat(upload): add drag-and-drop bulk upload zone to home page Adds a compact, unobtrusive drop zone between the search card and the document list. Only visible to users with WRITE_ALL permission. - Drag-and-drop or click-to-select multiple files at once - Client-side MIME type validation with per-file error messages - POSTs to /api/documents/quick-upload; refreshes list via invalidateAll() - Inline feedback: success count + per-file errors - i18n keys added to de/en/es message files Closes #66 (frontend part) Co-Authored-By: Claude Sonnet 4.6 --- frontend/messages/de.json | 7 +- frontend/messages/en.json | 7 +- frontend/messages/es.json | 7 +- frontend/src/routes/+page.svelte | 129 ++++++++++++++++++++++++++++++- 4 files changed, 146 insertions(+), 4 deletions(-) diff --git a/frontend/messages/de.json b/frontend/messages/de.json index 5d29f488..0c8f9838 100644 --- a/frontend/messages/de.json +++ b/frontend/messages/de.json @@ -265,5 +265,10 @@ "doc_panel_annotation_thread_title": "Annotation", "doc_panel_discussion_annotation_tab": "Annotation · Seite {page}", "pdf_annotations_show": "Annotierungen anzeigen", - "pdf_annotations_hide": "Annotierungen verbergen" + "pdf_annotations_hide": "Annotierungen verbergen", + "upload_drop_hint": "Dateien ablegen oder auswählen", + "upload_accepted_types": "PDF, JPEG, PNG, TIFF", + "upload_success": "{count} Dokument(e) erstellt", + "upload_invalid_type": "{filename}: Dateiformat nicht unterstützt", + "upload_error": "Fehler beim Hochladen von {filename}" } diff --git a/frontend/messages/en.json b/frontend/messages/en.json index 94bf692f..eb5ba31a 100644 --- a/frontend/messages/en.json +++ b/frontend/messages/en.json @@ -265,5 +265,10 @@ "doc_panel_annotation_thread_title": "Annotation", "doc_panel_discussion_annotation_tab": "Annotation · Page {page}", "pdf_annotations_show": "Show annotations", - "pdf_annotations_hide": "Hide annotations" + "pdf_annotations_hide": "Hide annotations", + "upload_drop_hint": "Drop files or click to select", + "upload_accepted_types": "PDF, JPEG, PNG, TIFF", + "upload_success": "{count} document(s) created", + "upload_invalid_type": "{filename}: unsupported file format", + "upload_error": "Error uploading {filename}" } diff --git a/frontend/messages/es.json b/frontend/messages/es.json index e0a46eef..dfb5ec70 100644 --- a/frontend/messages/es.json +++ b/frontend/messages/es.json @@ -265,5 +265,10 @@ "doc_panel_annotation_thread_title": "Anotación", "doc_panel_discussion_annotation_tab": "Anotación · Página {page}", "pdf_annotations_show": "Mostrar anotaciones", - "pdf_annotations_hide": "Ocultar anotaciones" + "pdf_annotations_hide": "Ocultar anotaciones", + "upload_drop_hint": "Soltar archivos o hacer clic para seleccionar", + "upload_accepted_types": "PDF, JPEG, PNG, TIFF", + "upload_success": "{count} documento(s) creado(s)", + "upload_invalid_type": "{filename}: formato de archivo no admitido", + "upload_error": "Error al subir {filename}" } diff --git a/frontend/src/routes/+page.svelte b/frontend/src/routes/+page.svelte index cbe28932..7b9ab16e 100644 --- a/frontend/src/routes/+page.svelte +++ b/frontend/src/routes/+page.svelte @@ -1,6 +1,6 @@