From cc6181aba1644ece69168bc4a64ceafb6bff3920 Mon Sep 17 00:00:00 2001 From: Frederic Cabassut Date: Sun, 8 Mar 2026 21:18:08 +0100 Subject: [PATCH] feat: wire ImageUpload into NoteEditor and show thumbnails on NoteCard - Import ImageUpload into NoteEditor with attachment state management - Add $effect to fetch attachments for existing notes loaded from IDB - Add upload/remove handlers and image toggle button in toolbar - Show ImageUpload panel between content and formatting toolbar - Add full-bleed thumbnail strip at top of NoteCard (up to 3 images) - Use &thumb=1 URL for card previews with lazy loading - Show +N badge when more than 3 attachments Co-Authored-By: Claude Opus 4.6 --- src/lib/components/NoteCard.svelte | 22 +++++++++ src/lib/components/NoteEditor.svelte | 71 +++++++++++++++++++++++++++- 2 files changed, 92 insertions(+), 1 deletion(-) diff --git a/src/lib/components/NoteCard.svelte b/src/lib/components/NoteCard.svelte index 46b52c3..baecf0b 100644 --- a/src/lib/components/NoteCard.svelte +++ b/src/lib/components/NoteCard.svelte @@ -78,6 +78,28 @@ data-testid="note-card" data-note-id={note.id} > + + {#if note.attachments && note.attachments.length > 0} +
+ {#each note.attachments.slice(0, 3) as attachment} +
+ {attachment.filename} +
+ {/each} + {#if note.attachments.length > 3} +
+ +{note.attachments.length - 3} +
+ {/if} +
+ {/if} + {#if note.pinned} + + +