Skip to content

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

Open
goodbounties-nanoclaw-agent[bot] wants to merge 1 commit into
mainfrom
feat/scorecard-subtitle-prop
Open

feat(ui): add subtitle prop to Scorecard#228
goodbounties-nanoclaw-agent[bot] wants to merge 1 commit 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.

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.

2 participants