-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Feature/7078 Allow decimal sequence numbers #7132
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
Feature/7078 Allow decimal sequence numbers #7132
Conversation
…undredth position.
🦋 Changeset detectedLatest commit: 1290065 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
✅ Deploy Preview for mermaid-js ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
@mermaid-js/examples
mermaid
@mermaid-js/layout-elk
@mermaid-js/layout-tidy-tree
@mermaid-js/mermaid-zenuml
@mermaid-js/parser
@mermaid-js/tiny
commit: |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #7132 +/- ##
==========================================
- Coverage 3.55% 3.55% -0.01%
==========================================
Files 474 473 -1
Lines 47453 47504 +51
Branches 730 731 +1
==========================================
Hits 1687 1687
- Misses 45766 45817 +51
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
shubhamparikh2704
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add changeset and some rendering tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for decimal sequence numbers in sequence diagrams, allowing values up to the hundredths place (e.g., 10.25). The implementation includes parser updates to accept decimal values, renderer modifications to handle floating-point arithmetic correctly, and dynamic font sizing for longer sequence numbers.
Key Changes:
- Updated Jison parser to accept decimal numbers up to two decimal places
- Implemented proper rounding to avoid floating-point precision errors
- Added dynamic font sizing based on sequence number length
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
packages/mermaid/src/diagrams/sequence/parser/sequenceDiagram.jison |
Updated NUM token regex to accept decimal values up to hundredths place |
packages/mermaid/src/diagrams/sequence/sequenceRenderer.ts |
Added floating-point rounding fix and dynamic font sizing for sequence numbers |
packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js |
Added unit tests for decimal number support and precision validation |
cypress/integration/rendering/sequencediagram.spec.js |
Added integration test for decimal sequence number rendering |
packages/mermaid/src/docs/syntax/sequenceDiagram.md |
Documented new decimal sequence number feature with examples |
docs/syntax/sequenceDiagram.md |
Documented new decimal sequence number feature with examples |
.changeset/slick-maps-hear.md |
Added changeset entry for the feature |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9aaa70b to
f602021
Compare
| Alice->Bob: Hello Bob, how are you? | ||
| Bob-->Alice: I am good thanks! | ||
| ``` | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why this is duplicating. I've tried a couple of things to fix it, like manually removing it and reverting to an older version when a manual change hadn't been made, but neither worked. Any ideas?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shubhamparikh2704 @sidharthv96 I wasn't able to figure out why this was duplicating so I made a new branch, updated my docs change, and created a new PR. Here is the PR: #7174
📑 Summary
Added support for sequence numbers in sequence diagrams to use decimal values up to the hundredths place, and enabled incrementing using decimal values to the same precision.
Resolves #7078
📏 Design Decisions
Describe the way your implementation works or what design decisions you made if applicable.
📋 Tasks
Make sure you
MERMAID_RELEASE_VERSIONis used for all new features.pnpm changesetand following the prompts. Changesets that add features should beminorand those that fix bugs should bepatch. Please prefix changeset messages withfeat:,fix:, orchore:.