From e8c6dd393053f0041f4a996b18b411b872e29c3a Mon Sep 17 00:00:00 2001 From: Joakim Date: Tue, 6 Jan 2026 16:16:44 +0100 Subject: [PATCH] feat(frontend): implement task CRUD functionality - Create TaskItem component with checkbox, meta info, tags - Create TaskList component with loading/empty states - Update home page with task list and filter toggle (pending/completed) - Add new task form with description, project, priority, due date, tags - Add task detail placeholder page - Implement task toggle (complete/uncomplete) - Add filter bar to switch between pending and completed tasks - Support for optimistic UI updates and offline queueing - Visual indicators for priority, due dates, overdue tasks - Mobile-optimized list items with proper touch targets --- opal-web/src/lib/components/TaskItem.svelte | 163 ++++++++++++++++ opal-web/src/lib/components/TaskList.svelte | 84 +++++++++ opal-web/src/routes/+page.svelte | 178 +++++++++++++++++- opal-web/src/routes/tasks/[uuid]/+page.svelte | 26 +++ opal-web/src/routes/tasks/new/+page.svelte | 172 +++++++++++++++++ 5 files changed, 621 insertions(+), 2 deletions(-) create mode 100644 opal-web/src/lib/components/TaskItem.svelte create mode 100644 opal-web/src/lib/components/TaskList.svelte create mode 100644 opal-web/src/routes/tasks/[uuid]/+page.svelte create mode 100644 opal-web/src/routes/tasks/new/+page.svelte diff --git a/opal-web/src/lib/components/TaskItem.svelte b/opal-web/src/lib/components/TaskItem.svelte new file mode 100644 index 0000000..5a0fa9f --- /dev/null +++ b/opal-web/src/lib/components/TaskItem.svelte @@ -0,0 +1,163 @@ + + +
onClick(task.uuid)} role="button" tabindex="0"> +
onToggle(task.uuid)}> + +
+ +
+
+ + {task.description} + +
+ +
+ {#if task.project} + {task.project} + {/if} + + {#if task.priority > 1} + + {priorityLabel} + + {/if} + + {#if task.due} + + {formatRelative(task.due)} + + {/if} + + {#if task.tags && task.tags.length > 0} +
+ {#each task.tags as tag} + {tag} + {/each} +
+ {/if} +
+
+
+ + diff --git a/opal-web/src/lib/components/TaskList.svelte b/opal-web/src/lib/components/TaskList.svelte new file mode 100644 index 0000000..3f3f967 --- /dev/null +++ b/opal-web/src/lib/components/TaskList.svelte @@ -0,0 +1,84 @@ + + +
+ {#if loading} +
+
+

Loading tasks...

+
+ {:else if tasks.length === 0} +
+ + + +

{emptyMessage}

+
+ {:else} + {#each tasks as task (task.uuid)} + + {/each} + {/if} +
+ + diff --git a/opal-web/src/routes/+page.svelte b/opal-web/src/routes/+page.svelte index cc88df0..c08de5a 100644 --- a/opal-web/src/routes/+page.svelte +++ b/opal-web/src/routes/+page.svelte @@ -1,2 +1,176 @@ -

Welcome to SvelteKit

-

Visit svelte.dev/docs/kit to read the documentation

+ + +
+
+
+

Tasks

+ + + + + New + +
+ +
+ + +
+ + +
+
+ + diff --git a/opal-web/src/routes/tasks/[uuid]/+page.svelte b/opal-web/src/routes/tasks/[uuid]/+page.svelte new file mode 100644 index 0000000..a920d70 --- /dev/null +++ b/opal-web/src/routes/tasks/[uuid]/+page.svelte @@ -0,0 +1,26 @@ + + +
+
+

Task Detail

+

UUID: {uuid}

+

Task detail view coming in next iteration...

+ ← Back to tasks +
+
+ + diff --git a/opal-web/src/routes/tasks/new/+page.svelte b/opal-web/src/routes/tasks/new/+page.svelte new file mode 100644 index 0000000..a8c37a6 --- /dev/null +++ b/opal-web/src/routes/tasks/new/+page.svelte @@ -0,0 +1,172 @@ + + +
+
+
+ + + + + Back + +

New Task

+
+ +
+ {#if error} +
{error}
+ {/if} + + + + + + + + + +
+ + +
+
+
+
+ +