Thoughts

1 thought of type "observation" about "Database Management" in the last 90 days

Tat-Tally Session 45A Complete (2026-03-15): Scoring Modes & Display Overhaul, Phase A (Database + Admin Settings) This is the first of three phases in a major feature build for the Tattoo Contest System (Tat-Tally). The three features being added are: (1) scoring mode toggle (total vs averaged), (2) live leaderboard toggle (on/off with 5-second cycling), and (3) display layer overhaul with three display types and per-judge monitors. What was done in Phase A: - Created migration `add_event_settings_scoring_displays` adding 3 new event-level columns: `scoring_mode` (enum: averaged/total), `live_leaderboard` (boolean), `judge_display_mode` (enum: per_judge/condensed) - Widened `entries.final_score` from numeric(4,1) to numeric(6,1) to support total mode (e.g., 10 criteria x 5 judges = max 500.0) - Updated the `update_entry_final_score()` Postgres trigger to check the event's scoring_mode and calculate sum vs avg accordingly - Added `recalculate_event_scores(p_event_id)` function for recalculating all scores when admin changes scoring mode mid-event - Updated `v_leaderboard` view to include `scoring_mode` column (joined through events table) - Built admin Event Settings page (`src/admin/src/pages/event-settings.tsx`) with scoring mode dropdown, live leaderboard toggle switch, and judge display mode selector. Includes a confirmation dialog when changing scoring mode (warns about recalculation). - Created shared scoring utilities at `src/shared/src/scoring.ts`: formatScore(), getMaxPossible(), scoreLabel(), scoreSummaryLabel() - Regenerated TypeScript types from Supabase, synced to all 7 database.types.ts files - All 6 apps pass tsc --noEmit Design doc with full behavioral specs: `docs/brainstorm-scoring-and-displays.md` Remaining phases: - Phase B (Display Layer Overhaul): useEventSettings hook, main display tally/leaderboard cycling, category display scorecard flash sequences, per-judge display with condensed mode, ScoreReveal and LeaderboardTable component updates - Phase C (Entrant App + Edge Function): Update get-portal Edge Function for per-judge breakdowns, entrant portal full scorecard display, constants tuning Project location: ~/Library/Mobile Documents/com~apple~CloudDocs/Projects/Apps/TattooContestSystem/ Supabase project ID: ovdtlcpgeydtgjnsxtqk All progress tracked in PROJECT-TRACKER.md