brackt/app/components/ui
Chris Parsons 285981ab9d
Improve draft room UX with better error handling and UI refinements (#17)
* Remove pause/resume controls when draft is complete, rename Live to Connected

- Hide Pause/Resume Draft buttons when isDraftComplete is true
- Change 'Live' status indicator to 'Connected' in both draft room and draft board views

https://claude.ai/code/session_01AUaKzx465NrY29Qv6MVwjC

* Fix code review issues in draft room: security, bugs, and quality

Security:
- Fix inconsistent commissioner check: draft.start, force-autopick, force-manual-pick,
  and make-pick all now query the commissioners table instead of league.createdBy,
  so co-commissioners have consistent access to all draft controls

Bugs:
- canPick now includes !isPaused so the UI correctly blocks picks during a pause
- isDraftComplete initial state now covers 'completed' season status, not just 'active'
- Guard JSON.parse in queue.reorder.ts with try/catch to return 400 instead of 500

Code quality:
- Add error handling (try/catch + toast) to handlePauseDraft, handleResumeDraft,
  handleRemoveFromQueue, and handleReorderQueue
- Replace alert() with toast.error() in handleMakePick, handleForceAutopick,
  handleForceManualPick for consistent UX
- Memoize filteredParticipants with useMemo to avoid recomputing on every render
- Replace custom force-pick dialog div with ShadCN Dialog component for proper
  keyboard support (Escape to close, focus trap, accessible markup); add dialog.tsx
- Remove console.log debug statements from socket event handlers and API routes
- Replace (global as any).__socketIO with getSocketIO() across all API routes
- Replace window.location.reload() in handleStartDraft with useRevalidator

https://claude.ai/code/session_01AUaKzx465NrY29Qv6MVwjC

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-02-20 21:50:27 -08:00
..
accordion.tsx feat: Integrate accordion component for sidebar and update autodraft settings to sync with props 2025-10-25 10:04:21 -07:00
alert-dialog.tsx feat: add commissioner model and league management features 2025-10-11 00:29:04 -07:00
badge.tsx feat: add admin routes and checkbox component for sports management 2025-10-12 21:54:49 -07:00
button.tsx feat: add fantasy league schema and new league routes 2025-10-11 00:07:39 -07:00
calendar.tsx feat: add draft date/time selection to league creation and settings 2025-10-15 22:02:21 -07:00
card.tsx feat: add fantasy league schema and new league routes 2025-10-11 00:07:39 -07:00
checkbox.tsx feat: add admin routes and checkbox component for sports management 2025-10-12 21:54:49 -07:00
collapsible.tsx feat: Implement draft room redesign with collapsible sidebar and tabbed content 2025-10-25 03:23:41 -07:00
context-menu.tsx feat: add draft API routes and implement draft room pick controls 2025-10-18 14:55:26 -07:00
dialog.tsx Improve draft room UX with better error handling and UI refinements (#17) 2026-02-20 21:50:27 -08:00
input.tsx feat: add fantasy league schema and new league routes 2025-10-11 00:07:39 -07:00
label.tsx feat: add fantasy league schema and new league routes 2025-10-11 00:07:39 -07:00
navigation-menu.tsx feat: add theme system with dark mode support and navbar component 2025-10-10 23:30:26 -07:00
popover.tsx feat: add draft date/time selection to league creation and settings 2025-10-15 22:02:21 -07:00
radio-group.tsx feat: add sports selection and team management to league settings 2025-10-13 19:59:34 -07:00
select.tsx feat: add fantasy league schema and new league routes 2025-10-11 00:07:39 -07:00
sheet.tsx feat: add theme system with dark mode support and navbar component 2025-10-10 23:30:26 -07:00
sonner.tsx feat: add commissioner model and league management features 2025-10-11 00:29:04 -07:00
switch.tsx feat: add autodraft status and team connection indicators to draft grid 2025-10-21 23:22:17 -07:00
table.tsx feat: add admin routes and checkbox component for sports management 2025-10-12 21:54:49 -07:00
tabs.tsx feat: Implement draft room redesign with collapsible sidebar and tabbed content 2025-10-25 03:23:41 -07:00
textarea.tsx feat: add admin routes and checkbox component for sports management 2025-10-12 21:54:49 -07:00