Skip to content

Add --look-ahead flag to limit visible upcoming words#47

Merged
ptrsauer merged 2 commits intomainfrom
feat/look-ahead
Feb 15, 2026
Merged

Add --look-ahead flag to limit visible upcoming words#47
ptrsauer merged 2 commits intomainfrom
feat/look-ahead

Conversation

@ptrsauer
Copy link
Owner

Summary

  • Adds --look-ahead <N> CLI option that limits the number of visible upcoming words during a typing test
  • Words beyond the look-ahead window are hidden, helping users focus on immediate words
  • When N exceeds remaining words, visibility clamps to the end of the word list (no overflow)

Test plan

  • 7 new tests (3 unit tests in test/mod.rs + 4 UI tests in ui.rs)
  • All 94 tests pass (85 unit + 9 integration)
  • Clippy clean, rustfmt applied

Closes #41

🤖 Generated with Claude Code

ptrsauer and others added 2 commits February 15, 2026 21:24
Implements a --look-ahead <N> option that shows only the next N upcoming
words during the typing test, hiding the rest. This helps users focus on
immediate words without being distracted by the full word list.

- Add look_ahead: Option<usize> to Test struct and CLI
- Modify words_to_spans to calculate visible_end based on look_ahead
- Add 7 new tests (3 unit + 4 UI) covering visibility limits and clamping

Closes #41

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Clarify help text: past and current word always visible
- Add test for look_ahead=0 (shows only current word)
- Add test for look_ahead at last word (no upcoming to show)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ptrsauer ptrsauer merged commit 3e01bb7 into main Feb 15, 2026
6 checks passed
@ptrsauer ptrsauer deleted the feat/look-ahead branch February 15, 2026 20:27
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 look-ahead: dim preview of upcoming words

1 participant