Skip to content

feat: add "train second key" guided lesson option - #623

Open
jpds wants to merge 5 commits into
aradzie:masterfrom
jpds:feat/train-next-letter
Open

feat: add "train second key" guided lesson option#623
jpds wants to merge 5 commits into
aradzie:masterfrom
jpds:feat/train-next-letter

Conversation

@jpds

@jpds jpds commented Jul 24, 2026

Copy link
Copy Markdown

This PR adds a "Train second key" option to the guided lesson settings. When enabled this mixes in with 20% probability either the next letter to train or the second-weakest letter for a user when all letters are unlocked.

I've increased my target typing speed for a layout and I found that when I had finally mastered a target key, the next key lessons would break that momentum and the previously unlocked key would lag again, causing a yo-yo between the two to happen.

Samples taken from the next-key are not factored into unlocking it, the words are only there to accustom the user to the motion of the next key.

@semanticdiff-com

semanticdiff-com Bot commented Jul 24, 2026

Copy link
Copy Markdown

Review changes with  SemanticDiff

Changed Files
File Status
  package.json  40% smaller
  packages/keybr-lesson/lib/text/words.test.ts  20% smaller
  packages/keybr-lesson/lib/fakes.ts  14% smaller
  packages/keybr-lesson/lib/guided.ts  11% smaller
  packages/keybr-lesson/lib/guided.test.ts  1% smaller
  .gitignore Unsupported file format
  e2e/guided-lesson/alphabet-size-churn.spec.ts  0% smaller
  e2e/guided-lesson/alphabet-unlock.spec.ts  0% smaller
  e2e/guided-lesson/daily-goal-toast.spec.ts  0% smaller
  e2e/guided-lesson/helpers.ts  0% smaller
  e2e/guided-lesson/mistake-color.spec.ts  0% smaller
  e2e/guided-lesson/pointer-highlight.spec.ts  0% smaller
  e2e/guided-lesson/recover-keys-churn.spec.ts  0% smaller
  e2e/guided-lesson/settings-churn.spec.ts  0% smaller
  e2e/smoke.spec.ts  0% smaller
  package-lock.json  0% smaller
  packages/keybr-lesson-ui/lib/Key.test.tsx  0% smaller
  packages/keybr-lesson-ui/lib/Key.tsx  0% smaller
  packages/keybr-lesson-ui/lib/KeyLegend.test.tsx  0% smaller
  packages/keybr-lesson-ui/lib/KeyLegend.tsx  0% smaller
  packages/keybr-lesson-ui/lib/KeyLegendList.tsx  0% smaller
  packages/keybr-lesson-ui/lib/styles.module.less Unsupported file format
  packages/keybr-lesson/lib/confirmed-unlocks.ts  0% smaller
  packages/keybr-lesson/lib/key.test.ts  0% smaller
  packages/keybr-lesson/lib/key.ts  0% smaller
  packages/keybr-lesson/lib/settings.ts  0% smaller
  packages/keybr-lesson/lib/text/words.ts  0% smaller
  packages/keybr-theme-designer/lib/design/LessonKeysPreview.tsx  0% smaller
  packages/keybr-themes/lib/themes/theme.less Unsupported file format
  packages/page-practice/lib/settings/lesson/GuidedLessonSettings.tsx  0% smaller
  packages/page-practice/lib/settings/lesson/TrainSecondKeyProp.tsx  0% smaller
  playwright.config.ts  0% smaller

@jpds
jpds force-pushed the feat/train-next-letter branch 9 times, most recently from 828065b to ef54873 Compare July 31, 2026 18:12
jpds added 5 commits July 31, 2026 19:12
Simulates a human typing through the full American English alphabet in the
guided lesson with a randomized per-round typing speed, checking that keys
never regress, unlock one at a time, and that the target key, its toast, and its
confidence state stay consistent throughout.

Others included tests cover the toasts, the on-screen keyboard's
hesitation-pointer highlighting the physically correct key, and a
mistyped-then-corrected character rendering in the theme's miss color.
Writes new guided-lesson settings to `localStorage` and reloads mid-run.
This checks progress survives the `GuidedLesson`/`Progress` reconstruction:

* `naturalWords` and a target-speed ramp shouldn't lose already-earned unlocks
* `alphabetSize` can force-include several keys in one round
* `recoverKeys` can legitimately re-lock a key past the guaranteed first 6.
Occasionally mistypes-then-corrects the displayed character instead of
typing it cleanly, mirroring a human fumble.
Adds lesson.guided.trainSecondKey: previews and unlocks a second key
alongside the primary focus, one letter at a time.
Solid outline in --accent, distinct from the focused key's
--secondary-l2.
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