diff --git a/ka-note/VERSION b/ka-note/VERSION index 61b3197..d1c1bf6 100644 --- a/ka-note/VERSION +++ b/ka-note/VERSION @@ -1 +1 @@ -1.2.10 \ No newline at end of file +1.2.14 \ No newline at end of file diff --git a/ka-note/client/src/app.css b/ka-note/client/src/app.css index a1999ce..e311d94 100644 --- a/ka-note/client/src/app.css +++ b/ka-note/client/src/app.css @@ -46,6 +46,7 @@ ul.tree-list li { /* Markdown content */ .markdown-content { @apply prose prose-sm prose-invert max-w-none; + overflow-wrap: anywhere; } .markdown-content pre { @@ -173,6 +174,7 @@ ul.tree-list li { .ka-editor-wrapper .ProseMirror { @apply prose prose-sm prose-invert max-w-none p-2.5 outline-none; + overflow-wrap: anywhere; } .ka-editor-wrapper .ProseMirror p.is-editor-empty:first-child::before { diff --git a/ka-note/client/src/app.html b/ka-note/client/src/app.html index 0846d9a..402780c 100644 --- a/ka-note/client/src/app.html +++ b/ka-note/client/src/app.html @@ -1,18 +1,22 @@ - - - - - - - - - - KaNote - %sveltekit.head% - - -
%sveltekit.body%
- - + + + + + + + + + + + + KaNote + %sveltekit.head% + + + +
%sveltekit.body%
+ + + \ No newline at end of file diff --git a/ka-note/client/src/lib/components/CommandBar.svelte b/ka-note/client/src/lib/components/CommandBar.svelte index b600103..d191b3c 100644 --- a/ka-note/client/src/lib/components/CommandBar.svelte +++ b/ka-note/client/src/lib/components/CommandBar.svelte @@ -56,7 +56,7 @@ const res = await authFetch(`/api/search?q=${encodeURIComponent(q)}&limit=${limit}`); if (!res.ok) throw new Error(`HTTP ${res.status}`); const data = await res.json() as { - history: { id: string; topicId: string; date: string; snippet: string }[]; + history: { id: string; topicId: string; contextId: string; date: string; snippet: string }[]; pages: { id: string; title: string; snippet: string }[]; }; const localPageIds = new Set( @@ -65,17 +65,21 @@ .map((p) => p.id), ); const combined: ServerResult[] = [ - ...data.history.map((h) => ({ - id: `hist-${h.id}`, - type: "nav-history" as const, - icon: "📓", - label: h.snippet.replace(/<[^>]+>/g, ""), - badge: `JOURNAL ${h.date}`, - action: () => { - closeBar(); - goto(`/context/daily-log?date=${h.date}`); - }, - })), + ...data.history.map((h) => { + const isJournal = h.topicId === 'daily-log-journal'; + const targetContextId = isJournal ? 'daily-log' : h.contextId; + return { + id: `hist-${h.id}`, + type: "nav-history" as const, + icon: isJournal ? "📓" : "📋", + label: h.snippet.replace(/<[^>]+>/g, ""), + badge: isJournal ? `JOURNAL ${h.date}` : `MEETING ${h.date}`, + action: () => { + closeBar(); + goto(`/context/${targetContextId}?date=${h.date}`); + }, + }; + }), ...data.pages .filter((p) => !localPageIds.has(p.id)) .map((p) => ({ diff --git a/ka-note/client/src/lib/components/JournalView.svelte b/ka-note/client/src/lib/components/JournalView.svelte index b3e77f8..5661434 100644 --- a/ka-note/client/src/lib/components/JournalView.svelte +++ b/ka-note/client/src/lib/components/JournalView.svelte @@ -36,6 +36,7 @@ let entryText = $state(''); let entryEditor: MarkdownEditor; let selectedDate = $state(initialDate ?? today()); + $effect(() => { if (initialDate) selectedDate = initialDate; }); let selectedLinkedContextId = $state(''); let wiedervorlageChecked = $state(true); let meetingPickerOpen = $state(false); diff --git a/ka-note/client/static/favicon-32.png b/ka-note/client/static/favicon-32.png new file mode 100644 index 0000000..d43d205 Binary files /dev/null and b/ka-note/client/static/favicon-32.png differ diff --git a/ka-note/client/static/favicon.svg b/ka-note/client/static/favicon.svg index 95ab8f9..433dc89 100644 --- a/ka-note/client/static/favicon.svg +++ b/ka-note/client/static/favicon.svg @@ -1,10 +1,25 @@ - - - + + + + + + + + + + + + + - - KA + KA diff --git a/ka-note/client/vite.config.ts b/ka-note/client/vite.config.ts index e470aa3..241d75f 100644 --- a/ka-note/client/vite.config.ts +++ b/ka-note/client/vite.config.ts @@ -16,8 +16,8 @@ export default defineConfig({ background_color: '#1a1a22', theme_color: '#1a1a22', icons: [ - { src: '/icon-192.png', sizes: '192x192', type: 'image/png' }, - { src: '/icon-512.png', sizes: '512x512', type: 'image/png', purpose: 'any maskable' } + { src: '/icon-192.png', sizes: '192x192', type: 'image/png', purpose: 'any' }, + { src: '/icon-512.png', sizes: '512x512', type: 'image/png', purpose: 'maskable' } ] }, workbox: { diff --git a/ka-note/server/ka-note.db-shm b/ka-note/server/ka-note.db-shm index 875cad3..2be2528 100644 Binary files a/ka-note/server/ka-note.db-shm and b/ka-note/server/ka-note.db-shm differ diff --git a/ka-note/server/ka-note.db-wal b/ka-note/server/ka-note.db-wal index cb27aa9..ae27db2 100644 Binary files a/ka-note/server/ka-note.db-wal and b/ka-note/server/ka-note.db-wal differ diff --git a/ka-note/server/src/lib/graph-service.ts b/ka-note/server/src/lib/graph-service.ts index b26ec74..6b86f00 100644 --- a/ka-note/server/src/lib/graph-service.ts +++ b/ka-note/server/src/lib/graph-service.ts @@ -100,6 +100,7 @@ export async function getCalendarEvents( : raw; return md .replace(CAUTION_BANNER, '') + .replace(/(?:\\?[-_=*~]){10,}/g, '\n\n---\n\n') .replace(/\n{3,}/g, '\n\n') .trim(); } diff --git a/ka-note/server/src/routes/search.ts b/ka-note/server/src/routes/search.ts index 9f5fce2..2d3becb 100644 --- a/ka-note/server/src/routes/search.ts +++ b/ka-note/server/src/routes/search.ts @@ -7,6 +7,7 @@ const search = new Hono(); interface HistoryResult { id: string; topicId: string; + contextId: string; date: string; snippet: string; } @@ -19,14 +20,16 @@ interface PageResult { const stmtSearchHistory = sqlite.prepare(` SELECT - id, - topic_id AS topicId, - date, + fts.id, + fts.topic_id AS topicId, + COALESCE(t.context_id, '') AS contextId, + fts.date, snippet(fts_history, 2, '', '', '...', 12) AS snippet - FROM fts_history + FROM fts_history fts + LEFT JOIN topics t ON t.id = fts.topic_id WHERE fts_history MATCH ? - AND user_id = ? - AND id NOT IN ( + AND fts.user_id = ? + AND fts.id NOT IN ( SELECT id FROM history_entries WHERE deleted_at IS NOT NULL AND user_id = ? ) ORDER BY rank