feat(Rating): show provider ratings - #4096
Conversation
There was a problem hiding this comment.
Pull request overview
This PR enhances the v2 Game Details header by adding inline, provider-branded rating chips (logos + formatted values) derived from the current ROM’s metadata, so users can see key ratings at a glance without switching tabs.
Changes:
- Adds computed rating-chip data (ordered by provider) and renders it in the header meta area.
- Formats provider rating values (percent-based providers with
%, IGDB normalized to a 10-point scale). - Adds styling for the new rating chip layout and introduces a filtered
visibleRegionslist.
Suppressed comments (3)
frontend/src/v2/components/GameDetails/GameHeader.vue:186
- The rating chip container already has an aria-label, but the provider logo
also has alt text. This can cause screen readers to announce the provider twice (image + labeled chip). Mark the logo as decorative (empty alt + aria-hidden) and keep the label on the chip container.
<img
class="r-v2-det-header__rating-logo"
:src="chip.logo"
:alt="`${chip.name} logo`"
/>
frontend/src/v2/components/GameDetails/GameHeader.vue:75
- IGDB rating is normalized to a 10-point scale, but the rendered value currently omits the "/10" suffix described in the PR (example: "5.4/10"). This makes IGDB look like an unlabelled number compared to the percent-based providers.
const values: Array<{ key: RatingChip["key"]; value: string | null }> = [
{
key: "igdb_id",
value: formatRating(
normalizeToTen(parseFloat(rom.igdb_metadata?.total_rating ?? "")),
),
},
frontend/src/v2/components/GameDetails/GameHeader.vue:180
- The PR description says rating chips should appear on a separate line below the system/platform/regions/languages/tags, but the current flex layout does not enforce a dedicated line and also renders ratings before the tags block. Depending on available width, tags may wrap after ratings (or ratings may stay on the same line as other meta), which does not match the stated layout.
<span
v-if="ratingChips.length || visibleRegions.length || languages.length || tags.length"
class="r-v2-det-header__sep"
>
·
</span>
<span v-if="ratingChips.length" class="r-v2-det-header__ratings">
<span
v-for="chip in ratingChips"
:key="chip.key"
class="r-v2-det-header__rating-inline"
:aria-label="`${chip.name} rating ${chip.value}`"
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
e64349e to
aaebae9
Compare
aaebae9 to
f601e21
Compare
|
Yes, the ratings could be added to the cards in the Metadata tab, or possibly to the Overview tab. However, I think ratings should remain immediately visible in the game header. They give users a quick sense of whether a game is considered excellent, good, average, or poorly received without requiring them to open another tab. I also looked at several platforms (e.g. gaming, medias), and ratings are commonly displayed prominently near the title or in the main header. This is only a suggestion, of course, and you can decide whether to accept or decline it. |
|
let's start with just having them in the Metadata pane and i can look into this later! |
|
@gantoine is it ok for you if I move it to game "Overview" tab instead of "Metadata" ? 🙏 |
|
@wadiebs metadata tab first, then i'll discuss with the team about updating the location |
- Remove ratings display from GameHeader component - Move rating logic (formatRating, normalizeToTen, RatingChip type) to MetadataTab - Add new 'Ratings' section in metadata tab (between Verification and Provider links) - Display ratings with provider logos (16×16px) and formatted values - Add 'ratings-label' translation key to all 18 locale files - Improve organization: ratings now grouped with provider metadata instead of header
3fe2940 to
103395f
Compare
|
Done. You can check please. Thank you! |
Greptile SummaryThe PR adds a localized Ratings section to the v2 game metadata tab, displaying available provider scores alongside provider logos.
Confidence Score: 4/5The MobyGames scaling error should be fixed before merging because ordinary provider scores are displayed at ten times their correct percentage. The backend can supply a MobyGames score such as Files Needing Attention: frontend/src/v2/components/GameDetails/MetadataTab.vue Important Files Changed
Prompt To Fix All With AI### Issue 1
frontend/src/v2/components/GameDetails/MetadataTab.vue:112-117
**MobyGames score is overscaled**
When MobyGames metadata contains a score such as `"90"`, this code multiplies the already 0–100 value by 10, causing the rating to display as `900%` instead of `90%`.
```suggestion
{
key: "moby_id",
value: formatRating(parseFloat(rom.moby_metadata?.moby_score ?? ""), {
percent: true,
}),
},
```
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "refactor(v2): move provider ratings from..." | Re-trigger Greptile |
MobyGames backend already provides 0-100 scores. Remove the unnecessary multiplication by 10 that was causing scores like 90 to display as 900%.
|
fixed what greptile found. |
Ratings had their own section in the metadata tab, duplicating the provider list rendered right below it. Each score now sits on its provider card, right aligned next to the external ID, and the standalone section is gone. Scale normalization and percent formatting move into providerRating(), next to providerId(), so the provider registry stays the single source of truth. Formatting itself is now Number.toLocaleString with style: "percent" rather than toFixed plus manual trailing-zero stripping, which also drops the NaN chips that missing metadata used to render. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The MobyGames API returns moby_score on a 0-10 scale and the backend stores it verbatim (handler/metadata/moby_handler.py), so a score of 5.5 was rendering as "5.5%" instead of "55%". v1 applies the same multiplier in Details/Title.vue, as does the mock library generator. This reverses 781e4ff, whose premise that the backend already returns 0-100 scores is not borne out by the recorded API responses in the MobyGames cassettes. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

Description
Ratings are an important part of a game's information because they help users quickly gauge its overall quality and community reception. Making ratings more visible allows users to assess a game at a glance, compare titles more easily, and make more informed decisions about what to play.
Changes:
Formatting Maintained:
Testing
Screenshots