feat: continuous timed mode — stream words until the clock stops (#6) - #26
Open
hindriix wants to merge 1 commit into
Open
feat: continuous timed mode — stream words until the clock stops (#6)#26hindriix wants to merge 1 commit into
hindriix wants to merge 1 commit into
Conversation
Timed tests (`-s`) previously ended the moment you reached the end of a fixed prompt, so a 60s run over 15 words was over in a couple seconds. This makes `-s` a true Monkeytype-style time attack: words stream in as you type and the test ends only when the timer expires. Closes the long-standing request in issue jrnxf#6. - thok: add a `refill_words` pool; `refill_if_needed()` tops the prompt up whenever the runway ahead of the cursor runs low, and continuous tests finish on the timer only (never by length). - main: seed the refill pool from the active language in the default word mode with `-s`; a custom prompt (`-p`) or sentences (`-f`) stay finite. - ui: render a scrolled 3-line viewport for the (now unbounded) prompt so the layout stays centered and stable; cursor math tracks the window. - docs + `--help`: describe continuous mode; refresh examples. - tests: cover refill, timer-only finish, and non-continuous length finish.
hindriix
force-pushed
the
feat/continuous-timed-mode
branch
from
July 25, 2026 06:07
f4dd032 to
6c24147
Compare
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.
What
Makes timed tests (
-s) a true Monkeytype-style time attack: instead of ending the moment you reach the end of a fixed prompt, fresh words stream in as you type and the test ends only when the clock hits zero.Closes #6.
Why
Today,
thokr -s 60over the default 15 words is over in a couple of seconds — the timer is really just a cap, not a duration. A timed test people actually want runs for the full time and keeps feeding you words. #6 has asked for this ("continually load new words to meet time limit / scroll lines") since early 2023.How
refill_wordspool; when it's non-empty,refill_if_needed()tops the prompt up whenever the runway ahead of the cursor runs low, andhas_finished()ends the test on the timer only — never by reaching the end of the words.-s. A custom prompt (-p) or sentences (-f) are finite text, so they still end at their own length.Verification
cargo build,cargo test,cargo clippy,cargo fmt --checkall clean; new unit tests cover refill-keeps-runway, timer-only finish, and that non-continuous mode still finishes by length.Backwards compatible: non-
-sruns and-p/-fare unchanged.