diet-guard/app/lib/widgets
Krzysztof kuhy Rudnicki d2e62bf210 Read the meal schedule from a forward-only history (Dart)
The phone/desktop half of the previous commit, so both devices now derive
their slots the same way. Still no edit surface, so `MealScheduleService`
returns the default and the derived hours are unchanged at 08/12/16/20.

`slot.dart` takes the schedule as a required argument, mirroring `_slots.py`,
and `slot_test.dart` gains the same every-hour x several-schedules sweep the
Python suite runs. That sweep is the contract: the two must agree on which
checkpoint a meal satisfies for every cell, not merely on the endpoints.

Also fixes a real bug this feature would otherwise have shipped on top of.
`syncToSlots` used the slot hour as the notification id but only cancelled ids
in the *current* schedule, so changing 08/12/16/20 -> 08/11/14/17/20 would
leave ids 12 and 16 posted with nothing that could ever cancel them: permanent
reminders for checkpoints that no longer exist. It now sweeps the whole 0..23
id space. The regression test was confirmed to fail against the old loop
(4 cancels vs 24) rather than passing vacuously.

MealScheduleService.current degrades to the default when the singleton is
absent, so `due_slot_check` deliberately does not init() it -- that would
reach path_provider from widget tests and from the WorkManager isolate before
main() runs. main.dart owns the real init, and background_sync_service.dart
does its own, since a fresh isolate has its own static state and would
otherwise nag against the default four meals.

609 Dart tests, 761 Python, both suites green.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0159b4E5hh512jYUeaJVNxfM
2026-08-16 14:41:37 +02:00
..
filters Split food_bank_screen; share the filter widgets with history 2026-08-15 19:43:08 +02:00
food_bank Split food_bank_screen; share the filter widgets with history 2026-08-15 19:43:08 +02:00
history Split food_bank_screen; share the filter widgets with history 2026-08-15 19:43:08 +02:00
autocomplete_suggestion_list.dart Compact LogMealScreen so it fits without scrolling on-screen keyboard 2026-07-04 05:19:23 +02:00
average_summary_row.dart Show weekly and monthly average intake on both devices 2026-08-09 14:59:40 +02:00
day_status_calendar.dart Make the meal gate usable without a pointer on a 1366x768 screen 2026-07-30 16:21:27 +02:00
macro_input_row.dart Split log_meal_screen into mixins and widget helpers 2026-08-15 20:59:48 +02:00
slot_selector_row.dart Read the meal schedule from a forward-only history (Dart) 2026-08-16 14:41:37 +02:00
streak_summary_row.dart Add budget-adherence calendar, streaks, and freely-editable synced budget 2026-07-13 21:31:45 +02:00
sync_health_banner.dart Make the phone publish on every tick, and fail closed on Firebase errors 2026-08-10 14:35:37 +02:00
today_progress_card.dart Pin meal pills to one row; drop the "Logged" restatement 2026-08-16 14:18:39 +02:00