feat(stats): explain PPR, MPR & checkout terms to newcomers#721
Merged
Conversation
Newcomers meet opaque darts jargon (PPR, MPR, Checkout %, Checkout score) most densely on the statistics screen and the end-of-game recap, with no in-app way to learn what they mean (#719). Add a reusable glossary component: a StatTerm enum resolving localized title/body, a showStatGlossaryDialog helper (AlertDialog), and a GlossaryTermLabel that renders the label plus a trailing info glyph and opens the definition on tap (Semantics button + kinetic splash). Both display surfaces funnel through two shared row widgets, so an optional StatTerm on StatsTableDataRow / PostGameBreakdownRow wires the affordance into every tabular location at once — stats page (X01 + Cricket), the game-recap breakdown, and the per-leg drill-down. Rows without a term are unchanged. Adds 8 localized keys (title + body x 4 terms) across all 7 locales. UI-only: no game events, projections, or persistence touched. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Owner
Author
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. 🤖 Generated with Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Makes the four opaque stat terms — PPR, MPR, Checkout %, Checkout score — tappable so newcomers can read a plain-language definition (#719). Each term now shows a trailing ⓘ glyph in the accent colour; tapping opens an
AlertDialogwith the definition.Approach
Both target surfaces funnel through just two shared rendering widgets, so the affordance is wired into those two spots and covers every tabular location at once:
StatsTableWidgetPostGameStatsBreakdownAn optional
StatTerm? termonStatsTableDataRow/PostGameBreakdownRowselects the tappable render path; rows without a term are unchanged.New reusable glossary component (
lib/core/glossary/)StatTermenum + l10n extension (title/body)showStatGlossaryDialog()— reuses the existing confirm-dialog patternGlossaryTermLabel— label + ⓘ,Semantics(button: true), kinetic-splashInkWellLocalization
8 new keys (title + body × 4 terms) across all 7 locales. Darts jargon localized per language (turn-of-3-darts = volée / Aufnahme / beurt / …; PPR/MPR/checkout kept as loanwords, matching the existing stat-label keys).
Scope
UI-only — no game events, no projection changes, no DB/persistence impact. Excluded (cramped/awkward tap targets, noted in the plan): the winner hero card, opponent mini-stats, and the PPR trend-chart legend/tooltip. The pre-existing hardcoded
'PPR'/'MPR'label strings are left as-is (separate label-i18n concern).Tests
glossary_term_label_test.dart: renders the icon, exposes button semantics, and tapping opens the localized definition dialog.Textpath).flutter test— all 2199 pass ·flutter analyze --no-fatal-infos— clean.Closes #719.
🤖 Generated with Claude Code