Skip to content

feat(donut-s2): add sentiment-colored delta line to DonutSummary - #900

Open
madelineluke wants to merge 1 commit into
feat/donut-emphasize-segment-color-swapfrom
feat/donut-summary-delta-line
Open

feat(donut-s2): add sentiment-colored delta line to DonutSummary#900
madelineluke wants to merge 1 commit into
feat/donut-emphasize-segment-color-swapfrom
feat/donut-summary-delta-line

Conversation

@madelineluke

Copy link
Copy Markdown
Collaborator

Summary

  • Adds an optional delta?: number prop to DonutSummary - a bold, sentiment-colored delta line (e.g. +2.5% green / -7.4% red) rendered below the label, per planning/specs/donut/implemented/donut-summary-delta-line.json.
  • Reuses the existing label font-size signal directly (the delta ramp is identical to the label's), rather than duplicating a scale/signal pair.
  • Generalizes the value/label stacking logic (baseline + dy + truncation limit) so any combination of value/label/delta positions correctly - including delta taking over the label's slot when label is omitted, and label becoming the anchor line when hideValue is set with delta present.
  • Supported for both the standard and isBoolean donut summary variants.

Test plan

  • yarn test --testPathPattern="donut" - 236 passed (17 new)
  • yarn tsc --noEmit - no new errors
  • yarn lint - clean
  • Visually verified in Storybook: positive delta, negative delta, no-label (delta takes value's slot), and hideValue (label becomes anchor, delta below) - all four stacking combinations render correctly

🤖 Generated with Claude Code

Adds an optional third line to DonutSummary - a bold, sentiment-colored
delta value (e.g. "+2.5%" green / "-7.4%" red) rendered below the label.
Reuses the existing label font-size signal directly (the delta ramp is
identical), and generalizes the value/label stacking logic so any
combination of value/label/delta positions correctly, including delta
taking over the label's slot when label is omitted, and label becoming
the anchor line when hideValue is set with delta present.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@madelineluke
madelineluke force-pushed the feat/donut-summary-delta-line branch from 2f3bd1b to be1b63b Compare September 3, 2026 16:15
@sonarqubecloud

sonarqubecloud Bot commented Sep 3, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
5 New Code Smells (required ≤ 0)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

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