diet-guard/app/lib/screens
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
..
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 Split log_meal_screen into mixins and widget helpers 2026-08-15 20:59:48 +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 Rebuild the slot row when settings changes the schedule 2026-08-16 15:12:57 +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_meal_schedule.dart Let the phone set the eating window and meal count 2026-08-16 14:56:12 +02:00
settings_screen.dart Let the phone set the eating window and meal count 2026-08-16 14:56:12 +02:00