diet-guard/app/test
Krzysztof kuhy Rudnicki c897279c8b fix: clear every macro field before a prefill, add the phone's delivery button
`fillControllersFromDish` set the dish's name, four macros and `grams` but
left `perGrams` untouched. A `100` left there by an earlier food-bank pick
made `nutritionForPortion` read the dish's per-portion macros as per-100g and
rescale them: one real entry on 2026-08-23 logged 472 kcal as 1217.8 (258/100).

The PC never had this -- `_gatelock_delivery.py` calls `_clear_inputs()` first
-- so the fix is that same discipline, as one `MacroControllers.clear()` call
rather than a `perGrams.clear()` line a seventh field could forget. `fillFrom`
now clears too, and `edit_entry_screen` routes through it instead of six
hand-written assignments; its `initState` fill had the same shape.

The old tests asserted controller *text* and passed throughout the bug, so the
new ones assert the computed `Nutrition` -- verified failing (400 -> 1200.0)
before the fix. `clear()` gets an enumerated test so a new field fails until
it is cleared too.

Also adds the log screen's "Today's delivery" button, matching the PC lock
screen's affordance: explicit taps are unguarded per the Triggers table, still
skip dishes already logged, and show the queue count. The whole action row
moved to its own widget, which put `log_meal_screen.dart` back under the cap.
The label is a FittedBox in an Expanded -- measured, since a Row clips an
oversized label without ever throwing.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QQpCiPaSbyRpwsLkH3dgsX
2026-08-23 09:34:47 +02:00
..
desktop Split the remaining seven Dart test files 2026-08-15 20:53:55 +02:00
models Read the meal schedule from a forward-only history (Dart) 2026-08-16 14:41:37 +02:00
screens fix: clear every macro field before a prefill, add the phone's delivery button 2026-08-23 09:34:47 +02:00
services feat: offer delivered dishes to the log form, one tap each 2026-08-23 09:07:17 +02:00
widgets fix: clear every macro field before a prefill, add the phone's delivery button 2026-08-23 09:34:47 +02:00
fake_notifications.dart Add OAuth device flow, background notifications, and fix AGP9 release crash (Milestones 3–4) 2026-06-25 17:29:23 +02:00
fake_secure_storage.dart Add Flutter half of cross-device sync (Milestone 3) 2026-06-22 22:42:27 +02:00
firebase_backend_google_test.dart Split the last four Dart lib files; file-length gate now reports zero 2026-08-15 21:07:24 +02:00
google_platform_test.dart Add Google sign-in support for the Firebase sync account 2026-08-12 23:36:10 +02:00
google_sign_in_backend_test.dart Add Google sign-in support for the Firebase sync account 2026-08-12 23:36:10 +02:00
keyboard_operability_test.dart Stop two keyboard tests hanging, and make the CI mirror mirror CI 2026-08-04 21:50:15 +02:00
kuchnia_bank_interop_test.dart fix: keep the catering dish queue alive across a submit 2026-08-22 23:36:53 +02:00
kuchnia_parity_test.dart feat: mirror the catering parser and slot spread in Dart, gated by one fixture 2026-08-23 08:00:54 +02:00
repo_invariants_test.dart fix: initialise the catering queue at startup 2026-08-23 09:08:54 +02:00
sync_merge_kuchnia_test.dart feat: carry the catering credential to the phone 2026-08-23 08:25:27 +02:00
widget_test.dart app: run the companion app's desktop target as a web build 2026-07-20 16:31:32 +02:00