brackt/app
Chris Parsons c5ccee2225
Show events on multiple dates when games span requested date range (#254)
* Fix admin Games to Score panel missing bracket events

The panel was silently dropping bracket events in two cases:

1. When a bracket event had `scoringEvents.eventDate` set to a future
   round date (e.g. "April 5") but an individual game's `scheduledAt`
   was today, the old dedup code picked `eventDate` first and the
   component filter `displayDate === today` never matched.

2. When an event had games on both today and tomorrow, whichever row
   the unordered step-1 query returned first "won" — potentially hiding
   a today game from the today tab entirely.

Fix: replace the `Map<id, firstDate>` deduplication with
`Map<id, Set<date>>` that collects every requested date an event
qualifies for (via either `eventDate` or `gameDate`). The return uses
`flatMap` to emit one entry per (event, date) pair, so events with
games on multiple days now appear correctly in both tabs.

https://claude.ai/code/session_01QkFxCF4xmKjdVCNPysWDML

* Fix lint errors: replace .sort() with .toSorted() and remove non-null assertion

- Replace Array#sort() with Array#toSorted() in two places (unicorn rule)
- Remove non-null assertion on Map#get(); use early continue instead

https://claude.ai/code/session_01QkFxCF4xmKjdVCNPysWDML

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-04-01 13:39:03 -07:00
..
components Initial storybook components. 2026-03-29 22:09:45 -07:00
contexts feat: implement middleware and context provider for Express integration 2025-10-11 20:56:00 -07:00
hooks Fix oxlint errors. 2026-03-22 20:41:44 -07:00
lib Add PDC World Darts Championship simulator with Elo-based bracket (#248) 2026-03-31 15:37:28 -07:00
models Show events on multiple dates when games span requested date range (#254) 2026-04-01 13:39:03 -07:00
routes Auto-eliminate non-group participants on group generation (#250) 2026-04-01 00:40:55 -07:00
services Fix noisy and broken tests. 2026-03-31 15:53:43 -07:00
test Add oxlint linting setup with zero errors (#194) 2026-03-21 09:44:05 -07:00
types Redesign standings page with sortable table, 7-day change, and chart repositioned (#205) 2026-03-22 11:05:13 -07:00
utils Add oxlint linting setup with zero errors (#194) 2026-03-21 09:44:05 -07:00
welcome Redesign to dark-mode-only with navy palette and accent colors (#13) 2026-02-20 19:26:11 -08:00
app.css Add NProgress navigation progress bar (#139) 2026-03-11 22:02:48 -07:00
entry.client.tsx Filter unnecessary sentry css and js errors. 2026-03-15 10:24:57 -07:00
entry.server.tsx Replace console.* with structured logger, fix no-inferrable-types (closes #98) (#199) 2026-03-21 13:41:39 -07:00
root.tsx Add NProgress navigation progress bar (#139) 2026-03-11 22:02:48 -07:00
routes.ts Add PDC World Darts Championship simulator with Elo-based bracket (#248) 2026-03-31 15:37:28 -07:00