brackt/app
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
..
components Refactor draft grid sports calculation and improve type safety (#16) 2026-02-20 21:26:27 -08:00
contexts feat: implement middleware and context provider for Express integration 2025-10-11 20:56:00 -07:00
hooks Add browser push notifications toggle to draft page (#11) 2026-02-20 19:30:53 -08:00
lib Add browser push notifications toggle to draft page (#11) 2026-02-20 19:30:53 -08:00
models Add Zod validation and expand export/import for EV and results data (#14) 2026-02-20 20:25:25 -08:00
routes Refactor draft grid sports calculation and improve type safety (#16) 2026-02-20 21:26:27 -08:00
services fix: correct test expectations for ICM edge cases and duplicate text queries 2026-02-17 14:24:07 -08:00
test feat: Add comprehensive scoring system database schema 2025-10-28 23:40:11 -07:00
types feat: add FIFA World Cup 48-team bracket template with group stage and projected scoring 2026-02-14 22:30:12 -08:00
utils Add Zod validation and expand export/import for EV and results data (#14) 2026-02-20 20:25:25 -08:00
welcome Redesign to dark-mode-only with navy palette and accent colors (#13) 2026-02-20 19:26:11 -08:00
app.css Redesign to dark-mode-only with navy palette and accent colors (#13) 2026-02-20 19:26:11 -08:00
root.tsx Redesign to dark-mode-only with navy palette and accent colors (#13) 2026-02-20 19:26:11 -08:00
routes.ts feat: implement sports season expected value calculations and probability updates 2025-11-21 22:05:50 -08:00