brackt/app/components/ui
Chris Parsons e5295812f6
Formalize simulator system with manifest, input-policy, runner, and admin UI (#409)
Introduces three new schema tables (simulator_profiles,
sports_season_simulator_configs, season_participant_simulator_inputs),
a central model layer (app/models/simulator.ts), and a single runner
entry point so every simulator run follows the same prepare → simulate
→ persist → snapshot → recalculate flow.

Key additions:
- manifest.ts: per-simulator display names, default configs, required/
  optional inputs, derivable-input declarations, and setup sections
- input-policy.ts: resolves sourceElo from projectedWins,
  projectedTablePoints, or sourceOdds; resolves ratings from sourceOdds;
  supports block / fallbackElo / averageKnown / worstKnownMinus strategies
- runner.ts: single entry point for admin simulation runs; materialises
  derived inputs, normalises result columns, zeroes omitted participants,
  snapshots EVs, and recalculates linked fantasy standings
- /admin/simulators: inventory page with per-season readiness and bulk run
- /admin/sports-seasons/:id/simulator: per-season setup page with readiness
  summary, input-policy editor, raw JSON config override, and CSV bulk input
- NCAAM/NCAAW simulators now read ratings from season_participant_simulator_inputs,
  falling back to the hardcoded name-keyed maps while DB data is being populated
- Clone flow copies simulator config by default; volatile inputs (odds, Elo)
  only copied when explicitly requested

Code-review fixes included in this commit:
- source field in compatibility bridge checked with !== null instead of !== undefined
- sourceEloRequirementLabel no longer appends "configured fallback" when the
  participant is already excluded from all resolved sources
- Duplicate inline label maps in input-policy.ts replaced with simulatorInputLabel
- save-config preserves existing inputPolicy when the submitted JSON omits it
- Input table truncation label added (Showing 20 of N)
- CSV description notes values must not contain commas
- N+1 comment added to listSportsSeasonSimulatorSummaries
- assertRegistrySchemaDriftFree called in manifest tests
- Runner test suite added covering happy path, already-running guard,
  readiness failure, empty results, and error recovery with status reset

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 21:09:53 -07:00
..
__tests__ Harden sport icon cleanup (#397) 2026-05-08 21:19:09 -07: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
AvatarEditor.tsx Fix avatar display bugs in navbar, standings, and draft views (#387) 2026-05-06 17:03:34 -07:00
AvatarUploader.tsx Add Cloudinary-backed avatar system (#385) 2026-05-06 14:47:37 -07:00
badge.tsx feat: add admin routes and checkbox component for sports management 2025-10-12 21:54:49 -07:00
BracktGradients.tsx Add Storybook stories for new components from staged changes (#321) 2026-04-23 22:09:25 -07:00
button.stories.tsx Initial storybook components. 2026-03-29 22:09:45 -07:00
button.tsx Add Storybook stories for new components from staged changes (#321) 2026-04-23 22:09:25 -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 Add Storybook stories for new components from staged changes (#321) 2026-04-23 22:09:25 -07:00
checkbox.stories.tsx Initial storybook components. 2026-03-29 22:09:45 -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
FlagBuilder.stories.tsx Add Cloudinary-backed avatar system (#385) 2026-05-06 14:47:37 -07:00
FlagBuilder.tsx Add Cloudinary-backed avatar system (#385) 2026-05-06 14:47:37 -07:00
FlagSvg.stories.tsx Add Cloudinary-backed avatar system (#385) 2026-05-06 14:47:37 -07:00
FlagSvg.tsx Improve flag config validation and remove settings completion tracking (#390) 2026-05-07 10:09:45 -07:00
GradientIcon.tsx New design (#309) 2026-04-23 13:14:55 -07: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
SectionCardHeader.tsx New design (#309) 2026-04-23 13:14:55 -07:00
select.tsx Formalize simulator system with manifest, input-policy, runner, and admin UI (#409) 2026-05-11 21:09:53 -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
SportIconUploader.tsx Harden sport icon cleanup (#397) 2026-05-08 21:19:09 -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
team-name-display.tsx Display team owner names in standings views (#184) 2026-03-19 20:19:28 -07:00
team-owner-badge.stories.tsx Add Storybook stories for new components from staged changes (#321) 2026-04-23 22:09:25 -07:00
team-owner-badge.tsx Add Storybook stories for new components from staged changes (#321) 2026-04-23 22:09:25 -07:00
textarea.tsx feat: add admin routes and checkbox component for sports management 2025-10-12 21:54:49 -07:00
UserAvatar.stories.tsx Add Cloudinary-backed avatar system (#385) 2026-05-06 14:47:37 -07:00
UserAvatar.tsx Add Cloudinary-backed avatar system (#385) 2026-05-06 14:47:37 -07:00