From a322688c9e772c7ac715c8e5f90835042f3259c2 Mon Sep 17 00:00:00 2001 From: beo3000 Date: Sun, 15 Mar 2026 11:32:20 +0100 Subject: [PATCH] upd task management --- .claude/worktrees/agent-a272da02 | 2 +- ka-note/.env.example | 2 + ka-note/VERSION | 2 +- ka-note/client/src/lib/actions/refClick.ts | 36 ++++- .../src/lib/components/AufgabenCard.svelte | 142 ++++++++++++++++++ .../src/lib/components/AufgabenSection.svelte | 22 +++ .../src/lib/components/ContextHeader.svelte | 71 +++++++-- .../src/lib/components/ContextPage.svelte | 48 ++++++ .../src/lib/components/JournalView.svelte | 7 +- .../lib/components/WiedervorlageCard.svelte | 29 +++- ka-note/client/src/lib/stores/agenda.ts | 30 +++- .../client/src/lib/stores/calendarStore.ts | 16 ++ ka-note/client/src/routes/+layout.svelte | 4 + .../src/routes/inventory/[id]/+page.svelte | 45 +++++- ka-note/server/ka-note.db-shm | Bin 32768 -> 32768 bytes ka-note/server/ka-note.db-wal | Bin 4144752 -> 4144752 bytes ka-note/server/src/lib/graph-service.ts | 5 +- ka-note/shared/src/types.ts | 6 +- 18 files changed, 436 insertions(+), 31 deletions(-) create mode 100644 ka-note/client/src/lib/components/AufgabenCard.svelte create mode 100644 ka-note/client/src/lib/components/AufgabenSection.svelte create mode 100644 ka-note/client/src/lib/stores/calendarStore.ts diff --git a/.claude/worktrees/agent-a272da02 b/.claude/worktrees/agent-a272da02 index 7518072..f28dc95 160000 --- a/.claude/worktrees/agent-a272da02 +++ b/.claude/worktrees/agent-a272da02 @@ -1 +1 @@ -Subproject commit 7518072e4510b0b4217809d0f54cc2de476428f0 +Subproject commit f28dc954e87e90afc18dd7891e2be338274d716c diff --git a/ka-note/.env.example b/ka-note/.env.example index a5fc6f7..e082181 100644 --- a/ka-note/.env.example +++ b/ka-note/.env.example @@ -14,6 +14,8 @@ AZURE_GRAPH_CLIENT_ID= AZURE_GRAPH_CLIENT_SECRET= # Fallback email when auth provides no email (e.g. API key login) CALENDAR_USER_EMAIL= +# IANA timezone for calendar event times (default: Europe/Berlin) +CALENDAR_TIMEZONE=Europe/Berlin # ── VISION / INVENTORY ─────────────────────────────────────────────────────── # AES-256-GCM key for encrypting user Vision API keys in DB diff --git a/ka-note/VERSION b/ka-note/VERSION index f941f22..9309ba2 100644 --- a/ka-note/VERSION +++ b/ka-note/VERSION @@ -1 +1 @@ -1.2.37 \ No newline at end of file +1.2.41 \ No newline at end of file diff --git a/ka-note/client/src/lib/actions/refClick.ts b/ka-note/client/src/lib/actions/refClick.ts index db8afa4..01f507c 100644 --- a/ka-note/client/src/lib/actions/refClick.ts +++ b/ka-note/client/src/lib/actions/refClick.ts @@ -1,5 +1,5 @@ import { goto } from '$app/navigation'; -import { findContextByMentionName, findContextByAbbreviation, upsertContext, createPage, toggleTaskDone } from '$lib/db/repositories'; +import { findContextByMentionName, findContextByAbbreviation, upsertContext, createPage, toggleTaskDone, updateTask } from '$lib/db/repositories'; import { db } from '$lib/db/schema'; interface RefPopup { @@ -232,12 +232,33 @@ async function handleTaskRefClick(chip: HTMLElement) { position: fixed; left: 50%; top: 30%; transform: translateX(-50%); z-index: 100; background: #2d2d2d; border: 1px solid #555; border-radius: 6px; padding: 10px 14px; box-shadow: 0 4px 12px rgba(0,0,0,0.5); - font-size: 0.85rem; color: #e0e0e0; min-width: 200px; + font-size: 0.85rem; color: #e0e0e0; min-width: 220px; `; - const title = document.createElement('div'); - title.style.cssText = 'font-weight: bold; margin-bottom: 6px; font-size: 0.9rem;'; - title.textContent = task.title; - popup.appendChild(title); + + const titleInput = document.createElement('input'); + titleInput.type = 'text'; + titleInput.value = task.title; + titleInput.style.cssText = ` + width: 100%; box-sizing: border-box; margin-bottom: 8px; + background: #3a3a3a; border: 1px solid #666; border-radius: 4px; + color: #e0e0e0; font-size: 0.9rem; font-weight: bold; padding: 3px 6px; + outline: none; + `; + const saveTitle = async () => { + const newTitle = titleInput.value.trim(); + if (newTitle && newTitle !== task.title) { + await updateTask(taskId, { title: newTitle }); + document.querySelectorAll(`[data-task-id="${taskId}"]`).forEach(el => { + el.title = newTitle; + }); + } + }; + titleInput.addEventListener('blur', saveTitle); + titleInput.addEventListener('keydown', async (e) => { + if (e.key === 'Enter') { e.preventDefault(); await saveTitle(); closePopup(); } + if (e.key === 'Escape') { closePopup(); } + }); + popup.appendChild(titleInput); const btnRow = document.createElement('div'); btnRow.style.cssText = 'display: flex; gap: 6px;'; @@ -247,7 +268,6 @@ async function handleTaskRefClick(chip: HTMLElement) { toggleBtn.addEventListener('click', async () => { closePopup(); await toggleTaskDone(taskId); - // Update all chips for this task directly in DOM (no re-render triggered) const isDoneNow = task.status !== 'done'; document.querySelectorAll(`[data-task-id="${taskId}"]`).forEach(el => { if (isDoneNow) { @@ -264,6 +284,8 @@ async function handleTaskRefClick(chip: HTMLElement) { btnRow.appendChild(toggleBtn); popup.appendChild(btnRow); document.body.appendChild(popup); + titleInput.focus(); + titleInput.select(); const onClickOutside = (e: MouseEvent) => { if (!popup.contains(e.target as Node)) closePopup(); }; setTimeout(() => document.addEventListener('click', onClickOutside), 0); diff --git a/ka-note/client/src/lib/components/AufgabenCard.svelte b/ka-note/client/src/lib/components/AufgabenCard.svelte new file mode 100644 index 0000000..6cf5ccf --- /dev/null +++ b/ka-note/client/src/lib/components/AufgabenCard.svelte @@ -0,0 +1,142 @@ + + +
+
+ + 📋 Aufgabe{task.dueDate ? ` · Fällig ${task.dueDate}` : ''} + + {#if task.assignee} + + → {task.assignee} + + {/if} +
+ + {#if $source} +
+ {#if $source.contextName} + {$source.contextName} + {#if $source.topicTitle} · {$source.topicTitle}{/if} + · {$source.entryDate} + {:else} + {$source.entryDate} + {/if} +
+ {/if} + +
+
{task.title}
+
+ + {#if showDueDate} +
+ + + +
+ {:else} +
+ + + {#if task.historyEntryId} + + {/if} + +
+ {/if} +
diff --git a/ka-note/client/src/lib/components/AufgabenSection.svelte b/ka-note/client/src/lib/components/AufgabenSection.svelte new file mode 100644 index 0000000..72dfbf2 --- /dev/null +++ b/ka-note/client/src/lib/components/AufgabenSection.svelte @@ -0,0 +1,22 @@ + + +{#if ($tasks ?? []).length > 0} +
+
+ Aufgaben ({($tasks ?? []).length}) +
+ {#each ($tasks ?? []) as task (task.id)} + + {/each} +
+{/if} diff --git a/ka-note/client/src/lib/components/ContextHeader.svelte b/ka-note/client/src/lib/components/ContextHeader.svelte index 6db898c..5a1f89a 100644 --- a/ka-note/client/src/lib/components/ContextHeader.svelte +++ b/ka-note/client/src/lib/components/ContextHeader.svelte @@ -1,6 +1,7 @@