feat: generate a complete themed meal from a collection (v0.52.0)

New "Generate meal" button on any owned collection — pick a theme (free
text) and 2-6 courses (starter/main/side/dessert/drink), one generateObject
call produces a coherent recipe per course (shared cuisine/style, matching
flavors across courses) and all of them get saved as real recipes and
added to that collection in one action.

Follows the meal-plan generation route's established pattern: single
withAiQuota charge for the whole generation, then a pre-flight loop
charging the tier's recipe limit once per generated recipe (rolled back
on a partial breach) before the insert transaction runs. Recipes are
tagged with their course name for later filtering; visibility defaults to
private like every other AI-generated recipe.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Arnaud
2026-07-19 12:16:28 +02:00
parent 1b72135958
commit 8f83a1eaae
11 changed files with 430 additions and 5 deletions
+22 -1
View File
@@ -1208,7 +1208,28 @@
"removedFromCollection": "{count, plural, one {1 recipe removed from this collection} other {{count} recipes removed from this collection}}",
"removeFromCollectionFailed": "Failed to remove from collection",
"removeFromCollectionConfirmTitle": "{count, plural, one {Remove 1 recipe from this collection?} other {Remove {count} recipes from this collection?}}",
"removeFromCollectionConfirmDescription": "The recipe itself won't be deleted, just removed from this collection."
"removeFromCollectionConfirmDescription": "The recipe itself won't be deleted, just removed from this collection.",
"generateMeal": "Generate meal",
"generateMealTitle": "Generate a complete meal",
"generateMealDescription": "AI generates one recipe per course, all matching the same theme, and adds them to this collection.",
"themeLabel": "Theme",
"themePlaceholder": "e.g. Italian dinner for a birthday",
"coursesLabel": "Courses (pick at least 2)",
"course": {
"starter": "Starter",
"main": "Main",
"side": "Side",
"dessert": "Dessert",
"drink": "Drink"
},
"minCoursesHint": "Pick at least 2 courses.",
"servingsLabel": "Servings",
"dietaryLabel": "Dietary needs",
"dietaryPlaceholder": "e.g. vegetarian, no nuts",
"generatingMeal": "Generating…",
"generateMealButton": "Generate",
"generateMealSuccess": "{count, plural, one {1 recipe added} other {{count} recipes added}} to this collection",
"generateMealFailed": "Failed to generate meal"
},
"shareDialog": {
"invite": "Invite",
+22 -1
View File
@@ -1199,7 +1199,28 @@
"removedFromCollection": "{count, plural, one {1 recette retirée de cette collection} other {{count} recettes retirées de cette collection}}",
"removeFromCollectionFailed": "Échec du retrait de la collection",
"removeFromCollectionConfirmTitle": "{count, plural, one {Retirer 1 recette de cette collection ?} other {Retirer {count} recettes de cette collection ?}}",
"removeFromCollectionConfirmDescription": "La recette elle-même ne sera pas supprimée, seulement retirée de cette collection."
"removeFromCollectionConfirmDescription": "La recette elle-même ne sera pas supprimée, seulement retirée de cette collection.",
"generateMeal": "Générer un repas",
"generateMealTitle": "Générer un repas complet",
"generateMealDescription": "L'IA génère une recette par plat, toutes selon le même thème, et les ajoute à cette collection.",
"themeLabel": "Thème",
"themePlaceholder": "ex. Dîner italien pour un anniversaire",
"coursesLabel": "Plats (choisissez-en au moins 2)",
"course": {
"starter": "Entrée",
"main": "Plat",
"side": "Accompagnement",
"dessert": "Dessert",
"drink": "Boisson"
},
"minCoursesHint": "Choisissez au moins 2 plats.",
"servingsLabel": "Portions",
"dietaryLabel": "Contraintes alimentaires",
"dietaryPlaceholder": "ex. végétarien, sans noix",
"generatingMeal": "Génération…",
"generateMealButton": "Générer",
"generateMealSuccess": "{count, plural, one {1 recette ajoutée} other {{count} recettes ajoutées}} à cette collection",
"generateMealFailed": "Échec de la génération du repas"
},
"shareDialog": {
"invite": "Inviter",