fix: make Mermaid rendering responsive - #246
Open
teng-lin wants to merge 1 commit into
Open
Conversation
teng-lin
marked this pull request as ready for review
August 13, 2026 21:31
RivoLink
reviewed
Aug 18, 2026
RivoLink
left a comment
Owner
There was a problem hiding this comment.
Hi,
Sorry for the delay, and thank you for your interest in the project and for this PR.
I have a few requests:
- Rebase from
mainand fix the CI check failure by adding:to the commit message:fix: responsive Mermaid layout - Maybe remove the
demo.mdfile from the commit and attach it to this PR instead. - GPG signing is required on the
mainbranch, so if you can sign it, great. If not, no worrie, I'll handle it while preserving you as the author.
GPG signing docs : https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits
Thanks!
| @@ -0,0 +1,85 @@ | |||
| # Responsive Mermaid rendering | |||
Owner
There was a problem hiding this comment.
Maybe remove this file from the commit and attach it to the PR
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.
What changed
demo.mdwith reproducible horizontal-flowchart and large-class-diagram examples.Why
Mermaid output is a pre-rendered two-dimensional text canvas. Leaf previously passed oversized diagram rows through the generic code-block wrapper. Wrapping those rows preserved the characters but broke their spatial relationships, splitting box borders, labels, and connectors across unrelated terminal rows.
A width guard prevents that corruption, but source fallback alone means large class diagrams no longer render at ordinary terminal widths. Class graphs with many wide cards and fan-out relationships can remain hundreds of columns wide in every graphical orientation.
This change treats Mermaid layout as responsive content. It tries alternate graph orientations when useful and uses a vertical class representation when no graphical orientation can fit. Class names, stereotypes, members, and authored relationships remain visible and searchable while the output grows downward instead of beyond the viewport.
User impact
Validation
cargo fmt --all -- --checkcargo test— 416 passedcargo clippy --all-targets --all-features -- -D warningscargo build --releasedemo.mdat 80 columns