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 (🛒)
- Add mapToLocalCategory() to map Open Food Facts tags (en:plant-based-foods...) to local categories (pasta, bevande, etc.)
- Add CATEGORY_LABELS for nice Italian display names with emoji icons
- Dashboard: items within each location section are now grouped by category with headers and count badges
- Inventory list: items grouped by category with collapsible headers
- renderGroupedByCategory() shared between dashboard and inventory views
- All CATEGORY_ICONS lookups now use mapToLocalCategory for consistent display
- When scanning returns 'Prodotto sconosciuto' or product has missing info: show inline edit form with name, brand, category fields on the action page
- saveEditedProductInfo() saves changes to DB and refreshes the action page
- New CSS: .cat-group-header, .cat-group-count, .edit-unknown-card styles
- Toast: add pointer-events:none when hidden to prevent invisible overlay blocking bottom nav
- Header: add prominent camera/scan button (📷) in top-right corner with pulse animation
- Product defaults: auto-fix products saved with 'pz/1' that have weight info in notes (re-detects unit/qty from Peso field and updates DB)
- Expiry sections: show relative days ('3 giorni', 'Domani', 'Scaduto da 5 giorni') instead of absolute dates
- Inventory list + dashboard items: use relative expiry labels
- New CSS: alert-item cards with badges, expiring/expired color-coded badges
- Added daysUntilExpiry() utility function
- Nuovo campo numerico nella pagina scansione per digitare il barcode
- Supporto tasto Invio per ricerca rapida
- Validazione: solo numeri, 4-14 cifre
- Riusa lo stesso flusso della scansione automatica (onBarcodeDetected)
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