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 <noreply@anthropic.com>
This commit is contained in:
@@ -1,46 +1,24 @@
|
||||
<script lang="ts">
|
||||
import EntryList from '$lib/components/EntryList.svelte';
|
||||
import QuickCapture from '$lib/components/QuickCapture.svelte';
|
||||
|
||||
let { data } = $props();
|
||||
</script>
|
||||
|
||||
<main class="min-h-screen bg-gray-50 p-8">
|
||||
<div class="max-w-2xl mx-auto">
|
||||
<h1 class="text-3xl font-bold text-gray-900 mb-2">TaskPlanner</h1>
|
||||
<p class="text-gray-600 mb-8">Core CRUD Phase - Form Actions Ready</p>
|
||||
<svelte:head>
|
||||
<title>TaskPlaner</title>
|
||||
</svelte:head>
|
||||
|
||||
<div class="bg-white rounded-lg shadow p-6 mb-6">
|
||||
<h2 class="text-lg font-semibold text-gray-800 mb-4">System Status</h2>
|
||||
|
||||
<div class="space-y-3">
|
||||
<div class="flex items-center gap-2">
|
||||
<span class="w-3 h-3 rounded-full bg-green-500"></span>
|
||||
<span class="text-gray-700">Form actions: create, update, delete, toggleComplete</span>
|
||||
</div>
|
||||
<div class="flex items-center gap-2">
|
||||
<span class="w-3 h-3 rounded-full bg-green-500"></span>
|
||||
<span class="text-gray-700">Entries loaded: {data.entries.length}</span>
|
||||
</div>
|
||||
</div>
|
||||
<main class="min-h-screen bg-gray-50 pb-40">
|
||||
<header class="bg-white border-b border-gray-200 sticky top-0 z-10">
|
||||
<div class="max-w-2xl mx-auto px-4 py-4">
|
||||
<h1 class="text-xl font-bold text-gray-900">TaskPlaner</h1>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
{#if data.entries.length > 0}
|
||||
<div class="bg-white rounded-lg shadow p-6">
|
||||
<h2 class="text-lg font-semibold text-gray-800 mb-4">Entries (tasks first, newest within type)</h2>
|
||||
<ul class="space-y-2">
|
||||
{#each data.entries as entry}
|
||||
<li class="p-3 bg-gray-50 rounded">
|
||||
<div class="font-medium text-gray-900">{entry.title || '(no title)'}</div>
|
||||
<div class="text-sm text-gray-600">{entry.content}</div>
|
||||
<div class="text-xs text-gray-400 mt-1">
|
||||
Type: {entry.type} | Status: {entry.status} | Created: {new Date(entry.createdAt).toLocaleString()}
|
||||
</div>
|
||||
</li>
|
||||
{/each}
|
||||
</ul>
|
||||
</div>
|
||||
{:else}
|
||||
<div class="bg-white rounded-lg shadow p-6">
|
||||
<p class="text-gray-500">No entries yet. Use form actions to create entries.</p>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="max-w-2xl mx-auto px-4 py-4">
|
||||
<EntryList entries={data.entries} />
|
||||
</div>
|
||||
|
||||
<QuickCapture />
|
||||
</main>
|
||||
|
||||
Reference in New Issue
Block a user