From 6eb1ec6eb28461e599afb4ab7f5bdd9208dab8e6 Mon Sep 17 00:00:00 2001 From: Yuri Karamian Date: Mon, 17 Aug 2026 19:44:35 +0200 Subject: [PATCH] fix: improve sidebar interactions --- src/lib/components/Sidebar.svelte | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/lib/components/Sidebar.svelte b/src/lib/components/Sidebar.svelte index e7e7ea5..ede14d9 100644 --- a/src/lib/components/Sidebar.svelte +++ b/src/lib/components/Sidebar.svelte @@ -335,6 +335,10 @@ } } + function dismissDeleteConfirm(event: MouseEvent) { + if (event.target === event.currentTarget) deleteConfirm = null; + } + async function confirmDelete(nb: NotebookEntry) { deleteConfirm = null; try { @@ -1029,10 +1033,9 @@ {#if deleteConfirm} -
deleteConfirm = null}> - -
e.stopPropagation()}> -

Delete "{deleteConfirm.name}"?

+
{ if (e.key === 'Escape') deleteConfirm = null; }}> +
+

Delete "{deleteConfirm.name}"?

This notebook contains {countNotesRecursive(deleteConfirm)} note{countNotesRecursive(deleteConfirm) === 1 ? '' : 's'} that will be permanently deleted.

@@ -1071,7 +1074,9 @@ class:drop-below={dropTargetPath === nb.path && dropPosition === 'below'} style="padding-left: {4 + depth * 16}px" data-nb-path={nb.path} - onclick={() => selectNotebook(nb)} + onclick={(e) => { + if (!(e.target as Element).closest('.nb-drag-handle')) selectNotebook(nb); + }} onkeydown={(e) => { if (e.key === 'F2') { e.preventDefault(); @@ -1153,12 +1158,11 @@ {/if} {nb.name} {nb.note_count} {#if $notebookSortMode === 'manual'} - + nbHandleDown(e, nb)} - onclick={(e) => e.stopPropagation()} >