Skip to content

Display star ratings on game listing cards - #183

Open
Karthik-rk-cspl wants to merge 1 commit into
github-samples:mainfrom
Karthik-rk-cspl:karthik-rk-cspl-display-star-ratings-on-game-cards
Open

Karthik-rk-cspl wants to merge 1 commit into
github-samples:mainfrom
Karthik-rk-cspl:karthik-rk-cspl-display-star-ratings-on-game-cards

Conversation

@Karthik-rk-cspl

Copy link
Copy Markdown

Description

Game listing cards did not show a game's rating, making it harder for visitors to compare games without opening each detail page. This adds the shared star-rating badge to every listing card, showing a one-decimal score out of five or No rating yet when no rating is available.

Related Issue

Fixes: #165

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to change)
  • 📚 Documentation update
  • 🧪 Test update
  • 🔧 Refactor (no functional changes)

Changes Made

  • Reuse the shared StarRating component on each game card, with a clamped, one-decimal score and five-point scale.
  • Show No rating yet for games without a rating.
  • Add formatter unit tests and listing-page E2E coverage; document rating display in the README.

Testing

Data Layer Changes

  • Ran npm run test:unit - all tests pass (42 tests)
  • Added/updated Vitest tests for rating formatting
  • Generated a migration (npm run db:generate) for any schema change (not applicable; no schema change)

Frontend Changes

  • Ran npm run test:e2e - all tests pass (22 tests)
  • Added data-testid attributes to interactive elements (not applicable; no new interactive elements)
  • Verified build succeeds (npm run build)

Additional checks: npm run lint and npm run typecheck:all both pass.

Checklist

  • My code follows the project's coding standards
  • I have used explicit TypeScript types for function parameters and return values
  • I have built the UI with Astro components and Tailwind CSS utility classes (dark theme)
  • I have updated documentation (README, instruction files) if needed
  • My changes are focused on a single concern
  • I have written clear commit messages explaining what and why

Additional Notes

The existing game-rating test ID is reused for assertions on listing cards and the detail page.

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