feat(leaderboard): add next WPM pace caret modes (@torturado)#8236
Open
torturado wants to merge 8 commits into
Open
feat(leaderboard): add next WPM pace caret modes (@torturado)#8236torturado wants to merge 8 commits into
torturado wants to merge 8 commits into
Conversation
- Implemented `getNextLeaderboardWpm` and `getNextDailyLeaderboardWpm` functions in the leaderboard controller. - Added corresponding routes for `/leaderboards/next` and `/leaderboards/daily/next`. - Updated DAL to fetch the next WPM based on user entries. - Enhanced tests to cover authentication and response scenarios for the new endpoints. - Introduced new pace caret options for "next" and "nextDaily" in the frontend configuration.
- Added `useQuery` to fetch server configuration in the `PaceCaret` component. - Updated `isPaceCaretModeAvailable` and `hasDailyLeaderboard` functions to utilize server configuration data. - Enhanced filtering logic for pace caret options based on server settings.
Contributor
|
Continuous integration check(s) failed. Please review the failing check's logs and make the necessary changes. |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds new pace caret modes that target the next distinct leaderboard WPM (“next” all-time, “nextDaily” daily), spanning schema/contracts, backend routes/controllers/DAL, and frontend settings + test logic; also makes the Settings UI react to async server-configuration so nextDaily appears once config loads.
Changes:
- Add
/leaderboards/next+/leaderboards/daily/nextcontract + backend handlers/queries + controller tests. - Add frontend query + test init logic to fetch next WPM and drive pace-caret speed.
- Add frontend availability gating + Settings/commandline UI exposure for
next/nextDaily.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/schemas/src/configs.ts | Extends PaceCaret enum with next/nextDaily. |
| packages/contracts/src/leaderboards.ts | Adds response schema + contract routes for next-WPM endpoints. |
| frontend/src/ts/test/pace-caret.ts | Initializes remote pace-caret modes by fetching next WPM (and awaiting config for daily). |
| frontend/src/ts/queries/leaderboards.ts | Adds Solid Query options + fetch helper for next pace-caret WPM. |
| frontend/src/ts/config/pace-caret-options.ts | Centralizes availability checks + context building for pace-caret modes. |
| frontend/src/ts/config/metadata.tsx | Updates pace-caret description/labels; blocks unavailable next* selections. |
| frontend/src/ts/components/pages/test/modes-notice/TestModesNotice.tsx | Adjusts notice formatting/visibility for nextDaily + async WPM availability. |
| frontend/src/ts/components/pages/settings/custom-setting/PaceCaret.tsx | Filters options based on auth + server config; subscribes to server configuration query. |
| frontend/src/ts/commandline/commandline-metadata.ts | Exposes next/nextDaily options + availability gating for commandline config. |
| backend/src/utils/daily-leaderboards.ts | Adds daily leaderboard “next WPM” computation. |
| backend/src/dal/leaderboards.ts | Adds Mongo query to get next all-time leaderboard WPM above current user’s WPM. |
| backend/src/api/routes/leaderboards.ts | Wires new routes to controller handlers. |
| backend/src/api/controllers/leaderboard.ts | Implements getNextLeaderboardWpm + getNextDailyLeaderboardWpm. |
| backend/tests/api/controllers/leaderboard.spec.ts | Adds controller tests for both next-WPM endpoints. |
fehmer
reviewed
Jul 15, 2026
fehmer
reviewed
Jul 15, 2026
Wraps the value as { next } while preserving null responses.
Contributor
|
Continuous integration check(s) failed. Please review the failing check's logs and make the necessary changes. |
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.
Description
Adds
nextandnextDailypace caret modes. These modes retrieve the next distinct WPM value from the all-time or daily leaderboard and use it as the target pace.The backend adds the required leaderboard routes, DAL queries, daily leaderboard validation, contracts, and controller tests. The frontend exposes the new settings and validates them against the current test mode and server
configuration.
When the Settings page loaded before the asynchronous server configuration request completed,
nextDailycould remain hidden for the entire session.PaceCaretnow subscribes to the server configuration query so the option appearsonce the configuration is available.
Checks
packages/schemas/src/languages.tsfrontend/src/ts/constants/languages.tsfrontend/static/languagespackages/schemas/src/themes.tsfrontend/src/ts/constants/themes.tsfrontend/static/themespackages/schemas/src/layouts.tsfrontend/static/layoutsfrontend/static/webfontspackages/schemas/src/fonts.tsfrontend/src/ts/constants/fonts.ts@inside parentheses at the end of the PR title.