v1.7.8: usa ingredienti dalla chat

- Nuovo endpoint chat_extract_recipe: Gemini estrae solo nomi+quantità
  con prompt minimo (nessun inventario nel prompt → niente troncamento),
  poi PHP fuzzy-match contro l'inventario completo identico a generateRecipe
- Frontend: _looksLikeRecipe() rileva risposte chat con ricetta;
  bottone '🥄 Usa ingredienti' appare sotto la bubble, chiama chatExtractIngredients()
  che mostra pannello inline con pulsanti '📦 Usa' per ogni ingrediente in dispensa
- useRecipeIngredient() riusato 1:1 con fallback _chatRecipeTitle per le note
- Stili CSS: btn-chat-use-recipe, chat-recipe-panel, chat-recipe-panel-container
- Chiavi i18n: use_ingredients_btn, recipe_ingredients_from_pantry (it/en/de)
This commit is contained in:
dadaloop82
2026-05-10 14:40:25 +00:00
parent 5462879783
commit 9973edf463
12 changed files with 547 additions and 58 deletions
+3 -1
View File
@@ -471,7 +471,9 @@
"suggestion_snack_text": "Was kann ich als schnellen Snack machen?",
"suggestion_juice_text": "Mach mir einen Saft oder Smoothie mit dem was ich habe",
"suggestion_light_text": "Ich habe Hunger, möchte aber etwas Leichtes",
"suggestion_expiry_text": "Was läuft bald ab und wie kann ich es verwenden?"
"suggestion_expiry_text": "Was läuft bald ab und wie kann ich es verwenden?",
"use_ingredients_btn": "Zutaten verwenden",
"recipe_ingredients_from_pantry": "Im Vorratsschrank gefundene Zutaten"
},
"cooking": {
"close": "Schließen",
+3 -1
View File
@@ -471,7 +471,9 @@
"suggestion_snack_text": "What can I make for a quick snack?",
"suggestion_juice_text": "Make me a juice or smoothie with what I have",
"suggestion_light_text": "I'm hungry but want something light",
"suggestion_expiry_text": "What's about to expire and how can I use it?"
"suggestion_expiry_text": "What's about to expire and how can I use it?",
"use_ingredients_btn": "Use ingredients",
"recipe_ingredients_from_pantry": "Ingredients found in pantry"
},
"cooking": {
"close": "Close",
+3 -1
View File
@@ -471,7 +471,9 @@
"suggestion_snack_text": "Cosa posso preparare per uno spuntino veloce?",
"suggestion_juice_text": "Fammi un succo o frullato con quello che ho",
"suggestion_light_text": "Ho fame ma voglio qualcosa di leggero",
"suggestion_expiry_text": "Cosa sta per scadere e come posso usarlo?"
"suggestion_expiry_text": "Cosa sta per scadere e come posso usarlo?",
"use_ingredients_btn": "Usa ingredienti",
"recipe_ingredients_from_pantry": "Ingredienti trovati in dispensa"
},
"cooking": {
"close": "Chiudi",