diet-guard/app/test/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
..
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 Split the remaining seven Dart test files 2026-08-15 20:53:55 +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_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_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