Refactor TypeTracker logic for live word updates and session reset after timer completion #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request refactors the TypeTracker behavior to improve usability and accuracy during typing sessions. The main changes include:
Instant word updates:
The displayed word now updates dynimically as the user types (
QLineEdit::textChangedsignal) instead of relying on the timer tick. This provides real-time feedback and a smoother typing experience.Proper session reset:
After the timer reaches one minutr or all words are completed, a
QMessageBoxshows the user's WPM, total characters typed, and accuracy. Once the user closes the dialog, the session is fully reset -- clearing counters, text fields, and disabling input until "Start" is pressed again.Cleaner initialization:
Simplified the
onStartButtonClicked()method to always reset state and show the first word immediately at the start of a session.These changes make the typing tracker more responsive, robust, and user-friendly while maintaining the code timing and accuracy features.