fix(flowchart): keep ELK edge labels centered - #8238
Conversation
🦋 Changeset detectedLatest commit: 6f04b4f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for mermaid-js ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (6)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe change adds configurable vertical offsets for rendered edge labels. The ELK renderer uses zero offset because ELK returns final label coordinates. Unit and end-to-end tests verify centered labels when subgraph title margins are configured. ChangesELK edge label alignment
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to ELK flowchart edge labels now remain centered when subgraph title margins are configured, while existing layout behavior retains its default positioning. The change is covered by targeted unit and end-to-end tests and is ready to merge. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 4 files. (6 skipped: 6 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
@mermaid-js/examples
mermaid
@mermaid-js/layout-elk
@mermaid-js/layout-tidy-tree
@mermaid-js/mermaid-zenuml
@mermaid-js/parser
@mermaid-js/tiny
commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #8238 +/- ##
========================================
Coverage 80.13% 80.13%
========================================
Files 624 624
Lines 85311 85316 +5
Branches 16183 16184 +1
========================================
+ Hits 68366 68371 +5
Misses 15909 15909
Partials 1036 1036
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
📑 Summary
Keep ELK edge labels centered when
flowchart.subGraphTitleMarginis configured. The common renderer now accepts a layout-specific vertical label offset, and ELK explicitly uses zero because its label coordinates already share the routed edge's final coordinate space.Resolves #7341
📏 Design Decisions
The common painter preserves its existing title-margin offset by default, so Dagre and swimlanes are unchanged. Only ELK opts out. This keeps the fix at the shared rendering boundary without changing ELK's layout data or duplicating label positioning logic.
Test verification (RED → GREEN)
develop: the issue diagram rendered in Chromium with edge centery=88.5, label centery=98, a9.5pxerror.1pxtolerance.9.5pxRED failure.docs:verifyreaches the same pre-existing missing generated parser AST error on both untouched baseline and patched trees; no failure identity changed.📋 Tasks
mermaid.Review Summary
What's working well
#7341.edgeLabelOffsetY.0, while other layouts retain the existing behavior.Security
No XSS or injection issues identified.
Things to address
No blocking or important issues found.
Verdict
APPROVE
Severity tally: 0 blocking / 0 important / 0 nit / 0 suggestion / 5 praise