fix(results-page): empty input history with zen mode (@byseif21)#7622
Open
byseif21 wants to merge 3 commits intomonkeytypegame:masterfrom
Open
fix(results-page): empty input history with zen mode (@byseif21)#7622byseif21 wants to merge 3 commits intomonkeytypegame:masterfrom
byseif21 wants to merge 3 commits intomonkeytypegame:masterfrom
Conversation
Contributor
There was a problem hiding this comment.
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 guaranteeingwordis always a string.
Comments suppressed due to low confidence (1)
frontend/src/ts/test/test-ui.ts:1332
containsKoreancheck is wrong wheninputisundefined:input?.match(...)returnsundefined, andundefined !== nullbecomestrue, socontainsKoreancan 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 onwordsince 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix some issue in input history in zen mode test