Skip to content

fix(sprint): published formulas, layout check before start, pause on blur - #39

Draft
prodelt wants to merge 1 commit into
mainfrom
fix/sprint-correctness
Draft

prodelt wants to merge 1 commit into
mainfrom
fix/sprint-correctness

Conversation

@prodelt

@prodelt prodelt commented Oct 5, 2026

Copy link
Copy Markdown
Owner

Review fixes for Sprint 60 s (merged in #35).

Metrics. The score comes from packages/metrics (computeMetrics) over the engine's keystroke log, as on the exercise result: SPM counts every character keystroke, accuracy is correct over all keystrokes, so in freeBackspace a wrong letter left in the line now counts against it (TZ §4.3). The engine gains stop(): a running or paused run ends as completed, and finish() returns the log so far. startSprint (model.ts) gates the input at 60 s of typing time, so no key after the minute reaches the log; the time is capped at the minute, or the time used if the line ends sooner. /formulas states this in uk and en.

Layout check and Play Mode. A pre-start card runs the exercise layout check: useLayoutCheck + LayoutStatus were extracted from PreStart (same markup and test ids), and Start stays disabled on a mismatch (TZ §4.2). The run holds Play Mode (rail and bar inert) and shows the typed-wrong-layout notice.

Pause. Leaving the window pauses the clock. Escape pauses and resumes, and the exercise pause dialog resumes, as in an exercise.

Smaller. The line now comes from seededRandom with a fresh seed per sprint (ADR 0005). The countdown starts from SPRINT_SECONDS, derived from SPRINT_MS. The locked copy uses "ви". The line uses the text-size setting and hides its count-up time and the 90 word stations.

Unchanged: the best counts only above the accuracy floor, and no Attempt is recorded.

Tests: model.test.ts covers the published-formula score, the 60 s gate, a pause not eating the minute, an early finish, ending once, leaving without a score, the idle clock, and the seeded line. engine.test.ts covers stop(). pnpm check: typecheck and lint pass. Unit tests: 808 pass and 1 fails. The failure is tools/architecture.test.ts flagging app/guide/CoachMarks.tsx, and it already fails on main. pnpm build: initial JS is 149.2 KB gzip. I checked it running in vite preview: the layout mismatch, Play Mode, Escape pause, blur pause (clock frozen), and the result screen.

🤖 Generated with Claude Code

…t, pause on blur

- Score from packages/metrics (computeMetrics) over the keystroke log, so
  accuracy is over all keystrokes and a wrong letter left in the line
  counts. The engine gains stop(): a time-boxed run ends as completed and
  finish() returns the log so far. startSprint gates the input at 60 s of
  typing time, so no key after the minute is logged; the time is capped
  at the minute, or the time used if the line ends sooner (stated on
  /formulas in uk and en).
- A pre-start card with the exercise layout check (shared useLayoutCheck
  and LayoutStatus extracted from PreStart); Start stays disabled on a
  mismatch. Play Mode during the run; the typed-layout notice too.
- Leaving the window pauses the clock; Escape pauses and resumes; the
  exercise pause dialog resumes.
- The line comes from seededRandom with a fresh seed per sprint (ADR 0005).
- The countdown starts from SPRINT_SECONDS, derived from SPRINT_MS.
- The locked line uses "ви". The line uses the text-size setting, hides
  its count-up time and its ninety word stations.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
typing-race Ready Ready Preview Oct 5, 2026 9:26pm UTC

This branch was successfully deployed

1 active deployment
Preview — 8e9a1320 Deployed Oct 5, 2026 by vercel[bot]
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