From 15fb01e2b12f854e8ba74a26c710b0547e1648d7 Mon Sep 17 00:00:00 2001 From: beo3000 Date: Mon, 23 Feb 2026 09:52:55 +0100 Subject: [PATCH] ui fixes --- ka-note/VERSION | 2 +- .../src/lib/components/DashboardView.svelte | 7 +--- .../client/src/lib/components/ViewTabs.svelte | 33 ++++++++----------- ka-note/client/src/lib/db/repositories.ts | 17 ++++++---- ka-note/shared/src/types.ts | 1 - 5 files changed, 27 insertions(+), 33 deletions(-) diff --git a/ka-note/VERSION b/ka-note/VERSION index 0c23e08..af86c26 100644 --- a/ka-note/VERSION +++ b/ka-note/VERSION @@ -1 +1 @@ -1.1.11 \ No newline at end of file +1.1.13 \ No newline at end of file diff --git a/ka-note/client/src/lib/components/DashboardView.svelte b/ka-note/client/src/lib/components/DashboardView.svelte index 8ab7715..cb10690 100644 --- a/ka-note/client/src/lib/components/DashboardView.svelte +++ b/ka-note/client/src/lib/components/DashboardView.svelte @@ -330,7 +330,7 @@ {#if metaOpen}
{#if isProject} - {@const meta = (context.meta ?? { status: '', owner: '', links: '' }) as ProjectMeta} + {@const meta = (context.meta ?? { status: '', owner: '' }) as ProjectMeta}
updateMeta('owner', e.currentTarget.value)} />
-
- - updateMeta('links', e.currentTarget.value)} /> -
-
+
{#each tabs as tab} -
+ {/if}
diff --git a/ka-note/client/src/lib/db/repositories.ts b/ka-note/client/src/lib/db/repositories.ts index 85d94cb..df0f1b7 100644 --- a/ka-note/client/src/lib/db/repositories.ts +++ b/ka-note/client/src/lib/db/repositories.ts @@ -75,10 +75,13 @@ export async function reorderContext(id: string, direction: 'up' | 'down'): Prom const idx = siblings.findIndex(c => c.id === id); const swapIdx = direction === 'up' ? idx - 1 : idx + 1; if (swapIdx < 0 || swapIdx >= siblings.length) return; - const other = siblings[swapIdx]; + // Swap positions in the array, then write clean sequential sortOrder values + [siblings[idx], siblings[swapIdx]] = [siblings[swapIdx], siblings[idx]]; const ts = now(); - await db.contexts.update(id, { sortOrder: other.sortOrder, updatedAt: ts, version: ctx.version + 1 }); - await db.contexts.update(other.id, { sortOrder: ctx.sortOrder, updatedAt: ts, version: other.version + 1 }); + for (let i = 0; i < siblings.length; i++) { + const s = siblings[i]; + await db.contexts.update(s.id, { sortOrder: i, updatedAt: ts, version: s.version + 1 }); + } } export async function findContextByMentionName(name: string, type: 'person' | 'project' | 'company'): Promise { @@ -502,10 +505,12 @@ export async function reorderNotebook(id: string, direction: 'up' | 'down'): Pro const idx = siblings.findIndex(n => n.id === id); const swapIdx = direction === 'up' ? idx - 1 : idx + 1; if (swapIdx < 0 || swapIdx >= siblings.length) return; - const other = siblings[swapIdx]; + [siblings[idx], siblings[swapIdx]] = [siblings[swapIdx], siblings[idx]]; const ts = now(); - await db.notebooks.update(id, { sortOrder: other.sortOrder, updatedAt: ts, version: nb.version + 1 }); - await db.notebooks.update(other.id, { sortOrder: nb.sortOrder, updatedAt: ts, version: other.version + 1 }); + for (let i = 0; i < siblings.length; i++) { + const s = siblings[i]; + await db.notebooks.update(s.id, { sortOrder: i, updatedAt: ts, version: s.version + 1 }); + } } export async function softDeleteNotebook(id: string): Promise { diff --git a/ka-note/shared/src/types.ts b/ka-note/shared/src/types.ts index 7c55914..c0c58ef 100644 --- a/ka-note/shared/src/types.ts +++ b/ka-note/shared/src/types.ts @@ -22,7 +22,6 @@ export interface AgendaContext extends SyncEntity { export interface ProjectMeta { status: string; owner: string; - links: string; notes?: string; }