Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Display no arrows for open links #6093

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

jahredhope
Copy link

@jahredhope jahredhope commented Nov 28, 2024

📑 Summary

In Flowcharts "Open links" (Links with no direction) are currently being displayed with single-directional arrows.

I believe this started occurring sometime in v11.

This change makes it so open links display with no arrow on their start or end.

Resolves #6020

📏 Design Decisions

Edges of type arrow_open should be treated as a special case, they are neither a single or double_ directional arrow.

I've added tests for single and double directional arrows to make the difference in use-case easier to see.

Example Before Change

mermaid-local-docs-before-change

Example After Change

mermaid-local-docs-after-change

📋 Tasks

I have:

  • 📖 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:.

resolves: #5813
resolves: #5964
resolves: #6020

Copy link

changeset-bot bot commented Nov 28, 2024

🦋 Changeset detected

Latest commit: ed8ba95

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

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

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

@github-actions github-actions bot added the Type: Bug / Error Something isn't working or is incorrect label Nov 28, 2024
Copy link

netlify bot commented Nov 28, 2024

Deploy Preview for mermaid-js ready!

Name Link
🔨 Latest commit ed8ba95
🔍 Latest deploy log https://app.netlify.com/sites/mermaid-js/deploys/6747ebf6b1bc8a00082ece9d
😎 Deploy Preview https://deploy-preview-6093--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 site configuration.

Copy link

pkg-pr-new bot commented Nov 28, 2024

Open in Stackblitz

npm i https://pkg.pr.new/mermaid-js/mermaid@6093
npm i https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/mermaid-zenuml@6093
npm i https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/layout-elk@6093
npm i https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/parser@6093

commit: ed8ba95

Copy link

codecov bot commented Nov 28, 2024

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Project coverage is 4.48%. Comparing base (64554a6) to head (b357624).
Report is 4 commits behind head on develop.

Files with missing lines Patch % Lines
packages/mermaid/src/diagrams/flowchart/flowDb.ts 0.00% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           develop   #6093   +/-   ##
=======================================
  Coverage     4.48%   4.48%           
=======================================
  Files          383     382    -1     
  Lines        54038   54030    -8     
  Branches       596     621   +25     
=======================================
  Hits          2425    2425           
+ Misses       51613   51605    -8     
Flag Coverage Δ
unit 4.48% <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/diagrams/flowchart/flowDb.ts 0.00% <0.00%> (ø)

... and 1 file with indirect coverage changes

@jahredhope
Copy link
Author

I'm not sure why the code coverage is failing. I expect it's incorrectly reporting as not covered, as it says the whole file as no coverage.

I'll try and dig into it, but I may need some help if anyone knows why it's reporting as such.

@jahredhope
Copy link
Author

I didn't realise someone had raised a fix for this ~3 weeks ago. My solution is a little different in that it results in an end type of 'none' rather than "arrow_open" which I like the explicitness of. So I'm leaving my PR open for the maintainers to pick which they prefer.

@jahredhope
Copy link
Author

I think there are actually a few issues and multiple fixes for the same thing. Perhaps they should be closed as duplicates for the original one?

Changes

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
1 participant