Skip to content

Display star ratings on game listing cards - #194

Open
Nagarajan-cspl wants to merge 1 commit into
github-samples:mainfrom
Nagarajan-cspl:nagarajan-cspl-display-game-star-ratings
Open

Nagarajan-cspl wants to merge 1 commit into
github-samples:mainfrom
Nagarajan-cspl:nagarajan-cspl-display-game-star-ratings

Conversation

@Nagarajan-cspl

Copy link
Copy Markdown

Summary

Game listing cards now show each game's star rating and numeric score so visitors can compare games without opening detail pages. Ratings are labeled accessibly as a score out of 5, and games without a rating display “No rating yet.” The existing shared rating component is reused, keeping the static Astro site free of added client-side JavaScript.

Background

Game cards did not expose rating information, making it harder to compare games from the listing. This change addresses #165.

Fixes: #165

Changes

  • Render the shared StarRating component on each game card.
  • Include the score denominator and accessible rating label; display a clear fallback when the rating is null.
  • Extend the game listing Playwright coverage to assert that a card shows its rating.

Testing

  • npm run test:unit - passed (39 tests).
  • npm run lint - passed.
  • npm run typecheck:all - passed (0 Astro errors, warnings, or hints).
  • npm run build - passed (24 static pages built).
  • npm run test:e2e - passed (21 tests).

Additional Notes

The shared rating component is also used on game detail pages, so the “No rating yet” fallback and explicit / 5 score format apply there as well.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.

Display star ratings on game listing cards

1 participant