From d2100c8500ccfa6cad7d414877a997a120d19cb3 Mon Sep 17 00:00:00 2001 From: mf Date: Fri, 26 Jun 2026 23:59:54 +0200 Subject: [PATCH] Create notes from empty list double-click (#175) Double-clicking empty space in the notes list now creates a new note. The notebook sidebar double-click shortcut is scoped to the notebook section so adjacent panes do not trigger notebook creation. Reviewed-on: https://codeberg.org/ArkHost/HelixNotes/pulls/175 --- src/lib/components/NoteList.svelte | 11 ++++++++++- src/lib/components/Sidebar.svelte | 5 +++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/lib/components/NoteList.svelte b/src/lib/components/NoteList.svelte index 69ffa7f..9d05d0d 100644 --- a/src/lib/components/NoteList.svelte +++ b/src/lib/components/NoteList.svelte @@ -449,6 +449,14 @@ } } + function handleListDoubleClick(e: MouseEvent) { + const target = e.target as HTMLElement | null; + if (target?.closest('button, input, .note-item, .context-menu, .sort-menu, .batch-move-picker, .cal')) return; + e.stopPropagation(); + if ($viewMode === 'tasks' || $viewMode === 'trash') return; + handleCreateNote(); + } + async function handleRename(note: NoteEntry) { if (!editValue.trim() || editValue.trim() === note.meta.title) { editingNote = null; @@ -1079,7 +1087,8 @@ {/if} -
+ +
{#if $viewMode === 'tasks'} {/if} diff --git a/src/lib/components/Sidebar.svelte b/src/lib/components/Sidebar.svelte index a1acd62..a300bd0 100644 --- a/src/lib/components/Sidebar.svelte +++ b/src/lib/components/Sidebar.svelte @@ -636,7 +636,7 @@ -