Compare commits

...

3 Commits

Author SHA1 Message Date
beo3000 80c7064666 ux update 2026-02-20 22:34:53 +01:00
beo3000 6818c469f6 ux updates 2026-02-20 22:33:48 +01:00
beo3000 46047ca543 ui update 2026-02-20 22:24:26 +01:00
7 changed files with 77 additions and 31 deletions

View File

@ -4,12 +4,12 @@
interface Props {
context: AgendaContext;
mode: 'prep' | 'meeting';
onmodechange: (mode: 'prep' | 'meeting') => void;
mode?: 'prep' | 'meeting';
onmodechange?: (mode: 'prep' | 'meeting') => void;
}
let { context, mode, onmodechange }: Props = $props();
const showModeSwitch = $derived(context.type === 'meeting' && context.id !== 'daily-log');
const showModeSwitch = $derived(!!onmodechange && context.type === 'meeting' && context.id !== 'daily-log');
const canRename = $derived(context.id !== 'daily-log');
let editing = $state(false);
let nameInput = $state('');
@ -71,13 +71,13 @@
<div class="flex gap-1 rounded-full bg-[#333] p-1">
<button
class="rounded-full border-none px-4 py-2 font-bold transition-all {mode === 'prep' ? 'bg-accent text-white shadow-md' : 'bg-transparent text-[#aaa] cursor-pointer'}"
onclick={() => onmodechange('prep')}
onclick={() => onmodechange?.('prep')}
>
Vorbereitung
</button>
<button
class="rounded-full border-none px-4 py-2 font-bold transition-all {mode === 'meeting' ? 'bg-warning text-[#222] shadow-md' : 'bg-transparent text-[#aaa] cursor-pointer'}"
onclick={() => onmodechange('meeting')}
onclick={() => onmodechange?.('meeting')}
>
Meeting
</button>

View File

@ -19,9 +19,10 @@
let { contextId }: Props = $props();
const context = liveQuery(() => db.contexts.get(contextId));
const isDailyLog = $derived(contextId === 'daily-log');
let mode = $state<'prep' | 'meeting'>(contextId === 'daily-log' ? 'meeting' : 'prep');
let activeView = $state('agenda');
let activeView = $state('journal');
let compact = $state(false);
// Rating modal state
@ -30,7 +31,7 @@
// Default view based on context type
$effect(() => {
if ($context) {
if (contextId === 'daily-log') {
if (isDailyLog) {
activeView = 'journal';
} else if ($context.type === 'meeting') {
activeView = 'agenda';
@ -81,8 +82,13 @@
<div bind:this={containerEl}>
{#if $context}
<ContextHeader context={$context} {mode} onmodechange={handleModeChange} />
<ViewTabs context={$context} {activeView} {compact} onviewchange={handleViewChange} ontogglecompact={toggleCompact} />
{#if isDailyLog}
<ContextHeader context={$context} />
<ViewTabs context={$context} {activeView} onviewchange={handleViewChange} />
{:else}
<ContextHeader context={$context} {mode} onmodechange={handleModeChange} />
<ViewTabs context={$context} {activeView} {compact} onviewchange={handleViewChange} ontogglecompact={toggleCompact} />
{/if}
{#if activeView === 'agenda'}
<AgendaView {contextId} {mode} />

View File

@ -196,7 +196,7 @@
class="self-start rounded bg-accent px-4 py-2 font-bold text-white hover:brightness-110"
onclick={handleAddEntry}
>
+ Eintrag hinzufügen
+ {selectedLinkedContextId ? 'Thema hinzufügen' : 'Notiz hinzufügen'}
</button>
</div>

View File

@ -282,6 +282,12 @@
{/if}
<div class="mt-auto border-t border-border pt-3">
<button
class="mb-1 w-full rounded px-2.5 py-2 text-left text-xs text-muted transition-colors hover:bg-white/5 hover:text-white"
onclick={() => { goto('/settings'); onnavigate?.(); }}
>
Einstellungen
</button>
{#if $account}
<div class="mb-2 truncate px-1 text-xs text-muted" title={$account.username}>
{$account.name ?? $account.username}

View File

@ -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<string, Topic[]>();
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 });
}
</script>
{#each $snoozedTopics ?? [] as topic (topic.id)}
<div class="mb-5 rounded-lg border-l-[5px] border-l-muted bg-card-bg opacity-60">
<div class="flex items-center justify-between px-5 py-4">
<span class="text-lg font-bold">{topic.title}</span>
<button
class="rounded bg-success px-4 py-2 font-bold text-white"
onclick={() => reactivate(topic.id)}
>
Reaktivieren
</button>
</div>
<div class="px-5 pb-4 text-[#aaa]">Bis: {topic.snoozeUntil}</div>
{#each grouped() as [date, topics]}
<div class="mb-6">
<div class="mb-2 text-sm font-bold text-accent">{date}</div>
{#each topics as topic (topic.id)}
<div class="mb-2 rounded-lg border-l-[5px] border-l-muted bg-card-bg opacity-60">
<div class="flex items-center justify-between px-5 py-4">
<div>
<span class="text-lg font-bold">{topic.title}</span>
{#if isDailyLog && topic.contextId !== 'daily-log'}
<span class="ml-2 text-xs text-muted">{contextMap.get(topic.contextId) ?? topic.contextId}</span>
{/if}
</div>
<button
class="rounded bg-success px-4 py-2 font-bold text-white"
onclick={() => reactivate(topic.id)}
>
Reaktivieren
</button>
</div>
</div>
{/each}
</div>
{:else}
<div class="text-center text-muted">Leer.</div>
<div class="text-center text-muted">Keine verschobenen Themen.</div>
{/each}

View File

@ -4,9 +4,9 @@
interface Props {
context: AgendaContext;
activeView: string;
compact: boolean;
compact?: boolean;
onviewchange: (view: string) => void;
ontogglecompact: () => void;
ontogglecompact?: () => void;
}
let { context, activeView, compact, onviewchange, ontogglecompact }: Props = $props();
@ -26,7 +26,7 @@
...(isDailyLog ? [] : [{ id: 'agenda', label: 'Agenda / Eingabe' }]),
{ id: 'journal', label: 'Journal / Historie' },
{ id: 'persons', label: 'Personen (All)' },
{ id: 'snoozed', label: 'Verschoben' }
...(isDailyLog ? [] : [{ id: 'snoozed', label: 'Verschoben' }])
]
: [
{ id: 'dashboard', label: `Dashboard: ${context.name.replace(/^(Project |Person |Firma )/, '')}` },
@ -46,7 +46,7 @@
</button>
{/each}
{#if isMeeting && activeView === 'agenda'}
{#if isMeeting && activeView === 'agenda' && ontogglecompact}
<div class="ml-auto">
<button
class="rounded border border-[#555] bg-transparent px-2.5 py-1 text-sm text-[#ccc] hover:bg-[#333]"

View File

@ -0,0 +1,3 @@
<h1 class="mb-6 text-2xl font-bold text-accent">Einstellungen</h1>
<div class="text-muted">Keine Einstellungen vorhanden.</div>