glp-companion/lib/features
Mike Kell e43603be1b feat(nutrition,pantry): add Phase 3C nutritional search engine, barcode scanning, and dual-source food cache
Implements the architecture 4.8 resolution ladder: local SQLCipher cache ->
Open Food Facts (4s timeout) -> USDA FoodData Central fallback, with every
remote hit written through to the new FoodProductsTable (schema v5).

- domain: FoodProduct entity + IFoodSearchRepository contract (pure Dart)
- data: UsdaFdcClient (FDC nutrient-ID mapper 1008/1003/1004/1005/1079/1093,
  api_key sent as query parameter - FDC ignores body keys and 403s otherwise),
  OpenFoodFactsClient (userAgent with app identity, SearchTerms search,
  getProductV3 barcode lookup), shared RemoteFoodDataSource interface
- presentation: FoodSearchController (400ms debounce, request-token
  supersession), FoodSearchScreen (MobileScanner sheet on mobile, manual UPC
  dialog + notification on desktop/web, macro action sheet with serving
  multipliers, Log to Diary / Add to Pantry actions)
- integration: /food-search route with ?preset=pantry, Nutrition screen entry
  button, Pantry screen Scan Item action
- hardening: FoodSearchUnavailableException distinguishes total source outage
  from a healthy empty result; GoogleHealthConnector dotenv reads now guarded
  with isInitialized (fixes NotInitializedError crashing app_navigation_test)
- tests: +16 (fallback sequence cache->OFF->USDA for text and barcode,
  USDA request shape via MockClient); full suite 170/170, analyze clean
2026-10-17 19:37:06 -04:00
..
auth feat(platform,auth,app): align identity to companionglp.com and harden OAuth deep-link handoff 2026-10-17 15:28:22 -04:00
exercise feat(app,exercise,recipes,settings): complete Phase 7 navigation and domain expansion 2026-10-16 19:19:02 -04:00
health_sync feat(platform,settings,nutrition): add Google Health cloud sync for desktop 2026-10-17 18:06:36 -04:00
meal_planner feat(app,exercise,recipes,settings): complete Phase 7 navigation and domain expansion 2026-10-16 19:19:02 -04:00
medication feat(app,exercise,recipes,settings): complete Phase 7 navigation and domain expansion 2026-10-16 19:19:02 -04:00
nutrition feat(nutrition,pantry): add Phase 3C nutritional search engine, barcode scanning, and dual-source food cache 2026-10-17 19:37:06 -04:00
pantry feat(nutrition,pantry): add Phase 3C nutritional search engine, barcode scanning, and dual-source food cache 2026-10-17 19:37:06 -04:00
recipes/presentation/screens feat(app,exercise,recipes,settings): complete Phase 7 navigation and domain expansion 2026-10-16 19:19:02 -04:00
settings/presentation feat(platform,settings,nutrition): add Google Health cloud sync for desktop 2026-10-17 18:06:36 -04:00