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

#5858 - fix: Timeline node width made dynamic #6100

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

afmireski
Copy link

📑 Summary

In timelineRenderer, the width of the timeline diagram nodes is hardcoded, making width configuration changes ineffective.

Resolves #5858

📏 Design Decisions

Extract the hardcoded value, defined here, into a constant and use it as the default if the node width is not specified in the timeline configuration.
I've added tests to verify the application of both the default and custom widths.

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

- Refactored timelineRenderer.drawEvents
    - Added DEFAULT_NODE_WIDTH of 150
    - Used conf?.timeline?.width as a dynamic value, or default value if
not provided
- Added integration tests in
cypress/integration/rendering/timeline.spec.ts to cover changes
@github-actions github-actions bot added the Type: Bug / Error Something isn't working or is incorrect label Nov 30, 2024
Copy link

netlify bot commented Nov 30, 2024

Deploy Preview for mermaid-js ready!

Name Link
🔨 Latest commit 146b86c
🔍 Latest deploy log https://app.netlify.com/sites/mermaid-js/deploys/674a5bcdf5d40c000891e1bb
😎 Deploy Preview https://deploy-preview-6100--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 30, 2024

Open in Stackblitz

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

commit: 146b86c

Copy link

codecov bot commented Nov 30, 2024

Codecov Report

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

Project coverage is 4.48%. Comparing base (cc29437) to head (146b86c).
Report is 28 commits behind head on develop.

Files with missing lines Patch % Lines
.../mermaid/src/diagrams/timeline/timelineRenderer.ts 0.00% 6 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           develop   #6100      +/-   ##
==========================================
- Coverage     4.49%   4.48%   -0.01%     
==========================================
  Files          383     383              
  Lines        53925   54043     +118     
  Branches       596     596              
==========================================
  Hits          2425    2425              
- Misses       51500   51618     +118     
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 Δ
.../mermaid/src/diagrams/timeline/timelineRenderer.ts 0.00% <0.00%> (ø)

... and 4 files with indirect coverage changes

@afmireski
Copy link
Author

Hello,

Looking at the test workflow failures, I noticed that the tests passed:
image

The error seems to be related to insufficient storage for saving Cypress screenshots:
image

Is there any correction I need to make?

I also noticed that Codecov reported a lack of coverage, but my integration tests appear to be running correctly. I would greatly appreciate any suggestions or feedback you can provide. I'm a newbie in open-source.

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.

Timeline does not honor width configuration
1 participant