Rename to diffrentiate between the predicate `isValid` and the element
`isValid`
Return `ValidationResult` instead of just a boolean
Update usage to the new format
Move config specific `resetIfEmpty` to the `ConfigInputOptions` type
### Description
The result chart burst axis maximum Y value needs to be updated after
adding the personal best line to keep the chart scale the same as the
wpm and raw lines.
### Checks
- [ ] Adding quotes?
- [ ] Make sure to include translations for the quotes in the
description (or another comment) so we can verify their content.
- [ ] Adding a language?
- Make sure to follow the [languages
documentation](https://github.com/monkeytypegame/monkeytype/blob/master/docs/LANGUAGES.md)
- [ ] Add language to `packages/schemas/src/languages.ts`
- [ ] Add language to exactly one group in
`frontend/src/ts/constants/languages.ts`
- [ ] Add language json file to `frontend/static/languages`
- [ ] Adding a theme?
- Make sure to follow the [themes
documentation](https://github.com/monkeytypegame/monkeytype/blob/master/docs/THEMES.md)
- [ ] Add theme to `packages/schemas/src/themes.ts`
- [ ] Add theme to `frontend/src/ts/constants/themes.ts`
- [ ] Add theme css file to `frontend/static/themes`
- [ ] Add some screenshot of the theme, especially with different test
settings (colorful, flip colors) to your pull request
- [ ] Adding a layout?
- [ ] Make sure to follow the [layouts
documentation](https://github.com/monkeytypegame/monkeytype/blob/master/docs/LAYOUTS.md)
- [ ] Add layout to `packages/schemas/src/layouts.ts`
- [ ] Add layout json file to `frontend/static/layouts`
- [ ] Adding a font?
- Make sure to follow the [themes
documentation](https://github.com/monkeytypegame/monkeytype/blob/master/docs/FONTS.md)
- [ ] Add font file to `frontend/static/webfonts`
- [ ] Add font to `packages/schemas/src/fonts.ts`
- [ ] Add font to `frontend/src/ts/constants/fonts.ts`
- [ ] Check if any open issues are related to this PR; if so, be sure to
tag them below.
- [x] Make sure the PR title follows the Conventional Commits standard.
(https://www.conventionalcommits.org for more info)
- [x] Make sure to include your GitHub username prefixed with @ inside
parentheses at the end of the PR title.
<!-- label(optional scope): pull request title (@your_github_username)
-->
<!-- I know I know they seem boring but please do them, they help us and
you will find out it also helps you.-->
Closes #
#6979
### 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>
steps to reproduce:
- set the browsers timezone with minus offset that is greater then the
current time utc (so new Date() will land on yesterday)
- the easiest way to do this is to open dev tools, sensors and add a
location with timezone `Pacific/Pago_Pago` which is UTC-11
- have a user with no activity for at least the last two days (utc)
- remember the last activity in the chart, e,g, August 8th has five
tests
- the last day on the chart is yesterday
- do a test
- graph now shows one activity for yesterday
- the remembered last activity is now shifted to e.g. August 7th with
five tests
fixed behaviour:
- same setup as before
- remember the last activity in the chart, e,g, August 8th has five
tests
- FIXED: the last day on the chart is today (in utc, so tomorrow in the
users timezone)
- do a test
- FIXED graph shows one activity for today (in utc)
- FIXED the remembered last activity is still on August 8th with five
tests
Introduced in #6865, caused by account button reacting to the
`snapshotUpdate` triggered by `addXp` function.
Fixed by merging result related snapshot functions into one and adding a
`noDispatchEvent` param to `setSnapshot` and using it in the new
function and `addXp`. This works because result and alerts panel both
call the `XPBar.update` directly to animate the xp gain.
### Description
enhances the caret positioning logic to support mixed language
directions (LTR and RTL) within words. It introduces a new
hasRTLCharacters utility function to detect RTL characters in individual
words, allowing the caret to adjust dynamically based on word-specific
direction rather than relying solely on the language's default direction
#### notes:
* tested no affect to the normal single direction.
* no tap mode handle included
* related #6694#6666
---------
Co-authored-by: Jack <jack@monkeytype.com>
* When leaving a theme item to a non‑theme item inside the mixed
commandline list, the preview theme temporarily applied after closing
the commandline without selecting it. so switched back to clearPreview()
as it was,
#### to REPRODUCE: type e.g "theme off" in the commandline then close
the commandline.
* and to fix the preview flashing issue that the false was added for, in
custom themes included setCustomThemeId with changeTheme in the check ,
so custom theme hovers are now treated as the same preview context and
no longer clear the preview between items.
### Description
There was a bug in which the displayed text in the custom text modal was
not being saved when submitted. This occurred when users opened the
custom text modal while taking a test with practice words.
The new behavior is clicking "ok" in the custom text modal calls
`resetBefore()` from `practise-words.ts` to prevent the test from
reverting to the previous list of words.
### Tests
|Action|Behavior|
|---|---|
|Submit some text in the custom text modal without practicing words|The
text in the modal's text area is displayed in the test|
|Submit some text in the custom text modal during a test with practice
words|The text in the modal's text area is displayed in the test|
|set the custom text to practice words twice in a row|The text in the
modal's text area is displayed in the test|
|change the custom text during a test with practice words|The text in
the modal's text area is displayed in the test|
### Checks
- [ ] Adding quotes?
- [ ] Make sure to include translations for the quotes in the
description (or another comment) so we can verify their content.
- [ ] Adding a language?
- Make sure to follow the [languages
documentation](https://github.com/monkeytypegame/monkeytype/blob/master/docs/LANGUAGES.md)
- [ ] Add language to `packages/schemas/src/languages.ts`
- [ ] Add language to exactly one group in
`frontend/src/ts/constants/languages.ts`
- [ ] Add language json file to `frontend/static/languages`
- [ ] Adding a theme?
- Make sure to follow the [themes
documentation](https://github.com/monkeytypegame/monkeytype/blob/master/docs/THEMES.md)
- [ ] Add theme to `packages/schemas/src/themes.ts`
- [ ] Add theme to `frontend/src/ts/constants/themes.ts`
- [ ] Add theme css file to `frontend/static/themes`
- [ ] Add some screenshot of the theme, especially with different test
settings (colorful, flip colors) to your pull request
- [ ] Adding a layout?
- [ ] Make sure to follow the [layouts
documentation](https://github.com/monkeytypegame/monkeytype/blob/master/docs/LAYOUTS.md)
- [ ] Add layout to `packages/schemas/src/layouts.ts`
- [ ] Add layout json file to `frontend/static/layouts`
- [ ] Adding a font?
- Make sure to follow the [themes
documentation](https://github.com/monkeytypegame/monkeytype/blob/master/docs/FONTS.md)
- [ ] Add font file to `frontend/static/webfonts`
- [ ] Add font to `packages/schemas/src/fonts.ts`
- [ ] Add font to `frontend/src/ts/constants/fonts.ts`
- [ ] Check if any open issues are related to this PR; if so, be sure to
tag them below.
- [x] Make sure the PR title follows the Conventional Commits standard.
(https://www.conventionalcommits.org for more info)
- [x] Make sure to include your GitHub username prefixed with @ inside
parentheses at the end of the PR title.
<!-- label(optional scope): pull request title (@your_github_username)
-->
<!-- I know I know they seem boring but please do them, they help us and
you will find out it also helps you.-->
### Description
- Fixed a visual bug in the updateXp() function where claiming rewards
would update any visible profile
- Added same user check when updating XP from alerts modal
- Check uid or displayname, when sameUserCheck is true and the
activePage is "profile".
https://github.com/user-attachments/assets/bd6ec3ca-14ea-4021-a889-7c1931ed6888
### Checks
- [ ] Adding quotes?
- [ ] Make sure to include translations for the quotes in the
description (or another comment) so we can verify their content.
- [ ] Adding a language?
- Make sure to follow the [languages
documentation](https://github.com/monkeytypegame/monkeytype/blob/master/docs/LANGUAGES.md)
- [ ] Add language to `packages/schemas/src/languages.ts`
- [ ] Add language to exactly one group in
`frontend/src/ts/constants/languages.ts`
- [ ] Add language json file to `frontend/static/languages`
- [ ] Adding a theme?
- Make sure to follow the [themes
documentation](https://github.com/monkeytypegame/monkeytype/blob/master/docs/THEMES.md)
- [ ] Add theme to `packages/schemas/src/themes.ts`
- [ ] Add theme to `frontend/src/ts/constants/themes.ts`
- [ ] Add theme css file to `frontend/static/themes`
- [ ] Add some screenshot of the theme, especially with different test
settings (colorful, flip colors) to your pull request
- [ ] Adding a layout?
- [ ] Make sure to follow the [layouts
documentation](https://github.com/monkeytypegame/monkeytype/blob/master/docs/LAYOUTS.md)
- [ ] Add layout to `packages/schemas/src/layouts.ts`
- [ ] Add layout json file to `frontend/static/layouts`
- [ ] Adding a font?
- Make sure to follow the [themes
documentation](https://github.com/monkeytypegame/monkeytype/blob/master/docs/FONTS.md)
- [ ] Add font file to `frontend/static/webfonts`
- [ ] Add font to `packages/schemas/src/fonts.ts`
- [ ] Add font to `frontend/src/ts/constants/fonts.ts`
- [x] Check if any open issues are related to this PR; if so, be sure to
tag them below.
- [x] Make sure the PR title follows the Conventional Commits standard.
(https://www.conventionalcommits.org for more info)
- [x] Make sure to include your GitHub username prefixed with @ inside
parentheses at the end of the PR title.
---------
Co-authored-by: Miodec <jack@monkeytype.com>
1. when a custom theme is active preview of regular theme was not
applied, introduced with
fdead53ba9
2. when custom theme is active previewing other custom themes set the
color to the active custom theme first, then the selected one causing
flashing
To reproduce:
1. preview of regular theme not working
- create a custom theme with black background, activate it
- open commandline to preview a regular theme
2. custom theme colors get set multiple times
- create a custom theme with white background called white and activate
it
- create to custom themes with black background called black1 and black2
- switch preview between black1 and black2
Implements temporary email detection for the registration email input
field on the login page. When users focus on the email input, the system
dynamically imports the `disposable-email-domains-js` package to check
for temporary/disposable email addresses.
## Changes Made
- **Dynamic Import**: Added lazy loading of
`disposable-email-domains-js` package that triggers on email input focus
- **Email Validation Enhancement**: Extended the existing email
validation in `login.ts` to include temporary email detection
- **User Warning**: Shows warning message "Be careful when using
temporary emails - you will need it to log into your account" for
detected temporary emails
- **Graceful Degradation**: Handles module import failures silently
without breaking existing functionality
- **Dependency Management**: Added `disposable-email-domains-js` to
frontend package dependencies
## Technical Implementation
The implementation integrates seamlessly with the existing
`validateWithIndicator` system:
```typescript
// Dynamic import on focus
emailInputEl.addEventListener("focus", async () => {
if (!moduleLoadAttempted) {
moduleLoadAttempted = true;
try {
disposableEmailModule = await import("disposable-email-domains-js");
} catch (e) {
// Silent failure - continues without temp email detection
}
}
});
// Validation check
if (disposableEmailModule && disposableEmailModule.isDisposableEmail) {
if (disposableEmailModule.isDisposableEmail(email)) {
return {
warning: "Be careful when using temporary emails - you will need it to log into your account"
};
}
}
```
## Key Features
- **Non-blocking**: Module only loads when needed and failures don't
interrupt the user experience
- **Warning Level**: Uses the existing warning system, allowing users to
continue with registration
- **Preserved Functionality**: All existing email validation (education
emails, typos) continues to work unchanged
- **Performance Optimized**: Lazy loading prevents unnecessary network
requests until the feature is actually used
## Testing
Verified that:
- Temporary emails (e.g., mailinator.com, 10minutemail.com) show
appropriate warnings
- Regular emails (e.g., gmail.com, outlook.com) pass validation normally
- Education emails continue to show existing warnings
- Module import failures are handled gracefully
- All existing validation behavior is preserved
<screenshot>


</screenshot>
Resolves the requirement to detect temporary emails while maintaining a
smooth user experience and backward compatibility.
> [!WARNING]
>
> <details>
> <summary>Firewall rules blocked me from connecting to one or more
addresses (expand for details)</summary>
>
> #### I tried to connect to the following addresses, but was blocked by
firewall rules:
>
> -
`https://api.github.com/repos/mziyut/disposable-email-domains-js/contents/package.json`
> - Triggering command: `curl -s REDACTED` (http block)
>
> If you need me to access, download, or install something from one of
these locations, you can either:
>
> - Configure [Actions setup
steps](https://gh.io/copilot/actions-setup-steps) to set up my
environment, which run before the firewall is enabled
> - Add the appropriate URLs or hosts to the custom allowlist in this
repository's [Copilot coding agent
settings](https://github.com/monkeytypegame/monkeytype/settings/copilot/coding_agent)
(admins only)
>
> </details>
<!-- START COPILOT CODING AGENT TIPS -->
---
✨ Let Copilot coding agent [set things up for
you](https://github.com/monkeytypegame/monkeytype/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Miodec <13181393+Miodec@users.noreply.github.com>
Co-authored-by: Jack <jack@monkeytype.com>