Add hierarchical tasks with tree and flat mode

- parent_id on tasks; roots shown by default, others expandable
- Expand/collapse per node with expand/collapse button
- Sub button creates subtask directly from the row
- Make subtask of button in edit dialog with searchable picker
- Remove parent clears the parent link in the dialog
- Flat mode toggle shows all tasks indented by depth
- Tree filter shows nodes whose descendants match, not only direct matches
- Deletion blocked if task has subtasks (client + server)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-17 18:55:14 +00:00
parent 444b51794a
commit b7ee5006d2
5 changed files with 381 additions and 77 deletions

View File

@@ -32,3 +32,12 @@ export function set_task(task) {
export function delete_task(id) {
return store.delete(`task:${id}`);
}
export function has_child_tasks(parent_id) {
for (const [key] of store.data.entries()) {
if (!key.startsWith('task:')) { continue; }
const task = store.get(key);
if (task.parent_id === parent_id) { return true; }
}
return false;
}