feat(tasks): migrate task store from localStorage to SQLite backend

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
jake
2026-03-21 13:00:52 +00:00
parent 7a9a034e3a
commit 6d8597e9ea
8 changed files with 230 additions and 22 deletions

View File

@@ -1,5 +1,6 @@
<script>
import { tasks, addTask, completeTask, uncompleteTask, deleteTask } from '$lib/stores/page.svelte.js';
import { getTasks, createTask, completeTask, deleteTask } from '$lib/stores/tasks.svelte.js';
const tasks = getTasks();
import { ChevronDown } from 'lucide-svelte';
let { wipLimit = 3 } = $props();
@@ -12,10 +13,10 @@
let overflowTasks = $derived(activeTasks.slice(wipLimit));
let hasOverflow = $derived(overflowTasks.length > 0);
function handleAdd() {
async function handleAdd() {
const text = newTaskText.trim();
if (!text) return;
addTask({ text, bucket: 'inbox' });
await createTask(text, { bucket: 'inbox' });
newTaskText = '';
}