brackt/app/components/league
Chris Parsons fbcecb490e
Add Discord draft pick announcements (#460)
* Add Discord draft pick announcements

Posts a message to the league Discord webhook each time a pick is made, announcing the picked participant and pinging the next team on the clock if their owner has opted into Discord notifications. Enabled via a separate toggle in league settings (independent from standings update notifications).

https://claude.ai/code/session_01Tvwsv3LfL9JUqxoLct8dTn

* Address code review feedback on Discord pick announcements

- Fix "on the clock" timing: read currentPickNumber fresh from DB post-autodraft-chain (matches sendOnTheClockEmail guarantee)
- Remove outer try/catch from notifyPickMadeOnDiscord so callers' .catch() is not dead code
- Add missing draft-discord.server.test.ts with 12 tests covering all early-exit and happy paths
- Fix silent empty-string fallback for missing pickedSlot: warn and skip instead
- Eliminate sequential season→league DB queries by accepting leagueId as a direct param
- Show "save webhook URL to configure options" hint when URL is typed but not yet saved
- Remove block-scope braces at both call sites (plain const declarations)
- Remove redundant "Round N, Pick M" description line (title already carries this info)
- Inline pickInRoundFor helper to avoid circular import with draft-utils

https://claude.ai/code/session_01Tvwsv3LfL9JUqxoLct8dTn

* Fix lint errors from review fixes

- Remove unused logger import (no longer needed after removing try/catch)
- Remove unused OWNER_ID constant in test fixture
- Use toSorted() instead of sort() in sendDraftOrderNotification

https://claude.ai/code/session_01Tvwsv3LfL9JUqxoLct8dTn

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-05-20 19:55:48 -07:00
..
__tests__ Improve draft info panel formatting (#428) 2026-05-14 23:42:04 -07:00
settings Add Discord draft pick announcements (#460) 2026-05-20 19:55:48 -07:00
CommissionersPanel.stories.tsx Migrate auth from Clerk to BetterAuth (#354) 2026-04-29 10:03:50 -07:00
CommissionersPanel.tsx Migrate auth from Clerk to BetterAuth (#354) 2026-04-29 10:03:50 -07:00
CreateLeagueCard.stories.tsx New design (#309) 2026-04-23 13:14:55 -07:00
CreateLeagueCard.tsx New design (#309) 2026-04-23 13:14:55 -07:00
DraftInfoCard.stories.tsx New design (#309) 2026-04-23 13:14:55 -07:00
DraftInfoCard.tsx Rename queue page to Set Pre-Draft Queue, remove VORP, fix re-add race condition (#436) 2026-05-15 18:47:36 -07:00
DraftSpeedPicker.stories.tsx Extract reusable league wizard components; wire settings page (#350) 2026-04-28 22:24:13 -07:00
DraftSpeedPicker.tsx Extract chess clock presets to shared constant (#432) 2026-05-15 14:02:49 -07:00
LeagueAvatar.stories.tsx Add Storybook stories for new components from staged changes (#321) 2026-04-23 22:09:25 -07:00
LeagueAvatar.tsx Add Storybook stories for new components from staged changes (#321) 2026-04-23 22:09:25 -07:00
LeagueRow.stories.tsx New design (#309) 2026-04-23 13:14:55 -07:00
LeagueRow.tsx Show commish-only leagues in a separate dashboard section, fixes #336 (#412) 2026-05-11 23:57:04 -07:00
MyLeaguesCard.stories.tsx New design (#309) 2026-04-23 13:14:55 -07:00
MyLeaguesCard.tsx Show commish-only leagues in a separate dashboard section, fixes #336 (#412) 2026-05-11 23:57:04 -07:00
OvernightPauseSettings.stories.tsx Extract reusable league wizard components; wire settings page (#350) 2026-04-28 22:24:13 -07:00
OvernightPauseSettings.tsx fix: resolve all 48 WCAG 2.2 AA accessibility issues (#439) 2026-05-17 20:11:38 -07:00
ReviewSection.stories.tsx Extract reusable league wizard components; wire settings page (#350) 2026-04-28 22:24:13 -07:00
ReviewSection.tsx Extract reusable league wizard components; wire settings page (#350) 2026-04-28 22:24:13 -07:00
ScoringPresetPicker.stories.tsx Extract reusable league wizard components; wire settings page (#350) 2026-04-28 22:24:13 -07:00
ScoringPresetPicker.tsx fix: resolve all 48 WCAG 2.2 AA accessibility issues (#439) 2026-05-17 20:11:38 -07:00
SportIcon.stories.tsx Extract reusable league wizard components; wire settings page (#350) 2026-04-28 22:24:13 -07:00
SportIcon.tsx Extract reusable league wizard components; wire settings page (#350) 2026-04-28 22:24:13 -07:00
SportsSeasonsSummary.stories.tsx New design (#309) 2026-04-23 13:14:55 -07:00
SportsSeasonsSummary.tsx Use sport icons in league views (#394) 2026-05-07 23:06:49 -07:00
StandingsPreview.stories.tsx New design (#309) 2026-04-23 13:14:55 -07:00
StandingsPreview.tsx Fix avatar display bugs in navbar, standings, and draft views (#387) 2026-05-06 17:03:34 -07:00
StatHelpers.tsx Add opencode oxlint plugin and UI refinements (#323) 2026-04-24 11:11:20 -07:00
StepperInput.stories.tsx Extract reusable league wizard components; wire settings page (#350) 2026-04-28 22:24:13 -07:00
StepperInput.tsx Extract reusable league wizard components; wire settings page (#350) 2026-04-28 22:24:13 -07:00
TeamsPanel.stories.tsx New design (#309) 2026-04-23 13:14:55 -07:00
TeamsPanel.tsx Add Storybook stories for new components from staged changes (#321) 2026-04-23 22:09:25 -07:00
TimerModeSelector.stories.tsx Extract reusable league wizard components; wire settings page (#350) 2026-04-28 22:24:13 -07:00
TimerModeSelector.tsx fix: resolve all 48 WCAG 2.2 AA accessibility issues (#439) 2026-05-17 20:11:38 -07:00
TimezonePromptBanner.tsx Add overnight pause for draft timers (#335) 2026-04-26 22:31:52 -07:00
TimezoneSelect.tsx Add overnight pause for draft timers (#335) 2026-04-26 22:31:52 -07:00
WizardAuthForm.stories.tsx Extract reusable league wizard components; wire settings page (#350) 2026-04-28 22:24:13 -07:00
WizardAuthForm.tsx Extract reusable league wizard components; wire settings page (#350) 2026-04-28 22:24:13 -07:00
WizardStepper.stories.tsx Extract reusable league wizard components; wire settings page (#350) 2026-04-28 22:24:13 -07:00
WizardStepper.tsx fix: resolve all 48 WCAG 2.2 AA accessibility issues (#439) 2026-05-17 20:11:38 -07:00