2.0: beta feedback — edit dish from shopping list + dish photos in planner
- Shopping list: dishes under "No ingredients yet" now open the dish editor on tap (pencil affordance); list reconciles on dismiss. This was a dead end on devices without Apple Intelligence (no Generate button, e.g. iPhone 14). - Planner: dish photo as a scrimmed card background in the week calendar, behind a new Settings toggle (settings_show_dish_photos, default on). New optional AppSettings.showDishPhotosInPlanner (CloudKit/migration safe). - FilledSlotView: inlines the meal-card chrome to support the photo layer. - Toggle localized in all 6 languages. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BkanrydYtrme8wipTzWssG
This commit is contained in:
@@ -18,6 +18,7 @@ struct ShoppingListView: View {
|
||||
@State private var newItemText: String = ""
|
||||
@State private var generatingDishId: UUID?
|
||||
@State private var showPaywall = false
|
||||
@State private var editingDish: Dish?
|
||||
|
||||
private var items: [ShoppingItem] {
|
||||
allItems
|
||||
@@ -131,6 +132,16 @@ struct ShoppingListView: View {
|
||||
.sheet(isPresented: $showPaywall) {
|
||||
PremiumView(settings: settings, source: "ingredient_generation")
|
||||
}
|
||||
.sheet(item: $editingDish, onDismiss: {
|
||||
// Pick up ingredients the user just added in the editor.
|
||||
ShoppingListService.reconcile(
|
||||
context: context,
|
||||
weekStartDate: weekStartDate,
|
||||
plannedDishes: plannedDishes
|
||||
)
|
||||
}) { dish in
|
||||
DishFormView(dish: dish)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -179,9 +190,23 @@ struct ShoppingListView: View {
|
||||
@ViewBuilder
|
||||
private func missingIngredientsRow(_ dish: Dish) -> some View {
|
||||
HStack {
|
||||
Text(dish.name)
|
||||
.foregroundColor(.mealMoodTextPrimary)
|
||||
// Tapping the dish opens its editor — the only path to add
|
||||
// ingredients on devices without on-device generation.
|
||||
Button {
|
||||
editingDish = dish
|
||||
} label: {
|
||||
HStack(spacing: 6) {
|
||||
Text(dish.name)
|
||||
.foregroundColor(.mealMoodTextPrimary)
|
||||
Image(systemName: "square.and.pencil")
|
||||
.font(.system(size: 13))
|
||||
.foregroundColor(.mealMoodTextSecondary)
|
||||
}
|
||||
}
|
||||
.buttonStyle(.borderless)
|
||||
|
||||
Spacer()
|
||||
|
||||
if IngredientGenerator.isAvailable {
|
||||
if generatingDishId == dish.id {
|
||||
ProgressView()
|
||||
|
||||
Reference in New Issue
Block a user