-
-
Notifications
You must be signed in to change notification settings - Fork 8k
6633: Log warning for blocks exceeding column width #6717
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
6633: Log warning for blocks exceeding column width #6717
Conversation
🦋 Changeset detectedLatest commit: f683b03 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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/mermaid-zenuml
@mermaid-js/parser
@mermaid-js/tiny
commit: |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #6717 +/- ##
==========================================
- Coverage 3.70% 3.70% -0.01%
==========================================
Files 454 454
Lines 44724 44736 +12
Branches 707 707
==========================================
Hits 1659 1659
- Misses 43065 43077 +12
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 ↗︎
|
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 a validation check to ensure no block’s width exceeds the configured column count and surfaces a clear error when it does.
- Introduces a runtime check in
blockDB.ts
that throws an error if any block’swidthInColumns
exceeds the declared columns. - Adds a unit test in
block.spec.ts
to verify the new error is thrown when a block is too wide. - Updates the Changeset to document this bugfix.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
packages/mermaid/src/diagrams/block/parser/block.spec.ts | Adds a test to verify an error is thrown for over-wide blocks |
packages/mermaid/src/diagrams/block/blockDB.ts | Implements the width-vs-columns validation and throws an error |
.changeset/ninety-roses-turn.md | Records the patch changeset for this bugfix |
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 make changes suggested by copilot
on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
resolved in ac97624 |
on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
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.
LGTM, the only other improvement would to update the changeset/PR title/PR description to say that we're only logging a warning instead.
on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
…://github.com/mermaid-js/mermaid into 6633-Stacking-blocks-renders-unexpected-space
📑 Summary
This PR introduces a validation check and corresponding warning when a block's width exceeds the configured number of columns.
Currently, blocks that span beyond the available column count cause render unexpected spaces without clear feedback to the user.
Resolves #6633
📏 Design Decisions
Describe the way your implementation works or what design decisions you made if applicable.
📋 Tasks
Make sure you
MERMAID_RELEASE_VERSION
is used for all new features.pnpm changeset
and following the prompts. Changesets that add features should beminor
and those that fix bugs should bepatch
. Please prefix changeset messages withfeat:
,fix:
, orchore:
.