feat: smart use-all context, scale baseline reset, freezer-ok alert suppression, conf qty fix, low-stock finish button

- submitUseAll() now detects opened packages: if current location has an opened pack, finishes only that; if exactly one opened pack exists elsewhere, uses it automatically; multiple opened packs → disambiguation modal
- quickUse() resets scale baseline on page open so stale weight doesn't immediately trigger auto-fill
- Expired alerts (dashboard + banner) now filter out freezer items within their safety window (level='ok')
- Review banner: conf unit quantity displayed as sub-unit total (e.g. 800g) instead of raw pack count; high-qty threshold evaluated on sub-unit volume to prevent '400 confezioni' nonsense
- Low-stock review banner gains 'È finito tutto' button → new bannerFinishAll() handler
- New _submitUseAllAt() helper and _showUseAllDisambiguation() modal
- New translation keys: toast_opened_finished, disambiguation_hint, disambiguation_all, banner_review_action_finish (it/en/de)
This commit is contained in:
dadaloop82
2026-05-03 13:12:35 +00:00
parent 4e583127dd
commit c814d99d1f
4 changed files with 192 additions and 15 deletions
+5 -1
View File
@@ -87,6 +87,7 @@
"quick_recipe": "🍳 Ricetta veloce con prodotti in scadenza",
"banner_review_title": "Quantità anomala",
"banner_review_action_ok": "È corretto",
"banner_review_action_finish": "🗑️ È finito tutto",
"banner_review_action_edit": "Correggi",
"banner_review_action_weigh": "Pesa",
"banner_review_dismiss": "Ignora",
@@ -237,7 +238,10 @@
"when_tomorrow": "scade <strong>domani</strong>",
"when_days": "scade tra <strong>{n} giorni</strong>",
"toast_used": "📤 Usato {qty} di {name}",
"toast_bring": "🛒 Prodotto finito → aggiunto a Bring!"
"toast_bring": "🛒 Prodotto finito → aggiunto a Bring!",
"toast_opened_finished": "🔓 Confezione aperta di {name} finita!",
"disambiguation_hint": "Cosa intendi con \"finito tutto\"?",
"disambiguation_all": "🗑️ Finito TUTTO ({qty})"
},
"product": {
"title_new": "Nuovo Prodotto",