- blindtest is only available with >=3 players AND >=2 humans (a bot can't be DJ):
lobby gate + tooltips updated, and server game:start rejects otherwise
- new botDifficulty setting (easy/normal/hard) drives how often bots answer
correctly (quiz + blindtest who-added / title-artist); host picks it in the
lobby when at least one bot is present
Verified e2e: blindtest start rejected with 1 human + 2 bots (NEED_THREE).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- server-side bot players (isBot): host adds/removes them in the lobby
(lobby:addBot / lobby:removeBot), capped at 8 players
- bots auto-vote each round: GameRound.botAnswer generates a plausible answer
(quiz ~50% right, blindtest guesses a random player / title); engine schedules
the votes within the answer window and triggers early end when all have voted
- bots are never DJ (pickDj excludes them) and are excluded from the blindtest
track-submission gate (they don't submit)
- snapshot players carry `bot`; lobby shows a 🤖 marker + add/remove controls
Verified e2e: 2 bots added, they vote, game ends with all 3 players scored
and rounds end early.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- room:leave event: removes the player from the room (not just disconnected),
reassigns host if the host leaves, deletes the room when empty
- store leaveRoom() emits it and clears the session (reset)
- room header gets a "Quitter" button (always available); end-screen "Quitter"
now also leaves cleanly
Verified e2e: leaver removed from snapshot, host reassigned to the next player.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- each player gets a reconnectToken; room:create/join return it
- new room:rejoin event: re-attaches the existing player (by id+token) to the
new socket, broadcasts player:rejoined + room:state, and resyncs the current
round to that socket (engine.resync re-emits round:start with their view)
- client persists the session (roomCode/playerId/token/name) in localStorage;
bootstraps the store from it and auto-rejoins on every socket connect;
clears it on reset/quit or failed rejoin
Verified e2e: wrong token rejected, correct token re-attaches (player present
+ connected).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- settings carry `categories` (empty = all); quiz/image pool filters by category
(DB + in-code bank), threaded through prepareQuizForRoom/loadGroup/loadQuizPool
- public GET /api/categories lists available categories
- lobby: category chips (Toutes + each), shown when quiz/images is active
- shared: RoomSettings.categories + UpdateSettingsPayload
Verified e2e: /api/categories returns the list; filtering by ["Pokémon"] serves
only Pokémon questions.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- image_reveal display: larger, object-contain (whole image up to 58vh), no crop
- image prompt optional in back-office (defaults to "Qui est-ce ?"), overridable
- mixed mode reworked: select "Mixte" then toggle sub-modes (Quiz/Images/
Blindtest). Blindtest sub-mode locked under 3 players; mixed itself no longer
needs 3. Server quiz pool formats derived from gameType + mixedModes.
shared: MixMode + RoomSettings.mixedModes (default quiz+image).
- DB: prompt uniqueness is now a partial index (excludes image_reveal) + unique
index on image_url; lets many images share the generic prompt, dedup by URL.
- seed: db:seed:images pulls Pokémon (PokéAPI) as image_reveal questions with
official artwork (remote URL) + FR/EN accepted answers; idempotent by image_url.
Verified: migration applied, Pokémon seed inserts FR+EN, image mode serves only
image_reveal, all checks green (23 tests).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- blindtest/mixed: the host can't start until every connected player has
submitted their track quota — client disables the button with a hint, and
game:start rejects with TRACKS_PENDING (authoritative)
- tracks-per-player is now a number stepper (− / + buttons + free typing,
clamped 1..10) instead of fixed 1/2/3 buttons
Verified e2e: start rejected while a player hasn't submitted, accepted once all did.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Restructure onboarding (option B):
- home is just Create / Join (code) — no name field
- name is chosen in the room: room:create/join no longer require a name;
new player:setName event. Nameless players are hidden from the snapshot
(players/scores/submissions) and excluded from eligible voters and the
3-player blindtest gate until they pick a pseudo.
- PseudoScreen with live DiceBear avatar preview gates RoomPage until set
- /join/:code auto-joins then redirects to the room (seamless invite links)
- RoomCode gains a "copier le lien" button (origin/join/CODE)
Verified e2e: nameless players excluded from the room until setName.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Return to lobby (replay without recreating the room):
- lobby:return (host): reset to lobby, scores to 0, keep players + tracks
- client: end screen has "Rejouer" (host) + "Quitter"; store clears transient
game state whenever the room goes back to lobby
Contributor has nothing to input:
- round:start carries a private `mine: true` to the contributor only (via
RoundStart.secretPlayerId targeted emit); they're excluded from eligible
voters. Client shows a "fais-les se tromper" card instead of the vote form.
Editable track submission:
- submitTrack ack returns trackId + youtubeId; new blindtest:removeTrack
- lobby shows submitted tracks as cards (YouTube thumbnail + title) with delete
Verified e2e (3 players): add/remove, private mine flag, return-to-lobby reset.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- DJ is now the track's contributor (controls their own song); their identity
is sent only to them so "who added" stays non-trivial. The contributor
doesn't vote and is excluded from the eligible-voters count.
- Scoring: the contributor earns nothing except in who_added/mixed, where they
get a misdirection bonus (50) per player who guesses the wrong adder.
- Blindtest (and mixed) require >= 3 connected players: lobby disables the
options with a hint, and game:start rejects with NEED_THREE.
- Player card is now 16:9 and full width — the video banner shows at reveal;
DJ gets a seek bar (current/duration) to jump anywhere, plus play/pause/restart.
- Mixed game order is shuffled (no predictable quiz/blindtest alternation).
Verified e2e (3 players): guard rejects at 2, DJ id hidden from others,
misdirection scoring correct. 23 tests pass.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Drizzle (postgres-js) setup: schema (quiz_category, quiz_question,
quiz_played, game_history), client (nullable — no DATABASE_URL → null),
drizzle.config, initial migration, migrate script
- Open Trivia DB seed: curated geek categories, mcq + truefalse, base64
decode (incl. type/difficulty), 1 req/5s rate limit, idempotent
(prompt unique); also seeds the FR in-code bank as source 'manual'
- quiz wired to the DB: per-room pool preloaded at game start (loadQuizPool
excludes already-played), records quiz_played for cross-session
anti-repeat; falls back to the in-code bank when no DB
- docker-compose for local Postgres; db:* scripts; DATABASE_URL in env
Roadmap V1 step 5. Verified against a real Postgres: migrate + seed (270
OpenTDB + 10 manual), DB-backed game serves OpenTDB questions and fills
quiz_played; no-DB fallback still serves the in-code bank.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>