Skip to content

feat: sync nutrition metrics from HealthKit - #9

Open
jkuehnemundt wants to merge 1 commit into
meltforce:mainfrom
jkuehnemundt:feat/nutrition-metrics
Open

jkuehnemundt wants to merge 1 commit into
meltforce:mainfrom
jkuehnemundt:feat/nutrition-metrics

Conversation

@jkuehnemundt

Copy link
Copy Markdown

Summary

  • The server allowlist already accepts 39 dietary metrics, but the iOS app only synced caffeine and water
  • Apps like Yazio write calories, macros and micronutrients into HealthKit — users expected them to appear in FreeReps
  • Add 18 nutrition types: energy consumed, protein, total/saturated/mono/polyunsaturated fat, carbohydrates, sugar, fiber, cholesterol, sodium, potassium, calcium, iron, magnesium, zinc, vitamin C, vitamin D
  • All use aggregateCumulative to match their cumulative HealthKit semantics
  • Caffeine corrected from g/individual to mg/aggregateCumulative

Test plan

  • Build the iOS app in Xcode — verify no compile errors
  • Check HealthKit permissions screen shows the new nutrition types
  • Sync with a Yazio user's HealthKit data and verify dietary_energy_consumed, dietary_protein etc. appear in FreeReps
  • Confirm dietary_water and dietary_caffeine still sync correctly after the strategy change

…, vitamins)

The server allowlist already accepts 39 dietary metrics, but the iOS app
only read caffeine and water. Apps like Yazio write calories, macros and
micronutrients into HealthKit and users expected them to appear in
FreeReps.

Add the 18 most commonly tracked nutrition types: energy consumed,
protein, total/saturated/mono/polyunsaturated fat, carbohydrates, sugar,
fiber, cholesterol, sodium, potassium, calcium, iron, magnesium, zinc,
vitamin C and vitamin D. All use aggregateCumulative to match their
cumulative HealthKit semantics. Caffeine switches from g to mg and from
individual to aggregateCumulative to align with how HealthKit stores it.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant