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:
@@ -13,6 +13,7 @@ import SwiftUI
|
||||
struct RecipeTabView: View {
|
||||
@EnvironmentObject var appState: AppState
|
||||
@EnvironmentObject var groceryList: GroceryListManager
|
||||
@EnvironmentObject var mealPlan: MealPlanManager
|
||||
@EnvironmentObject var viewModel: RecipeTabView.ViewModel
|
||||
@Environment(\.horizontalSizeClass) private var horizontalSizeClass
|
||||
|
||||
@@ -114,6 +115,7 @@ struct RecipeTabView: View {
|
||||
}())
|
||||
.environmentObject(appState)
|
||||
.environmentObject(groceryList)
|
||||
.environmentObject(mealPlan)
|
||||
.onAppear {
|
||||
viewModel.importedRecipeDetail = nil
|
||||
}
|
||||
@@ -126,6 +128,7 @@ struct RecipeTabView: View {
|
||||
.id(category.id)
|
||||
.environmentObject(appState)
|
||||
.environmentObject(groceryList)
|
||||
.environmentObject(mealPlan)
|
||||
case .allRecipes:
|
||||
AllRecipesListView(
|
||||
onCreateNew: { viewModel.navigateToNewRecipe() },
|
||||
@@ -133,12 +136,14 @@ struct RecipeTabView: View {
|
||||
)
|
||||
.environmentObject(appState)
|
||||
.environmentObject(groceryList)
|
||||
.environmentObject(mealPlan)
|
||||
}
|
||||
}
|
||||
.navigationDestination(for: Recipe.self) { recipe in
|
||||
RecipeView(viewModel: RecipeView.ViewModel(recipe: recipe))
|
||||
.environmentObject(appState)
|
||||
.environmentObject(groceryList)
|
||||
.environmentObject(mealPlan)
|
||||
}
|
||||
}
|
||||
} detail: {
|
||||
|
||||
Reference in New Issue
Block a user