SP-008: Add Question Timer with Historical Tracking#3
Open
fikriauliya wants to merge 7 commits into
Open
Conversation
Tests verify timer starts with new questions, displays MM:SS format, continues during wrong answers, stops/records on correct answers, and shows historical completion times with local storage persistence. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add timer state management in GameContext with start/stop functionality - Display current timer in MM:SS format during question solving - Store completion times in local storage with question metadata - Show recent completion times history in GameController - Timer starts when new question appears and stops on correct answer - Timer continues running during incorrect attempts - Add comprehensive test coverage for all timer functionality - Mark SP-008 as completed in TODOS.md 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Update hardcoded localhost:5174 to use VITE_PORT from environment, ensuring tests run on the correct port configured in .env file. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Implements SP-008 question timer feature with historical tracking functionality:
Changes Made
Core Implementation
CompletionTimeinterface for structured time data storageTesting & Quality
data-testidattributes for reliable test targetingFeatures Delivered
✅ Timer displays in MM:SS format and updates every second
✅ Timer starts when new question appears
✅ Timer stops and records time only on correct answers
✅ Completion times stored in localStorage
✅ Historical times displayed to user
✅ Timer continues running during incorrect attempts
✅ Data persists between browser sessions
Technical Details
The timer implementation follows the existing GameContext pattern:
useEffecthooks for automatic timer managementsetIntervalfor precise second-by-second updates🤖 Generated with Claude Code