From e5a37bd7ed91efec94b43441effc1208c4fd99d5 Mon Sep 17 00:00:00 2001 From: beo3000 Date: Tue, 24 Feb 2026 19:06:18 +0100 Subject: [PATCH] opt side panel --- ka-note/VERSION | 2 +- .../src/lib/components/MeetingControls.svelte | 83 ++++-- .../client/src/lib/components/Sidebar.svelte | 240 ++++-------------- ka-note/server/ka-note.db-shm | Bin 32768 -> 32768 bytes 4 files changed, 116 insertions(+), 209 deletions(-) diff --git a/ka-note/VERSION b/ka-note/VERSION index 1a7057f..8865fe5 100644 --- a/ka-note/VERSION +++ b/ka-note/VERSION @@ -1 +1 @@ -1.1.52 \ No newline at end of file +1.1.54 \ No newline at end of file diff --git a/ka-note/client/src/lib/components/MeetingControls.svelte b/ka-note/client/src/lib/components/MeetingControls.svelte index 1c8816f..b9e404a 100644 --- a/ka-note/client/src/lib/components/MeetingControls.svelte +++ b/ka-note/client/src/lib/components/MeetingControls.svelte @@ -14,34 +14,77 @@
{#if isDailyLog} - - - +
+ + +
{:else if isMeetingMode && !isProcessed} - - - - +
+ + + +
{:else} - - {/if}
diff --git a/ka-note/client/src/lib/components/Sidebar.svelte b/ka-note/client/src/lib/components/Sidebar.svelte index 5dbac48..49b87ad 100644 --- a/ka-note/client/src/lib/components/Sidebar.svelte +++ b/ka-note/client/src/lib/components/Sidebar.svelte @@ -5,10 +5,8 @@ import { liveQuery } from 'dexie'; import { db } from '$lib/db/schema'; import { resetAndReseed } from '$lib/db/seed'; - import { upsertContext } from '$lib/db/repositories'; - import { newId } from '$lib/db/helpers'; - import type { AgendaContext, ContextType } from '@ka-note/shared'; - import { account, logout, login } from '$lib/auth/authStore.js'; + import type { AgendaContext } from '@ka-note/shared'; + import { account, logout } from '$lib/auth/authStore.js'; import { syncStatus, lastSyncAt, fullSync } from '$lib/sync/syncService'; import { deletedItemCount } from '$lib/stores/agenda'; import { favoriteNotebooks } from '$lib/stores/wiki'; @@ -42,9 +40,6 @@ collapsed[key] = !collapsed[key]; } - let creatingType: ContextType | null = $state(null); - let newName = $state(''); - function navigate(id: string) { goto(`/context/${id}`); onnavigate?.(); @@ -57,46 +52,17 @@ return ctx.name; } - function startCreating(type: ContextType) { - creatingType = type; - newName = ''; + // Active nav item style: subtle left border indicator + function navItem(active: boolean) { + return active + ? 'mb-1 w-full rounded-r px-2.5 py-2 text-left text-sm border-l-2 border-accent bg-white/8 font-semibold text-white' + : 'mb-1 w-full rounded px-2.5 py-2 text-left text-sm border-l-2 border-transparent text-[#aaa] hover:bg-white/5 hover:text-white transition-colors'; } - function cancelCreating() { - creatingType = null; - newName = ''; - } - - async function createNewContext() { - const name = newName.trim(); - if (!name || !creatingType) return; - - const type = creatingType; - const slug = name.toLowerCase().replace(/\s+/g, '-'); - const id = type === 'company' ? `f-${slug}` : type === 'person' ? `u-${slug}` : type === 'project' ? `p-${slug}` : newId(); - const fullName = type === 'company' ? `Firma ${name}` : type === 'project' ? `Project ${name}` : type === 'person' ? `Person ${name}` : name; - - const existing = ($contexts ?? []).filter((c: AgendaContext) => c.type === type); - const sortOrder = existing.length; - - const meta = type === 'person' ? { fullName: '', email: '', phone: '', duSince: '', personSubType: 'contact' as const } : undefined; - await upsertContext({ id, name: fullName, type, sortOrder, ...(meta ? { meta } : {}) }); - cancelCreating(); - navigate(id); - } - - function handleInputKeydown(e: KeyboardEvent) { - if (e.key === 'Enter') { - e.preventDefault(); - createNewContext(); - } else if (e.key === 'Escape') { - cancelCreating(); - } - } - - function autofocus(node: HTMLElement) { - node.focus(); - } + // Section header: ▼ toggle (small) + label (navigates to overview) + const sectionHeader = 'flex items-center gap-2 mt-6 mb-1 pl-1 pr-1'; + const sectionToggle = 'text-[10px] text-muted hover:text-white transition-colors flex-shrink-0 px-1 py-1'; + const sectionLabel = 'text-xs uppercase text-muted hover:text-white flex items-center gap-1.5 transition-colors flex-1 text-left font-medium tracking-wide'; {#if !hideLogo} @@ -108,244 +74,142 @@ {/if} -
General
+
🏠 General
- - - -
- + -
{#if !collapsed['meetings']} {/if} -
- + -
{#if !collapsed['projects']} {/if} -
- + -
{#if !collapsed['companies']} {/if} -
- + -
{#if !collapsed['people']} {/if} -
- + -
{#if !collapsed['wiki']} {/if}
diff --git a/ka-note/server/ka-note.db-shm b/ka-note/server/ka-note.db-shm index 6b9614c3a3959dcf07b25a25005deede45f91299..38aeab81a41df491daad00d9b95fa81c6d5ed21c 100644 GIT binary patch delta 56 ucmZo@U}|V!;*@x#%K!!wIpqcAZk^bEW#@A