Repository navigation
Rank best Nth-placed teams across groups (World Cup style) - #48
Merged
Merged
Conversation
Adds the first phase of stage-to-stage advancement: a cross-group ranking of the teams finishing just below the automatic qualification spots (e.g. the best third-placed teams), opt-in per stage via config.best_placed_count. - BestPlacedCalculator ranks each group's Nth-placed row across groups by points, goal difference, then goals for (h2h is meaningless across groups, matching FIFA/UEFA cross-group rules) - Stage page shows the ranking with a qualifying cut-line when enabled - Create/Edit stage forms gain "Advance per group" and "Best-placed qualifiers" fields for grouped formats - Ranked position derives from advances_count + 1 (default 3rd) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The best-placed ranking card sits below all the group tables, so an admin enabling it saw no visible change in the standings themselves. Group tables now draw World Cup style qualification zones: - top advances_count rows (automatic qualifiers): volt highlight - the best-placed candidate row: amber highlight - zones only appear when the stage sets advances_count, so tables without a qualification cut keep the plain leader highlight Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jul 19, 2026
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
Phase ① of World Cup–style advancement: a cross-group ranking of best Nth-placed teams (e.g. the third-place table used by the World Cup, Euro, and AFCON to fill knockout spots), opt-in per stage via
config.best_placed_count.BestPlacedCalculatortakes each group's Nth-placed row (computed by the existing per-group standings calculator, so in-group tiebreakers incl. head-to-head still apply) and ranks them across groups by points → goal difference → goals for → name. Head-to-head is deliberately excluded across groups — the teams never met — matching FIFA/UEFA cross-group rules.best_placed_countis configured.advances_count) and Best-placed qualifiers fields for grouped formats.advances_count + 1(default 3rd). Groups too small to have an Nth place are skipped.Next phases (separate PRs): entrant slot descriptors on knockout stages,
SeedStageFromGroupswith admin confirm + draw mode, best-thirds allocation tables.Testing
🤖 Generated with Claude Code