diet-guard/app/lib/widgets
Krzysztof kuhy Rudnicki 895a87cf86 Split history_screen and its test into widget siblings
history_screen.dart (1052) and history_screen_test.dart (1017) were a third of
the remaining over-cap work. Widget extraction only -- no route changes, since
routes are user-visible and repo_invariants_test.dart pins the navigation
surface.

  history_screen.dart          1052 -> 211
  lib/widgets/history/
    history_filter.dart         102  filter criteria + sort enum (pure data)
    history_grouping.dart       206  HistoryItem tree, apply/group/format
    history_list.dart           194  GroupedList, DayHeaderTile, EntryTile
    history_filter_sheet.dart   242  the sheet itself
    history_filter_fields.dart  168  search field, slider labels, range row
    history_filter_sort.dart    140  source chips + sort controls

Names that now cross a file boundary became public (HistoryItem, DayHeader,
EntryRow, buildGroupedItems, formatDay, dateRangeLabel, the tile widgets), each
with the doc comment public_member_api_docs requires -- 49 of them, written
rather than suppressed.

The four macro range sliders (kcal/protein/carbs/fat) were four near-identical
30-line blocks differing only in label, key, unit and which HistoryFilter pair
they read/write. They are now one FilterRangeRow taking min/max plus an
onChanged, which is most of how the sheet got under the cap.

The test file mirrors the source split one-for-one, six files under
test/screens/history/. Its setUp/tearDown and the settle() helper (needed by
every part, because HistoryScreen loads via an untracked initState future) moved
to history_test_support.dart rather than being copy-pasted six times.

Verified: 555 flutter tests (same count as before -- no test lost in the split),
flutter analyze clean over all of lib/ and test/, 701 python tests at 100%
branch coverage, `python -m diet_guard sync` -> 402 entries/exit 0, live
~/.local/share/diet_guard byte-identical. Over-cap files: 42 -> 40.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RA9ynjqXPnexRQnR5oAuCC
2026-08-15 19:35:19 +02:00
..
history Split history_screen and its test into widget siblings 2026-08-15 19:35:19 +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 Compact LogMealScreen so it fits without scrolling on-screen keyboard 2026-07-04 05:19:23 +02:00
slot_selector_row.dart Remove the Snack chip from the phone's slot selector 2026-08-14 22:31:09 +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 Remove unused features; fix reminder false alarms; share all state 2026-07-26 16:39:52 +02:00