Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add opt-in calorie and macro tracking - #96

Merged
saksham2001 merged 6 commits into
mainfrom
claude/calorie-intake-tracking-8f065d
Jul 26, 2026
Merged

saksham2001 merged 6 commits into
mainfrom
claude/calorie-intake-tracking-8f065d

Conversation

@saksham2001

Copy link
Copy Markdown
Owner

Summary

Adds opt-in calorie/macro tracking: meal logging via a dedicated Nutrition page (manual entry, Open Food Facts search, barcode scan, AI photo/describe analysis) and via the AI coach (text or photo → log_meal with in-chat meal cards). Nutrition numbers are grounded in Open Food Facts where possible, with per-entry provenance (verified / AI estimate / manual) — never silently guessed. Intake goals (kcal + macros) are set in Settings or by the coach; when enabled, nutrition context flows into coach chat, check-ins, and summaries. Surfaced as an Activity-page card, a Today tile, and a home-screen widget — no new tab. Off by default with granular sub-toggles (share with coach, photo analysis, HealthKit dietary export, Today/widget visibility).

Type of change

  • ✨ New feature (non-breaking change that adds functionality)
  • 🤖 Coach / LLM change (tools, prompts, orchestration)
  • 🎨 UI / DesignSystem change

How was this tested?

  • Added / updated unit tests (PulseLoopTests) — 54 new tests (repository, prefs decode, OFF mapper/client with stubbed URLSession, coach tools, goals, context injection)
  • Ran the test suite locally — 762/762 pass; app + widget-extension targets build green
  • Tested with demo data (-seedDemo YES, no hardware) — verified Activity card, Nutrition page, and settings in the simulator (new -enableNutrition YES / -openNutrition YES test hooks); additive SwiftData migration verified on launch

Privacy & data

  • This change does not send health data off-device without explicit user action. Feature is off by default; the only visible trace while disabled is the Settings row. Meal photos reach the user's configured LLM provider only via explicit attach/Analyze actions; Open Food Facts calls are user-triggered (search/scan) and cache-first; HealthKit dietary export is a separate opt-in.
  • No secrets, API keys, or personal data are committed.

Checklist

  • My code follows the project's style (SwiftLint passes).
  • I ran the tests and they pass.

@saksham2001
saksham2001 merged commit c0def0f into main Jul 26, 2026
2 checks passed
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