feat(03-02): implement word mode for typing engine

- Add createWordExerciseState() that splits words into letters with boundaries
- Add getCurrentWordIndex() helper for UI word tracking
- Extend TypingExerciseState with mode, words, wordBoundaries fields
- Backwards compatible: createExerciseState sets mode='letters'
- All 85 tests pass

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-29 13:45:54 +02:00
co-authored by Claude Opus 4.6
parent 958f4460a7
commit 2c0c2f2701
2 changed files with 41 additions and 0 deletions
+3
View File
@@ -74,6 +74,9 @@ export interface TypingExerciseState {
correctStreak: number;
totalCorrect: number;
totalErrors: number;
mode: "letters" | "words";
words?: string[];
wordBoundaries?: number[];
}
// Screen names