From 46047ca5432db51bae70a89d0c48600f2ffe7a97 Mon Sep 17 00:00:00 2001 From: beo3000 Date: Fri, 20 Feb 2026 22:24:26 +0100 Subject: [PATCH] ui update --- .../client/src/lib/components/Sidebar.svelte | 6 ++ .../src/lib/components/SnoozedView.svelte | 65 ++++++++++++++----- .../client/src/lib/components/ViewTabs.svelte | 8 ++- ka-note/client/src/lib/stores/settings.ts | 44 +++++++++++++ .../client/src/routes/settings/+page.svelte | 29 +++++++++ 5 files changed, 133 insertions(+), 19 deletions(-) create mode 100644 ka-note/client/src/lib/stores/settings.ts create mode 100644 ka-note/client/src/routes/settings/+page.svelte diff --git a/ka-note/client/src/lib/components/Sidebar.svelte b/ka-note/client/src/lib/components/Sidebar.svelte index 46bbbaa..6b421c3 100644 --- a/ka-note/client/src/lib/components/Sidebar.svelte +++ b/ka-note/client/src/lib/components/Sidebar.svelte @@ -282,6 +282,12 @@ {/if}
+ {#if $account}
{$account.name ?? $account.username} diff --git a/ka-note/client/src/lib/components/SnoozedView.svelte b/ka-note/client/src/lib/components/SnoozedView.svelte index f19ba31..9bd4154 100644 --- a/ka-note/client/src/lib/components/SnoozedView.svelte +++ b/ka-note/client/src/lib/components/SnoozedView.svelte @@ -2,37 +2,68 @@ import { liveQuery } from 'dexie'; import { db } from '$lib/db/schema'; import { updateTopic } from '$lib/db/repositories'; + import type { Topic, AgendaContext } from '@ka-note/shared'; interface Props { contextId: string; } let { contextId }: Props = $props(); + const isDailyLog = $derived(contextId === 'daily-log'); + const snoozedTopics = liveQuery(() => - db.topics - .where('contextId').equals(contextId) - .filter(t => !t.deletedAt && t.status === 'snoozed' && !!t.snoozeUntil) - .toArray() + isDailyLog + ? db.topics.filter(t => !t.deletedAt && t.status === 'snoozed' && !!t.snoozeUntil).toArray() + : db.topics.where('contextId').equals(contextId) + .filter(t => !t.deletedAt && t.status === 'snoozed' && !!t.snoozeUntil) + .toArray() ); + const contexts = liveQuery(() => db.contexts.filter(c => !c.deletedAt).toArray()); + + const contextMap = $derived( + new Map(($contexts ?? []).map((c: AgendaContext) => [c.id, c.name])) + ); + + const grouped = $derived(() => { + const topics = $snoozedTopics ?? []; + const groups = new Map(); + for (const t of topics) { + const date = t.snoozeUntil!; + const list = groups.get(date) ?? []; + list.push(t); + groups.set(date, list); + } + return [...groups.entries()].sort(([a], [b]) => a.localeCompare(b)); + }); + function reactivate(id: string) { updateTopic(id, { snoozeUntil: null, status: 'active', isNew: false }); } -{#each $snoozedTopics ?? [] as topic (topic.id)} -
-
- {topic.title} - -
-
Bis: {topic.snoozeUntil}
+{#each grouped() as [date, topics]} +
+
{date}
+ {#each topics as topic (topic.id)} +
+
+
+ {topic.title} + {#if isDailyLog && topic.contextId !== 'daily-log'} + {contextMap.get(topic.contextId) ?? topic.contextId} + {/if} +
+ +
+
+ {/each}
{:else} -
Leer.
+
Keine verschobenen Themen.
{/each} diff --git a/ka-note/client/src/lib/components/ViewTabs.svelte b/ka-note/client/src/lib/components/ViewTabs.svelte index fe19d17..0be1b34 100644 --- a/ka-note/client/src/lib/components/ViewTabs.svelte +++ b/ka-note/client/src/lib/components/ViewTabs.svelte @@ -1,5 +1,6 @@ + +

Einstellungen

+ +
+

Daily Log Tabs

+ + + + +