Commit Graph

9 Commits

Author SHA1 Message Date
Jonas Bark
a795b3c681 refactor: route FBD-specific callers through emulator.fitnessBike
activeDefinition now returns the CompositeBleDefinition; consumers
that need the FitnessBikeDefinition specifically use the fitnessBike
convenience getter. Bumps prop submodule to pick up the composite
machinery.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 17:55:53 +02:00
Jonas Bark
6712a5803c fix reported issues 2026-04-28 10:38:04 +02:00
Jonas Bark
4e75d9fa0f feat: open Past Workouts in a sheet and surface duration / distance
Persists the WorkoutSummary alongside each saved workout as a sidecar
JSON file (workout-…fit.json) so the past-workouts list can render
duration, distance, avg power, and avg HR per row without parsing the
FIT. Reading is best-effort — older workouts without a sidecar fall
back to the previous filename-only layout.

Splits WorkoutsListPage into a Scaffold-wrapped page (kept for
backwards compatibility / desktop nav) and a chrome-free WorkoutsList
widget that the MiniWorkoutCard now mounts inside openSheet at the
bottom edge. WorkoutsList renders a small header and the "open folder"
shortcut when its showHeader flag is set so it stays self-contained
inside the sheet.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 09:54:31 +02:00
Jonas Bark
3859dcb55a feat(workout): WorkoutRepository for local .fit file storage
Adds PastWorkout model, WorkoutRepository (save/list/delete) with UTC-stamped filenames, and wires it into Core.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 11:52:44 +02:00
Jonas Bark
76b6a03cc7 feat(workout): WorkoutRecorder with idle/recording/paused state machine
Implements WorkoutRecorder with start/pause/resume/stop transitions, 1 Hz
sampling loop via configurable tick timer, active duration tracking that
excludes pause time, and WorkoutResult with summary. Wires recorder into Core.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 11:52:44 +02:00
Jonas Bark
ecb8eff17a feat(workout): encode samples to FIT activity file
Implements FitFileWriter.encode() which converts WorkoutSamples and a
WorkoutSummary into a standards-compliant FIT Activity file with
FileId → Event(start) → Records → Event(stop) → Lap → Session → Activity.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 11:52:43 +02:00
Jonas Bark
32ca7fbf9c refactor(workout): rename sum→aggregate with max flag; add WorkoutSummary doc 2026-04-24 11:52:43 +02:00
Jonas Bark
6488f18789 feat(workout): add WorkoutSample and WorkoutSummary with tests 2026-04-24 11:52:43 +02:00
Jonas Bark
30356143a1 feat(workout): add TrainerMetrics adapter over bike definitions
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 11:52:43 +02:00