Skip to content

Add --case-insensitive flag#44

Merged
ptrsauer merged 2 commits intomainfrom
feat/case-insensitive
Feb 15, 2026
Merged

Add --case-insensitive flag#44
ptrsauer merged 2 commits intomainfrom
feat/case-insensitive

Conversation

@ptrsauer
Copy link
Owner

Summary

  • Adds --case-insensitive CLI flag that ignores case differences when comparing typed input
  • When enabled, uppercase characters are stored as lowercase and all comparisons (prefix check, word completion, auto-complete on last word) use case-insensitive matching
  • Applies consistently across all test modes (initial, restart, practice missed/slow words)

Design Decisions

  • Flag is off by default to preserve existing behavior
  • Typed input is lowercased at input time (not just at comparison) so progress field reflects what was actually stored — cleaner than lowercasing at every comparison point
  • Both starts_with prefix checks and full word equality checks use .to_lowercase() when flag is set

Test plan

  • 5 new unit tests for case-insensitive behavior (lowercase→uppercase, uppercase→lowercase, correct flag, case-sensitive mismatch, auto-complete)
  • All 83 tests pass (74 unit + 9 integration)
  • Clippy clean, rustfmt clean

Closes #38

🤖 Generated with Claude Code

ptrsauer and others added 2 commits February 15, 2026 21:06
When enabled, typed input is compared case-insensitively against target
words. Uppercase characters are stored as lowercase, and word completion
checks ignore case differences. Useful for users who want to focus on
typing speed without worrying about shift key accuracy.

Closes #38

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Backspace/Ctrl-H correctness tracking now uses case-insensitive
  comparison when the flag is enabled, preventing incorrect error
  marking when progress is lowercase but target has uppercase
- UI split functions (split_current_word, split_typed_word) now accept
  case_insensitive parameter and use char-level lowercase comparison,
  fixing visual feedback showing correct characters as incorrect

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ptrsauer ptrsauer merged commit b019608 into main Feb 15, 2026
6 checks passed
@ptrsauer ptrsauer deleted the feat/case-insensitive branch February 15, 2026 20:10
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.

Add --case-insensitive flag for case-agnostic typing practice

1 participant