3 Commits

Author SHA1 Message Date
bbc12ee4be feat(optimize): Diagram Doctor panel to declutter tangled flowcharts
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.
2026-05-22 20:11:49 +03:00
b648ee904d feat(editor): Mermaid syntax highlighting, linter and autocomplete
- StreamLanguage tokenizer for Mermaid: diagram-type keywords, general
  keywords, directions, arrows/links, strings, %% comments, init
  directives and YAML frontmatter, with a dark-theme HighlightStyle
- live linter via mermaid.parse: maps parse errors to the right editor
  line (accounting for the frontmatter lines mermaid strips), with wavy
  underline, gutter marker and message tooltip
- autocomplete: Mermaid keyword/type/direction options plus starter
  diagram snippets offered on the first line; bracket closing
- dark-themed completion + diagnostic tooltips

Adds @codemirror/lint, @codemirror/autocomplete and @lezer/highlight.
2026-05-22 16:46:43 +03:00
dfafea41f4 chore: scaffold Tauri 2 + Svelte 5 workspace
Standard Tauri layout with a Svelte 5 + TypeScript + Vite frontend and a
Rust backend in src-tauri. Adds build tooling, app/window config,
capabilities, generated icons and the project README.
2026-05-22 16:27:11 +03:00