Skip to content

feat: s2 donut summary, metric value/label sizing to named size tiers - #889

Draft
madelineluke wants to merge 1 commit into
mainfrom
feat/donut-summary-responsive-sizing
Draft

feat: s2 donut summary, metric value/label sizing to named size tiers#889
madelineluke wants to merge 1 commit into
mainfrom
feat/donut-summary-responsive-sizing

Conversation

@madelineluke

@madelineluke madelineluke commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

Description

Replaces DonutSummary's placeholder ratio-based font sizing (donutRadius * holeRatio * 0.35, with the label always forced to exactly half the value's size) with two independent threshold scales/signals (value, label) keyed off the donut's outer diameter. A diameter snaps to the nearest of the five named S2 size tiers (XS/S/M/L/XL) via shared midpoint cutpoints, rather than the old scale's snap-down behavior. Value/label font sizes are now independently specified per tier (matching the design tokens), not derived as a fixed ratio of each other. Text truncation/fit-based visibility (DONUT_SUMMARY_MIN_RADIUS) intentionally continues to use the real holeRatio-derived inner radius, not the tier's fixed ring-width token - the actual arc ring geometry (getArcMark) is untouched by this change and still holeRatio-based, so truncation math stays matched to what's actually rendered. That ring-geometry/design-token mismatch is real and confirmed (measured against the Figma reference) but is tracked as a separate issue rather than folded into this PR (see #891). Adds a new non-pre-alpha Donut/Features/Donut Summary Storybook story showing all five size tiers side by side.

Related Issue

Implements planning/specs/donut/donut-summary-responsive-sizing.json - second spec in the planning/specs/donut/ s2 donut feature series (reordered ahead of donut-direct-labels, which depends on the size-tier constants this PR establishes). No GitHub issue tracked.

Motivation and Context

The center metric value/label sizing didn't match the S2 design system's named size tiers, and hardcoded the label to always be exactly half the value's font size, which doesn't hold once independently-specified per-tier sizes are used.

How Has This Been Tested?

  • yarn test --testPathPattern="react-spectrum-charts-s2|vega-spec-builder-s2" - 2112/2112 passing
  • yarn lint - clean
  • yarn tsc --noEmit - no new errors (pre-existing unrelated errors confirmed present on main)
  • Verified visually in Storybook (Donut/Features/Donut Summary/Size Tiers) that value/label font sizes scale correctly across all five tiers

Screenshots (if appropriate):

N/A - verified in Storybook, see test plan above.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

…to named size tiers

DonutSummary previously sized its center text with a placeholder ratio
(donutRadius * holeRatio * 0.35) that forced the label to always be
exactly half the value's font size. The S2 design system instead
specifies five named size tiers (XS/S/M/L/XL) with independently
authored value and label font sizes that don't follow a fixed ratio.

Replaces the single ratio-based scale/signal with two independent
threshold scales (value, label) keyed off the donut's outer diameter,
snapping to the nearest named tier via shared midpoint cutpoints.
Text truncation/fit-based visibility intentionally continues to use
the real holeRatio-derived inner radius rather than the tier's
ring-width token, since the actual arc geometry is untouched by this
change and still holeRatio-based - that mismatch is filed separately.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@madelineluke
madelineluke marked this pull request as draft August 19, 2026 19:35
@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

@madelineluke madelineluke changed the title Donut Summary — calibrate metric value/label sizing to named size tiers feat: s2 donut summary, metric value/label sizing to named size tiers Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant