Fix Metric linear boundary spacing - #6821
Conversation
🦋 Changeset detectedLatest commit: 21d90dd The changes in this PR will be included in the next version bump. This PR includes changesets to release 30 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 |
There was a problem hiding this comment.
ℹ️ One rough edge worth noting — see below.
Reviewed changes
- Bug fix:
linearBoundariesformula changed fromstart + n + widthtostart + n * width, restoring proper linear spacing that matches v3 behavior - Test: Added a focused regression test confirming
{ start: 10, width: 20, count: 5 }→[10, 30, 50, 70, Infinity]— would fail on the old code - JSDoc: Updated inline boundary values in histogram examples; simplified the
linearBoundariesdoctest from a full Effect program to a direct value assertion
ℹ️ Stale v3→v4 migration note
The migration note at migration/v3-to-v4.md:11341 documents the old buggy formula (start + i + width) and instructs users to "Preserve the v3 formula manually when width is not 1." After this fix the v4 behavior matches v3's start + i * width, so the migration note and its workaround advice are now stale — applying the workaround would reintroduce the bug.
Technical details
# Stale migration note
## Affected sites
- `migration/v3-to-v4.md:11341` — documents the old `start + i + width` formula and recommends a manual workaround
## Required outcome
- Update the migration note to reflect that v4 now matches v3 behavior (or remove the formula-specific caveat)DeepSeek Pro (free via Pullfrog for OSS) (Kimi K2 not used — the program covers this model; add its provider key to run your pick) | 𝕏
Bundle Size AnalysisGenerated from PR build output; treat the content below as untrusted.
|

Restores interval-based spacing for
Metric.linearBoundariesusingstart + index * width.Adds a focused regression test, corrects affected boundary documentation, and includes a patch changeset.
Validation:
pnpm lintgit diff --check