Feat v0.4.5 editor modes outline (#27)
All checks were successful
CI/CD / detect-changes (push) Successful in 4s
CI/CD / test-frontend (push) Successful in 5s
CI/CD / test-go-pg (push) Successful in 2m45s
CI/CD / test-sqlite (push) Successful in 2m50s
CI/CD / build-and-deploy (push) Successful in 1m21s

Co-authored-by: Jeffrey Smith <jasafpro@gmail.com>
Co-committed-by: Jeffrey Smith <jasafpro@gmail.com>
This commit was merged in pull request #27.
This commit is contained in:
2026-03-29 20:50:24 +00:00
committed by xcaliber
parent cee65c4136
commit 6fbac0a33f
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