feat: add single-donut Binary story and story tests for donut-binary - #906
Open
c-lamoureux wants to merge 4 commits into
Open
feat: add single-donut Binary story and story tests for donut-binary#906c-lamoureux wants to merge 4 commits into
c-lamoureux wants to merge 4 commits into
Conversation
…ry segment The isBoolean (2-segment) donut always rendered its secondary arc via the normal categorical color scale instead of the fixed chart.donut.color.secondary-gray token the design requires, so consumers had to manually pass a gray color as a workaround. The secondary segment now always resolves to secondary-gray, matching the same fixed-token precedent already used for the empty-state ring. Revised the donut-binary spec after confirming the skill's "only the primary segment is labeled" note describes the existing center-hole DonutSummary value, not the outside-ring SegmentLabel component - SegmentLabel remains intentionally suppressed for binary donuts. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Reconciled against the final diff (donutUtils.ts/test.ts, DonutBinary.story.tsx) - implementationPlan, crossCutting, and edgeCases already matched, so this only flips status and moves the file into planning/specs/donut/implemented/.
madelineluke
force-pushed
the
feat/donut-binary-secondary-color-labels
branch
from
September 8, 2026 21:48
6c34a41 to
20ae969
Compare
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.
Description
Follow-up from reviewing #888:
Binarystory alongside the existing two-chartBooleanexample: a single<Donut isBoolean>using the normal (default) categorical color scheme, matching the design mock (88.3% "Satisfied", pinkcategorical-600primary). Proves the secondary-gray override in feat: s2 donut binary #888 works standalone, without requiring a second donut or explicit color overrides.DonutBinary.test.tsx, following the existingDonut.test.tsxpattern (render the story, assert on rendered marks/text), covering:Boolean: each chart's primary segment keeps its explicit color; secondary segment is forced tosecondary-grayin both charts.Binary: primary segment renders via the normal color scale; secondary segment is still forced tosecondary-gray; center-hole value and label render correctly.Notes
isBoolean's summary value format is hardcoded to.0%(0 decimals) indonutSummaryUtils.ts, so0.883renders as88%, not88.3%as in the design mock. TheBinarytest asserts the actual current behavior (88%). This predates this PR (and feat: s2 donut binary #888) and isn't fixed here — separate fromnumberFormat, which is already threaded through for the non-boolean summary path but not the boolean one. Worth a follow-up issue.How Has This Been Tested?
yarn test --testPathPattern="DonutBinary"— 6/6 passingDonut/Features/BinaryandBoolean)