brackt/app/routes/leagues
Chris Parsons 7294084c13
Refactor draft grid sports calculation and improve type safety (#16)
* Fix flex pick count using unique sports drafted, not total season sports

The flex count was calculated as `totalPicks - totalSportsInSeason`, which
always returned 0 when a team drafted multiple participants from the same
sport (e.g. 2 picks from UEFA Champions League with 2 sports in season =
2 - 2 = 0). Now uses the number of unique sports the team has actually
drafted from, so 2 picks in 1 sport correctly shows 1 flex used.

https://claude.ai/code/session_01DZ6jqgZTDEmJucanBtRCtM

* Code review fixes for TeamsDraftedGrid and draft route

- Fix misleading early-return message: "No picks have been made yet" only
  fires when there are no sports configured, so update to say "No sports
  have been configured for this season."
- Remove unused draftOrder and team.seasonId from TeamsDraftedGrid props
- Replace availableParticipants prop with sports prop to eliminate
  duplicate sports derivation; route already computes seasonSportsData
- Add alphabetical sort to seasonSportsData so ordering is consistent
- Fix availableParticipants: any[] in loader — restructure to ternary so
  TypeScript infers the Drizzle select type directly
- Remove any annotation from seasonSportsData forEach callback (now typed)
- Fix teamSportPicks.indexOf(pick) O(n) re-scan — use map callback index i

https://claude.ai/code/session_01DZ6jqgZTDEmJucanBtRCtM

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-02-20 21:26:27 -08:00
..
__tests__ feat: Add comprehensive scoring system database schema 2025-10-28 23:40:11 -07:00
$leagueId.draft-board.$seasonId.tsx Redesign to dark-mode-only with navy palette and accent colors (#13) 2026-02-20 19:26:11 -08:00
$leagueId.draft.$seasonId.tsx Refactor draft grid sports calculation and improve type safety (#16) 2026-02-20 21:26:27 -08:00
$leagueId.server.ts feat: add recharts library and implement PointProgressionChart component for historical views 2025-11-14 21:18:34 -08:00
$leagueId.settings.tsx Redesign to dark-mode-only with navy palette and accent colors (#13) 2026-02-20 19:26:11 -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 feat: add FIFA World Cup 48-team bracket template with group stage and projected scoring 2026-02-14 22:30:12 -08:00
$leagueId.tsx Redesign to dark-mode-only with navy palette and accent colors (#13) 2026-02-20 19:26:11 -08:00
new.tsx Add implementation plan for commissioner-without-team feature (#6) 2026-02-20 08:45:09 -08:00