Suppress Mermaid render error artifacts#1286
Draft
codenem wants to merge 1 commit into
Draft
Conversation
Configure Mermaid to suppress its built-in error renderer in both interactive UI previews and generated document HTML. Render failures now surface through the product toast flow with a safe inline fallback instead of leaving raw Mermaid diagnostics in the document body. Signed-off-by: Cursor Agent <[email protected]> Co-authored-by: Émile Ré <[email protected]>
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
suppressErrorRenderingand cleans up Mermaid's fallback error node.Validation
npm --workspace @probo/ui run lintnpm --workspace @probo/ui run check(fails on existingsrc/Foundation.stories.tsx(193,16)missingsocialName, unrelated to this change)make go-fmtNotes
npm installwas required in this cloud environment because dependencies were not installed; the local Node 22/npm 10 toolchain emitted an engine warning for the repo's Node 24/npm 11 requirement.Linear Issue: ENG-438
Summary by cubic
Prevents raw
mermaiderror text from appearing in the editor, Markdown preview, and generated docs. Adds a shared renderer in@probo/uithat suppressesmermaiderror nodes, shows a toast on failure, and falls back to safe inline content (ENG-438).Package: ui
+104-28renderMermaidDiagramhelper that initializesmermaidwithsuppressErrorRenderingand removes its fallback error node; exportedmermaidRenderErrorToast.MermaidDiagramand rich editorMermaidNodeViewto use the helper; on failure, show a toast and render a safe inline fallback instead of raw error text.Service
+1-1mermaidwithsuppressErrorRenderingso exported HTML never shows Mermaid’s error output.Written for commit cc8c47f. Summary will update on new commits.