Let the game explain itself

Game-log chips gain explanation-on-demand tooltips, while the recording script learns to demonstrate the game it claims to show.

The game log already recorded words, spawned fruit, and eaten fruit, but it still expected the player to remember why each event mattered. Every chip is now a button with an explanation attached: word chips show their score calculation, spawn chips explain the combo and its value, and eaten fruit names the combo that created it. The log remains compact until someone asks for the detail.

Explanation on demand#

This extends the earlier decision to teach combos where they happen. The new question was whether to put more text directly in the log, open a detached help surface, or anchor an overlay to the thing being explained. Anchored tooltips won because the connection stays visible without turning a short history into a wall of formulas and descriptions. They also gave the agent one reusable component and one content builder, with localized output shared across word, spawn, and fruit events.

The test that clicked outside the test suite#

The implementation was developed test-first, and 1,195 unit and component tests passed, but the final smoke test in headless Chromium still found a real gap. Escape and typing did not dismiss the tooltip because the listeners were attached to document, while the game dispatches keyboard events at window. Moving the listeners up fixed both the direct events and ordinary bubbled interactions. That is the useful distinction here: the tests proved the content and component states, while smoke testing proved that the component lived correctly inside this application.

The tooltip was correct in isolation and wrong in the place where a player would use it.

Make the recording play honestly#

The scripted gameplay recorder had a similar credibility problem. It could reproduce combos, but some scripts used uninteresting two-letter words and steered away from an apple sitting nearby. The dry-run gate now rejects scripted words shorter than four letters, and the daily trace predicts the real apple queue offline so the planned route can detour through one. Daily recordings also run in both light and dark themes by default, using identical moves so the two clips can transition without changing the play underneath.

Two ways to demand evidence#

These changes serve different audiences, but they apply the same standard. A score should reveal the values that produced it, a fruit should reveal why it exists, and a marketing recording should visibly play the mechanic it claims to demonstrate. The next step is to reuse the tooltip foundation where the fruit itself appears on the board, and to keep tightening the recorder until its scripted player behaves like a plausible one rather than a cursor following a route.