brackt/app/routes/leagues
Chris Parsons 16aa450d63
feat: proactively prune ineligible queue items after each pick (#59)
After every pick, recalculate draft eligibility for all teams and
remove any queued participants whose sport is no longer eligible
(e.g. a team queued a snooker player but just filled their last flex
slot). Previously this was only caught lazily when autodraft fired,
which could pause the draft or pick an unwanted player.

- Add getAllQueuesForSeason to draft-queue.ts — fetches all queue rows
  for a season in one query (Map<teamId, QueueItem[]>) instead of N+1
  per-team queries
- Add pruneIneligibleQueueItems to draft-utils.ts — uses Promise.all
  for the four required data fetches, collects ineligible items in a
  single loop pass, warns on orphaned participant references
- Call from both pick paths: executeAutoPick and draft.make-pick.ts
- Emit queue-eligibility-pruned socket event per affected team so the
  client updates the queue UI in real time
- Add 5 tests covering: single ineligible removal, all eligible (no-op),
  empty queues (no delete called, getTeamQueue never called), mixed
  queue (only ineligible item removed), and unknown participant (warn)

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-02 22:07:22 -08:00
..
__tests__ fix: guard against stale revalidation overwriting fresh socket data 2026-03-01 12:23:24 -08:00
$leagueId.draft-board.$seasonId.tsx Claude/fix pick timer ghll n (#29) 2026-02-22 19:29:29 -08:00
$leagueId.draft.$seasonId.tsx feat: proactively prune ineligible queue items after each pick (#59) 2026-03-02 22:07:22 -08:00
$leagueId.server.ts Claude/fix pick timer ghll n (#29) 2026-02-22 19:29:29 -08:00
$leagueId.settings.tsx fix: address code review issues from draft board scrolling and team creation changes (#35) 2026-02-24 10:01:27 -08:00
$leagueId.sports-seasons.$sportsSeasonId.server.ts Fix sports season page 404 when sports season is linked to multiple leagues (#10) 2026-02-20 11:35:35 -08:00
$leagueId.sports-seasons.$sportsSeasonId.tsx feat: Add routes and components for sports season display, including playoff brackets and standings 2025-11-12 23:44:33 -08:00
$leagueId.standings.$seasonId.teams.$teamId.tsx feat: Implement team breakdown pages with detailed score breakdown 2025-11-14 20:01:21 -08:00
$leagueId.standings.$seasonId.tsx Claude/fix pick timer ghll n (#29) 2026-02-22 19:29:29 -08:00
$leagueId.tsx feat: show live draft alert banner on league page (#42) 2026-02-27 23:00:42 -08:00
new.tsx Add implementation plan for commissioner-without-team feature (#6) 2026-02-20 08:45:09 -08:00