Skip to content

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

Open
madelineluke wants to merge 2 commits 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 2 commits 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

@madelineluke
madelineluke force-pushed the feat/donut-summary-delta-line branch from 2f3bd1b to be1b63b Compare September 3, 2026 16:15
madelineluke and others added 2 commits September 8, 2026 15:36
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>
…e smells in donutSummaryUtils

Extracts baseline/heightFromCenter/dyExpr nested ternaries into if/else
chains, and pulls the nested template literal in getSummaryDeltaEncode's
dyExpr into a named valueGapExpr constant first. No behavior change.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@madelineluke
madelineluke force-pushed the feat/donut-summary-delta-line branch from 5720825 to 9251f52 Compare September 8, 2026 21:49
@sonarqubecloud

sonarqubecloud Bot commented Sep 8, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

@madelineluke
madelineluke removed this pull request from stack #898 September 9, 2026 22:41
@madelineluke
madelineluke added this pull request to stack #908 September 9, 2026 22:42
@madelineluke
madelineluke removed this pull request from stack #908 September 9, 2026 22:42
@madelineluke
madelineluke added this pull request to stack #909 September 9, 2026 22:43
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