fix(ui): highlight the word the engine played, not the run it abuts #291

Merged
developer merged 1 commits from fix/offline-highlight-direction into development 2026-07-27 21:46:33 +00:00

1 Commits

Author SHA1 Message Date
Ilia Denisov 27e19e82bd fix(ui): highlight the word the engine played, not the run it abuts
CI / changes (pull_request) Successful in 3s
CI / unit (pull_request) Has been skipped
CI / integration (pull_request) Has been skipped
CI / ui (pull_request) Successful in 1m20s
CI / conformance (pull_request) Successful in 10s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m58s
The board's green highlight re-derived the play's orientation itself
("the longer run wins"), while the engine settles a lone staged tile
under the single-word rule through the validator, because its two
orientations can differ in legality. A vertical play that merely abuts a
longer horizontal word therefore greened that horizontal run — a word
the play does not form — and anchored the score badge on it, while the
caption, the score and the committed move all stayed correct.

formedGeometry now takes the orientation from the preview, which every
preview source already carries (EvalResult.dir: the on-device evaluator,
the network evaluate and a reused hint), and no longer infers it. The
rule, not the transport, is the trigger, so this fixes online one-word
games as well as offline ones.

A differential test now walks random positions, asks the engine port for
every legal play it can find, and asserts the highlighted cells are
exactly the cells of the words the engine says that play forms.
2026-07-27 23:32:59 +02:00