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": "🍳 Quick recipe with expiring products",
"banner_review_title": "Anomalous quantity",
"banner_review_action_ok": "It's correct",
"banner_review_action_finish": "🗑️ All gone",
"banner_review_action_edit": "Correct",
"banner_review_action_weigh": "Weigh",
"banner_review_dismiss": "Dismiss",
@@ -237,7 +238,10 @@
"when_tomorrow": "expires <strong>tomorrow</strong>",
"when_days": "expires in <strong>{n} days</strong>",
"toast_used": "📤 Used {qty} of {name}",
"toast_bring": "🛒 Product finished → added to Bring!"
"toast_bring": "🛒 Product finished → added to Bring!",
"toast_opened_finished": "🔓 Opened package of {name} finished!",
"disambiguation_hint": "What do you mean by \"all done\"?",
"disambiguation_all": "🗑️ Finish EVERYTHING ({qty})"
},
"product": {
"title_new": "New Product",