Repository navigation
Conversation
Mermaid code blocks render as diagrams once streaming completes, with a copy button for the source and a toggle between the diagram and the source.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9011 +/- ##
=======================================
Coverage 79.46% 79.46%
=======================================
Files 475 475
Lines 26028 26028
Branches 6938 6938
=======================================
Hits 20684 20684
Misses 5344 5344
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
… speed up streaming Add copy as SVG, copy as image and download PNG to rendered mermaid blocks, using the shared ff-btn styles. Diagrams render as soon as their closing fence has streamed in, and text streams several words per tick.
andypalmi
marked this pull request as draft
October 21, 2026 10:52
…d of bundling mermaid The Expert now sends each rendered diagram's SVG alongside the message, so the frontend no longer needs the mermaid dependency. The SVG is sanitized, matched to its code block by source, and recoloured with the FlowFuse theme variables.
… whitespace Streaming collapses runs of whitespace in code, so the indented source of a block no longer equalled the source the diagram was rendered from.
The diagrams take their colours from variables, so one set of values follows the FlowFuse theme instead of overriding the diagram's own classes.
… highlight mermaid code Mermaid blocks are now a plain code block variant. The Code toggle and export buttons are added once the diagram is shown and the toggle uses the hidden attribute, which removes the state-driven CSS and leaves other code blocks as they were. Mermaid sources get a highlight.js grammar.
This branch was successfully deployed
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.
Closes #9010
Closes FlowFuse/engineering#577
Closes FlowFuse/engineering#578
Testing