Skip to content

fix(a11y): format Sparkline numbers using StatCard format and asset props - #723

Open
dezzy-music wants to merge 1 commit into
MergeFi:mainfrom
dezzy-music:fix/statcard-sparkline-format-value-709
Open

dezzy-music wants to merge 1 commit into
MergeFi:mainfrom
dezzy-music:fix/statcard-sparkline-format-value-709

Conversation

@dezzy-music

Copy link
Copy Markdown

Summary

Fixes #709.

StatCard rendered Sparkline without formatValue, causing describeTrend to fall back to String(v). For currency and count cards, screen readers announced raw unformatted numbers (e.g. 'trending up from 1234.5 to 8420') instead of locale-formatted currency/count strings matching the card's visible formatting.

Changes

  • In src/components/ui/StatCard.tsx, passed a formatValue callback to Sparkline derived from the card's format, asset, and locale.
  • Cleaned up unused isRTLLocale import in StatCard.tsx.
  • Added unit tests in src/components/ui/StatCard.test.tsx asserting accessible name announcements for currency and count sparklines.

Verification

  • Ran Jest: 25/25 tests pass in StatCard.test.tsx and 3/3 in dashboard-charts.a11y.test.tsx.
  • Ran ESLint: 0 errors.

@vercel

vercel Bot commented Oct 13, 2026

Copy link
Copy Markdown

@dezzy-music is attempting to deploy a commit to the chonilius' projects Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
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.

StatCard's sparkline announces raw numbers (e.g. '1234.5') for currency cards

1 participant