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:
@@ -831,6 +831,102 @@ abstract class AppLocalizations {
|
||||
/// In en, this message translates to:
|
||||
/// **'Week planned'**
|
||||
String get weekPlannedLabel;
|
||||
|
||||
/// No description provided for @planMenuButton.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Plan meals'**
|
||||
String get planMenuButton;
|
||||
|
||||
/// No description provided for @planMenuTitle.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'What to plan?'**
|
||||
String get planMenuTitle;
|
||||
|
||||
/// No description provided for @planOptionSingleMeal.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Single meal'**
|
||||
String get planOptionSingleMeal;
|
||||
|
||||
/// No description provided for @planOptionSingleMealDesc.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Choose a day and meal type'**
|
||||
String get planOptionSingleMealDesc;
|
||||
|
||||
/// No description provided for @planOptionDay.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'One day'**
|
||||
String get planOptionDay;
|
||||
|
||||
/// No description provided for @planOptionDayDesc.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'All meals for one day'**
|
||||
String get planOptionDayDesc;
|
||||
|
||||
/// No description provided for @planOptionDays.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Several days'**
|
||||
String get planOptionDays;
|
||||
|
||||
/// No description provided for @planOptionDaysDesc.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Custom date range'**
|
||||
String get planOptionDaysDesc;
|
||||
|
||||
/// No description provided for @planOptionWeek.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'A week'**
|
||||
String get planOptionWeek;
|
||||
|
||||
/// No description provided for @planOptionWeekDesc.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'7 days at once'**
|
||||
String get planOptionWeekDesc;
|
||||
|
||||
/// No description provided for @planSelectDate.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Select date'**
|
||||
String get planSelectDate;
|
||||
|
||||
/// No description provided for @planSelectMealType.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Meal type'**
|
||||
String get planSelectMealType;
|
||||
|
||||
/// No description provided for @planSelectRange.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Select period'**
|
||||
String get planSelectRange;
|
||||
|
||||
/// No description provided for @planGenerateButton.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Plan'**
|
||||
String get planGenerateButton;
|
||||
|
||||
/// No description provided for @planGenerating.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Generating plan…'**
|
||||
String get planGenerating;
|
||||
|
||||
/// No description provided for @planSuccess.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Menu planned!'**
|
||||
String get planSuccess;
|
||||
}
|
||||
|
||||
class _AppLocalizationsDelegate
|
||||
|
||||
Reference in New Issue
Block a user