feat: shopping list pantry hints, barcode multi-API fallback (OPF/beauty/Gemini), README disclaimer

- Shopping list: each item now shows 'Hai già Xg in dispensa' for same-family inventory stock
  - Lazy-loads inventory once per shopping page visit (_getShoppingInventoryCache)
  - Matches by first significant token (same logic as related-stock on action page)
  - Green hint below item badges, dark-mode aware (.shopping-pantry-hint)
- Barcode lookup: added Open Products Facts + Open Beauty Facts as step 3;
  Gemini AI (_barcodeLookupGemini) as final step 4 fallback
- Added stockForName PHP endpoint (stock_for_name action) for future use
- Restored missing function signatures for _offFetchProduct() and saveProduct()
  that were accidentally lost when stockForName was added in a previous session
- Translation: added shopping.pantry_hint in it/en/de
This commit is contained in:
dadaloop82
2026-05-23 09:53:17 +00:00
parent 561c6e9809
commit 6a41b53174
6 changed files with 236 additions and 7 deletions
+4 -2
View File
@@ -213,7 +213,8 @@
"barcode_acquired": "🔖 Barcode gescannt: {code}",
"scan_barcode": "🔖 Barcode scannen",
"create_named": "{name} erstellen",
"new_without_barcode": "Neues Produkt ohne Barcode"
"new_without_barcode": "Neues Produkt ohne Barcode",
"stock_in_pantry": "Bereits im Vorrat:"
},
"action": {
"title": "Was möchtest du tun?",
@@ -474,7 +475,8 @@
"priority_medium": "Mittel",
"priority_low": "Niedrig",
"smart_last_update": "Aktualisiert {time}",
"names_already_updated": "Alle Namen sind bereits aktuell"
"names_already_updated": "Alle Namen sind bereits aktuell",
"pantry_hint": "Bereits zuhause: {qty}"
},
"ai": {
"title": "🤖 KI-Identifikation",
+4 -2
View File
@@ -213,7 +213,8 @@
"barcode_acquired": "🔖 Barcode scanned: {code}",
"scan_barcode": "🔖 Scan Barcode",
"create_named": "Create {name}",
"new_without_barcode": "New product without barcode"
"new_without_barcode": "New product without barcode",
"stock_in_pantry": "Already in pantry:"
},
"action": {
"title": "What do you want to do?",
@@ -474,7 +475,8 @@
"priority_medium": "Medium",
"priority_low": "Low",
"smart_last_update": "Updated {time}",
"names_already_updated": "All names are already up to date"
"names_already_updated": "All names are already up to date",
"pantry_hint": "Already at home: {qty}"
},
"ai": {
"title": "🤖 AI Identification",
+4 -2
View File
@@ -213,7 +213,8 @@
"barcode_acquired": "🔖 Barcode acquisito: {code}",
"scan_barcode": "🔖 Scansiona Barcode",
"create_named": "Crea {name}",
"new_without_barcode": "Nuovo prodotto senza barcode"
"new_without_barcode": "Nuovo prodotto senza barcode",
"stock_in_pantry": "Hai gia in dispensa:"
},
"action": {
"title": "Cosa vuoi fare?",
@@ -474,7 +475,8 @@
"priority_medium": "Media",
"priority_low": "Bassa",
"smart_last_update": "Aggiornato {time}",
"names_already_updated": "Tutti i nomi sono già aggiornati"
"names_already_updated": "Tutti i nomi sono già aggiornati",
"pantry_hint": "Hai gia {qty} in dispensa"
},
"ai": {
"title": "🤖 Identificazione AI",