Feat v0.4.5 editor modes + document outline
All checks were successful
CI/CD / detect-changes (pull_request) Successful in 3s
CI/CD / test-frontend (pull_request) Successful in 5s
CI/CD / test-go-pg (pull_request) Successful in 2m37s
CI/CD / test-sqlite (pull_request) Successful in 2m45s
CI/CD / build-and-deploy (pull_request) Successful in 1m32s

Tri-state viewMode (rendered/edit/split) replaces binary preview toggle.
Split view uses CSS grid with synced scroll. Document outline panel parses
headings and supports click-to-scroll in both CM6 and preview. Mode
preference persisted to localStorage. Notes package bumped to v0.6.0.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-29 20:40:22 +00:00
parent cee65c4136
commit db9d630399
7 changed files with 248 additions and 24 deletions

View File

@@ -2,6 +2,36 @@
All notable changes to Switchboard Core are documented here.
## v0.4.5 — Editor Modes + Document Outline
### Added
- **Tri-state view mode**: Notes open in rendered (read-only) mode by default.
Toolbar button cycles through Edit (CM6) and Split (side-by-side) modes.
Replaces the old binary preview toggle.
- **Split view**: Side-by-side CM6 editor + rendered preview using CSS grid.
CM6 instance preserved when toggling between edit and split modes.
- **Synced scroll**: In split mode, scrolling the CM6 editor proportionally
scrolls the preview pane via linear ratio mapping on `scrollDOM`.
- **View mode persistence**: User's preferred mode saved to localStorage
(`sw.storage.local('notes')`). New `editor_mode` manifest setting with
admin-level default (rendered / edit / split).
- **Document outline**: Collapsible TOC panel adjacent to the editor body.
`parseHeadings()` extracts heading level, text, and line number (skips
fenced code blocks). Click heading to scroll — uses CM6
`EditorView.scrollIntoView()` in edit/split mode, DOM `scrollIntoView()`
in rendered mode. Updates on body change with 300ms debounce.
### Changed
- Notes package version bumped from 0.5.0 to 0.6.0.
- Editor body wrapped in `.notes-editor__content` flex container to
accommodate the outline panel.
- Wikilink click handling active in both rendered and split modes.
- Mobile: split view collapses to single column, outline panel hidden.
---
## v0.4.4 — Rich Editor + Import/Export
### Added