0:00
/0:02
Notes now display their default attachment (photo, video, or audio) directly in the list view, giving users a quick visual preview before opening the full note.
- Added getDefaultAttachment utility (src/utils.ts): A new function that retrieves the default attachment from a note's attachments array. It filters for supported
media types (photo, video, audio), prioritizes attachments marked as is_default, and falls back to the first attachment if no default is set. - Updated note list rendering (src/components/PersonDetail.tsx): The notes list now checks each note for a default attachment and renders it above the date:
- Photos: Displayed with object-contain in a max-width container, maintaining aspect ratio
- Videos: Rendered as muted, autoplay-disabled video elements (showing first frame as preview)
- Audio: Displayed with a native audio player in a styled container
Error handling: Failed media loads are gracefully tracked and hidden, ensuring a broken attachment doesn't break the UI. The error state is keyed by both note ID
and attachment URL, so switching attachments will retry loading.
The attachment is clickable and opens the full note view, matching the existing interaction pattern.