Urgent.News

What's breaking now, across thousands of outlets.

Tech

The board came back. The highlights lied.

I ship Codenames AI , a web game. Each game mode keeps its own save in localStorage . Reload the tab, switch to a different mode, come back later: the board, turn, clue history, and in-progress results all come back. That felt like a win until I added spymaster clue targeting. While drafting a clue, I can click cards on my team. Those clicks sync the clue count and show which words I had in mind.…

The web game Codenames AI retains game data such as the board, turn, clue history, and in-progress results upon reload. However, when switching game modes, previously highlighted cards persisted in memory and remained lit even if the user had not clicked them. This caused confusion as the UI falsely suggested the user had intended those cards.

Clearing highlights when the board changed would stop this misinformation. To resolve the issue, per-mode persistence of clicks was needed, treating a thinking aid similarly to a move. This change raised the question of whether reloading should restore those clicks at all. Google Docs' autosave default of preserving a document when reloaded influenced this decision.

While highlighting a card or typing a clue should persist, AI-generated clues and targets should not. The snapshot type needed to reflect what the product accepts as true truth, not what was merely displayed. The restoration process should clear drafting poses and restore the saved game, ensuring no leftover thinking aids persist into the next turn.

Testing the behavior of coming back to a saved game was crucial, rather than just verifying the save loaded correctly. The persistence boundary lies in semantics, not architecture.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

More from Friday 4 September →