fix(gitGraph): correct BT orientation arc sweep flags#7424
Merged
Conversation
These files (CLAUDE.md, AGENTS.md, assistant/, .claude/skills/, package-level CLAUDE.md files) are synced from the mermaid-ops control plane via /sync and should not be committed to this repo. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Swap SVG arc sweep-flag values in the BT (bottom-to-top) orientation branches of drawArrow() so curves bend in the correct direction. Fixes both rerouting and non-rerouting code paths for merge and non-merge arrows. Also fixes an incorrect x-coordinate in the non-rerouting BT p1.x>p2.x non-merge case. Resolves #6593 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
✅ Deploy Preview for mermaid-js ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
🦋 Changeset detectedLatest commit: 9dcbf0e 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 |
This was referenced Feb 27, 2026
@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❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #7424 +/- ##
=======================================
Coverage 3.55% 3.55%
=======================================
Files 489 489
Lines 48729 48729
Branches 765 765
=======================================
Hits 1734 1734
Misses 46995 46995
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 ↗︎
|
Revert 5 of 6 arc swaps from previous commit — only the non-rerouting BT p1.x > p2.x non-merge case was actually wrong. The other 5 cases were correct in the original code. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add 4 new visual snapshot tests in the BT section that exercise the fixed arc path: branch ordering with merge from right branch, three-branch merge, cherry-pick, and double cherry-pick — all in BT orientation. Resolves #7423 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
Fixes the BT (bottom-to-top) orientation arrow curves in
gitGraphdiagrams. One specific code path indrawArrow()had two errors causing curves to bend incorrectly when a branch to the right of main draws a non-merge arrow back leftward.Resolves #6593
What was wrong
In
gitGraphRenderer.ts, the non-rerouting BTp1.x > p2.xnon-merge path (line ~748) had two bugs:p2.x - radiusshould bep2.x + radius— the horizontal line segment extended past the target in the wrong directionarc(sweep=0) should bearc2(sweep=1) — the SVG arc swept the wrong wayThe BT orientation is derived from TB by flipping Y-direction offsets and swapping arc sweep flags. The TB
p1.x > p2.xnon-merge path usesp2.x + radiusandarc, so BT should usep2.x + radiusandarc2. The original code incorrectly hadp2.x - radiusandarc.Changes
packages/mermaid/src/diagrams/git/gitGraphRenderer.ts— 1 line changed:cypress/integration/rendering/gitGraph.spec.js— 4 new E2E regression tests:Test plan