Skip to content

feat(stats): explain PPR, MPR & checkout terms to newcomers#721

Merged
mathrb merged 1 commit into
mainfrom
feat/stats-term-glossary
Jul 3, 2026
Merged

feat(stats): explain PPR, MPR & checkout terms to newcomers#721
mathrb merged 1 commit into
mainfrom
feat/stats-term-glossary

Conversation

@mathrb

@mathrb mathrb commented Jul 3, 2026

Copy link
Copy Markdown
Owner

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 AlertDialog with 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:

  • Statistics page (X01 + Cricket detail tables) → StatsTableWidget
  • Game-recap page — top summary and the per-leg drill-down → PostGameStatsBreakdown

An optional StatTerm? term on StatsTableDataRow / PostGameBreakdownRow selects the tappable render path; rows without a term are unchanged.

New reusable glossary component (lib/core/glossary/)

  • StatTerm enum + l10n extension (title/body)
  • showStatGlossaryDialog() — reuses the existing confirm-dialog pattern
  • GlossaryTermLabel — label + ⓘ, Semantics(button: true), kinetic-splash InkWell

Localization

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

  • New glossary_term_label_test.dart: renders the icon, exposes button semantics, and tapping opens the localized definition dialog.
  • Existing table/page tests unchanged and green (non-termed rows keep the plain-Text path).
  • flutter test — all 2199 pass · flutter analyze --no-fatal-infos — clean.

Closes #719.

🤖 Generated with Claude Code

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>
@mathrb

mathrb commented Jul 3, 2026

Copy link
Copy Markdown
Owner Author

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

🤖 Generated with Claude Code

@mathrb mathrb merged commit c9f8f7c into main Jul 3, 2026
2 checks passed
@mathrb mathrb deleted the feat/stats-term-glossary branch July 3, 2026 14:30
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.

[Feature]: Explain statistics terms (PPR, MPR, checkout %) to newcomers

1 participant