From c66217e6f1ca2ba2236822f834de95b2ee415094 Mon Sep 17 00:00:00 2001 From: Frederic Cabassut Date: Sun, 22 Mar 2026 19:53:01 +0100 Subject: [PATCH] feat: add checklist shortcut to create button Add a checkbox icon next to the "Add a crumb..." button that opens a new note directly in checklist mode, similar to Google Keep's quick-create bar. The NoteEditor accepts a new initialChecklistMode prop. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/lib/components/NoteEditor.svelte | 5 +++-- src/lib/components/NotesView.svelte | 31 ++++++++++++++++++++-------- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/src/lib/components/NoteEditor.svelte b/src/lib/components/NoteEditor.svelte index 5954d1e..79f9cc5 100644 --- a/src/lib/components/NoteEditor.svelte +++ b/src/lib/components/NoteEditor.svelte @@ -33,10 +33,11 @@ interface Props { note: Note | null; isNew?: boolean; + initialChecklistMode?: boolean; onClose: () => void; } - const { note, isNew = false, onClose }: Props = $props(); + const { note, isNew = false, initialChecklistMode = false, onClose }: Props = $props(); const prefs = getPreferences(); // svelte-ignore state_referenced_locally @@ -46,7 +47,7 @@ // svelte-ignore state_referenced_locally let color = $state(note?.color ?? prefs.defaultNoteColor); // svelte-ignore state_referenced_locally - let checklistMode = $state(note?.checklistMode ?? false); + let checklistMode = $state(note?.checklistMode ?? initialChecklistMode); let showColorPicker = $state(false); let showImageUpload = $state(false); // svelte-ignore state_referenced_locally diff --git a/src/lib/components/NotesView.svelte b/src/lib/components/NotesView.svelte index 76b5b89..6123aa0 100644 --- a/src/lib/components/NotesView.svelte +++ b/src/lib/components/NotesView.svelte @@ -6,6 +6,7 @@ import { onMount } from 'svelte'; import type { Note, NoteFilter } from '$lib/types/index.js'; import Plus from 'lucide-svelte/icons/plus'; + import SquareCheck from 'lucide-svelte/icons/square-check'; interface Props { filter: NoteFilter; @@ -16,6 +17,7 @@ let editingNote: Note | null = $state(null); let showNewNote = $state(false); + let newNoteChecklist = $state(false); // Sync store with route props and reload notes when filter changes $effect(() => { @@ -32,6 +34,7 @@ function closeEditor() { editingNote = null; showNewNote = false; + newNoteChecklist = false; history.replaceState(null, '', location.pathname); } @@ -55,14 +58,24 @@ {#if filter === 'all' && !tag}