Codenames AI Dev Fixes Bug Where Stale Card Highlights Leaked Across Game Modes
A developer building Codenames AI, a browser-based word game, discovered that spymaster targeting highlights — used to visually mark intended clue targets — were persisting incorrectly when players switched between game modes. Because each mode loads its own 25-card board, leftover highlights from a previous mode could illuminate cards the player had never actually selected, making the UI misleading. The root cause was treating temporary drafting UI state the same as committed game state during session restoration via localStorage. The fix established a clear rule: saved snapshots restore confirmed game state such as the board, turn, and clue history, while drafting aids like target highlights and unsubmitted AI clues are always cleared on reload or mode switch. This distinction — persisting what the product has accepted as true rather than everything the UI last held — now governs how the game handles both manual and AI-generated drafting state.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in