From 640584be3005ceb54e8b0cc51473f63f8f840166 Mon Sep 17 00:00:00 2001 From: igor_nadein Date: Sat, 28 Feb 2026 13:37:38 +0300 Subject: [PATCH] feat: Add two-column layout to document details modal - Left column: metadata and information (2/3 width) - Right column: document thumbnail preview (1/3 width) - Thumbnail supports: images (direct display), PDFs (iframe), other files (icon placeholder) - Added 'Open in full size' button in thumbnail section - Removed separate file open button from main content - Sticky positioning for thumbnail on scroll - Responsive: single column on mobile, two columns on large screens - Changed modal size from 'lg' to 'xl' for better layout --- frontend/src/app/documents/page.tsx | 135 +++++++++++++++++++++------- 1 file changed, 103 insertions(+), 32 deletions(-) diff --git a/frontend/src/app/documents/page.tsx b/frontend/src/app/documents/page.tsx index e57678db..727672cc 100644 --- a/frontend/src/app/documents/page.tsx +++ b/frontend/src/app/documents/page.tsx @@ -658,21 +658,23 @@ export default function DocumentsPage() { isOpen={!!selectedDocument} onClose={() => setSelectedDocument(null)} title={selectedDocument?.title} - size="lg" + size="xl" showFullscreenToggle > {selectedDocument && ( -
- {/* Status Badge */} -
- -
+
+ {/* Left Column - Information */} +
+ {/* Status Badge */} +
+ +
- {/* Metadata Grid */} -
+ {/* Metadata Grid */} +
{/* Author */}
@@ -816,27 +818,6 @@ export default function DocumentsPage() {
)} - {/* Divider */} -
- - {/* File Action */} - {selectedDocument.file_url && ( -
- -
- )} - {/* Workflow Actions */}

Действия

@@ -880,6 +861,96 @@ export default function DocumentsPage() { />
)} +
+ + {/* Right Column - Document Thumbnail */} +
+
+ {selectedDocument.file_url && ( +
+
+

Превью документа

+
+ + {/* Thumbnail Content */} +
+ {(() => { + const fileExt = selectedDocument.file_name?.toLowerCase().split('.').pop() || ''; + const isImage = ['jpg', 'jpeg', 'png', 'gif', 'webp', 'svg', 'bmp'].includes(fileExt); + const isPDF = fileExt === 'pdf'; + + if (isImage) { + return ( + {selectedDocument.file_name { + // Fallback to icon on error + e.currentTarget.style.display = 'none'; + }} + /> + ); + } + + if (isPDF) { + return ( +
+