From 7cebf44dcc9a3e1488c7deccac5b8f25105f2e2e Mon Sep 17 00:00:00 2001 From: Frederic Cabassut Date: Sun, 8 Mar 2026 21:21:47 +0100 Subject: [PATCH] feat: add offline attachment support with IDB pending store and sync - Bump IDB version to 2, add pendingAttachments object store with noteId index - Add CRUD helpers: addPendingAttachment, getPendingAttachments, removePendingAttachment - ImageUpload stores blobs in IDB when offline, displays via blob URLs - Show pending sync indicator (RefreshCw icon) on not-yet-uploaded images - Add pushPendingAttachments to sync client, runs after note push - Pending attachments auto-upload on reconnect via existing online event listener Co-Authored-By: Claude Opus 4.6 --- src/lib/components/ImageUpload.svelte | 42 +++++++++++++++++++++++-- src/lib/sync/client.ts | 28 ++++++++++++++++- src/lib/sync/idb.ts | 44 ++++++++++++++++++++++++++- 3 files changed, 110 insertions(+), 4 deletions(-) diff --git a/src/lib/components/ImageUpload.svelte b/src/lib/components/ImageUpload.svelte index 35955d2..4cfecb6 100644 --- a/src/lib/components/ImageUpload.svelte +++ b/src/lib/components/ImageUpload.svelte @@ -1,7 +1,10 @@