Conversation
vertical and horizontal lines were rendered too long. This should be fixed by now
🦋 Changeset detectedLatest commit: 89201ed 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. |
@mermaid-js/examples
mermaid
@mermaid-js/layout-elk
@mermaid-js/layout-tidy-tree
@mermaid-js/mermaid-zenuml
@mermaid-js/parser
@mermaid-js/tiny
commit: |
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #7416 +/- ##
=======================================
Coverage 3.58% 3.58%
=======================================
Files 475 475
Lines 47605 47605
Branches 741 741
=======================================
Hits 1706 1706
Misses 45899 45899
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
knsv
left a comment
There was a problem hiding this comment.
[sisyphus-bot]
Thanks for this fix, @Crafter-Y — really clean work! The root cause analysis and fix are both spot-on.
What's Working Well
🎉 Correct diagnosis of the geometry bug. The old SVG path used mixed relative/absolute commands that accumulated incorrectly:
Old: M0 ${iconSize} v${-iconSize} q0,-5 5,-5 h${iconSize} q5,0 5,5 v${iconSize} H0 Z
With iconSize = 48, this traces a path from (0,48) → (0,0) → curve to (5,-5) → right to (53,-5) → curve to (58,0) → down to (58,48) → back to (0,48). That's a 58×53 bounding box instead of the expected 48×48. The extra 10px width and 5px height cause getBBox() to return oversized dimensions, which the layout engine uses for edge routing — hence the lines overshooting.
🎉 The fix is exactly right. Switching to all absolute SVG commands (V, Q, H) eliminates the accumulation issue and produces the correct iconSize × iconSize rectangle with 5px rounded top corners:
New: M0,${iconSize} V5 Q0,0 5,0 H${iconSize-5} Q${iconSize},0 ${iconSize},5 V${iconSize} Z
🎉 No secondary side effects. The getBBox() call on line 351 picks up the corrected dimensions dynamically, so the layout engine will automatically use the right values. No other code needs to change.
🎉 Changeset present with correct patch bump and fix: prefix.
🎉 Issue linked — Resolves #7313.
💡 [suggestion] E2E visual regression test
The architecture diagram's e2e test suite (cypress/integration/rendering/architecture.spec.ts) is currently entirely skipped due to non-deterministic layout — so it's not realistic to require a visual regression test for this PR. That said, if you'd like to add one, even a skipped test case with the exact diagram from #7313 would serve as documentation of the fix:
it('should render edges at correct length (issue #7313)', () => {
imgSnapshotTest(`
architecture-beta
service cell[Table Cell]
service colspan[colspan]
service rowspan[rowspan]
cell:R --> L:colspan
cell:B --> T:rowspan
`);
});This is purely a suggestion — not blocking in any way.
Summary
This is a clean, focused one-line bug fix that correctly addresses the geometry issue. The SVG path is now mathematically correct, the changeset is proper, and the issue is linked. Approved!
🤖 Generated with Claude Code
|
@Crafter-Y, Thank you for the contribution! |
vertical and horizontal lines were rendered too long. This should be fixed by now
📑 Summary
As described in the issue, there were problems rendering the architecture diagram. Lines should now be rendered at the correct width
Resolves #7313
📏 Design Decisions
I think it should be clear what I did there
📋 Tasks
Make sure you
MERMAID_RELEASE_VERSIONis used for all new features.pnpm changesetand following the prompts. Changesets that add features should beminorand those that fix bugs should bepatch. Please prefix changeset messages withfeat:,fix:, orchore:.