diff --git a/ka-note/VERSION b/ka-note/VERSION index 28b8ef6..db06d56 100644 --- a/ka-note/VERSION +++ b/ka-note/VERSION @@ -1 +1 @@ -1.1.2 \ No newline at end of file +1.1.5 \ No newline at end of file diff --git a/ka-note/client/src/lib/components/ContextHeader.svelte b/ka-note/client/src/lib/components/ContextHeader.svelte index 77ca7ee..011d705 100644 --- a/ka-note/client/src/lib/components/ContextHeader.svelte +++ b/ka-note/client/src/lib/components/ContextHeader.svelte @@ -74,13 +74,13 @@ {#if showModeSwitch}
diff --git a/ka-note/client/src/routes/companies/+page.svelte b/ka-note/client/src/routes/companies/+page.svelte index d27361d..a30bd95 100644 --- a/ka-note/client/src/routes/companies/+page.svelte +++ b/ka-note/client/src/routes/companies/+page.svelte @@ -2,9 +2,28 @@ import { goto } from '$app/navigation'; import { liveQuery } from 'dexie'; import { db } from '$lib/db/schema'; - import { softDeleteContext, toggleFavorite } from '$lib/db/repositories'; + import { softDeleteContext, toggleFavorite, upsertContext } from '$lib/db/repositories'; + import { newId } from '$lib/db/helpers'; import ConfirmDialog from '$lib/components/ConfirmDialog.svelte'; + let creating = $state(false); + let newName = $state(''); + + async function create() { + const name = newName.trim(); + if (!name) return; + const id = newId(); + await upsertContext({ id, name: `Firma ${name}`, type: 'company' }); + newName = ''; + creating = false; + goto(`/context/${id}`); + } + + function onKeydown(e: KeyboardEvent) { + if (e.key === 'Enter') { e.preventDefault(); create(); } + else if (e.key === 'Escape') { creating = false; newName = ''; } + } + const allCompanies = liveQuery(() => db.contexts.filter(c => !c.deletedAt && c.type === 'company').sortBy('sortOrder') ); @@ -30,7 +49,21 @@
-

Alle Firmen

+
+

Alle Firmen

+ +
+ + {#if creating} + setTimeout(() => { creating = false; newName = ''; }, 150)} + autofocus + /> + {/if} {#if companies.length > 0}
diff --git a/ka-note/client/src/routes/meetings/+page.svelte b/ka-note/client/src/routes/meetings/+page.svelte index 491144e..24617a5 100644 --- a/ka-note/client/src/routes/meetings/+page.svelte +++ b/ka-note/client/src/routes/meetings/+page.svelte @@ -2,9 +2,28 @@ import { goto } from '$app/navigation'; import { liveQuery } from 'dexie'; import { db } from '$lib/db/schema'; - import { softDeleteContext, toggleFavorite } from '$lib/db/repositories'; + import { softDeleteContext, toggleFavorite, upsertContext } from '$lib/db/repositories'; + import { newId } from '$lib/db/helpers'; import ConfirmDialog from '$lib/components/ConfirmDialog.svelte'; + let creating = $state(false); + let newName = $state(''); + + async function create() { + const name = newName.trim(); + if (!name) return; + const id = newId(); + await upsertContext({ id, name, type: 'meeting' }); + newName = ''; + creating = false; + goto(`/context/${id}`); + } + + function onKeydown(e: KeyboardEvent) { + if (e.key === 'Enter') { e.preventDefault(); create(); } + else if (e.key === 'Escape') { creating = false; newName = ''; } + } + const allMeetings = liveQuery(() => db.contexts.filter(c => !c.deletedAt && c.type === 'meeting' && c.id !== 'daily-log').sortBy('sortOrder') ); @@ -26,7 +45,21 @@
-

Alle Jour Fixes

+
+

Alle Jour Fixes

+ +
+ + {#if creating} + setTimeout(() => { creating = false; newName = ''; }, 150)} + autofocus + /> + {/if} {#if meetings.length > 0}
diff --git a/ka-note/client/src/routes/persons/+page.svelte b/ka-note/client/src/routes/persons/+page.svelte index c5367cb..28e846e 100644 --- a/ka-note/client/src/routes/persons/+page.svelte +++ b/ka-note/client/src/routes/persons/+page.svelte @@ -1,6 +1,9 @@
-

Alle Personen

+
+

Alle Personen

+ +
+ + {#if creating} + setTimeout(() => { creating = false; newName = ''; }, 150)} + autofocus + /> + {/if} +
diff --git a/ka-note/client/src/routes/projects/+page.svelte b/ka-note/client/src/routes/projects/+page.svelte index 05e7853..fa00aab 100644 --- a/ka-note/client/src/routes/projects/+page.svelte +++ b/ka-note/client/src/routes/projects/+page.svelte @@ -2,10 +2,29 @@ import { goto } from '$app/navigation'; import { liveQuery } from 'dexie'; import { db } from '$lib/db/schema'; - import { softDeleteContext, toggleFavorite } from '$lib/db/repositories'; + import { softDeleteContext, toggleFavorite, upsertContext } from '$lib/db/repositories'; + import { newId } from '$lib/db/helpers'; import ConfirmDialog from '$lib/components/ConfirmDialog.svelte'; import type { AgendaContext, ProjectMeta } from '@ka-note/shared'; + let creating = $state(false); + let newName = $state(''); + + async function create() { + const name = newName.trim(); + if (!name) return; + const id = newId(); + await upsertContext({ id, name: `Project ${name}`, type: 'project' }); + newName = ''; + creating = false; + goto(`/context/${id}`); + } + + function onKeydown(e: KeyboardEvent) { + if (e.key === 'Enter') { e.preventDefault(); create(); } + else if (e.key === 'Escape') { creating = false; newName = ''; } + } + const allProjects = liveQuery(() => db.contexts.filter(c => !c.deletedAt && c.type === 'project').sortBy('sortOrder') ); @@ -36,7 +55,21 @@
-

Alle Projekte

+
+

Alle Projekte

+ +
+ + {#if creating} + setTimeout(() => { creating = false; newName = ''; }, 150)} + autofocus + /> + {/if} {#if activeProjects.length > 0}

Aktiv

diff --git a/ka-note/client/src/routes/wiki/[id]/+page.svelte b/ka-note/client/src/routes/wiki/[id]/+page.svelte index 63624c4..0dd013d 100644 --- a/ka-note/client/src/routes/wiki/[id]/+page.svelte +++ b/ka-note/client/src/routes/wiki/[id]/+page.svelte @@ -98,48 +98,51 @@ {#if currentPage}
-

- {#if editing} - e.key === 'Enter' && (e.preventDefault(), saveTitle())} - placeholder="Seitentitel..." - /> - {:else} - {currentPage.title} - {/if} +
+ +
+ {#if editing} + e.key === 'Enter' && (e.preventDefault(), saveTitle())} + placeholder="Seitentitel..." + /> + {:else} + {currentPage.title} + {/if} - - - - -
- - + +
+ + +
- -

+ +
+ + +
+
diff --git a/ka-note/client/src/routes/wiki/notebook/[id]/+page.svelte b/ka-note/client/src/routes/wiki/notebook/[id]/+page.svelte index 6486112..a360b9b 100644 --- a/ka-note/client/src/routes/wiki/notebook/[id]/+page.svelte +++ b/ka-note/client/src/routes/wiki/notebook/[id]/+page.svelte @@ -46,54 +46,56 @@ {#if $notebook$}
-

- +
+ +
+ - {#if editingName} - { if (e.key === 'Enter') { e.preventDefault(); saveRename(); } else if (e.key === 'Escape') editingName = false; }} - onblur={saveRename} - autofocus - /> - {:else} - {$notebook$.name} - - {/if} + {#if editingName} + { if (e.key === 'Enter') { e.preventDefault(); saveRename(); } else if (e.key === 'Escape') editingName = false; }} + onblur={saveRename} + autofocus + /> + {:else} + {$notebook$.name} + + {/if} - - - - -
- - + +
+ + +
-
+ +
+
-

+
{#each ($pages$ ?? []) as p (p.id)} diff --git a/ka-note/server/ka-note.db-wal b/ka-note/server/ka-note.db-wal index 9cacbe2..eaf8005 100644 Binary files a/ka-note/server/ka-note.db-wal and b/ka-note/server/ka-note.db-wal differ