From fed184828e34ad4d1b0a1d075a77bd9d8f73b0c1 Mon Sep 17 00:00:00 2001 From: Thomas Richter Date: Thu, 29 Jan 2026 11:07:51 +0100 Subject: [PATCH] feat(02-02): add QuickCapture component and integrate main page - QuickCapture fixed at bottom with type selector and submit button - Uses enhance for progressive form enhancement - Persists last used type via preferences store - Clears form on successful submit - Main page composes EntryList and QuickCapture - Adequate bottom padding (pb-40) for capture bar clearance - Sticky header with app title Co-Authored-By: Claude Opus 4.5 --- src/lib/components/QuickCapture.svelte | 71 ++++++++++++++++++++++++++ src/routes/+page.svelte | 52 ++++++------------- 2 files changed, 86 insertions(+), 37 deletions(-) create mode 100644 src/lib/components/QuickCapture.svelte diff --git a/src/lib/components/QuickCapture.svelte b/src/lib/components/QuickCapture.svelte new file mode 100644 index 0000000..a0c17a8 --- /dev/null +++ b/src/lib/components/QuickCapture.svelte @@ -0,0 +1,71 @@ + + +
{ + return async ({ result, update }) => { + if (result.type === 'success') { + // Update preference + $preferences.lastEntryType = type; + // Clear form + title = ''; + content = ''; + // Let SvelteKit refresh data + } + await update(); + }; + }} + class="fixed bottom-0 left-0 right-0 bg-white border-t border-gray-200 shadow-lg safe-bottom" +> +
+
+ +
+ +
+ + +
+
+
+
+
diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index e93da86..96d867f 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -1,46 +1,24 @@ -
-
-

TaskPlanner

-

Core CRUD Phase - Form Actions Ready

+ + TaskPlaner + -
-

System Status

- -
-
- - Form actions: create, update, delete, toggleComplete -
-
- - Entries loaded: {data.entries.length} -
-
+
+
+
+

TaskPlaner

+
- {#if data.entries.length > 0} -
-

Entries (tasks first, newest within type)

-
    - {#each data.entries as entry} -
  • -
    {entry.title || '(no title)'}
    -
    {entry.content}
    -
    - Type: {entry.type} | Status: {entry.status} | Created: {new Date(entry.createdAt).toLocaleString()} -
    -
  • - {/each} -
-
- {:else} -
-

No entries yet. Use form actions to create entries.

-
- {/if} +
+
+ +