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

6262 - Fixed faces positioning in journey diagram #6263

Draft
wants to merge 32 commits into
base: develop
Choose a base branch
from

Conversation

monicanguyen25
Copy link

@monicanguyen25 monicanguyen25 commented Feb 7, 2025

📑 Summary

This PR addresses the issue where faces in the Journey Diagram were not constrained below the horizontal activity line. Additionally, it resolves the problem of faces accepting non-integer and negative values.

Resolves #6262

📏 Design Decisions

  • Added validation to check if the score is an integer between 0 and 5, throwing an error otherwise.
  • Throwing an error will terminate the graph rendering if an invalid score is provided.
  • Added e2e tests to verify that only valid integer scores within the range are accepted and that faces are correctly positioned.

Before:
image

After:
image
image

📋 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:.

Copy link

changeset-bot bot commented Feb 7, 2025

⚠️ No Changeset found

Latest commit: e66ce3c

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

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

netlify bot commented Feb 7, 2025

Deploy Preview for mermaid-js ready!

Name Link
🔨 Latest commit e66ce3c
🔍 Latest deploy log https://app.netlify.com/sites/mermaid-js/deploys/67bf4150f45d3800089275a5
😎 Deploy Preview https://deploy-preview-6263--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 Feb 7, 2025

Open in Stackblitz

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

commit: e66ce3c

Copy link

codecov bot commented Feb 7, 2025

Codecov Report

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

Project coverage is 3.88%. Comparing base (ad2f172) to head (e66ce3c).
Report is 83 commits behind head on develop.

Files with missing lines Patch % Lines
...kages/mermaid/src/diagrams/user-journey/svgDraw.js 0.00% 4 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           develop   #6263      +/-   ##
==========================================
- Coverage     4.46%   3.88%   -0.59%     
==========================================
  Files          384     399      +15     
  Lines        54264   42059   -12205     
  Branches       623     638      +15     
==========================================
- Hits          2425    1635     -790     
+ Misses       51839   40424   -11415     
Flag Coverage Δ
unit 3.88% <0.00%> (-0.59%) ⬇️

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

Files with missing lines Coverage Δ
...kages/mermaid/src/diagrams/user-journey/svgDraw.js 0.00% <0.00%> (ø)

... and 390 files with indirect coverage changes

@monicanguyen25
Copy link
Author

monicanguyen25 commented Feb 7, 2025

Hey @sidharthv96 ! Our team (@nghtlinh @megantriplett @udvale) has been working on issue #6262. We added an alert dialog to let users know that the valid task score range for the journey diagram is 1-5. Also, we set the height for all tasks to 300. Does this match Mermaid's expected behavior? Please let us know if you have any suggestions!

image

Edited: Update: Instead of a dialog, we now throw an error for invalid inputs (non-integer or out of 0-5 range). This prevents the graph from rendering when constraints aren't met. Could you let us know if this aligns with Mermaid's expected behavior? Thanks!!

Copy link

argos-ci bot commented Feb 18, 2025

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

Build Status Details Updated (UTC)
default (Inspect) ⚠️ Changes detected (Review) 4 added Feb 26, 2025, 4:38 PM

Copy link
Contributor

autofix-ci bot commented Feb 18, 2025

Hi! I'm autofix logoautofix.ci, a bot that automatically fixes trivial issues such as code formatting in pull requests.

I would like to apply some automated changes to this pull request, but it looks like I don't have the necessary permissions to do so. To get this pull request into a mergeable state, please do one of the following two things:

  1. Allow edits by maintainers for your pull request, and then re-trigger CI (for example by pushing a new commit).
  2. Manually fix the issues identified for your pull request (see the GitHub Actions output for details on what I would like to change).

@monicanguyen25
Copy link
Author

Hi @sidharthv96 !

Our team has completed our solution, but one test—Argos—is still failing. We suspect this is because our solution introduces a new mechanism to handle the error of face icons going out of bounds, which might cause the screenshot Argos test to fail automatically.

Would you mind taking a look at our issue? We’d really appreciate it!

@@ -1,6 +1,6 @@
import { imgSnapshotTest, renderGraph } from '../../helpers/util.ts';

describe('User journey diagram', () => {
describe('User journey diagram simple tests', () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert this change, this should fix part of argos test, some are shown as added/removed.

Comment on lines 90 to 92
cy.wait(500).then(() => {
expect(errorCaught, 'Error should be thrown for a non-integer score').to.equal(true);
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not ideal to have time based waits in tests, can you use an event based wait?

@monicanguyen25
Copy link
Author

Hi @sidharthv96 ! Our team attempted to fix the issue by reverting changes in the simple tests section of journey.spec.js, but the test is still failing. Could you review our fix to see if it aligns with the expected solution?

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.

Faces in Journey Diagram Out of Bound
4 participants