Commit Graph
10 Commits
Author SHA1 Message Date
joshuaandClaude Opus 5.5 1410c0fa13 Move scoreboard visibility controls to a full-width bar
The toggle lived in the right-hand column, which drops below the scoring
grid on windows narrower than 1280px, so it was off screen. It now sits
directly under the title at every width.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 15:08:47 +02:00
joshuaandClaude Opus 5.5 da09f59b2a Phase 6: scoreboard visibility toggle and reveal mode
- setVisibility: visible / frozen / hidden. Freezing snapshots the scores
  on the server with the same engine the scoreboard uses; freezing twice
  keeps the original snapshot.
- Reveal mode: start, reveal next (last place first, one click per team),
  finish (sets visible) and cancel. The host sees who is next; the
  scoreboard plays a visual drum-roll for teams revealed while watching.
- H cycles visibility in the control room.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 14:58:32 +02:00
joshuaandClaude Opus 5.5 f7122b193c Phase 5: control room with direct scoring, bonuses and shortcuts
- /admin/events/[eventId]/live: game list with status, previous/next,
  mark done/reopen, scoring grid, standings, and bonus/penalty with undo.
- Scores autosave per cell with optimistic UI; the validate_score trigger
  and RLS do the checking so a save costs one DB round trip.
- BlockInput and NumberStepper are shared UI, ready for the judge page.
- buildLiveView shapes all data on the server from the scoring engine, so
  the client components contain no score math.
- N / P switch games, ? shows shortcut help.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 14:48:41 +02:00
joshuaandClaude Opus 5.5 17eb76d036 Phase 4: scoreboard page, public API and realtime refresh
- buildScoreboardPayload is the single place deciding what the public may
  see: visible, frozen (snapshot scores, live current game), hidden (no
  scores, alphabetical) and reveal (unrevealed teams carry no score/order).
- GET /api/public/scoreboard/[token] validates the token, then loads the
  event with the service client in one parallel round trip.
- notify() pings sb/admin/game channels over Realtime's REST endpoint with
  no data; useRefreshChannel refetches immediately on a ping, throttles
  bursts, and falls back to a 10s poll, focus and reconnect.
- /s/[token]: FLIP rank animation, count-up totals, reduced motion,
  fullscreen, cursor hide and a connection indicator.
- Admin setup actions now notify, so renames and reorders show up live.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 14:19:03 +02:00
joshuaandClaude Opus 5.5 b60c9db4f4 Phase 3: admin magic-link auth and event setup screens
- /login sends a Supabase magic link (admin emails only); /auth/confirm
  completes sign-in; proxy.ts guards /admin and every server action
  re-checks with requireAdmin(), since actions are plain POST endpoints.
- /admin lists, creates, duplicates and deletes events.
- /admin/events/[eventId] edits teams (colour, order) and games with
  criteria, presets and notes. All input goes through zod schemas that
  mirror the database constraints so errors read as plain sentences.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 13:47:36 +02:00
joshuaandClaude Opus 5.5 0c66e9b80e Ignore the coverage report in ESLint
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 13:33:42 +02:00
joshuaandClaude Opus 5.5 84dfe6a54b Phase 2: scoring engine with full branch coverage
Pure functions in src/lib/scoring implementing docs/SCORING.md: cell values
(override > judge average), weighted raw totals, raw and placement points
with tie averaging, and competition-ranked standings. Coverage thresholds
are enforced at 100% for the module. Also silences the hydration warning
caused by browser extensions modifying <html>.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 13:33:21 +02:00
joshuaandClaude Opus 5.5 bc8e4f3f5a Phase 1: generate database types and type the Supabase clients
Types are generated from the live database's API schema by
scripts/gen-types.mjs (npm run gen:types), in the same shape as
supabase gen types, so no Supabase CLI login is needed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 13:20:31 +02:00
joshuaandClaude Opus 5.5 b134f87326 Phase 1: token schemas and anon RLS check script
tokens.ts validates link tokens (32 hex chars) before any DB query.
check:rls proves the anon key cannot read or insert on any table, and
fails loudly if the migration has not been applied.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 12:49:53 +02:00
joshuaandClaude Opus 5.5 c89a82295b Phase 0: scaffold Next.js, Tailwind tokens, Supabase clients, env validation
Next.js 16 App Router with strict TypeScript, Tailwind 4 theme tokens from
docs/UI.md, Vitest, and the three Supabase clients. Env vars are validated
with zod in next.config.ts so dev and build fail fast with a readable error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 12:27:11 +02:00