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:
@@ -135,5 +135,22 @@
|
||||
"generateWeekLabel": "주간 계획하기",
|
||||
"generateWeekSubtitle": "AI가 한 주 동안 아침, 점심, 저녁 식사 메뉴를 만들어 드립니다",
|
||||
"generatingMenu": "메뉴 생성 중...",
|
||||
"weekPlannedLabel": "주간 계획 완료"
|
||||
"weekPlannedLabel": "주간 계획 완료",
|
||||
|
||||
"planMenuButton": "식사 계획하기",
|
||||
"planMenuTitle": "무엇을 계획하시겠어요?",
|
||||
"planOptionSingleMeal": "식사 1회",
|
||||
"planOptionSingleMealDesc": "날짜와 식사 유형 선택",
|
||||
"planOptionDay": "하루",
|
||||
"planOptionDayDesc": "하루 전체 식사",
|
||||
"planOptionDays": "며칠",
|
||||
"planOptionDaysDesc": "기간 직접 설정",
|
||||
"planOptionWeek": "일주일",
|
||||
"planOptionWeekDesc": "7일 한 번에",
|
||||
"planSelectDate": "날짜 선택",
|
||||
"planSelectMealType": "식사 유형",
|
||||
"planSelectRange": "기간 선택",
|
||||
"planGenerateButton": "계획하기",
|
||||
"planGenerating": "플랜 생성 중\u2026",
|
||||
"planSuccess": "메뉴가 계획되었습니다!"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user