Add meal plan feature with cross-device sync and automatic stale data cleanup

Introduces weekly meal planning with a calendar-based tab view, per-recipe
date assignments synced via Nextcloud Cookbook custom metadata, and 30-day
automatic pruning of old entries on load, save, and sync merge.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-15 05:23:29 +01:00
parent 5890dbcad4
commit 8b23652f10
17 changed files with 1332 additions and 6 deletions

View File

@@ -27,6 +27,7 @@ class ObservableRecipeDetail: ObservableObject {
@Published var recipeInstructions: [String]
@Published var nutrition: [String:String]
var groceryState: GroceryState?
var mealPlanAssignment: MealPlanAssignment?
// Additional functionality
@Published var ingredientMultiplier: Double
@@ -50,6 +51,7 @@ class ObservableRecipeDetail: ObservableObject {
recipeInstructions = []
nutrition = [:]
groceryState = nil
mealPlanAssignment = nil
ingredientMultiplier = 1
}
@@ -71,6 +73,7 @@ class ObservableRecipeDetail: ObservableObject {
recipeInstructions = recipeDetail.recipeInstructions
nutrition = recipeDetail.nutrition
groceryState = recipeDetail.groceryState
mealPlanAssignment = recipeDetail.mealPlanAssignment
ingredientMultiplier = Double(recipeDetail.recipeYield == 0 ? 1 : recipeDetail.recipeYield)
}
@@ -94,7 +97,8 @@ class ObservableRecipeDetail: ObservableObject {
recipeIngredient: self.recipeIngredient,
recipeInstructions: self.recipeInstructions,
nutrition: self.nutrition,
groceryState: self.groceryState
groceryState: self.groceryState,
mealPlanAssignment: self.mealPlanAssignment
)
}