-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
fix(timeline): wrap long timeline titles properly #6405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
|
commit: |
✅ Deploy Preview for mermaid-js ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #6405 +/- ##
==========================================
- Coverage 3.87% 3.87% -0.01%
==========================================
Files 413 412 -1
Lines 43216 43238 +22
Branches 665 665
==========================================
Hits 1675 1675
- Misses 41541 41563 +22
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
960ff73
to
d9eddea
Compare
d582394
to
d9eddea
Compare
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
✅ Deploy Preview for mermaid-js ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for mermaid-js ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
3cf9fa7
to
74b0191
Compare
📑 Summary
This PR fixes a layout bug in the Mermaid Timeline diagram where long titles do not wrap and instead overflow or shrink the diagram unnecessarily. The fix introduces robust text wrapping using SVG logic and proper positioning of the title block.
Resolves #6393
📏 Design Decisions
Replace the single element used for the diagram title with a group that contains dynamically calculated elements.
Implemented a wrapText utility in svgDraw.js that:
Splits the title string by whitespace.
Appends new lines when the current line exceeds the maximum width.
Maintains proper line height and alignment.
Centered the title visually by adjusting the x position based on the diagram’s width and manually shifting the group with text-anchor: middle.
Kept the implementation fully SVG-native (no ) for cross-browser consistency and to match Mermaid’s rendering style
📋 Tasks
Make sure you
MERMAID_RELEASE_VERSION
is used for all new features.pnpm changeset
and following the prompts. Changesets that add features should beminor
and those that fix bugs should bepatch
. Please prefix changeset messages withfeat:
,fix:
, orchore:
.