[pull] master from monkeytypegame:master#658
Merged
pull[bot] merged 3 commits intoUncodedtech:masterfrom Sep 19, 2025
Merged
Conversation
) ### Description 1. refactor: - store (language direction / state of direction reversing funbox) in test-state.ts, and set them on `TestLogic.init()` which is called on each restart which happens on each change of Config.language or funbox. - use these new direction variables in (caret.ts / test-ui.ts / pace-caret.ts /result-word-highlight.ts) instead of calling `await JSONData.getCurrentLanguage(Config.language)`. 2. css changes: - add `unicode-bidi: bidi-override;` to .words with ligatures in backwards to fix the direction of LTR words on LTR languages in custom tests (which now have `.withLigatures` class regardless of language). - remove `direction: rtl;` from right to left .word and keep it on right to left #words. This was done because after adding the above `bidi-override`, (.word)s directioin was being forced to rtl on tests with RTL language and RTL words (custom and none custom tests), which is wrong (should be ltr on those tests because of the backwards funbox). - P.S., removing this from .word does not affect normal tests, because .word direction is inherited from #words directtion on non .withLigatures tests (e.g, non custom tests in non withLigatures languages), and it is calculated using internal browser algorithm based on characters used in .withLigatures tests (tests in languages with ligatures and all custom tests). 3. add the property "reverseDirection" to backwards funbox, which signifies that the direction of the test should be the reverse of the direction of Config.language, and the direction of a word should be the reverse of `Strings.isWordRightToLeft()`. 4. allow backwards funbox to work on languages with ligatures. 5. move `void Caret.updatePosition()` call to after the call of `TestUI.lineJump()` in `input-controller.ts:handleSpace()`. 6. change name of `Strings.getWordDirection()` to `Strings.isWordRightToLeft()` which explains what does the returned boolean mean, and add a parameter `reverseDirection` that flips the final result if true. --------- Co-authored-by: Miodec <jack@monkeytype.com>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )