diet-guard/app/lib
Krzysztof kuhy Rudnicki d02f6aa6e8 Rebuild the slot row when settings changes the schedule
Found on the phone, not in the suite. Setting five meals updated the settings
preview and fired a reminder for the new 14:00 checkpoint, while the slot row
behind them kept showing the old 08/12/16/20 until the app was restarted:
onOpenSettings pushed the route without awaiting the pop, so the log screen
never rebuilt against the schedule the user had just chosen.

It now awaits and calls onScheduleMayHaveChanged, which re-reads the logged
slots and re-derives the selected slot -- the hour it pointed at may not be a
checkpoint at all any more. The other three destinations still fire and
forget, since none of them can change what this screen renders.

The regression test was confirmed to fail against the pre-fix behaviour
("Found 0 widgets with text 11:00") rather than passing vacuously.

Both files crossed the 250-line cap with the addition, so the hook moved to
log_meal_sync_mixin.dart -- which already owns refreshSlots and loggedSlots
and is the better home regardless -- and the new test into its own file.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0159b4E5hh512jYUeaJVNxfM
2026-08-16 15:12:57 +02:00
..
desktop Split wrapper_server and sync_merge into siblings 2026-08-15 16:42:27 +02:00
models Read the meal schedule from a forward-only history (Dart) 2026-08-16 14:41:37 +02:00
screens Rebuild the slot row when settings changes the schedule 2026-08-16 15:12:57 +02:00
services Sync the meal schedule as sched: fields on the budget record 2026-08-16 14:49:08 +02:00
ui Make the meal gate usable without a pointer on a 1366x768 screen 2026-07-30 16:21:27 +02:00
widgets Read the meal schedule from a forward-only history (Dart) 2026-08-16 14:41:37 +02:00
main.dart Read the meal schedule from a forward-only history (Dart) 2026-08-16 14:41:37 +02:00