From 1b55474a9b7f7daf3ce168a1932b383af4e6aff6 Mon Sep 17 00:00:00 2001 From: dotta Date: Mon, 6 Apr 2026 11:56:20 -0500 Subject: [PATCH] Display image attachments as square-cropped gallery grid Image attachments now render in a 4-column grid with square aspect ratio and center-cropped thumbnails. Clicking opens the existing gallery modal. Hover reveals a trash icon; clicking it shows an inline confirmation overlay before deleting. Non-image attachments retain the original list layout. Co-Authored-By: Paperclip --- ui/src/pages/IssueDetail.tsx | 146 ++++++++++++++++++++++++----------- 1 file changed, 100 insertions(+), 46 deletions(-) diff --git a/ui/src/pages/IssueDetail.tsx b/ui/src/pages/IssueDetail.tsx index 7c80eb71..f62d3264 100644 --- a/ui/src/pages/IssueDetail.tsx +++ b/ui/src/pages/IssueDetail.tsx @@ -1218,7 +1218,9 @@ export function IssueDetail() { const isImageAttachment = (attachment: IssueAttachment) => attachment.contentType.startsWith("image/"); const attachmentList = attachments ?? []; const imageAttachments = attachmentList.filter(isImageAttachment); + const nonImageAttachments = attachmentList.filter((a) => !isImageAttachment(a)); const hasAttachments = attachmentList.length > 0; + const [confirmDeleteId, setConfirmDeleteId] = useState(null); const attachmentUploadButton = ( <> {attachmentError}

)} -
- {attachmentList.map((attachment) => ( -
-
- - {attachment.originalFilename ?? attachment.id} - - + {imageAttachments.length > 0 && ( +
+ {imageAttachments.map((attachment) => ( +
{ + const idx = imageAttachments.findIndex((a) => a.id === attachment.id); + setGalleryIndex(idx >= 0 ? idx : 0); + setGalleryOpen(true); + }} + > + {attachment.originalFilename +
+ {confirmDeleteId === attachment.id ? ( +
e.stopPropagation()} + > +

Delete?

+
+ + +
+
+ ) : ( + + )}
-

- {attachment.contentType} · {(attachment.byteSize / 1024).toFixed(1)} KB -

- {isImageAttachment(attachment) && ( - - )} -
- ))} -
+ ))} +
+ )} + + {nonImageAttachments.length > 0 && ( +
+ {nonImageAttachments.map((attachment) => ( +
+
+ + {attachment.originalFilename ?? attachment.id} + + +
+

+ {attachment.contentType} · {(attachment.byteSize / 1024).toFixed(1)} KB +

+
+ ))} +
+ )}
) : null}