Commit graph

2 commits

Author SHA1 Message Date
Chris Parsons
172302cad6 Fix snake draft Discord pick numbering and small UX tweaks
Some checks failed
🚀 Deploy / 🧪 Test (pull_request) Successful in 1m36s
🚀 Deploy / ʦ TypeScript (pull_request) Failing after 1m16s
🚀 Deploy / 🔍 Lint (pull_request) Successful in 48s
🚀 Deploy / 🐳 Build (pull_request) Has been skipped
🚀 Deploy / 🚀 Deploy (pull_request) Has been skipped
- Discord pick notifications now show the sequential pick-in-round
  (e.g. "Round 2, Pick 9") rather than the snake-adjusted slot position
  ("Round 2, Pick 5") — fixes confusing numbers on even rounds
- Remove unused pickInRound param from notifyPickMadeOnDiscord; add
  regression test for the 13-team snake draft case
- League name in draft-in-progress card is now a link to the league
  homepage alongside the existing Enter Draft button
- Overnight pause cell label shortened to "🌙 Pause" (resumesAt line
  below it already provides the time context)
- Queue and recent picks items use bg-card instead of bg-muted for
  better visual separation from the panel background

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 21:01:05 -07:00
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