Skip to content

Polish API rating widget with 0-decimal display#325

Merged
greatest0fallt1me merged 1 commit into
CalloraOrg:mainfrom
1nonlypiece:feat/issue-285
Jun 29, 2026
Merged

Polish API rating widget with 0-decimal display#325
greatest0fallt1me merged 1 commit into
CalloraOrg:mainfrom
1nonlypiece:feat/issue-285

Conversation

@1nonlypiece

Copy link
Copy Markdown
Contributor

Adds a reusable StarRating widget that rounds ratings consistently (half-up) and pads the display to a fixed decimal width so values don't jump in lists.

  • formatRating(value, decimals) helper: clamps to 0–5, treats non-finite input as 0, rounds half-up, and zero-pads (e.g. 4 -> 4.0, 4.6 with decimals=0 -> 5).
  • Accessible widget: descriptive aria-label, decorative stars, tabular-nums + fixed width, design tokens for dark mode.
  • 8 focused vitest cases covering rounding, padding, clamping, and rendering.

Closes #285

@greatest0fallt1me greatest0fallt1me merged commit e49515c into CalloraOrg:main Jun 29, 2026
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.

Polish API rating widget with 0-decimal display

2 participants