Skip to content

fix(stats): pluralize the platform game count and lift meta legibility - #4065

Merged
gantoine merged 1 commit into
masterfrom
fix/server-stats-legibility
Aug 2, 2026
Merged

fix(stats): pluralize the platform game count and lift meta legibility#4065
gantoine merged 1 commit into
masterfrom
fix/server-stats-legibility

Conversation

@gantoine

@gantoine gantoine commented Aug 2, 2026

Copy link
Copy Markdown
Member

Description

Fixes #4057 — the four Server Stats nits from the issue, all in the v2 PlatformsStatsSection.

  1. 1 games1 game. settings.platform-count-games was interpolated without a plural choice. It now passes the count as vue-i18n's choice index, and every locale gained the plural forms its existing collection.games-count sibling already uses (including the 4-form Czech rule registered in locales/index.ts; locales without numeral agreement — hu, tr, ja, ko, zh — mirror their sibling's repeated form).

  2. The separator dot is now visible. It was a · character at 12px in --r-color-fg-faint (0.25 alpha in dark). It's drawn as a 4px circle in --r-color-fg-muted instead, and carries aria-hidden so screen readers skip it.

  3. The size percentage moved off the faint tier to --r-color-fg-muted, same readability complaint.

  4. The region +N / - toggle is now an outlined button, matching the region chips it sits next to (surface fill, --r-color-border-strong, hover state). It also picked up title / aria-label ("Show more regions" / "Show fewer regions") and aria-expanded — it previously had no accessible name at all. The collapse glyph is a proper minus sign rather than a hyphen.

  5. The coverage tooltip spells out what the number means: IGDB: 159 / 227IGDB matches: 159 / 227, via a translated key instead of an inline template literal.

Three new keys (platform-metadata-matches, platform-regions-show-more, platform-regions-show-less) are translated across all 18 locales.

Testing

PlatformsStatsSection.test.ts previously mocked t to echo the key, which cannot exercise plural selection. It now mounts with a real createI18n over the actual en_US/settings.json, plus a new case asserting a one-game platform renders 1 game next to a six-game one rendering 6 games.

Verified with vitest (20 passed), vue-tsc, trunk check, both i18n scripts, npm run build, and a Playwright pass over a preview build against a real library in both dark and light themes — confirming 1 game, the new tooltips, and the outlined toggle in its expanded and collapsed states.

AI assistance disclosure

This change was written with AI assistance (Claude Code / Claude Opus 5). The AI produced the component and locale changes, the added test, and this description; I reviewed them and the verification runs above. The non-English translations were AI-generated following each locale's existing terminology in the same files — native-speaker review is welcome, particularly for the plural forms.

Checklist

  • I've tested the changes locally
  • I've updated relevant comments
  • I've assigned reviewers for this PR
  • I've added unit tests that cover the changes

Screenshots (if applicable)

Captured against a real library in both themes; happy to attach on request.

Server Stats rendered "1 games" for a single-game platform, and the row
meta line leaned on the faint foreground tier: the middot separator, the
size percentage and the region expand toggle all sat at the edge of
readability.

- Pass the count as vue-i18n's plural choice and give every locale the
  plural forms its `collection.games-count` sibling already uses.
- Draw the separator as a 4px dot in the muted tier instead of a thin
  middot glyph, and move the size percentage off the faint tier.
- Outline the region expand/collapse control so it reads as a button,
  and label it for screen readers.
- Spell out the coverage tooltip as "IGDB matches: 159 / 227".

Fixes #4057

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings August 2, 2026 16:19
@greptile-apps

greptile-apps Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR improves the v2 platform statistics display by pluralizing game counts, clarifying metadata coverage, increasing visual contrast, and making the region toggle accessible.

  • Adds localized plural forms and accessibility labels across all 18 supported locales.
  • Replaces faint text separators with visible decorative dots and improves metadata contrast.
  • Adds an outlined, named region-expansion control with aria-expanded.
  • Uses real vue-i18n messages in the component test and verifies singular and plural English counts.

Confidence Score: 5/5

The PR appears safe to merge, with no concrete blocking or independently actionable non-blocking defects identified.

The component changes consistently use the new translations, preserve existing data behavior, improve accessibility and contrast, and add focused coverage for the corrected English plural rendering.

Reviews (1): Last reviewed commit: "fix(stats): pluralize the platform game ..." | Re-trigger Greptile

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses the UX and i18n nits in the v2 Settings server stats (PlatformsStatsSection), improving correctness of game-count pluralization, readability of metadata/region separators and percentages, and accessibility/clarity of tooltips and the region expand-collapse control.

Changes:

  • Updated settings.platform-count-games usage to pass vue-i18n plural choice index, and expanded all locale values to plural-form strings.
  • Improved UI legibility by replacing the middot separator glyph with a rendered dot, lifting faint text to a stronger token, and restyling the regions toggle as an outlined button with accessible labeling.
  • Added a unit test that mounts with real vue-i18n messages to validate singular vs plural rendering.

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated no comments.

Show a summary per file
File Description
frontend/src/v2/components/Settings/PlatformsStatsSection.vue Pluralization fix, clearer tooltip text via i18n key, improved separator rendering, and accessible outlined regions toggle.
frontend/src/v2/components/Settings/PlatformsStatsSection.test.ts Uses real createI18n messages and adds a singular/plural assertion for game counts.
frontend/src/locales/bg_BG/settings.json Adds plural forms and new tooltip/toggle strings for platform stats.
frontend/src/locales/cs_CZ/settings.json Adds plural forms (4-form) and new tooltip/toggle strings for platform stats.
frontend/src/locales/de_DE/settings.json Adds plural forms and new tooltip/toggle strings for platform stats.
frontend/src/locales/en_GB/settings.json Adds plural forms and new tooltip/toggle strings for platform stats.
frontend/src/locales/en_US/settings.json Adds plural forms and new tooltip/toggle strings for platform stats.
frontend/src/locales/es_ES/settings.json Adds new tooltip/toggle strings for platform stats.
frontend/src/locales/fr_FR/settings.json Adds plural forms and new tooltip/toggle strings for platform stats.
frontend/src/locales/hu_HU/settings.json Adds plural forms and new tooltip/toggle strings for platform stats.
frontend/src/locales/it_IT/settings.json Adds plural forms and new tooltip/toggle strings for platform stats.
frontend/src/locales/ja_JP/settings.json Adds plural forms and new tooltip/toggle strings for platform stats.
frontend/src/locales/ko_KR/settings.json Adds plural forms and new tooltip/toggle strings for platform stats.
frontend/src/locales/pl_PL/settings.json Adds plural forms (3-form) and new tooltip/toggle strings for platform stats.
frontend/src/locales/pt_BR/settings.json Adds plural forms and new tooltip/toggle strings for platform stats.
frontend/src/locales/ro_RO/settings.json Adds plural forms and new tooltip/toggle strings for platform stats.
frontend/src/locales/ru_RU/settings.json Adds plural forms and new tooltip/toggle strings for platform stats.
frontend/src/locales/tr_TR/settings.json Adds plural forms and new tooltip/toggle strings for platform stats.
frontend/src/locales/zh_CN/settings.json Adds plural forms and new tooltip/toggle strings for platform stats.
frontend/src/locales/zh_TW/settings.json Adds plural forms and new tooltip/toggle strings for platform stats.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gantoine
gantoine merged commit e7c2362 into master Aug 2, 2026
15 checks passed
@gantoine
gantoine deleted the fix/server-stats-legibility branch August 2, 2026 18:04
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.

[UI/UX] Missing singular/plural in server stats

2 participants