Skip to content

fix(results-page): empty input history with zen mode (@byseif21)#7622

Open
byseif21 wants to merge 3 commits intomonkeytypegame:masterfrom
byseif21:fix/input-history-zen
Open

fix(results-page): empty input history with zen mode (@byseif21)#7622
byseif21 wants to merge 3 commits intomonkeytypegame:masterfrom
byseif21:fix/input-history-zen

Conversation

@byseif21
Copy link
Contributor

@byseif21 byseif21 commented Mar 10, 2026

fix some issue in input history in zen mode test

  • the results history render empty entries because the code still tried to read target words
  • always shows wpm infinity for last words

Copilot AI review requested due to automatic review settings March 10, 2026 22:56
@monkeytypegeorge monkeytypegeorge added the frontend User interface or web stuff label Mar 10, 2026
@github-actions github-actions bot added the waiting for review Pull requests that require a review before continuing label Mar 10, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes results-page word history rendering when TestWords.words.get(i) is missing (notably in zen mode), preventing failures when building per-word history UI.

Changes:

  • Default missing TestWords.words.get(i) to "" while building results word history.
  • Remove redundant ?? "" at character-splitting callsite by guaranteeing word is always a string.
Comments suppressed due to low confidence (1)

frontend/src/ts/test/test-ui.ts:1332

  • containsKorean check is wrong when input is undefined: input?.match(...) returns undefined, and undefined !== null becomes true, so containsKorean can be true even with no input. Use a boolean cast instead (e.g. Boolean((input ?? "").match(re)) / re.test(input ?? "")) and drop the now-unnecessary optional chain on word since it’s always a string here.
    const containsKorean =
      input?.match(
        /[\uac00-\ud7af]|[\u1100-\u11ff]|[\u3130-\u318f]|[\ua960-\ua97f]|[\ud7b0-\ud7ff]/g,
      ) !== null ||
      word?.match(

 it is per-word and caused Infinite tooltips on last few words with zen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend User interface or web stuff waiting for review Pull requests that require a review before continuing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants