Fix qualifying-points notifications: full-field scoreboard + manual-set announcements #134

Merged
chrisp merged 1 commit from claude/qp-scoreboard-all-participants into main 2026-07-09 17:24:28 +00:00
Owner

What & why

Two related fixes to the qualifying-points (QP) Discord notification, based on reported behavior on Wimbledon.

1. Scoreboard sections show the full drafted field

Previously every section was scoped to participants whose QP changed this sync. That's right for Points Awarded and Knocked Out (the pinged "what just happened" sections), but the two scoreboard sections should read as a live standings snapshot:

  • Drafted Participants in Top 8 and Non-scoring Participants now draw from a new per-league scoreboard (every drafted participant), scoped to the sports season being announced so a golf pick can't surface in a tennis event.
  • Non-scoring is now a single compact Name (points, manager) line below Top 8, listing everyone not in the top 8 (the exact complement of the Top 8 filter).
  • Top 8 now requires qpTotal > 0 in addition to rank ≤ 8. Early in a season, competition ranking ties all winless players into a rank ≤ 8 band; a rank-only filter would flood the section with T5. Name — 0 QP rows.

2. Manually set bracket results now announce

Setting a match winner (e.g. a Wimbledon semifinal) wrote QP but sent no Discord message — only processQualifyingEvent notifies, and the manual paths called processQualifyingBracketEvent directly. The set-winner, set-round-winners, and complete-round paths now route through processQualifyingEvent. The tournament fan-out still skips the primary window via skipEventId, so mirror windows aren't double-posted. (reprocess-bracket stays silent — it's a data-correction tool.)

Tests

  • discord.test.ts: scoreboard-sourced Top 8/Non-scoring, compact non-scoring line, ordering, and a regression test that zero-QP players tied into the top-8 rank band stay out of Top 8.
  • qualifying-points-discord.server.test.ts: scoreboard carries the full drafted field even when entries is filtered, and cross-sport participants are excluded.
  • Full unit suite + npm run typecheck green.

🤖 Generated with Claude Code

## What & why Two related fixes to the qualifying-points (QP) Discord notification, based on reported behavior on Wimbledon. ### 1. Scoreboard sections show the full drafted field Previously every section was scoped to participants whose QP changed this sync. That's right for **Points Awarded** and **Knocked Out** (the pinged "what just happened" sections), but the two scoreboard sections should read as a live standings snapshot: - **Drafted Participants in Top 8** and **Non-scoring Participants** now draw from a new per-league `scoreboard` (every drafted participant), scoped to the sports season being announced so a golf pick can't surface in a tennis event. - **Non-scoring** is now a single compact `Name (points, manager)` line below Top 8, listing everyone not in the top 8 (the exact complement of the Top 8 filter). - **Top 8** now requires `qpTotal > 0` in addition to rank ≤ 8. Early in a season, competition ranking ties all winless players into a rank ≤ 8 band; a rank-only filter would flood the section with `T5. Name — 0 QP` rows. ### 2. Manually set bracket results now announce Setting a match winner (e.g. a Wimbledon semifinal) wrote QP but sent no Discord message — only `processQualifyingEvent` notifies, and the manual paths called `processQualifyingBracketEvent` directly. The **set-winner**, **set-round-winners**, and **complete-round** paths now route through `processQualifyingEvent`. The tournament fan-out still skips the primary window via `skipEventId`, so mirror windows aren't double-posted. (`reprocess-bracket` stays silent — it's a data-correction tool.) ## Tests - `discord.test.ts`: scoreboard-sourced Top 8/Non-scoring, compact non-scoring line, ordering, and a regression test that zero-QP players tied into the top-8 rank band stay out of Top 8. - `qualifying-points-discord.server.test.ts`: `scoreboard` carries the full drafted field even when `entries` is filtered, and cross-sport participants are excluded. - Full unit suite + `npm run typecheck` green. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
chrisp added 1 commit 2026-07-09 17:04:42 +00:00
Fix qualifying-points notifications: full-field scoreboard + manual-set announcements
All checks were successful
🚀 Deploy / 🧪 Test (pull_request) Successful in 2m58s
🚀 Deploy / ʦ🔍 Typecheck & Lint (pull_request) Successful in 1m19s
🚀 Deploy / 🐳 Build (pull_request) Has been skipped
🚀 Deploy / 🚀 Deploy (pull_request) Has been skipped
🚀 Deploy / 🧪 Test (push) Successful in 2m53s
🚀 Deploy / ʦ🔍 Typecheck & Lint (push) Successful in 1m23s
🚀 Deploy / 🐳 Build (push) Successful in 1m8s
🚀 Deploy / 🚀 Deploy (push) Successful in 12s
5d0363a309
The QP Discord embed's two "scoreboard" sections now reflect the whole drafted
field instead of only participants whose QP changed this sync:

- Non-scoring / Top 8 draw from a new per-league `scoreboard` (all drafted
  participants), scoped to the sports season being announced so a golf pick can't
  leak into a tennis event. Points Awarded / Knocked Out stay scoped to the sync's
  changes and remain the only pinged sections.
- Non-scoring is now a single compact "Name (points, manager)" line below Top 8,
  covering everyone not in the top 8 (the exact complement of the Top 8 filter).
- Top 8 requires qpTotal > 0 as well as rank <= 8, so early-season winless players
  tied into a low rank band no longer flood the section with "T5. Name — 0 QP".

Manually setting a bracket match result (e.g. a Wimbledon semifinal) now announces
the QP update. The set-winner / set-round-winners / complete-round paths route
through processQualifyingEvent (which snapshots, diffs, and notifies) instead of
processQualifyingBracketEvent (which scored silently). The tournament fan-out still
skips the primary window via skipEventId, so mirror windows aren't double-posted.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
chrisp merged commit 5d0363a309 into main 2026-07-09 17:24:28 +00:00
Sign in to join this conversation.
No description provided.