feat: Apple Health integration, profile metric sync, and advanced calorie calculations#16
feat: Apple Health integration, profile metric sync, and advanced calorie calculations#16hoveeman wants to merge 7 commits into
Conversation
Brings together the working-tree integration of the imperial-units and Apple Health feature work (matching feature/metric-imperial and feature/apple-health) plus related model/service/view updates, so the Enhancements branch builds and runs all features together. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…anced calories subtext
… + units Upstream independently shipped a redesigned settings tree, a per-profile UnitsPreference + UnitsFormatter units system, and a manual-entry profile editor (ProfileSettingsView) — all overlapping this branch. Reconciled by adopting upstream's implementations and re-homing only the parts unique to this PR (HealthKit sync, Apple Health profile import, advanced calories). Units (drop the homegrown WorkoutAppGroup.useImperialUnits toggle): - ActivityView/TodayView/VitalsView/RecordViews/Components: read upstream's profile `units` via UnitsFormatter (distance, pace, temperature). Distance trend graphs keep a units-derived numeric divisor. - Threaded `units` through the splits UI (SplitStrip/SplitsTable/kmSplitSeconds) and ActivityWorkoutRow instead of the global flag. - Kept WorkoutAppGroup.useImperialUnits ONLY as an app-group mirror for the Live Activity widget (can't read SwiftData) and model-layer unit labels; it's now written from profile.units on save and seeded at launch. Profile editor: - Dropped ProfileEditView + AppRoute.profileEdit in favor of upstream's ProfileSettingsView; ported the "Sync from Apple Health" import into it. Advanced calories: - Moved the "Use advanced calories" toggle into upstream's WorkoutSettingsView (Activity Tracking); the calorie calc still reads the same app-group key. Activity buckets: - Kept upstream's idempotent upsert-by-timestamp applyActivityBucket (dropped this branch's resetDay variant) while preserving the HealthKit triggerAutomaticSync hook in PulseEventBus. Verified: clean simulator build + full test suite (144 passed) on iOS 26.5. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
@hoveeman have you been able to test these with any of the rings (56ff or Colmi)? It would be great if you can report your findings. Since this is a major revision we should have extensive testing. I am also going to start testing these soon. |
I had tested it with the 56ff ring pretty extensively and found issues with syncing and reading data but resolved all of those issues. However, I do see some of upstream has changed a bit since this PR and could do some further analysis. |
…tion) HealthSettingsSection (connection status, authorization, and 'Sync workouts history') existed but was never rendered. Add an 'Apple Health' settings row + settingsHealth route + HealthSettingsDetailView wrapper, matching the CoachSettingsDetailView idiom. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
I have pulled your changes in and updated the PR. Appears to be working properly still. I will continue to test over the next day or two. |
This Pull Request implements Apple Health (HealthKit) integration for PulseLoop, including:
Apple Health Syncing:
User Profile Editor:
ProfileEditView).Advanced Calorie Calculations:
MET * Weight * Duration) with specific MET multipliers mapped to activity types.