diff --git a/api/index.php b/api/index.php index 50462fb..6ed08a8 100644 --- a/api/index.php +++ b/api/index.php @@ -3645,10 +3645,10 @@ PROMPT; $payload = [ 'contents' => [['role' => 'user', 'parts' => [['text' => $prompt]]]], - 'generationConfig' => ['temperature' => 0.1, 'maxOutputTokens' => 2048] + 'generationConfig' => ['temperature' => 0.1, 'maxOutputTokens' => 8192] ]; - $result = callGeminiWithFallback($apiKey, $payload, 30); + $result = callGeminiWithFallback($apiKey, $payload, 45); if ($result['http_code'] !== 200) { echo json_encode(['success' => false, 'error' => $result['data']['error']['message'] ?? 'gemini_error']); diff --git a/assets/js/app.js b/assets/js/app.js index fdc5a60..4229f6d 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -12449,11 +12449,20 @@ async function chatTransferToRecipes(btn, replyText) { await saveRecipeToArchive(recipe); _cachedRecipe = { meal: recipe.meal || 'pranzo', recipe }; renderRecipe(recipe); - document.getElementById('recipe-overlay').style.display = 'flex'; - document.getElementById('recipe-ask').style.display = 'none'; - document.getElementById('recipe-loading').style.display = 'none'; - document.getElementById('recipe-result').style.display = ''; btn.textContent = '✅ ' + (t('chat.transferred') || 'Aggiunta alle Ricette!'); + btn.disabled = true; + // Add "Apri la ricetta" button next to the transfer button + const openBtn = document.createElement('button'); + openBtn.className = 'btn-chat-use-recipe'; + openBtn.style.marginLeft = '8px'; + openBtn.textContent = '📖 ' + (t('chat.open_recipe') || 'Apri la ricetta'); + openBtn.onclick = () => { + document.getElementById('recipe-overlay').style.display = 'flex'; + document.getElementById('recipe-ask').style.display = 'none'; + document.getElementById('recipe-loading').style.display = 'none'; + document.getElementById('recipe-result').style.display = ''; + }; + btn.parentNode.insertBefore(openBtn, btn.nextSibling); showToast('✅ ' + (t('chat.transferred') || 'Aggiunta alle Ricette!'), 'success'); } catch (err) { console.error('[chatTransferToRecipes]', err); diff --git a/index.html b/index.html index c625faa..7f6bb83 100644 --- a/index.html +++ b/index.html @@ -1462,6 +1462,6 @@ - + diff --git a/translations/de.json b/translations/de.json index 8460b86..dec5cbe 100644 --- a/translations/de.json +++ b/translations/de.json @@ -474,7 +474,8 @@ "suggestion_expiry_text": "Was läuft bald ab und wie kann ich es verwenden?", "transfer_to_recipes": "Zu Rezepten hinzufügen", "transferring": "Übertrage...", - "transferred": "Zu Rezepten hinzugefügt!" + "transferred": "Zu Rezepten hinzugefügt!", + "open_recipe": "Rezept öffnen" }, "cooking": { "close": "Schließen", diff --git a/translations/en.json b/translations/en.json index 920085e..cf664a6 100644 --- a/translations/en.json +++ b/translations/en.json @@ -474,7 +474,8 @@ "suggestion_expiry_text": "What's about to expire and how can I use it?", "transfer_to_recipes": "Transfer to Recipes", "transferring": "Transferring...", - "transferred": "Added to Recipes!" + "transferred": "Added to Recipes!", + "open_recipe": "Open recipe" }, "cooking": { "close": "Close", diff --git a/translations/it.json b/translations/it.json index f78061a..e7184c3 100644 --- a/translations/it.json +++ b/translations/it.json @@ -474,7 +474,8 @@ "suggestion_expiry_text": "Cosa sta per scadere e come posso usarlo?", "transfer_to_recipes": "Trasferisci a Ricette", "transferring": "Trasferimento in corso...", - "transferred": "Aggiunta alle Ricette!" + "transferred": "Aggiunta alle Ricette!", + "open_recipe": "Apri la ricetta" }, "cooking": { "close": "Chiudi",