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:
alexandrev-tibco
2026-07-14 22:06:11 +02:00
parent 9118cc6e86
commit 29cba08678
11 changed files with 83 additions and 6 deletions
+7 -3
View File
@@ -271,6 +271,7 @@ struct WeekCalendarView: View {
tags: dishTags.map { (name: $0.localizedName(language: settings.languageEnum.resolved()), color: $0.color) },
mealType: mealType,
showsRuleWarning: slot.isRuleOverridden,
photoData: settings.showDishPhotosInPlannerResolved ? dishData.photoData : nil,
onRemove: viewModel.canEditCurrentWeek ? {
guard let live = liveSlot(for: slot) else { return }
viewModel.removeDish(from: live, plan: plan, settings: settings)
@@ -313,6 +314,7 @@ struct WeekCalendarView: View {
let name: String
let descriptionText: String?
let tagIds: [UUID]
let photoData: Data?
}
private struct DisplaySlot {
@@ -326,7 +328,7 @@ struct WeekCalendarView: View {
private var dishesSnapshotKey: String {
dishes
.map { "\($0.id.uuidString)|\($0.name)|\($0.tagIds.count)|\($0.descriptionText ?? "")" }
.map { "\($0.id.uuidString)|\($0.name)|\($0.tagIds.count)|\($0.descriptionText ?? "")|\($0.photoData?.count ?? 0)" }
.joined(separator: ";")
}
@@ -335,7 +337,8 @@ struct WeekCalendarView: View {
return DishSnapshot(
name: live.name,
descriptionText: live.descriptionText,
tagIds: live.tagIds
tagIds: live.tagIds,
photoData: live.photoData
)
}
return dishSnapshotsById[dishId]
@@ -348,7 +351,8 @@ struct WeekCalendarView: View {
DishSnapshot(
name: dish.name,
descriptionText: dish.descriptionText,
tagIds: dish.tagIds
tagIds: dish.tagIds,
photoData: dish.photoData
)
)
})