feat: general cooking-question chatbot on the recipes homepage

The existing recipe chat (RecipeChatPanel) is tightly scoped to one
recipe — recipeId is required and its system prompt embeds that recipe's
full ingredient/step context. Added a sibling, not a modification: a new
floating assistant on the recipes list page for questions that aren't
about any specific recipe (technique, substitutions, timing, food safety).

New /api/v1/ai/cooking-chat route (same quota/rate-limit/model-resolution
pattern as recipe-chat, minus the recipe lookup) and CookingAssistantPanel
component (same floating-button + Sheet UI). Positioned at bottom-24
rather than bottom-6 so it doesn't sit in the same band as the recipe
list's floating bulk-action bar during select mode.

Verified locally: asked a real cooking question through the actual UI,
got a correctly-formatted markdown answer with no recipe context leaking
in (confirmed the request payload only carries the question, no recipeId).
This commit is contained in:
Arnaud
2026-07-12 19:35:00 +02:00
parent 9a448ef34d
commit 2ffa05e4cf
5 changed files with 260 additions and 0 deletions
+14
View File
@@ -388,6 +388,20 @@
"inputPlaceholder": "Ask a question…",
"send": "Send message"
},
"cookingChat": {
"sorry": "Sorry, I couldn't answer that.",
"error": "Something went wrong. Please try again.",
"suggestion1": "How do I know when oil is hot enough?",
"suggestion2": "What's a good substitute for buttermilk?",
"suggestion3": "How long can I keep leftovers in the fridge?",
"suggestion4": "What's the difference between simmering and boiling?",
"ariaLabel": "Ask a cooking question",
"title": "Cooking assistant",
"subtitle": "Ask any cooking question — not tied to a specific recipe",
"intro": "Ask anything about cooking — techniques, substitutions, timing, equipment…",
"inputPlaceholder": "Ask a question…",
"send": "Send message"
},
"servingScaler": {
"servings": "Servings",
"reset": "Reset",
+14
View File
@@ -388,6 +388,20 @@
"inputPlaceholder": "Posez une question…",
"send": "Envoyer le message"
},
"cookingChat": {
"sorry": "Désolé, je n'ai pas pu répondre à cela.",
"error": "Une erreur s'est produite. Veuillez réessayer.",
"suggestion1": "Comment savoir si l'huile est assez chaude ?",
"suggestion2": "Quel est un bon substitut au lait fermenté ?",
"suggestion3": "Combien de temps puis-je garder des restes au frigo ?",
"suggestion4": "Quelle est la différence entre mijoter et bouillir ?",
"ariaLabel": "Poser une question de cuisine",
"title": "Assistant culinaire",
"subtitle": "Posez n'importe quelle question de cuisine — pas liée à une recette précise",
"intro": "Demandez n'importe quoi sur la cuisine — techniques, substitutions, minutage, équipement…",
"inputPlaceholder": "Posez une question…",
"send": "Envoyer le message"
},
"servingScaler": {
"servings": "Portions",
"reset": "Réinitialiser",