diet-guard/app/test/screens
Krzysztof kuhy Rudnicki da8822006f Let the phone set the eating window and meal count
The first edit surface, landing after the sync layer so a schedule set here
reaches the PC rather than leaving the two devices deriving different slots.

Three dropdowns -- first meal, last meal, meals per day -- and a live preview
of the checkpoints they derive. Setting 08:00, 20:00 and 5 shows
08:00 · 11:00 · 14:00 · 17:00 · 20:00, which is asserted in the screen test
rather than only in the model's.

Dropdowns rather than showTimePicker: that returns a TimeOfDay with minutes,
and slots are whole hours on both devices by design. They also make the
invalid states unrepresentable instead of validated -- "last meal" offers only
hours after "first", and "meals per day" only counts the window has whole
hours for. MealSchedule.normalized() still clamps, but that is the defence
against corrupt synced data, not the input contract.

Saving re-runs the due-slot check, because reminder ids are slot hours: a
schedule change orphans the ids it no longer contains, and waiting for the
next background tick would leave a stale nag on screen for up to 15 minutes.

The UI is a `part` mixin like settings_kcal_goal.dart -- settings_screen.dart
was at 238 of the 250-line cap and is now at 247.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0159b4E5hh512jYUeaJVNxfM
2026-08-16 14:56:12 +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_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 Pin meal pills to one row; drop the "Logged" restatement 2026-08-16 14:18:39 +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