perf(ui): reuse hint result as move preview, skip redundant evaluate #85

Merged
developer merged 2 commits from feature/hint-preview-reuse into development 2026-06-19 10:18:14 +00:00
Owner

Taking a hint auto-placed the tiles then re-validated them via a debounced evaluate — duplicate engine work and a visible disabled→enabled flicker on the submit button over slow links. The hint is the engine's own top-ranked, fully scored legal move, so its move already carries the score/words/dir an evaluate returns.

Seed preview directly from the hint move (previewFromHint) and cancel any pending evaluate timer; a later manual edit re-arms recompute() so rearranged tiles are re-evaluated as before. Client-only — no backend, wire or schema change.

Local: pnpm check 0 err, test:unit 286 pass (incl. new previewFromHint), build ok, test:e2e 150 pass.

Taking a hint auto-placed the tiles then re-validated them via a debounced `evaluate` — duplicate engine work and a visible disabled→enabled flicker on the submit button over slow links. The hint is the engine's own top-ranked, fully scored legal move, so its `move` already carries the `score`/`words`/`dir` an `evaluate` returns. Seed `preview` directly from the hint move (`previewFromHint`) and cancel any pending evaluate timer; a later manual edit re-arms `recompute()` so rearranged tiles are re-evaluated as before. Client-only — no backend, wire or schema change. Local: `pnpm check` 0 err, `test:unit` 286 pass (incl. new `previewFromHint`), `build` ok, `test:e2e` 150 pass.
developer added 1 commit 2026-06-19 10:03:40 +00:00
perf(ui): reuse hint result as move preview, skip redundant evaluate
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Has been skipped
CI / integration (pull_request) Has been skipped
CI / ui (pull_request) Successful in 53s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m9s
0dd4099d68
Taking a hint auto-placed the suggested tiles and then called recompute(),
which round-trips a debounced evaluate for that exact placement. The hint is
the engine's own top-ranked, fully scored legal move, so its move already
carries the score, words and direction an evaluate would return — the second
call was pure duplicate work and added a visible disabled->enabled flicker on
the submit button over slow links.

Seed the move preview directly from the hint move via previewFromHint and
cancel any pending evaluate timer so a stale one cannot clobber it. A later
manual edit re-arms recompute() as before, so rearranged tiles are re-evaluated
normally. Client-only; no backend, wire or schema change.
developer added 1 commit 2026-06-19 10:12:55 +00:00
fix(ui): lower-case hint preview words to match evaluate
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Has been skipped
CI / integration (pull_request) Has been skipped
CI / ui (pull_request) Successful in 52s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 2m20s
d0681c5efe
A hint's MoveRecord words are upper-cased on decode (for the move-history view),
whereas an EvalResult keeps the backend's lower case. Seeding the move preview
from the hint verbatim flipped the score caption to upper case and nudged its
height. Lower-case the words in previewFromHint so the caption reads the same
as the evaluate path it replaces.
owner approved these changes 2026-06-19 10:17:44 +00:00
developer merged commit 0eb1e0ef47 into development 2026-06-19 10:18:14 +00:00
developer deleted branch feature/hint-preview-reuse 2026-06-19 10:18:14 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: developer/scrabble-game#85