Repository navigation
feat(superdeck): replace flutter_mermaid with mermaid_core - #117
Merged
leoafarias merged 4 commits intoSep 21, 2026
Merged
Conversation
|
Visit the preview URL for this PR (updated for commit 6c56e80): https://superdeck-dev--pr117-feat-superdeck-merma-n217muay.web.app (expires Wed, 21 Oct 2026 20:43:37 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: bd68fc230762285849207e7e120aaf87cd4ca2f9 |
leoafarias
added this pull request to stack #119
September 21, 2026 20:28
Replaces `flutter_mermaid` 0.1.0 with `mermaid_flutter` 0.3.0 and its
pure-Dart `mermaid_core`, keeping `MermaidCodeBlock` as the only place
the renderer is named.
What changes for a deck:
- Class, state, entity-relationship and user-journey diagrams render
again. They were documented before the build plugin was removed and
have been unsupported since. Mind maps, Git graphs, C4, quadrant and
the rest of the port's 28 families come with them.
- A diagram that cannot be parsed reports the line it failed on, instead
of "Unable to parse diagram" with no location.
- `%%{init: ...}%%` directives and frontmatter configuration are honoured.
- Diagram colours are derived from the app's Material colour scheme
rather than a fixed light/dark preset, over a transparent background.
- Diagram nodes carry semantics, so a diagram is not an unlabelled
picture to a screen reader or to browser automation.
Capture and export:
- `keepLastGoodSceneOnError` is off. The package keeps the previous
drawing on a parse error, which suits a live editor; a slide is a
finished artefact, so it shows the error instead of a stale diagram.
- A failed diagram reports `SlideCaptureReadiness.fail`, so a PDF export
stops and names the slide rather than writing a page without it.
- The diagram scales down to the width its Markdown block was given and
keeps its natural aspect ratio.
The demo deck gains a Mermaid slide, so the path is exercised by the
demo, the integration test and the browser smoke run rather than only by
unit tests.
…tely
mermaid_core 0.3.0 accepts two flowchart inputs that mermaid.js 12
rejects, and renders something plausible instead of reporting them:
graph TD
A[Start --> B[Finish] one node labelled "Start --> B[Finish"
A ~~> B two nodes, the edge drawn invisible
Both lose part of the author's diagram without saying so. A slide cannot
afford that, so `checkMermaidSource` runs before rendering and reports
them with the failing line.
The check is upstream's own flowchart parser, vendored verbatim under
`markdown/mermaid/vendor/` with its MIT licence and the source commit,
and tightened in exactly the two marked places. Using their grammar
rather than a SuperDeck pattern matcher is what keeps quoted labels
(`A["array [0]"]`), the real invisible link (`~~~`), subgraphs, shapes,
`classDef`, `linkStyle`, `click`, init directives and frontmatter
working — all asserted. Other diagram families are left to the renderer,
which already reports what it cannot parse.
Adds a corpus test that renders every Mermaid fence in the guide, the
demo deck and the skills reference, so a documented diagram cannot stop
rendering unnoticed.
Moves the decision record into `docs/maintainers/adr/`, marks it Accepted, and replaces the pre-decision spike plan with what was actually delivered, including the vendored two-case patch and what the delivery deliberately did not do. Drops the assumptions about a live editor: the playground's file-backed editor is gone, so keeping the last good scene while an author types is no longer a SuperDeck use case, and the four concerns are restated as runtime diagrams, deck previews, derived thumbnails, and the deck-owned artwork of a saved deck.
leoafarias
force-pushed
the
feat/superdeck-mermaid-core
branch
from
September 21, 2026 20:32
f8785b2 to
b32aa49
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
flutter_mermaid0.1.0 with exactmermaid_coreandmermaid_flutter0.3.0 dependencies.Stack
refactor/playground-wizard-only; review only the commits in this PR boundary.Validation
fvm dart run melos run analyze --no-select— passedfvm dart run melos run test --no-select— passed as part of the 2,142-test stack verificationPlatform note