From e76919ab5c9aee5b0085634abda90323cbec151c Mon Sep 17 00:00:00 2001 From: Yuri Karamian Date: Fri, 24 Jul 2026 20:55:57 +0200 Subject: [PATCH] Fix mobile navigation and Tasks layout --- src/lib/components/AppLayout.svelte | 39 ++++++++++++++++------------- src/lib/components/NoteList.svelte | 7 +++++- 2 files changed, 27 insertions(+), 19 deletions(-) diff --git a/src/lib/components/AppLayout.svelte b/src/lib/components/AppLayout.svelte index 12c3653..5cad8c4 100644 --- a/src/lib/components/AppLayout.svelte +++ b/src/lib/components/AppLayout.svelte @@ -614,25 +614,28 @@ // Run sidebar and note list refresh in parallel await Promise.all([sidebar?.refresh(), noteList?.refresh()]); - // Auto-cleanup orphaned attachments in the background - setTimeout(async () => { - if (get(editorDirty)) return; // skip if user is actively editing - try { - const orphans = await findOrphanedAttachments(); - if (orphans.length > 0) { - if (get(editorDirty)) return; // re-check after async scan - const moved = await trashOrphanedAttachments(orphans.map((o) => o.name)); - if (moved > 0) { - const toast = document.createElement('div'); - toast.style.cssText = 'position:fixed;bottom:24px;left:50%;transform:translateX(-50%);background:var(--bg-secondary);color:var(--text-primary);padding:10px 18px;border-radius:8px;box-shadow:0 4px 12px rgba(0,0,0,.15);border:1px solid var(--border-color);font-size:13px;z-index:10000;opacity:0;transition:opacity .3s;pointer-events:none'; - toast.textContent = `Moved ${moved} orphaned attachment${moved > 1 ? 's' : ''} to trash`; - document.body.appendChild(toast); - requestAnimationFrame(() => (toast.style.opacity = '1')); - setTimeout(() => { toast.style.opacity = '0'; setTimeout(() => toast.remove(), 300); }, 4000); + // Full-vault attachment scans cause navigation stalls on mobile storage. + // Mobile users can run the same cleanup explicitly from the Info panel. + if (!isMobile) { + setTimeout(async () => { + if (get(editorDirty)) return; // skip if user is actively editing + try { + const orphans = await findOrphanedAttachments(); + if (orphans.length > 0) { + if (get(editorDirty)) return; // re-check after async scan + const moved = await trashOrphanedAttachments(orphans.map((o) => o.name)); + if (moved > 0) { + const toast = document.createElement('div'); + toast.style.cssText = 'position:fixed;bottom:24px;left:50%;transform:translateX(-50%);background:var(--bg-secondary);color:var(--text-primary);padding:10px 18px;border-radius:8px;box-shadow:0 4px 12px rgba(0,0,0,.15);border:1px solid var(--border-color);font-size:13px;z-index:10000;opacity:0;transition:opacity .3s;pointer-events:none'; + toast.textContent = `Moved ${moved} orphaned attachment${moved > 1 ? 's' : ''} to trash`; + document.body.appendChild(toast); + requestAnimationFrame(() => (toast.style.opacity = '1')); + setTimeout(() => { toast.style.opacity = '0'; setTimeout(() => toast.remove(), 300); }, 4000); + } } - } - } catch (_) {} - }, 3000); + } catch (_) {} + }, 3000); + } // Restore the last session (view + open note) if enabled. if ($appConfig?.restore_last_session) { diff --git a/src/lib/components/NoteList.svelte b/src/lib/components/NoteList.svelte index 4dd189f..64b1b33 100644 --- a/src/lib/components/NoteList.svelte +++ b/src/lib/components/NoteList.svelte @@ -1112,7 +1112,7 @@ {/if} -
+
{#if $viewMode === 'tasks'} {/if} @@ -2213,6 +2213,11 @@ padding: 4px 8px 180px; } + .note-list.mobile .list-content.tasks-mode { + padding-bottom: 0; + overflow: hidden; + } + .note-list.mobile .note-item { padding: 14px 16px; min-height: 56px;