diet-guard/app/test/screens
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
..
food_bank Split food_bank_screen; share the filter widgets with history 2026-08-15 19:43:08 +02:00
history Split history_screen and its test into widget siblings 2026-08-15 19:35:19 +02:00
calendar_screen_test.dart Remove unused features; fix reminder false alarms; share all state 2026-07-26 16:39:52 +02:00
edit_entry_screen_foodbank_test.dart fix: clear every macro field before a prefill, add the phone's delivery button 2026-08-23 09:34:47 +02:00
edit_entry_screen_test.dart Split the remaining seven Dart test files 2026-08-15 20:53:55 +02:00
github_mirror_device_dialog_test.dart Split six Dart test files; share the sync fixtures via a support sibling 2026-08-15 20:49:54 +02:00
github_mirror_device_flow_test.dart Split six Dart test files; share the sync fixtures via a support sibling 2026-08-15 20:49:54 +02:00
github_mirror_device_poll_test.dart Split six Dart test files; share the sync fixtures via a support sibling 2026-08-15 20:49:54 +02:00
github_mirror_screen_test.dart Split six Dart test files; share the sync fixtures via a support sibling 2026-08-15 20:49:54 +02:00
log_meal_kuchnia_mixin_test.dart fix: clear every macro field before a prefill, add the phone's delivery button 2026-08-23 09:34:47 +02:00
log_meal_prefill_nutrition_test.dart fix: clear every macro field before a prefill, add the phone's delivery button 2026-08-23 09:34:47 +02:00
log_meal_schedule_test.dart Rebuild the slot row when settings changes the schedule 2026-08-16 15:12:57 +02:00
log_meal_screen_nav_test.dart Split six Dart test files; share the sync fixtures via a support sibling 2026-08-15 20:49:54 +02:00
log_meal_screen_sync_test.dart Remove unused features; fix reminder false alarms; share all state 2026-07-26 16:39:52 +02:00
log_meal_screen_test.dart Rebuild the slot row when settings changes the schedule 2026-08-16 15:12:57 +02:00
settings_kuchnia_test.dart feat: add the catering login to settings, with an Android-only fetch 2026-08-23 08:33:52 +02:00
settings_screen_battery_test.dart Split the remaining seven Dart test files 2026-08-15 20:53:55 +02:00
settings_screen_test.dart Let the phone set the eating window and meal count 2026-08-16 14:56:12 +02:00