- Nuova sezione 'Log' nella bottom nav con icona 📒
- Mostra tutte le transazioni (entrate/uscite) raggruppate per data
- Ogni voce: icona 📥/📤, nome prodotto, marca, quantità, posizione, orario
- Bordo verde per aggiunte, rosso per uscite
- Paginazione con 'Carica altri...' (50 per pagina)
- Backend: aggiunto supporto offset a listTransactions
- useFromInventory controlla se il prodotto è esaurito ovunque (qty=0 in tutte le location)
- Se finito, lo aggiunge automaticamente alla lista Bring! con nome e marca
- Toast notifica '🛒 Prodotto finito → aggiunto a Bring!' in tutte le UI (ricetta, uso diretto, usa tutto)
- Prosciutto crudo light e Philadelphia Light aggiunti manualmente a Bring!
- Backend: aggiunge brand e expiry_date all'arricchimento ingredienti
- Frontend: sotto ogni ingrediente dalla dispensa mostra:
- Marca in corsivo (se presente)
- Icona posizione (🧊 Frigo/Freezer, 🗄️ Dispensa)
- Scadenza con colore urgenza (⛔ scaduto, 🔴 <3gg, 🟡 <7gg, 📅 data)
- Nuovo stile CSS per riga dettaglio ingrediente
- Ricetta cachata in localStorage: riaprendo mostra la stessa ricetta
- Si rigenera solo se cambia tipo pasto (colazione/pranzo/cena) o bottone 'Generane un'altra'
- Prompt Gemini aggiornato: richiede qty_number nella stessa unità di misura dell'inventario
- Bottone 'Usa' ora scala la quantità effettiva della ricetta (non più sempre 1)
- Estratta renderRecipe() per riutilizzo con cache
- Aggiunto bottone '🔄 Generane un'altra' nel risultato ricetta
- Backend: arricchisce risposta ricetta con product_id, location per ingredienti from_pantry
- Matching fuzzy nome ingrediente AI → prodotto inventario (exact/contains/word overlap)
- Frontend: bottone '📦 Usa' per ogni ingrediente catalogato in dispensa
- Click → chiama inventory_use API → scala 1 unità → feedback visivo (barrato + verde)
- Ingredienti non in dispensa (🛒) mostrati senza bottone
- Specification inviata a Bring! include emoji priorità (🔴/🟡/🟢) + dettagli
- AI prompt aggiornato: specification deve sempre indicare quantità consigliata
- In Bring! si vede es: '🔴 500g, bio' per urgenza alta
- Tap on any expired or expiring item opens the detail modal
- From the modal: edit quantity/location/expiry, delete, or use
- Same behavior as regular inventory items
- Added showAlertItemDetail() function (loads inventory then shows modal)
- Visual feedback on tap (scale + highlight)
AI Identification:
- Rewrite analyzeWithAI() to use Gemini API for real image analysis
- Auto-start analysis immediately after taking photo (no manual button)
- Gemini identifies product name, brand, category from photo
- Reverse search on Open Food Facts to find matching barcoded products
- User can select a match to import full product data with barcode
- Or save product directly without barcode
- New API endpoint: gemini_identify with OFF reverse search
Dashboard:
- Move 🚫 Scaduti section to TOP of dashboard
- Show only top 4 soonest expiring items below
- Limit API query to 4 results
- Change query from 7-day threshold to soonest 10 items with expiry
- Section now always visible when items have expiry dates
- Improved badges: OGGI, Domani, N giorni, Ng, ~N mesi
- Color coding: red (today), orange (≤7d), yellow (≤30d), grey (>30d)
- Renamed section to 'Prossime Scadenze'
- Remove camera/scan button from bottom nav (scan stays in header)
- Add 🍳 Ricetta button with prominent styling in bottom nav
- Auto-detect meal type based on time of day (colazione/pranzo/cena)
- Ask number of persons (default 1)
- Generate recipe via Gemini AI using pantry ingredients
- Prioritize expiring/expired items in recipe suggestions
- Focus on healthy, balanced meals
- Full recipe with ingredients list and step-by-step procedure
- Show prep/cook time, tags, nutrition notes, expiry warnings
- Mark ingredients as from pantry (✅) or extra (🛒)
- Ridotto il frame della camera scadenza a 180px con zoom 2x e crop centrale
- Fix: premere 'Appena comprato' / 'Ce l'avevo già' non modifica più la quantità
- Fix: nomi prodotti in script non-latino vengono sostituiti con alternative leggibili
- Corretto nome prodotto 'Celozrnný toastový chléb' → 'Sandwich American Style'
- Migliorato ordine fallback nomi: product_name_it → generic_name_it → product_name
Features:
- Barcode scanning (QuaggaJS) + Open Food Facts API lookup
- Inventory management with locations (Frigo, Freezer, Dispensa)
- Product database with Italian product suggestions
- Expiry date estimation by category
- AI expiry date reading via Gemini Vision API
- Flexible unit of measure (pz, conf, g, kg, ml, L)
- Nutriscore/NOVA/Ecoscore/allergens display
- Mobile-first PWA with offline support
- SQLite backend with PHP REST API