Skip to content

Display star ratings on game listing cards - #192

Open
Selvacspl wants to merge 1 commit into
github-samples:mainfrom
Selvacspl:selvacspl-display-star-ratings-game-cards
Open

Selvacspl wants to merge 1 commit into
github-samples:mainfrom
Selvacspl:selvacspl-display-star-ratings-game-cards

Conversation

@Selvacspl

Copy link
Copy Markdown

Description

Game listing cards now show each game's star rating so visitors can compare games before opening the detail page. The shared rating badge displays stars and a one-decimal score out of five, or "No rating yet" when the rating is unavailable.

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.
  • Include / 5 with the formatted numeric rating and show "No rating yet" for missing ratings.
  • Add an end-to-end assertion that listing cards render ratings.

Testing

Data Layer Changes

  • Ran npm run test:unit - all tests pass (39 tests)
  • Added/updated Vitest tests for data-layer changes (no data-layer changes)
  • Generated a migration (npm run db:generate) for any schema change (no schema change)

Frontend Changes

  • Ran npx playwright test --workers=1 - all 22 end-to-end tests pass
  • Added data-testid attributes to interactive elements (no new interactive elements)
  • Verified build succeeds (npm run build)

Also passed npm run lint and npm run typecheck:all. The default parallel E2E run hit intermittent navigation timeouts; the serial run passed.

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 (no documentation changes needed)
  • My changes are focused on a single concern
  • I have written clear commit messages explaining what and why

Additional Notes

The shared badge is also used on game detail pages, so the improved score format and missing-rating fallback are consistent there.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

@Selvacspl Selvacspl left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve

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