Skip to content

Stop the wpm timer when the last word is typed, not at Enter - #4

Merged
Byntham merged 1 commit into
mainfrom
t3/stop-wpm-at-final-word
Nov 5, 2026
Merged

Byntham merged 1 commit into
mainfrom
t3/stop-wpm-at-final-word

Conversation

@Byntham

@Byntham Byntham commented Nov 5, 2026

Copy link
Copy Markdown
Owner

Problem

A prompt's timer kept running until you pressed Enter. Any pause before sending, or a reflexive space after the last word, lowered your wpm.

Fix

The timer now stops at the last keystroke that changed the words. Trailing spaces and the wait before Enter don't count. The live wpm readout uses the same time, so it freezes once the last word is typed.

Proof

  • New tests/timing.test.ts fails on main (recorded 12000 ms against 6900 ms of typing) and passes with the fix. It covers a 5 s pause before Enter, a trailing space, and the live readout.
  • In the real app (Playwright): a 75-character prompt typed in 3847 ms of wall time, then a space and a 3 s pause before Enter, recorded 3681 ms (244 wpm).
  • npm run lint, npm run typecheck, vitest (28 tests) and the full tests/play.mjs browser playthrough pass.

Reviewed with sol-loop: 1 round with gpt-6.1-sol. Sol verdict: approved

Created with Claude Opus 5.5 in Claude Code.

🤖 Generated with Claude Code

The recorded time for a prompt used to run until Enter. It now stops at
the last keystroke that changed the words, so a trailing space or a
pause before sending does not lower the wpm.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Byntham
Byntham merged commit 1eeb849 into main Nov 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant