# Changelog All notable changes to Switchboard Core are documented here. ## v0.4.6 — Sidebar Restructure ### Added - **Sidebar tabs**: Two-tab header ("Notes" / "Outline") replaces the static sidebar header. Notes tab contains folder tree, tag filter, search, and note list. Outline tab shows the document heading tree for the active note. Outline tab disabled (grayed) when no note is selected. - **Sidebar outline**: Document outline relocated from editor-side panel into the sidebar's Outline tab. Nested heading hierarchy (H1→H2→H3) with depth indentation via `padding-left`. Click heading scrolls to it in both preview and CM6 editor modes. - **Active heading tracking**: Scroll listener (RAF-throttled) highlights the current heading in the sidebar outline based on scroll position. Uses `getBoundingClientRect()` in preview/split mode and CM6 viewport line in edit mode. ### Changed - Notes package version bumped from 0.6.0 to 0.7.0. - `EditorPane` exposes headings, scroll function, and active heading index to parent via callback props (`onHeadingsChange`, `scrollToHeadingRef`, `onActiveHeadingChange`). - Sidebar auto-resets to Notes tab when active note is deleted. ### Removed - Old `DocumentOutline` component and `.doc-outline` CSS styles (replaced by sidebar outline). ## 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 - **CodeMirror 6 integration**: Notes editor now uses the vendored CM6 bundle (`CM.noteEditor()`) for rich markdown editing with syntax highlighting, wikilink autocomplete (`[[` triggers note title completion), and inline preview decorations for headings, code blocks, and blockquotes. - **CM6 dynamic loading**: Bundle loaded via `