Repository navigation
fix(bundlecheck): Make bars equal when formatted sizes match - #479
Merged
aversini merged 1 commit intoJan 31, 2026
Merged
Conversation
Detect when all displayed (formatted) gzip/raw sizes are identical and treat them as equal for bar calculation. Update calcBarLength to accept an allSame flag and return the full barWidth when values are effectively the same to avoid misleading visual differences for values that format to the same string. Add tests to verify equal bar lengths for values that format identically and differing bar lengths when formatted values differ.
There was a problem hiding this comment.
Pull request overview
This PR refines the bundle size trend graph so that bar lengths better reflect the human-readable size labels and avoid misleading visual differences for values that format identically. It does this by detecting when the formatted gzip/raw sizes are all the same and treating them as equal for bar-scaling, with accompanying tests to lock in the behavior.
Changes:
- Update
renderTrendGraphto compute whether all formatted gzip/raw sizes are identical and pass anallSameflag into the bar-length calculation. - Extend the internal
calcBarLengthhelper to accept theallSameflag and return the full bar width when values are effectively equal in their formatted representation. - Add targeted tests verifying equal bar lengths when formatted values match and differing bar lengths when formatted values differ, alongside existing min-max scaling tests.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
packages/bundlecheck/src/trend.ts |
Adds formatted-size equality checks and updates bar-length calculation to use an allSame flag so all visually-equal sizes render with full-width bars. |
packages/bundlecheck/src/__tests__/trend.test.ts |
Adds tests covering the new equal-bar behavior for identically formatted values and ensuring bars differ when formatted values differ, preserving existing min-max scaling expectations. |
aversini
deleted the
fix(bundlecheck)-Make-bars-equal-when-formatted-sizes-match
branch
January 31, 2026 13:36
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Detect when all displayed (formatted) gzip/raw sizes are identical and treat them as equal for bar calculation. Update calcBarLength to accept an allSame flag and return the full barWidth when values are effectively the same to avoid misleading visual differences for values that format to the same string. Add tests to verify equal bar lengths for values that format identically and differing bar lengths when formatted values differ.