diff --git a/assets/js/app.js b/assets/js/app.js index d2aad53..afb56d7 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -13619,40 +13619,9 @@ function renderCookingStep() { }).join(''); } - // Show ALL unused from_pantry ingredients only on the first step. - // On subsequent steps the ingredient panel stays hidden to avoid distraction. - const ings = _cookingStep === 0 - ? (_cookingRecipe.ingredients || []) - .map((ing, idx) => ({ ...ing, _idx: idx })) - .filter(ing => ing.from_pantry && ing.product_id && ing.used !== true) - : []; - + // Ingredients are shown in the recipe view only, not in cooking mode. const ingsEl = document.getElementById('cooking-step-ings'); - if (ings.length > 0) { - const cookingLocLabels = Object.fromEntries(Object.entries(LOCATIONS).map(([k,v]) => [k, `${v.icon} ${v.label}`])); - ingsEl.innerHTML = ings.map(ing => { - const loc = (ing.location || 'dispensa').replace(/'/g, "\\'"); - const qtyNum = Math.round((ing.qty_number || 0) * 10) / 10; - // Build info chips: brand, location, expiry - const chips = []; - if (ing.brand) chips.push(`${escapeHtml(ing.brand)}`); - const locLabel = cookingLocLabels[ing.location] || (ing.location ? `📍 ${ing.location}` : `${LOCATIONS.dispensa.icon} ${LOCATIONS.dispensa.label}`); - chips.push(`${locLabel}`); - if (ing.expiry_date) { - const daysLeft = Math.round((new Date(ing.expiry_date) - new Date()) / 86400000); - const expClass = daysLeft <= 3 ? 'exp-soon' : daysLeft <= 7 ? 'exp-close' : ''; - chips.push(`📅 ${t('cooking.expires_chip').replace('{date}', formatDate(ing.expiry_date))}`); - } - return `