- API returns total_remaining, product_name, unit, default_qty after use
- isLowStock() detects when inventory is running low (pz<=2, conf<=1, weight/vol<=25% of default)
- After using a product, if low stock detected, shows prompt asking to add to Bring shopping list
- Works in main USE form, USE ALL, and recipe ingredient USE
- Prompt chains properly: low-stock then move-after-use (if applicable)
- Skips prompt when product is fully depleted (already auto-added to Bring)
- Clicking 'Usa' on a recipe ingredient now opens a modal popup instead of
directly consuming. Shows location selector, quantity controls (+/- buttons),
conf/sub-unit mode, and 'Usa TUTTO' option.
- Quantity is pre-filled with the recipe's suggested amount
- Auto-selects location with opened package
- After use, shows move-after-use modal (stays on recipe page, not dashboard)
- Separate recipe-context move functions (showRecipeMoveModal, confirmRecipeMove)
- Modal overlay z-index 250 to appear above recipe dialog
- Fixed isSuspiciousDefaultQty: for conf products, checks package_unit thresholds
(375g is fine for g-max=10000, not checked against conf-max=50)
- Auto-split on use: when using from a conf product with whole+fractional qty,
automatically separates whole confs from opened part
e.g. Panna 2.6conf → use 5g → 2conf (sealed) + 0.56conf (opened)
- Move modal now moves only the opened row (via opened_id)
- Use query prefers fractional rows (opened packages) first
- Non-conf products still get standard move-after-use behavior
- Fixed Cracker integrali default_quantity from 500 to 16 (was weight in grams, should be pieces)
- Review system now also flags products with absurd default_quantity (package size)
e.g. a 'pz' product claiming 500pz per package gets flagged as '📦 Conf. sospetta'
- Uses same QTY_THRESHOLDS max values for detection
- Quick recipe: prompt now specifies 1 persona, excludes freezer products
- USE form: auto-selects location with opened package as default
(deducts from already-opened packages before sealed ones)
- Move-after-use modal verified working (shows after partial use)
- Added 'Ricetta veloce' button between stat cards and expired section
(navigates to chat and auto-asks Gemini for a recipe with expiring products)
- Added waste vs consumption mini chart between expiring and opened sections
(horizontal bar showing used/wasted ratio from last 30 days)
- API: getStats() now returns used_30d and wasted_30d counts
- Cache busters updated to 20260316c
- Dopo aver usato un prodotto, se rimane quantità mostra modal con opzione
di spostarlo in un'altra posizione (es. dispensa→frigo dopo apertura)
- La scadenza viene ricalcolata per la nuova posizione
- Fix marmellata: default_quantity era 0 → non appariva tra prodotti aperti
- Auto-set default_quantity al primo add per prodotti g/ml/kg/l senza pkg size
- Versione: 20260316b
- selectPurchaseType: non usa più date hardcoded, ricalcola sempre in base
alla posizione e stato sotto vuoto corrente
- Edit inventario: cambiare posizione o toggle sotto vuoto ricalcola la scadenza
- Spostamento prodotto: ricalcola scadenza per la nuova posizione
- Fix DB: fusi di pollo freezer 120gg, Bel Paese vacuum 21gg, Speck vacuum 75gg
- Versione: 20260315j
- Query SQL ora rileva prodotti aperti per tutte le unità dove la quantità
non è multiplo della dimensione confezione (soglia 2% per evitare errori arrot.)
- Frontend: rendering differente per conf (X conf + rimanente) e altri (Xg / Yg)
- Versione: 20260315i
- Scanner: usa BarcodeDetector API nativa (Chrome Android) come primario, Quagga come fallback
- Settings: aggiunta tab Fotocamera per scegliere posteriore/anteriore/specifica
- Scanner feedback: barra verde (scansione attiva), gialla (barcode rilevato)
- Ricette: invio titoli ricette del giorno per evitare duplicati nello stesso giorno
- Debug: sistema di logging remoto (client_debug.log) per diagnostica da dispositivi chioscati
- Fix: permessi .env per scrittura da Apache
- Numero grande e visibile (es. '10')
- Sotto: unità + dettaglio confezione (es. 'conf da 36g')
- Sotto: proporzione rimasta in piccolo (es. '¼')
- Stesso layout per dashboard compact items
- Frazione esclusa per unit=conf (dove default_quantity è il peso)
- Cache-busting v=20260311c
- Aggiunto version param a CSS/JS per forzare reload browser
- startManualEntry() resetta pf-conf-size-row correttamente
- Validazione: se unit=conf ma dimensione non specificata, errore
- onAddUnitChange: scrollIntoView quando conf-size-row appare
- Reset campi conf quando si cambia unità nel form aggiungi
- Nuovo campo package_unit in DB (migrazione automatica)
- Form aggiungi/modifica: quando si seleziona 'conf', appare campo per
specificare il contenuto della singola confezione (es. 300g, 2L)
- Visualizzazione: '3 conf (da 300g)' in inventario, dettaglio, butta
- formatQuantity aggiornato con supporto package_unit
- API: salva/restituisce package_unit in tutti gli endpoint
- Ricette e chat: contesto arricchito con info confezione
- CSS: stili per il nuovo campo conf-size
- Gemini star icon button next to camera in header
- Full chat page with message bubbles, typing indicator
- Conversation history persisted in localStorage (last 50 messages)
- System context includes: full inventory with expiry dates, appliances, dietary restrictions
- Multi-turn conversation with Gemini 2.0 Flash
- Pre-built suggestion chips: snack, juice/smoothie, light meal, use expiring items
- Clear chat button for fresh conversations
- Indigo/purple themed UI matching Gemini branding
- PHP gemini_chat API endpoint with inventory context injection
- Flags inventory items with abnormally small or large quantities
- Per-unit thresholds (pz/conf, g, kg, ml, l)
- Confirm button (✓) to mark as correct (stored in localStorage)
- Edit button (✏️) opens existing edit modal
- Smooth dismiss animation on confirm
- Amber-themed styling to distinguish from expiry alerts
- Frazione mostrata solo se c'è un avanzo reale e default_quantity > 1
- Rimossi duplicati (5 pz + 5 conf), pieno, ⅛, titoli ridondanti
- pz/conf arrotondati a intero (no 8.8 pz)
- Stile più discreto e piccolo
- Fix qty_number nelle ricette: validazione e conversione automatica
delle unità di misura (g↔kg, ml↔L, g→pz con default_quantity)
- Sanity check: cap qty_number al disponibile, correzione valori
assurdamente piccoli dovuti a errori di Gemini
- Aggiunto indicatore confezione (¼, ½, ¾, pieno) vicino alla
quantità nell'inventario e nella barra stato dopo scansione
- Aggiunto default_quantity nella query inventory_list
- Nuova funzione formatPackageFraction() per calcolo frazioni