Add live group standings tab to the tournament page - #4
Merged
Conversation
Introduce a Groups | Standings | Knockout tab nav on the tournament page, modeled after the FIFA tournament-standings layout. The new Standings tab renders one FIFA-style table per group with P / W / D / L / GF / GA / GD / Pts, derived directly from finished match scores that the results importer already persists. Before any matches are played the table shows the same zeroed baseline as fifa.com. The view also exposes a Live results vs. My picks toggle for signed-in participants. The picks view reuses the table layout but populates only rank and team name, because predictions store finishing order, not score lines. No schema or API changes are required: the data this needs already lives in Match.homeScore, awayScore, status, and homeLabel/awayLabel. Standings derivation is a new pure utility (computeGroupStandings, computePredictedGroupStandings) with unit coverage for the empty, partial, full, draw, and tiebreaker cases. i18n keys land in en / es / pt / it / nl, using each language's canonical column abbreviations. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Summary
Adds a Groups | Standings | Knockout tab nav on the tournament page and a new Standings tab that mirrors the official FIFA standings layout — one FIFA-style table per group with P / W / D / L / GF / GA / GD / Pts, sorted by points → goal difference → goals for → team name.
The view exposes a Live results vs My picks toggle for signed-in participants. The picks view reuses the same table layout but only populates rank + team name (predictions store finishing order, not score lines).
No schema or API changes are required —
Match.homeScore,awayScore,status, andhomeLabel/awayLabelare already populated by the results importer.What changed
src/utils/standings.jscomputeGroupStandings(group, matches)— derives the 8-column FIFA-style row per teamcomputePredictedGroupStandings(group, prediction)— projects a user's first/second/third onto the same shapetests/standings.test.js— 9 unit cases (empty, partial, full, draw, tiebreakers, foreign matches, partial picks)src/pages/Tournament.jsxsrc/index.css— design-system styles for the view tabs, the standings toggle, and the per-group standings table (dark + light themes, responsive 1/2/3-column grid matching the groups grid)tournament.knockout,tournament.standingsViewActual,tournament.standingsViewPicks,tournament.standingsPicksNote,tournament.standingsEmpty, and thetournament.standingsTable.*column headers (short + full) added in en / es / pt / it / nl with each language's canonical sports abbreviations (PJ/G/E/P in Spanish, J/V/E/D in Portuguese, PG/V/N/P in Italian, GS/W/G/V in Dutch, P/W/D/L in English).IMPLEMENTATION_STATUS.mdandQA_CHECKLIST.mdupdated to reflect the new view.Test plan
npm run verify(lint + db:generate + db:validate + node --test + vite build) — all green locallynpm run import:resultsand confirm the table updatesMade with Cursor