Add an Optimize side panel that analyses the active flowchart and applies
one-click, reversible source rewrites to make dense graphs readable.
- optimize.ts: pure, label-aware flowchart parser + metrics, a 0-100
readability score, and transforms — ELK layered layout, node/rank
spacing + curved edges, de-emphasising cross-cutting hub edges
(event bus / audit / cost-style fan-ins), duplicate-edge removal,
direction toggle, and a non-destructive focus variant.
- mermaid.ts: register @mermaid-js/layout-elk so `layout: elk` renders.
- OptimizePanel.svelte + Toolbar toggle; panels are mutually exclusive.
- Preview: render the focus variant when a node is spotlighted, with a
clear-focus pill.
- store/Editor: applySource() bumps a revision so programmatic rewrites
re-sync CodeMirror and stay undoable with the editor's history.
- CodeMirror 6 editor with a debounced Mermaid 11 preview (zoom, pan,
auto fit-to-view and inline error reporting)
- project start screen with recent projects, sidebar diagram explorer,
toolbar and a Git panel (status, commit, history, branches)
- SVG/PNG export, per-project theme switching, toasts
- rune-based central store orchestrating all backend calls
- view modes (Code / Split / Preview) plus a viewer mode with a
slide-in quick-edit drawer (Cmd/Ctrl+E)