Skip to content

[Feature]: Show workout completion indicator in the daily diary #1250

@G5K-org

Description

@G5K-org

Problem

When browsing the Diary screen after finishing a workout, there is no visual indicator to distinguish completed workout sessions from sessions that were just logged. Users have no way to tell at a glance whether they've already done their workout for the day.

Proposed Solution

Add a small "Done" badge to completed workout session rows in the Diary screen.

Implementation approach (mobile only, no server changes required):

  1. src/stores/activeWorkoutStore.ts — Add a completedSessionIds: Record<string, true> field to the persisted state. When clearWorkout() is called and the workout was fully complete (activeSetId === null), record the session ID before resetting all other state. This field survives the clear action and is persisted to AsyncStorage.

  2. src/components/SwipeableExerciseRow.tsx — Read completedSessionIds from the store. If the current session's ID is present, render a small green "Done" badge next to the source label. The badge persists across cold starts.

Why this approach:

  • No server changes — ExerciseSessionResponse has no completion flag; tracking is client-side only
  • Uses the existing activeWorkoutStore AsyncStorage persist layer
  • The indicator appears after the user taps the ✓ checkmark to dismiss the finished workout

Affected Files

  • SparkyFitnessMobile/src/stores/activeWorkoutStore.ts
  • SparkyFitnessMobile/src/components/SwipeableExerciseRow.tsx

Acceptance Criteria

  • Complete all sets in a preset workout and tap the finish checkmark
  • Navigate to Diary — the finished workout row shows a green "Done" badge
  • Background/kill the app and reopen — badge is still visible
  • A workout session that was not completed via the active tracker shows no badge

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions