Skip to content

Replace Mermaid with Pele while preserving shape threads - #3168

Merged
max-sixty merged 3 commits into
mainfrom
codex/pele-renderer
Oct 19, 2026
Merged

max-sixty merged 3 commits into
mainfrom
codex/pele-renderer

Conversation

@max-sixty

@max-sixty max-sixty commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

Replace the diagram package's Mermaid renderer with Pele 1.6.0 while retaining Mermaid source syntax and threads attached to individual shapes. Leaf registers the same node:<authored id> anchors from Pele's parsed models and rendered boxes across flowcharts, state, class, entity-relationship and sequence diagrams, including containers and nested states.

Pele supplies parsing, layout and SVG generation in one lazy, offline-capable module. The renderer is 666 KB uncompressed (246 KB gzip), down from 5.25 MB (1.49 MB gzip). Leaf supplies its fonts and live light/dark palette, disables source links and images, and updates authored selectors and measured diagram heights in the examples and documentation. One vendoring adaptation preserves unsupported HTML-looking tags as escaped label text instead of silently dropping them; the upstream request is Pele #31, also reproduced on 1.7.0.

Validation: focused browser/model checks cover shape-thread submission, source revision and reload, keyboard and touch selection, all supported diagram families, duplicate identities, hostile labels, fonts, scheme changes, SVG definitions and lazy loading. pnpm run check covers reproducible bundles, framework, runtime and Worker tests. Independent code review and a fresh browser user verified shape-thread behavior; before/after light and dark views were inspected.

This was written by Codex on behalf of max-sixty

Keep authored node identities across flowchart, state, class, entity and sequence diagrams. Render from explicit semantic models without shared parser serialization, and retain inert SVG, live palette colors and offline exports. Adapt Pele rich labels so unsupported HTML-looking tags remain safely escaped literal text rather than disappearing.
@max-sixty
max-sixty merged commit 2965cd5 into main Oct 19, 2026
4 checks passed
@max-sixty
max-sixty deleted the codex/pele-renderer branch October 19, 2026 20:19
leaf-agent added a commit that referenced this pull request Oct 19, 2026
Pele's SVG classes and diagram sizes left four browser checks on
unreachable or uncovered targets. This updates their fixtures to
exercise painted nodes, a scrollable drawing at the narrow width, and a
second reaction target clear of the floating card. The checks still test
aim, available room, edge fade, and action bar placement through real
browser input.

These four cases failed on current `main` before the change and pass
together after it (`4 passed` in the focused browser run). The changed
drawing geometry follows
[#3168](#3168), which replaced
Mermaid with Pele. [Failed main CI
run](https://github.com/max-sixty/leaf/actions/runs/39321098548).

---------

Co-authored-by: leaf-agent <[email protected]>
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