Skip to content

Conversation

@darshanr0107
Copy link
Contributor

@darshanr0107 darshanr0107 commented Nov 21, 2025

This PR adds a new configuration option showCommitHashLabel (default: true) that allows users to hide commit labels for commits with auto-generated hash IDs (e.g., "0-a1b2c3d") while still displaying labels for commits with custom IDs.

This feature addresses the use case where users want to emphasize important commits with custom IDs while keeping the diagram clean by hiding the less meaningful auto-generated hash labels.

  • Add showCommitHashLabel to GitGraphDiagramConfig
  • Update gitGraphRenderer to conditionally show/hide hash labels
  • Add comprehensive tests for all orientations (LR, TB, BT)
  • Update documentation with usage examples

Resolves #7142

📏 Design Decisions

Describe the way your implementation works or what design decisions you made if applicable.

📋 Tasks

Make sure you

  • 📖 have read the contribution guidelines
  • 💻 have added necessary unit/e2e tests.
  • 📓 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 Nov 21, 2025

🦋 Changeset detected

Latest commit: 048eb4b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
mermaid Minor

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

@netlify
Copy link

netlify bot commented Nov 21, 2025

Deploy Preview for mermaid-js ready!

Name Link
🔨 Latest commit 048eb4b
🔍 Latest deploy log https://app.netlify.com/projects/mermaid-js/deploys/6920513329340200088b4957
😎 Deploy Preview https://deploy-preview-7184--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.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 21, 2025

Open in StackBlitz

@mermaid-js/examples

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

mermaid

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

@mermaid-js/layout-elk

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

@mermaid-js/layout-tidy-tree

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

@mermaid-js/mermaid-zenuml

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

@mermaid-js/parser

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

@mermaid-js/tiny

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

commit: 048eb4b

@codecov
Copy link

codecov bot commented Nov 21, 2025

Codecov Report

❌ Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 3.55%. Comparing base (b1fe4ff) to head (048eb4b).

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

Impacted file tree graph

@@            Coverage Diff             @@
##           develop   #7184      +/-   ##
==========================================
- Coverage     3.55%   3.55%   -0.01%     
==========================================
  Files          473     473              
  Lines        47500   47502       +2     
  Branches       731     731              
==========================================
  Hits          1687    1687              
- Misses       45813   45815       +2     
Flag Coverage Δ
unit 3.55% <0.00%> (-0.01%) ⬇️

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

Files with missing lines Coverage Δ
packages/mermaid/src/config.type.ts 100.00% <ø> (ø)
...kages/mermaid/src/diagrams/git/gitGraphRenderer.ts 0.00% <0.00%> (ø)
🚀 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 Nov 21, 2025

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

Build Status Details Updated (UTC)
default (Inspect) ⚠️ Changes detected (Review) 1 changed, 5 added Nov 21, 2025, 12:02 PM

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow hide commits without id

2 participants