Skip to content

feat(ui): add subtitle prop to Scorecard - #228

Merged
L03TJ3 merged 2 commits into
mainfrom
feat/scorecard-subtitle-prop
Oct 22, 2026
Merged

L03TJ3 merged 2 commits into
mainfrom
feat/scorecard-subtitle-prop

Conversation

@goodbounties-nanoclaw-agent

Copy link
Copy Markdown
Contributor

Description

Adds an optional subtitle prop to Scorecard (packages/ui) — a short contextual/source note rendered below the trend row when a trend is present, or directly below the value row when it is not. Layout is unchanged when subtitle is omitted.

About #223

How Has This Been Tested?

  • Extended tests/design-system/smoke.spec.ts (Scorecard story test) with assertions that the subtitle text renders for both the with-trend row (unique-wallets) and without-trend row (daily-flow-rate), and regenerated the tracked baseline screenshot tests/design-system/test-results/story-scorecard-default.png.
  • Ran the full tests/design-system/smoke.spec.ts suite locally (45 tests across Card, GlowCard, Drawer, TokenAmount, ClaimWidget, ThemePlayground, Stepper, Scorecard, PieDonutChart, BarChart, LineAreaChart, DataTable) — all passed, no regressions.
  • Built packages/ui via pnpm build (tsup) — ESM/CJS/DTS all succeeded, confirming the prop and new sub-component type-check.
  • Visually verified the regenerated screenshot: subtitle renders in the correct position for both variants (bare/card) and both trend states, with no clipping.

Checklist:

  • PR title matches follow: (Feature|Bug|Chore) Task Name
  • My code follows the style guidelines of this project
  • I have followed all the instructions described in the initial task (check Definitions of Done)
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have added reference to a related issue in the repository
  • I have added a detailed description of the changes proposed in the pull request. I am as descriptive as possible, assisting reviewers as much as possible.
  • I have added screenshots related to my pull request (for frontend tasks)
  • I have pasted a gif showing the feature.
  • @mentions of the person or team responsible for reviewing proposed changes

Plan sub-issue: #225

Adds an optional subtitle line to Scorecard, rendered below the trend
row when a trend is present or below the value row otherwise. No
change to layout when subtitle is omitted.

Closes #223

On-Behalf-Of: BountyCoder[onecli] (yaskkeryodtdijpv)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an optional subtitle prop to the shared Scorecard design-system component (packages/ui) to allow a short contextual/source note that renders beneath the metric (after the trend row when present, otherwise after the value row) without affecting layout when omitted.

Changes:

  • Extended ScorecardProps with subtitle?: string and added a ScorecardSubtitleText styled sub-component for consistent typography/colors.
  • Updated the Scorecard Storybook story data and controls to demonstrate subtitle usage with and without a trend.
  • Extended the existing Playwright smoke test to assert the subtitle renders for both a with-trend and no-trend row, and adjusted viewport height for the extra line.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.

File Description
packages/ui/src/components/Scorecard.tsx Adds subtitle prop and renders it conditionally using a new ScorecardSubtitleText component.
examples/storybook/src/stories/design-system/Scorecard.stories.tsx Updates mock rows and Storybook controls to demonstrate subtitle in both trend/no-trend cases.
tests/design-system/smoke.spec.ts Adds assertions for subtitle rendering and increases viewport height to avoid clipping.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@thalescb

Copy link
Copy Markdown

@copilot Please resolve only the screenshot conflict in tests/design-system/test-results/story-scorecard-default.png on PR #228. Regenerate the screenshot on this PR branch. Leave packages/ui/src/components/Scorecard.tsx, examples/storybook/src/stories/design-system/Scorecard.stories.tsx, tests/design-system/smoke.spec.ts, and all other files unchanged. Do not merge. Report the files changed and the checks run. If resolving the screenshot requires changing any other file or a check fails, stop and report the blocker.

@thalescb

Copy link
Copy Markdown

@copilot Please resolve only the screenshot conflict in tests/design-system/test-results/story-scorecard-default.png on PR #228. Regenerate the screenshot on this PR branch. Leave packages/ui/src/components/Scorecard.tsx, examples/storybook/src/stories/design-system/Scorecard.stories.tsx, tests/design-system/smoke.spec.ts, and all other files unchanged. Do not merge. Report the files changed and the checks run. If resolving the screenshot requires changing other files, or any check fails, stop and report the blocker.

@L03TJ3

L03TJ3 commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

@copilot Please resolve only the screenshot conflict in tests/design-system/test-results/story-scorecard-default.png on PR #228. Regenerate the screenshot on this PR branch. Leave packages/ui/src/components/Scorecard.tsx, examples/storybook/src/stories/design-system/Scorecard.stories.tsx, tests/design-system/smoke.spec.ts, and all other files unchanged. Do not merge. Report the files changed and the checks run. If resolving the screenshot requires changing any other file or a check fails, stop and report the blocker.

Copilot AI commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

@copilot Please resolve only the screenshot conflict in tests/design-system/test-results/story-scorecard-default.png on PR #228. Regenerate the...

Stopped because the targeted check failed: pnpm test:demo tests/design-system/smoke.spec.ts --grep '^Scorecard/Default story renders all 5 mock-data rows in both variants$' --project=chromium --workers=1 --retries=0 exited 1 with No tests found.

Files changed: none (confirmed with git status --short and git diff --name-only). Screenshot was not regenerated; no merge or new commit was made. No further checks or changes attempted.

Copilot AI requested a review from L03TJ3 October 22, 2026 04:33
@L03TJ3
L03TJ3 merged commit 2eb144e into main Oct 22, 2026
16 of 17 checks passed

This branch was successfully deployed

5 active deployments
preview-storybook — 13778ca7 Deployed Oct 22, 2026 by L03TJ3 via preview #468
preview-superfluid-campaign — 13778ca7 Deployed Oct 22, 2026 by L03TJ3 via preview #237
preview-ai-credits — 13778ca7 Deployed Oct 22, 2026 by L03TJ3 via preview #407
preview-gooddata — 13778ca7 Deployed Oct 22, 2026 by L03TJ3 via gooddata-web-preview #129
internal — 13778ca7 Deployed Oct 22, 2026 by L03TJ3 via authorize-preview #237
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.

5 participants