From 4d972b824e046296b292142aa06debab88fe7293 Mon Sep 17 00:00:00 2001 From: dadaloop82 Date: Wed, 15 Apr 2026 11:05:23 +0000 Subject: [PATCH] fix: vacuum state in move-after-use modal + show all recipe ingredients in cooking mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - showMoveAfterUseModal: add '🫙 Torna sotto vuoto' checkbox (default=previous state) only shown if item was vacuum sealed; confirmMoveAfterUse passes vacuum_sealed to API - showRecipeMoveModal: same vacuum checkbox with wasVacuum default passed from ingredient - confirmRecipeMove: passes vacuum_sealed to inventory_update - PHP API: add vacuum_sealed to recipe ingredient enrichment - renderCookingStep: remove step-text word filter; show ALL unused from_pantry ingredients at every cooking step (AI uses pronouns like 'tagliarla' instead of repeating the ingredient name, causing them to be invisible) --- api/index.php | 1 + assets/js/app.js | 45 ++++++++++++++++++++++++++++++++------------- 2 files changed, 33 insertions(+), 13 deletions(-) diff --git a/api/index.php b/api/index.php index f1fcf0d..51bd69d 100644 --- a/api/index.php +++ b/api/index.php @@ -2013,6 +2013,7 @@ PROMPT; $ing['default_quantity'] = (float)($bestMatch['default_quantity'] ?? 0); $ing['package_unit'] = $bestMatch['package_unit'] ?? ''; $ing['available_qty'] = $bestMatch['quantity'] . ' ' . $bestMatch['unit']; + $ing['vacuum_sealed'] = !empty($bestMatch['vacuum_sealed']) ? 1 : 0; if (!empty($bestMatch['brand'])) { $ing['brand'] = $bestMatch['brand']; } diff --git a/assets/js/app.js b/assets/js/app.js index ebab010..32c63ad 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -4785,7 +4785,12 @@ function showMoveAfterUseModal(product, fromLoc, remaining, openedId) { const locButtons = otherLocs.map(([k, v]) => `` ).join(''); - + const wasVacuum = !!product.vacuum_sealed; + const vacuumRow = wasVacuum ? ` + ` : ''; document.getElementById('modal-content').innerHTML = `