Skip to content

Conversation

@danielway
Copy link
Owner

Implemented a timer system that allows users to start/stop timers for tasks instead of manually logging in 15 minute increments. This addresses issue #38.

Changes:

  • Extended TimeState to track active timer (taskId, startTime, date)
  • Modified startTime action to set activeTimer and prevent multiple concurrent timers
  • Modified stopTime action to use activeTimer and automatically log elapsed time
  • Added cancelTimer action to cancel timer without logging
  • Created TimerButton component with real-time elapsed time display
  • Integrated timer button into TaskRow component (both view and edit modes)
  • Added Timer column header to table layout

Features:

  • Start/Stop timer buttons for each task
  • Real-time elapsed time display (HH:MM:SS)
  • Only one timer can run at a time (others are disabled)
  • Timer state persists in Redux store and localStorage
  • Automatic time logging when timer is stopped

Implemented a timer system that allows users to start/stop timers for tasks
instead of manually logging in 15 minute increments. This addresses issue #38.

Changes:
- Extended TimeState to track active timer (taskId, startTime, date)
- Modified startTime action to set activeTimer and prevent multiple concurrent timers
- Modified stopTime action to use activeTimer and automatically log elapsed time
- Added cancelTimer action to cancel timer without logging
- Created TimerButton component with real-time elapsed time display
- Integrated timer button into TaskRow component (both view and edit modes)
- Added Timer column header to table layout

Features:
- Start/Stop timer buttons for each task
- Real-time elapsed time display (HH:MM:SS)
- Only one timer can run at a time (others are disabled)
- Timer state persists in Redux store and localStorage
- Automatic time logging when timer is stopped
Added test coverage for the automatic timer logging feature including:
- Updated timeSlice tests for new timer API (startTime, stopTime, cancelTimer)
- Added tests for activeTimer state tracking
- Created TimerButton component tests covering:
  - Start/stop timer functionality
  - Elapsed time display
  - Disabled state when another task has active timer
  - UI styling (contained error vs outlined primary)
  - State updates in Redux store

All 225 tests passing including 7 new TimerButton tests.
Fixed issues that were causing CI failures:
- Applied Prettier formatting to TimerButton.test.tsx
- Added missing 'type' field to Task objects in tests (required by task types feature)
- Fixed TypeScript type assertions in test files
- Used 'as unknown as RootState' for partial state mocks in timeSlice.test.ts
- Added proper RootState type assertions for store.getState() calls

All 236 tests passing and build successful.
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.

3 participants