Skip to content

feat: per-finger key colouring and current-key highlight#10

Merged
agolosnichenko merged 29 commits into
mainfrom
feature/finger-map
Jun 5, 2026
Merged

feat: per-finger key colouring and current-key highlight#10
agolosnichenko merged 29 commits into
mainfrom
feature/finger-map

Conversation

@agolosnichenko

Copy link
Copy Markdown
Owner

What this does

Adds a finger-map widget to lessons so the trainee can see which finger to use for the next key, with the current key highlighted as they type.

  • New keyboard layout data plus a char→key index, so any target character resolves to a physical key (domain/layout data + lookup).
  • FingerMap widget renders the keyboard with per-finger colouring and a shift hint.
  • TypingView exposes the current character and posts a CursorMoved message; the first character is highlighted on mount, and backspace moves the highlight back.
  • Lessons wire the finger map to the live cursor so the key for the next character is highlighted.
  • A lesson aborts cleanly when the active keyboard layout is unknown rather than failing mid-attempt.
  • .gitignore: ignore Claude Code local settings and the scheduled-tasks lock file.

Base branch

Targets main (not feature/core-engine): this branch forked from main at 24819f8, so against main the diff is exactly the ten finger-map commits. feature/core-engine lacks the already-merged release/content PRs and would produce a noisy diff.

Tests

Unit tests cover layout lookup (including the error path via pytest.raises), per-finger and space-key highlighting, the FingerMap widget, and CursorMoved on mount and on backspace.

🤖 Generated with Claude Code

agolosnichenko and others added 26 commits June 5, 2026 20:21
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Resolve the layout before generating the target and pop the screen from
on_mount instead of compose, so an invalid layout backs out to the menu
without deadlocking the settling screen stack. Refresh the README install
instructions and bump the lockfile to 0.2.0.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Live stats widget renders net WPM and running error count per keystroke.
Follows the dumb-view pattern of LessonGuide: holds computed values
and exposes pure render_text() for testability without a terminal.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Drop the redundant LiveStats persistence test and assert exact zero WPM
for a single keystroke instead of a non-informative lower bound.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Show a LazyVim-style start screen: a centered TYPEHERO wordmark and a
muted tagline with the running version and cleared-lesson count above the
lesson list. The version is read from package metadata so it tracks
pyproject. Bump the package to 1.0.0.

Release-As: 1.0.0

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@agolosnichenko agolosnichenko changed the title Finger map: per-finger key colouring and current-key highlight feat: per-finger key colouring and current-key highlight Jun 5, 2026
agolosnichenko and others added 3 commits June 6, 2026 04:05
Pin the course layout to a LayoutName StrEnum and reject unknown layouts,
malformed tips, and non-typable target chars in the content loader. Enforce
KeyboardLayout/Key invariants (single-char keys, trailing space row, no
duplicate chars) and let LessonGuide render a tip without a principle.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@agolosnichenko agolosnichenko merged commit 8d28431 into main Jun 5, 2026
1 check passed
@agolosnichenko agolosnichenko deleted the feature/finger-map branch June 5, 2026 20:22
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