From 372e8cdff1a43892e82b485e6e4e7a6248010a1f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 1 Mar 2026 07:32:30 +0000 Subject: [PATCH] feat(ui): add pdf.js viewer, image zoom/pan, text preview, and preview modal - Replace iframe in file_view.html with pdf.js for PDF files - Add image viewer with zoom/pan controls to file_view.html - Add text file viewer with line numbers to file_view.html - Add preview side-panel modal to files.html (file list) - Fix file_detail.html bottom preview section variable names - Add aria-labels and WCAG compliance to all new elements Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com> --- frontend/templates/file_detail.html | 34 ++-- frontend/templates/file_view.html | 300 ++++++++++++++++++++++++++-- frontend/templates/files.html | 271 +++++++++++++++++++++++++ 3 files changed, 571 insertions(+), 34 deletions(-) diff --git a/frontend/templates/file_detail.html b/frontend/templates/file_detail.html index f329b6c2..4681086f 100644 --- a/frontend/templates/file_detail.html +++ b/frontend/templates/file_detail.html @@ -1528,11 +1528,11 @@ {% endif %} - {% if file_exists or processed_exists %} + {% if original_file_exists or processed_file_exists %}

File Previews

- {% if file_exists %} + {% if original_file_exists %}

Original File

@@ -1541,36 +1541,46 @@ {{ file.original_filename }} {% elif file.mime_type and file.mime_type.startswith('text/') %} - + {% else %} - - + +
+
+ +

See PDF viewer above

+
+
{% endif %}
- Open in new tab + Open in new tab - Download + Download
{% endif %} - {% if processed_exists %} + {% if processed_file_exists %}

Processed File

- - + +
+
+ +

See PDF viewer above

+
+
- Open in new tab + Open in new tab - Download + Download
diff --git a/frontend/templates/file_view.html b/frontend/templates/file_view.html index 0aaa77fd..ac0548e1 100644 --- a/frontend/templates/file_view.html +++ b/frontend/templates/file_view.html @@ -3,6 +3,11 @@ {% block head_extra %} + + + {% endblock %} @@ -582,6 +661,9 @@ {{ file.created_at.strftime('%Y-%m-%d %H:%M:%S') if file.created_at else 'N/A' }}
+ @@ -621,6 +703,9 @@
{{ file.processing_status | title }}
+ @@ -676,6 +761,24 @@
+ + +