Skip to content

Render Mermaid diagrams in Markdown containers (1.7.5) - #183

Merged
marcosqlbi merged 7 commits into
mainfrom
codex/mermaid-markdown-prototype
Oct 1, 2026
Merged

marcosqlbi merged 7 commits into
mainfrom
codex/mermaid-markdown-prototype

Conversation

@Alberto-Ferrari

@Alberto-Ferrari Alberto-Ferrari commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Render fenced Mermaid diagrams inside Markdown containers, so an explanation copied from a chat keeps its diagrams and can be annotated on the board. This releases the feature as 1.7.5.

  • Enable all 32 built-in Mermaid 12.0.0 diagram families, including C4 variants and railroad notations. Mermaid detects the diagram type, and Whiteboard keeps no list of allowed types of its own.
  • Render locally through one hidden WebView2 controller and cache frozen WPF drawings. Pan, zoom, and pen drawing reuse those drawings. Diagrams keep their natural size, shrink to fit the available width, and update the container height without stretching linked ink or adding undo steps.
  • Save the original Markdown with an SVG snapshot of each successful diagram. Saved diagrams reopen without WebView2. Saves, session recovery, previews, and exports wait for pending diagrams and use the completed layout.
  • Convert nested and HTML-based labels, rotated baselines, clipping, and linked-node transforms for WPF. Keep strict-mode rendering, blocked external resources, bounded requests, and passive SVG validation for saved snapshots.
  • Check for the WebView2 Runtime before starting the browser. A PC without it shows each new or changed diagram's source with a message that names the runtime and points to the FAQ, and saved diagrams still show from their snapshots.
  • Add Microsoft.EdgeWebView2Runtime as a package dependency to every winget submission. The workflow now runs wingetcreate update --out, then scripts/winget-dependencies.ps1, then wingetcreate submit, because update cannot add a dependency.

Release and documentation

  • VersionPrefix is 1.7.5, with a single changelog entry.
  • README, the site guide, home page, comparison, FAQ, and privacy page describe Mermaid diagrams. User-visible error messages no longer say "prototype", and the WebView2 profile folder is %LOCALAPPDATA%\SQLBI\Whiteboard\Mermaid.
  • docs/mermaid-prototype.md becomes docs/mermaid.md, and the basic sample becomes docs/samples/mermaid-diagrams.md.
  • Decision 34 records why Mermaid runs in WebView2, why the minimum Windows version did not move, why the MSI installers do not install the runtime, and the winget dependency.

Validation

  • Release solution build: zero warnings and errors.
  • Core smoke tests.
  • WPF smoke tests without browser integration, including a missing-runtime test that gives the renderer a runtime check reporting no runtime.
  • WPF integration tests with SQLBI_WHITEBOARD_MERMAID_BROWSER=1: all 32 families, C4 and railroad variants, label bounds and styles, cache reuse, invalid-syntax recovery, safe shutdown, offline restoration, and PowerPoint/PDF exports.
  • scripts/release-notes.ps1 -Version 1.7.5.
  • winget dry run on the 1.7.4 assets: wingetcreate update --out without a token, the dependency script twice, then winget validate --manifest.
  • Visual inspection of catalogue previews, and manual Wacom Cintiq validation by the maintainer.

The catalogue test compared PowerPoint notes against a first line that still ended in a carriage return, so the XY chart, Sankey, and event modeling export checks always failed. That is fixed. Fixing it exposed one failure of the exact-pixel comparison for the Sankey editable deck, which did not recur in about 100 repeats, including with forced garbage collection. The check now keeps both pictures and reports the difference if it fails again.

Limits

  • An installed or portable package has not been tried on a machine without the WebView2 Runtime. The missing-runtime path is covered by the automated test.
  • The new winget workflow steps first run on GitHub when 1.7.5 is published.
  • Experimental families keep Mermaid's beta status. Custom themes and configuration directives, external icon packs, fonts, and images, and third-party diagram plugins are out of scope.

🤖 Generated with Claude Code

Alberto-Ferrari and others added 6 commits October 1, 2026 11:30
Bump the version to 1.7.5 and describe Mermaid diagrams in the changelog,
README, site guide, FAQ, privacy page, and internal docs, without the
prototype wording. Rename the design doc to docs/mermaid.md and record the
WebView2 dependency as decision 34.

Check for the WebView2 Runtime before starting the diagram browser, so a PC
without it gets a message that names the runtime and points to the FAQ.
The winget workflow now adds Microsoft.EdgeWebView2Runtime as a package
dependency to every submission.

Fix the catalogue test that compared PowerPoint notes against a first line
ending in a carriage return, and keep the pictures when the exact export
comparison fails.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@marcosqlbi marcosqlbi changed the title Render Mermaid diagrams in Markdown containers Render Mermaid diagrams in Markdown containers (1.7.5) Oct 1, 2026
The test pointed WEBVIEW2_BROWSER_EXECUTABLE_FOLDER at an empty folder, which
the GitHub runner did not treat as a missing runtime, so the renderer found
the installed runtime and failed with the generic message. The renderer now
takes an optional runtime check, and the test passes one that reports none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@marcosqlbi
marcosqlbi merged commit e86097c into main Oct 1, 2026
5 checks passed
@marcosqlbi
marcosqlbi deleted the codex/mermaid-markdown-prototype branch October 1, 2026 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants