Skip to content

Conversation

@estulpz202
Copy link

@estulpz202 estulpz202 commented Dec 7, 2025

📑 Summary

Ensure gitGraph respects the latest Mermaid configuration on every render.

Previously, gitGraphRenderer read the Mermaid config once at module load and cached gitGraph options. As a result, rotateCommitLabel, showBranches, and parallelCommits appeared to be ignored after the first render in interactive environments (such as the live editor) where users tweak the config without a full page reload.

This PR refreshes the gitGraph config inside draw so each render uses the latest settings.

Resolves #7126

📏 Design Decisions

  • The renderer used a module-level constant which meant gitGraph options were captured once at module initialization and never updated.
  • This PR changes DEFAULT_GITGRAPH_CONFIG to a mutable variable and refreshes it at the start of draw

This keeps the behavior of the first render unchanged while ensuring that subsequent renders pick up any updated gitGraph options in the Mermaid config.

  • The existing error handling is preserved. If gitGraph config is missing, the renderer still throws GitGraph config not found.
  • The change is intentionally minimal and scoped to the config lookup logic so it should not affect other diagram types or non-interactive usage.

📋 Tasks

Make sure you

  • 📖 have read the contribution guidelines
  • 💻 have added necessary unit/e2e tests.
    • additional tests not required
  • 📓 have added documentation. Make sure MERMAID_RELEASE_VERSION is used for all new features.
  • 🦋 If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpm changeset and following the prompts. Changesets that add features should be minor and those that fix bugs should be patch. Please prefix changeset messages with feat:, fix:, or chore:.

@changeset-bot
Copy link

changeset-bot bot commented Dec 7, 2025

⚠️ No Changeset found

Latest commit: 5e96d37

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@netlify
Copy link

netlify bot commented Dec 7, 2025

Deploy Preview for mermaid-js ready!

Name Link
🔨 Latest commit 5e96d37
🔍 Latest deploy log https://app.netlify.com/projects/mermaid-js/deploys/6934da6b6d9bd80008ca711b
😎 Deploy Preview https://deploy-preview-7223--mermaid-js.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions bot added the Type: Bug / Error Something isn't working or is incorrect label Dec 7, 2025
@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 7, 2025

Open in StackBlitz

@mermaid-js/examples

npm i https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/examples@7223

mermaid

npm i https://pkg.pr.new/mermaid-js/mermaid@7223

@mermaid-js/layout-elk

npm i https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/layout-elk@7223

@mermaid-js/layout-tidy-tree

npm i https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/layout-tidy-tree@7223

@mermaid-js/mermaid-zenuml

npm i https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/mermaid-zenuml@7223

@mermaid-js/parser

npm i https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/parser@7223

@mermaid-js/tiny

npm i https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/tiny@7223

commit: 5e96d37

@codecov
Copy link

codecov bot commented Dec 7, 2025

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 3.56%. Comparing base (a3a5040) to head (5e96d37).
⚠️ Report is 5 commits behind head on develop.

Files with missing lines Patch % Lines
...kages/mermaid/src/diagrams/git/gitGraphRenderer.ts 0.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           develop   #7223   +/-   ##
=======================================
  Coverage     3.56%   3.56%           
=======================================
  Files          474     473    -1     
  Lines        47577   47566   -11     
  Branches       734     734           
=======================================
  Hits          1696    1696           
+ Misses       45881   45870   -11     
Flag Coverage Δ
unit 3.56% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...kages/mermaid/src/diagrams/git/gitGraphRenderer.ts 0.00% <0.00%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@argos-ci
Copy link

argos-ci bot commented Dec 7, 2025

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ✅ No changes detected - Dec 7, 2025, 1:48 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Bug / Error Something isn't working or is incorrect

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gitGraph: rotateCommitLabel: false, showBranches: false and parallelCommits: true not working

3 participants