brackt/app/components
Chris Parsons 1bf65e33f7
Add commish right-click context menus to MiniDraftGrid team headers (#327)
* Add commish right-click context menus to MiniDraftGrid team headers

Adds onAdjustTimeBankOpen and onSetAutodraftOpen props to MiniDraftGrid
so the last-two-rounds display on the Participants tab shows the same
"Adjust Time Bank…" / "Set Autodraft…" context menu on right-click that
the full Draft Board already exposes. Also passes those callbacks from
the route's miniDraftGrid useMemo so they are wired up for commissioners.

https://claude.ai/code/session_017JCShLVs9xZ6FZmyrUFaE1

* Address all code review issues for draft room context menus

Layout bug: flex-1 min-w-20 was nested inside headerInner instead of the
direct flex-child wrapper in MiniDraftGrid, breaking equal column sizing.
Fixed by moving the classes to the outermost element in both the menu and
non-menu paths (matching DraftGridSection's pattern).

MiniDraftGrid improvements:
- Hoist hasHeaderMenu constant above the draftSlots.map() loop
- Add optional connectedTeams prop; disconnected teams render italic +
  muted-foreground, consistent with DraftGridSection
- connectedTeams now wired through the route's miniDraftGrid useMemo

DraftGridSection interface:
- Make onForceAutopick and onForceManualPickOpen optional (?) to match
  every other commissioner callback; add null checks at all three call
  sites (context menu, mobile MoreVertical button, mobile Sheet)
- Gate those two callbacks behind isCommissioner at the route level

Tests (new files):
- app/components/__tests__/MiniDraftGrid.test.tsx — covers layout classes,
  connected/disconnected styling, and all four context menu interactions
- app/components/__tests__/DraftGridSection.test.tsx — covers all three
  context menu surfaces for both commissioner and non-commissioner roles

Storybook: add CommissionerView and DisconnectedTeams stories to
MiniDraftGrid.stories.tsx

https://claude.ai/code/session_017JCShLVs9xZ6FZmyrUFaE1

* Move hasHeaderMenu out of IIFE into component body

Computing it before the return statement is the right place since it only
depends on props, not loop variables. Removes the IIFE entirely and fixes
the indentation of the map callback body.

https://claude.ai/code/session_017JCShLVs9xZ6FZmyrUFaE1

* Mock HTMLElement.scrollTo in test setup

jsdom does not implement scrollTo on elements, causing any component that
calls element.scrollTo() (e.g. MiniDraftGrid's scroll-to-current-cell
effect) to throw in unit tests.

https://claude.ai/code/session_017JCShLVs9xZ6FZmyrUFaE1

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-04-25 07:42:43 -07:00
..
__tests__ Add commish right-click context menus to MiniDraftGrid team headers (#327) 2026-04-25 07:42:43 -07:00
draft Add commish right-click context menus to MiniDraftGrid team headers (#327) 2026-04-25 07:42:43 -07:00
league Add opencode oxlint plugin and UI refinements (#323) 2026-04-24 11:11:20 -07:00
marketing Add Storybook stories for new components from staged changes (#321) 2026-04-23 22:09:25 -07:00
scoring Add Storybook stories for new components from staged changes (#321) 2026-04-23 22:09:25 -07:00
sport-season New design (#309) 2026-04-23 13:14:55 -07:00
sports Display upcoming matches (#141) 2026-03-12 10:12:38 -07:00
standings Add Storybook stories for new components from staged changes (#321) 2026-04-23 22:09:25 -07:00
ui Add Storybook stories for new components from staged changes (#321) 2026-04-23 22:09:25 -07:00
AutodraftSettings.tsx New design (#309) 2026-04-23 13:14:55 -07:00
BatchResultEntry.tsx feat: batch qualifying results entry (#290) 2026-04-12 14:52:22 -07:00
DraftGrid.tsx New design (#309) 2026-04-23 13:14:55 -07:00
DraftSidebar.tsx New design (#309) 2026-04-23 13:14:55 -07:00
navbar.tsx Migrate authentication from Clerk to BetterAuth (#324) 2026-04-24 22:00:49 -07:00
NavigationProgress.tsx Add NProgress navigation progress bar (#139) 2026-03-11 22:02:48 -07:00
NotificationSettings.tsx New design (#309) 2026-04-23 13:14:55 -07:00
ParticipantSelector.tsx feat: Add ParticipantSelector component for improved participant selection in brackets 2025-11-08 21:36:29 -08:00
StandingsTable.tsx Show tied ranks with T prefix across standings and Discord (#239) 2026-03-27 20:45:15 -07:00
TeamAvatar.stories.tsx Add Storybook stories for new components from staged changes (#321) 2026-04-23 22:09:25 -07:00
TeamAvatar.tsx Add Storybook stories for new components from staged changes (#321) 2026-04-23 22:09:25 -07:00
UserMenu.tsx Migrate authentication from Clerk to BetterAuth (#324) 2026-04-24 22:00:49 -07:00