Skip to content

Drill the generated ladder instead of one hard-coded sentence - #18

Merged
RCheesley merged 1 commit into
mainfrom
drill-the-ladder
Sep 22, 2026
Merged

RCheesley merged 1 commit into
mainfrom
drill-the-ladder

Conversation

@RCheesley

Copy link
Copy Markdown
Owner

The ladder (#1), the text generator (#3) and the drill surface (#6) all landed separately, each leaving a marked seam. Nothing joined them up, so the app drilled the same sample sentence whichever lesson you chose. This is the join.

Drill text now comes from the lesson's own key set, so a learner is never shown a key the ladder has not given them yet.

A bug this introduced, and the fix

Setting nextLessonName exposed a real problem. The continue button was wired straight to startDrill, so naming the next lesson on it made it promise a rung and then restart the current one. #9 had deliberately left nextLessonName null for exactly this reason; wiring it up without wiring the advance would have shipped the lying button it was avoiding.

It now advances only when the result actually earned it and the caller supplied somewhere to go, and reads "Drill this lesson again" otherwise.

Verified by hand rather than only by test: typed lesson one to three stars, the button read "Start The left thumb", taking it switched the drill to text containing e — the key that lesson adds — and the ladder updated to ★★★ passed.

?seed=

The drill seed comes from the clock, so each attempt at a lesson differs. ?seed= pins it, which makes a drill reproducible — the end-to-end suite needs that, and it is the only way to compare two runs of the same text by hand.

Tests that assumed one sentence

Both suites hard-coded the sample, and a good many hard-coded a, pinky and ask along with it. They now derive what they need:

  • Functional reads the rendered drill text back off the surface.
  • End-to-end computes the same text the app will from the pinned seed, plus the hand, finger and description of whichever key it is about to assert on.

That was the right fix rather than pinning new literals: an assertion that hard-codes pinky only holds while one sentence is hard-coded too.

Also

  • Fills in the journey earns two stars and advances to the next lesson, which could not be written until advancing existed.
  • docs/accessibility.md brought up to date — the ladder and statistics views are covered now, and the remaining gaps are named with the issues that own them. The largest is that no person has yet heard this through a screen reader (Make the trainer usable with a screen reader #10).

478 vitest, 122 Playwright, axe clean in both themes.

🤖 Generated with Claude Code

The ladder, the text generator and the drill surface all existed but nothing
joined them up, so the app drilled the same sample sentence whichever lesson
you picked. The drill text now comes from the lesson's own key set, which is
the thing the project is for: a learner is never shown a key the ladder has
not given them yet.

Setting nextLessonName exposed a bug this introduced. The continue button was
wired straight to startDrill, so naming the next lesson on it made it promise
a rung and then restart the current one. It now advances only when the result
actually earned it and the caller supplied somewhere to go, and says "Drill
this lesson again" otherwise. A button that names a lesson it will not open is
worse than one that offers another go.

The drill seed comes from the clock so each attempt differs, and ?seed= pins
it. That makes a drill reproducible, which the end-to-end suite needs and
which is the only way to compare two runs of the same text by hand.

Tests that hard-coded the sample now derive what they need: the functional
suite reads the rendered text back, and the end-to-end suite computes the same
text the app will from the pinned seed, along with the finger, hand and
description of whichever key it is about to assert on. Hard-coding "a" or
"pinky" only held while one sentence was hard-coded too.

Fills in the end-to-end journey for earning two stars and advancing, which
could not be written until advancing existed. Brings docs/accessibility.md up
to date: the ladder and statistics views are covered now, and the gaps that
remain are named with the issues that own them.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@RCheesley
RCheesley merged commit 68f5a8b into main Sep 22, 2026
3 checks passed
@RCheesley
RCheesley deleted the drill-the-ladder branch September 22, 2026 17:45
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