From 6acb044230309d1f5d653231b7c4de62d6500f26 Mon Sep 17 00:00:00 2001 From: Till JS Date: Wed, 15 Apr 2026 14:24:56 +0200 Subject: [PATCH] =?UTF-8?q?feat(kontext,notes):=20cross-module=20handoff?= =?UTF-8?q?=20=E2=80=94=20save=20Kontext=20as=20a=20Note?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wires the "Als Notiz speichern" action at the bottom of the Kontext widget (UI itself landed in 003f75f7e) to actually open Notes next to Kontext and focus the new note: - workbench-scenes: new addAppAfter(appId, anchorAppId). addApp() always appended, which pushed Notes to the far end of the carousel; addAppAfter inserts directly after the anchor (Kontext) and no-ops if the target is already open so the user's current position isn't yanked around. - notes/stores/selection: new transient in-memory focus signal (focusedNoteId) that cross-module callers populate. Kept non-persistent intentionally — surviving a remount would re-open random notes after page loads. - notes/ListView: $effect reads focusedNoteId, waits for the Dexie liveQuery to surface the just-created row, opens it in the inline editor, clears the focus signal, then scrolls the matching data-note-id element into view via queueMicrotask so the DOM has rendered the editor variant. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../web/src/lib/modules/notes/ListView.svelte | 21 +++++++++++++++ .../modules/notes/stores/selection.svelte.ts | 26 +++++++++++++++++++ .../src/lib/stores/workbench-scenes.svelte.ts | 20 ++++++++++++++ 3 files changed, 67 insertions(+) create mode 100644 apps/mana/apps/web/src/lib/modules/notes/stores/selection.svelte.ts diff --git a/apps/mana/apps/web/src/lib/modules/notes/ListView.svelte b/apps/mana/apps/web/src/lib/modules/notes/ListView.svelte index 92bee85d8..d71aacbff 100644 --- a/apps/mana/apps/web/src/lib/modules/notes/ListView.svelte +++ b/apps/mana/apps/web/src/lib/modules/notes/ListView.svelte @@ -5,6 +5,7 @@