From c70f5284c7d2351afd9f3be6f68c81f9d28628a7 Mon Sep 17 00:00:00 2001 From: jubnl Date: Sat, 4 Apr 2026 18:48:37 +0200 Subject: [PATCH] fix(collabNotes): show all attachments in expanded note view (closes #402) The expanded/fullscreen note modal was missing the attachments section entirely, so users had no way to access files beyond the 1-2 shown in the compact card view. Added a full, untruncated attachments grid below the markdown content in the modal. --- client/src/components/Collab/CollabNotes.tsx | 35 ++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/client/src/components/Collab/CollabNotes.tsx b/client/src/components/Collab/CollabNotes.tsx index 933ca84..0e449e3 100644 --- a/client/src/components/Collab/CollabNotes.tsx +++ b/client/src/components/Collab/CollabNotes.tsx @@ -1350,6 +1350,41 @@ export default function CollabNotes({ tripId, currentUser }: CollabNotesProps) {
{viewingNote.content || ''} + {(viewingNote.attachments || []).length > 0 && ( +
+
{t('files.title')}
+
+ {(viewingNote.attachments || []).map(a => { + const isImage = a.mime_type?.startsWith('image/') + const ext = (a.original_name || '').split('.').pop()?.toUpperCase() || '?' + return ( +
+ {isImage ? ( + setPreviewFile(a)} + onMouseEnter={e => { e.currentTarget.style.transform = 'scale(1.06)'; e.currentTarget.style.boxShadow = '0 2px 8px rgba(0,0,0,0.15)' }} + onMouseLeave={e => { e.currentTarget.style.transform = 'scale(1)'; e.currentTarget.style.boxShadow = 'none' }} /> + ) : ( +
setPreviewFile(a)} + style={{ + width: 64, height: 64, borderRadius: 8, cursor: 'pointer', + background: a.mime_type === 'application/pdf' ? '#ef44441a' : 'var(--bg-secondary)', + display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', gap: 1, + transition: 'transform 0.12s, box-shadow 0.12s', + }} + onMouseEnter={e => { e.currentTarget.style.transform = 'scale(1.06)'; e.currentTarget.style.boxShadow = '0 2px 8px rgba(0,0,0,0.15)' }} + onMouseLeave={e => { e.currentTarget.style.transform = 'scale(1)'; e.currentTarget.style.boxShadow = 'none' }}> + {ext} +
+ )} + {a.original_name} +
+ ) + })} +
+
+ )}
,