Skip to content

Mark completed workout days in day picker#24

Merged
willchan merged 5 commits intomainfrom
claude/fix-workout-button-order-JsHWh
Mar 8, 2026
Merged

Mark completed workout days in day picker#24
willchan merged 5 commits intomainfrom
claude/fix-workout-button-order-JsHWh

Conversation

@willchan
Copy link
Owner

@willchan willchan commented Mar 8, 2026

Summary

Add visual indicators for completed workout days in the home screen's day picker. Days that have been completed in the current cycle and week are now marked with a "completed" style and disabled to prevent re-selection.

Key Changes

  • E2E Tests: Added comprehensive test suite (completed-days.spec.ts) covering:

    • Marking days as completed after finishing a workout
    • Disabling completed day buttons
    • Handling multiple completed days
    • Resetting completed days when switching weeks
  • Home Screen Logic: Modified renderHome() to:

    • Fetch workout history via getAllHistory()
    • Filter history by current template, cycle, and week
    • Track completed day indices from history logs
    • Apply "completed" class and disable attribute to completed day buttons
  • Styling: Added .day-picker-btn.completed styles to visually distinguish completed days:

    • Reduced opacity (0.5)
    • Strike-through text decoration
    • Muted colors and disabled cursor
    • Updated hover state to exclude completed buttons

Implementation Details

Completed days are determined by checking if a workout history entry exists for the current template, cycle, and week combination. The completed state is scoped to the current cycle+week, so switching to a different week will show no completed days for that week.

https://claude.ai/code/session_018eaTK95ZfpXszWTjSGFSVn

claude added 5 commits March 8, 2026 21:51
Query workout history for the current cycle+week and visually disable
day buttons that have already been completed (with strikethrough and
reduced opacity). This prevents accidentally re-selecting a finished
day and makes it clear which workouts remain in the current week.

https://claude.ai/code/session_018eaTK95ZfpXszWTjSGFSVn
Generates baseline screenshots showing the home screen with Squat and
Bench days marked as completed (strikethrough + reduced opacity) while
Deadlift is the active next workout.

https://claude.ai/code/session_018eaTK95ZfpXszWTjSGFSVn
The test was reloading the page before the async IndexedDB write from
the checkbox change handler had completed. Now polls IndexedDB directly
to confirm the setting is persisted before reloading.

https://claude.ai/code/session_018eaTK95ZfpXszWTjSGFSVn
The fix from main already polls IndexedDB via waitForFunction; remove
the redundant toPass block that our branch added independently.

https://claude.ai/code/session_018eaTK95ZfpXszWTjSGFSVn
@willchan willchan merged commit 4aa29bb into main Mar 8, 2026
1 check passed
@willchan willchan deleted the claude/fix-workout-button-order-JsHWh branch March 19, 2026 00:04
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.

2 participants