theme_guess/frontend/src/game
Gabriel Franco 36b2725498 fix(frontend): share one ThemeGuessGame instance across solo/matchmaking/rooms
ThemeGuessGame's constructor permanently binds click/mousemove/document
listeners onto the single shared #code-canvas/#category-panel. Solo,
matchmaking, and private-room flows each independently constructed their
own instance, so using more than one mode in the same page load (e.g.
Solo then Find Match) left multiple instances double-bound to the same
DOM, corrupting whichever mode was used first.

Add game/sharedGame.ts: a single lazily-constructed instance, reused via
setTheme/setSnippet and now-mutable onCategoryAssigned across every
flow. main.ts, matchmakingFlow.ts, and privateRoomFlow.ts now call
getSharedGame() instead of `new ThemeGuessGame(...)`.

Verified via CDP DOMDebugger.getEventListeners against a live session:
exactly one click/mousemove listener on #code-canvas after playing a
Solo round followed by a real matched Matchmaking round in the same
page load (previously would have been two of each).
2026-09-10 14:31:59 -03:00
..
botMatch.ts feat(frontend): wire bot engine into solo-vs-bot split-view match 2026-09-10 12:40:54 -03:00
layoutConstants.ts refactor(frontend): move to frontend/, port to Vite + TypeScript 2026-09-10 10:37:44 -03:00
multiplayerMatch.ts feat(frontend): add private room UI flow (create/join/repeat) 2026-09-10 14:07:20 -03:00
opponentView.ts feat(frontend): add in-match split-view opponent progress pane 2026-09-10 12:03:42 -03:00
panelView.ts refactor(frontend): move to frontend/, port to Vite + TypeScript 2026-09-10 10:37:44 -03:00
renderer.ts feat(frontend): add in-match split-view opponent progress pane 2026-09-10 12:03:42 -03:00
resultView.ts feat(frontend): add in-match orchestrator and multiplayer scoreboard 2026-09-10 12:16:15 -03:00
scoring.ts refactor(frontend): move to frontend/, port to Vite + TypeScript 2026-09-10 10:37:44 -03:00
sharedGame.ts fix(frontend): share one ThemeGuessGame instance across solo/matchmaking/rooms 2026-09-10 14:31:59 -03:00
ThemeGuessGame.ts fix(frontend): share one ThemeGuessGame instance across solo/matchmaking/rooms 2026-09-10 14:31:59 -03:00
timerHud.ts feat(frontend): add in-match orchestrator and multiplayer scoreboard 2026-09-10 12:16:15 -03:00