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

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.
This commit is contained in:
Ilia Denisov
2026-06-19 12:12:53 +02:00
parent 0dd4099d68
commit d0681c5efe
2 changed files with 7 additions and 4 deletions
+2 -2
View File
@@ -107,7 +107,7 @@ describe('placementFromHint', () => {
});
describe('previewFromHint', () => {
it('reuses the hint move as a legal preview, carrying score, words and direction', () => {
it('reuses the hint move as a legal preview, lower-casing words to match evaluate', () => {
const preview = previewFromHint({
player: 0,
action: 'play',
@@ -120,7 +120,7 @@ describe('previewFromHint', () => {
score: 18,
total: 42,
});
expect(preview).toEqual({ legal: true, score: 18, words: ['CAT', 'AN'], dir: 'V' });
expect(preview).toEqual({ legal: true, score: 18, words: ['cat', 'an'], dir: 'V' });
});
});