feat(result): option to copy slow words list with filtering (@vrutant08) - #8290
Open
vrutant08 wants to merge 3 commits into
Open
feat(result): option to copy slow words list with filtering (@vrutant08)#8290vrutant08 wants to merge 3 commits into
vrutant08 wants to merge 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds result-screen action to copy “slow words” (below user-set WPM threshold) to clipboard, via SimpleModal, alongside existing input-history copy buttons.
Changes:
- Add
copySlowWordsListButtonto test result input-history header. - Add click handler to compute burst WPMs, prompt threshold, filter words, copy to clipboard.
- Extend
copyToClipboardto accept optional custom notification text.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| frontend/src/ts/test/test-ui.ts | Wire new “copy slow words” modal + filtering; enhance clipboard helper message |
| frontend/src/html/pages/test-result.html | Add new button in input history toolbar |
Comments suppressed due to low confidence (1)
frontend/src/ts/test/test-ui.ts:1962
- Slow words list can include an empty word (and copy extra spaces) when inputHistory contains abandoned/empty words (getInputHistory returns ""), because speed 0 is always < threshold. Skip empty history entries/non-finite bursts and avoid recomputing inputHistory repeatedly.
typedWords.forEach((word, index) => {
const speed = burstHistory[index] ?? Infinity;
if (speed < speedThreshold) {
slowWords.push(word);
}
…ge WPM Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.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 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
Added a "Copy slow words list" option to the test result screen under the input history section, alongside the existing "Copy missed words" button.
When clicked, a theme-matched input pop up opens prompting the user for a WPM threshold (defaults to the average wpm of that test). Words typed below that threshold are fetched(eg. if entered 120, then every word typed below 120 will be copied) and copied to the clipboard.
Features Added
#copySlowWordsListButtonbutton totest-result.htmlwith a speedometer icon (fa-tachometer-alt).showSimpleModalwith WPM input validation.getWordBurstHistory(eventLog)to filter words typed under the requested speed.Screenshots
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.tsCloses #