diet-guard/app/lib/screens
Krzysztof kuhy Rudnicki af35eb20c8 feat: offer delivered dishes to the log form, one tap each
The phone now prefills the log form with today's delivered dishes, in the
caterer's own meal order. It still never logs anything itself -- a delivered
meal is not an eaten meal, so the user taps for each dish.

Two guards carried over from the PC, both of which fail silently if dropped:

- **The queue survives a submit.** `prefillNextDish` has two callers: the
  initial load and the post-submit advance. On the PC the second briefly did
  not exist, which made "(N more to go)" a dead letter -- every dish after the
  first waited behind another tap. The test asserts the *form controller*
  holds dish 2 after dish 1 is logged, not that a dish is "available"; the
  latter passes throughout that bug.
- **The automatic refresh is guarded** by a device-local last-fetched date,
  mirroring `refresh_delivery_once`. The log-flow trigger can fire after every
  meal and each unguarded walk is a login plus three requests. The settings
  button deliberately stays unguarded: an explicit ask always goes and looks,
  matching `diet-guard kuchnia`. Only a clean fetch records the day, so an
  outage retries.

Dishes are ordered against `MealScheduleService.current`, never a hardcoded
four slots -- offering a dish for a slot the user's schedule does not have is
the "checkpoint that can never be satisfied" failure in a new costume.

Editing the description before submitting leaves the dish queued: what was
logged was not the delivered dish, and marking it eaten would lose a real
delivery silently.

Two bugs the tests caught:

- `dishesStillQueued` excluded the offered dish, so the status line read
  "0 more" while a real dish sat in the form. The offered dish is prefilled,
  not logged; it counts.
- An end-to-end test through the real `LogMealScreen` never terminated --
  that screen's `initState` fans out into sync, notifications and the food
  bank, and pumping it to quiescence hangs. Rather than keep fighting it, the
  behaviour is tested at the mixin that owns it, through a minimal host. The
  guarantee asserted is the same one: form contents after a submit.

`log_meal_screen.dart` is back under the 250-line cap by moving the nutrition
build into `log_meal_actions.dart` and inlining a one-line alias.

694 Dart tests, 1040 Python tests, 100% Python branch coverage.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QQpCiPaSbyRpwsLkH3dgsX
2026-08-23 09:07:17 +02:00
..
calendar_screen.dart Drop five redundant unawaited() wrappers around Navigator.push 2026-08-14 16:17:18 +02:00
edit_entry_screen.dart Remove unused features; fix reminder false alarms; share all state 2026-07-26 16:39:52 +02:00
food_bank_screen.dart Split food_bank_screen; share the filter widgets with history 2026-08-15 19:43:08 +02:00
github_client_id_dialog.dart Split the last four Dart lib files; file-length gate now reports zero 2026-08-15 21:07:24 +02:00
github_mirror_actions.dart Split the last four Dart lib files; file-length gate now reports zero 2026-08-15 21:07:24 +02:00
github_mirror_screen.dart Split the last four Dart lib files; file-length gate now reports zero 2026-08-15 21:07:24 +02:00
history_screen.dart Split history_screen and its test into widget siblings 2026-08-15 19:35:19 +02:00
log_meal_actions.dart feat: offer delivered dishes to the log form, one tap each 2026-08-23 09:07:17 +02:00
log_meal_kuchnia_mixin.dart feat: offer delivered dishes to the log form, one tap each 2026-08-23 09:07:17 +02:00
log_meal_nav_mixin.dart Rebuild the slot row when settings changes the schedule 2026-08-16 15:12:57 +02:00
log_meal_progress.dart Pin meal pills to one row; drop the "Logged" restatement 2026-08-16 14:18:39 +02:00
log_meal_screen.dart feat: offer delivered dishes to the log form, one tap each 2026-08-23 09:07:17 +02:00
log_meal_sync_mixin.dart Rebuild the slot row when settings changes the schedule 2026-08-16 15:12:57 +02:00
settings_kcal_goal.dart Split the last four Dart lib files; file-length gate now reports zero 2026-08-15 21:07:24 +02:00
settings_kuchnia.dart feat: add the catering login to settings, with an Android-only fetch 2026-08-23 08:33:52 +02:00
settings_meal_schedule.dart Let the phone set the eating window and meal count 2026-08-16 14:56:12 +02:00
settings_screen.dart feat: add the catering login to settings, with an Android-only fetch 2026-08-23 08:33:52 +02:00