Changeset 0.37.9 (#221)

This commit is contained in:
2026-03-21 20:16:19 +00:00
parent 2695bb3bdc
commit 37b639c9c8
27 changed files with 3435 additions and 2018 deletions

View File

@@ -1,5 +1,96 @@
# Changelog
## [0.37.9] — 2026-03-21
### Summary
Preact NotesPane kit — Obsidian-grade composable note components replacing
the old imperative `note-panel.js`, `note-graph.js`, and `notes.js` (~1,630
lines deleted). Every piece independently importable. `NotesPane` is the
default assembly; surfaces import individual pieces for custom layouts.
### New
- **NotesPane kit** (`src/js/sw/components/notes-pane/`) — 10 files:
- `NotesPane` — default assembly: list + editor + reader + graph + quick switcher
- `useNotes(opts)` — state machine (views, CRUD, pagination, search, folders,
sort, selection, backlinks, daily notes, wikilink navigation, pinning)
- `NoteList` — toolbar, search, folder/sort filters, tag cloud, pinned section,
selection bar, load-more pagination
- `NoteListItem` — single note row with title, time, preview, folder, tags, pin
- `NoteEditor` — title/folder/tags/content with CM6 integration, word/char count,
Ctrl+S save, Esc cancel, folder datalist autocomplete
- `NoteReader` — rendered markdown with wikilink chips, transclusion embeds,
sticky outline sidebar, daily note nav, backlinks panel, unlinked mentions
- `NoteGraph` — canvas force-directed graph with focus mode (single-click =
focus neighbors, double-click = open note), ghost node click → create,
folder colors, pan/zoom/drag, orphan toggle
- `renderNoteMarkdown` — marked+DOMPurify with wikilink chip rendering,
transclusion blocks, heading extraction for outline
- `SaveToNoteDialog` — create-new or append-to-existing, independently
importable by ChatPane or any surface
- `QuickSwitcher` — Cmd+K/Ctrl+K overlay: fuzzy title search, keyboard nav
(↑↓ Enter Esc), recent notes (localStorage), create-on-enter
- **`sw.notesPane(container, opts)`** — SDK mount helper, lazy-imports Preact
NotesPane, returns imperative handle
- **`sw-notes-pane.css`** — component styles with `sw-notes-pane` prefix (~500 lines)
- **Obsidian-grade features:**
- Wikilinks (`[[Title]]`, `[[Title|Display]]`) → clickable chips
- Transclusions (`![[Title]]`) → inline embedded content (1-level)
- Quick Switcher (Ctrl+K) with fuzzy search + create-on-enter
- Outline sidebar (sticky, right side, scroll-to-heading)
- Daily notes with auto-template + prev/next day navigation
- Pinned notes (localStorage) at top of list
- Tag cloud with clickable filter chips
- Unlinked mentions (note titles in content not yet wikilinked)
- Graph focus mode (click = focus neighbors, walk the graph)
- Ghost node click → create missing note
- Word/character count in editor
- Keyboard shortcuts (Ctrl+S, Ctrl+N, Ctrl+D, Ctrl+K, Esc)
### Deleted
- `src/js/notes.js` (155 lines) — backward-compat shim
- `src/js/note-panel.js` (976 lines) — old imperative NotePanel
- `src/js/note-graph.js` (501 lines) — old canvas graph
- `src/css/panels.css` — all `.note-*`, `.notes-*`, `.wikilink-*`,
`.transclusion-*`, `.save-note-*` rules stripped
- `server/pages/templates/surfaces/chat.html``notes.js` script tag removed
- `server/pages/templates/base.html``note-panel.js` + `note-graph.js`
script tags removed
### Changed
- `notes.html` — rewritten: Preact vendor globals + SDK `boot()` +
`sw.notesPane()` mount (same pattern as settings/admin surfaces)
- `base.html` — added `sw-notes-pane.css` stylesheet link
- `switchboard-sdk.js``sw.notes()` redirects to `sw.notesPane()` with
deprecation warning
- `app.js` — removed `_initNotesListeners()` + `_registerNotesPanel()` calls
- `ui-format.js``_openNoteFromTool()` made no-op (dies in v0.37.10)
- `ui-core.js` — note tool-call link handler made no-op
- `server/version.go` — version `0.37.8``0.37.9`
- `VERSION``0.37.8``0.37.9`
- `src/js/sw/sdk/index.js``sw.notesPane()` helper, `sw._sdk``0.37.9`
### Design Notes
- **Kit of Parts** — same composability pattern as ChatPane. Any surface can
import `NoteList` alone, or `NoteEditor` + `NoteReader`, or the full assembly.
- **handleRef pattern** — same as ChatPane (no `forwardRef`/compat).
- **Graph interaction model** — single click = focus (show 1-hop neighbors),
double click = open note. Walk the graph by clicking through focused nodes.
Ghost nodes (unresolved wikilinks) create on click via `navigateToLink`.
- **Outline sidebar** — sticky right pane when note has >2 headings; falls back
to stacked layout on mobile (<600px).
### Known Issues (minor, pre-tag)
- Light mode: some notes-pane styles still reference dark theme defaults.
Needs CSS variable audit for `--bg-surface`, `--input-bg` in light theme.
---
## [0.37.8] — 2026-03-21
### Summary