feat: flexible meal planning wizard — plan 1 meal, 1 day, several days, or a week
Backend:
- migration 005: expand menu_items.meal_type CHECK to all 6 types (second_breakfast, afternoon_snack, snack)
- ai/types.go: add Days and MealTypes to MenuRequest for partial generation
- openai/menu.go: parametrize GenerateMenu — use requested meal types and day count; add caloric fractions for all 6 meal types
- menu/repository.go: add UpsertItemsInTx for partial upsert (preserves existing slots); fix meal_type sort order in GetByWeek
- menu/handler.go: add dates+meal_types path to POST /ai/generate-menu; extract fetchImages/saveRecipes helpers; returns {"plans":[...]} for dates mode; backward-compatible with week mode
Client:
- PlanMenuSheet: bottom sheet with 4 planning horizon options
- PlanDatePickerSheet: adaptive sheet with date strip (single day/meal) or custom CalendarRangePicker (multi-day/week); sliding 7-day window for week mode
- menu_service.dart: add generateForDates
- menu_provider.dart: add PlanMenuService (generates + invalidates week providers), lastPlannedDateProvider
- home_screen.dart: add _PlanMenuButton card below quick actions; opens planning wizard
- l10n: 16 new keys for planning UI across all 12 languages
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -372,4 +372,52 @@ class AppLocalizationsEn extends AppLocalizations {
|
||||
|
||||
@override
|
||||
String get weekPlannedLabel => 'Week planned';
|
||||
|
||||
@override
|
||||
String get planMenuButton => 'Plan meals';
|
||||
|
||||
@override
|
||||
String get planMenuTitle => 'What to plan?';
|
||||
|
||||
@override
|
||||
String get planOptionSingleMeal => 'Single meal';
|
||||
|
||||
@override
|
||||
String get planOptionSingleMealDesc => 'Choose a day and meal type';
|
||||
|
||||
@override
|
||||
String get planOptionDay => 'One day';
|
||||
|
||||
@override
|
||||
String get planOptionDayDesc => 'All meals for one day';
|
||||
|
||||
@override
|
||||
String get planOptionDays => 'Several days';
|
||||
|
||||
@override
|
||||
String get planOptionDaysDesc => 'Custom date range';
|
||||
|
||||
@override
|
||||
String get planOptionWeek => 'A week';
|
||||
|
||||
@override
|
||||
String get planOptionWeekDesc => '7 days at once';
|
||||
|
||||
@override
|
||||
String get planSelectDate => 'Select date';
|
||||
|
||||
@override
|
||||
String get planSelectMealType => 'Meal type';
|
||||
|
||||
@override
|
||||
String get planSelectRange => 'Select period';
|
||||
|
||||
@override
|
||||
String get planGenerateButton => 'Plan';
|
||||
|
||||
@override
|
||||
String get planGenerating => 'Generating plan…';
|
||||
|
||||
@override
|
||||
String get planSuccess => 'Menu planned!';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user