Commit Graph

547 Commits

Author SHA1 Message Date
dadaloop82 bc36c93c08 feat: screensaver shows shopping total 2026-05-07 19:29:55 +00:00
dadaloop82 c02a2fc632 feat: screensaver shopping panel with item count and estimated total 2026-05-07 19:29:53 +00:00
dadaloop82 7fd2da1d67 fix: price cache timestamp prevents stale totals across clients 2026-05-07 18:58:13 +00:00
dadaloop82 dfbdbc6efb fix: use timestamp-based price cache validity; invalidate stale per-item cache 2026-05-07 18:58:11 +00:00
dadaloop82 12560dd4c1 release: v1.7.4 — server-side centralized price totals 2026-05-07 18:55:40 +00:00
dadaloop82 6c342a412b fix: centralize price totals server-side; batch API call; 5-min total cache 2026-05-07 18:55:37 +00:00
dadaloop82 12934a045c release: v1.7.4 patch — skip price reload on tab open 2026-05-07 18:50:07 +00:00
dadaloop82 a01ca583ea fix: skip price fetch on first render when smart data empty; bump header to v1.7.4 2026-05-07 18:50:04 +00:00
dadaloop82 47fe51148f Merge branch 'main' of github-evershelf:dadaloop82/EverShelf 2026-05-07 17:55:33 +00:00
dadaloop82 acd6ddb140 release: v1.7.4 — AI price estimation for shopping list 2026-05-07 17:55:18 +00:00
dadaloop82 13b55104a1 chore: release v1.7.4 — AI price estimation, dashboard badge, real-time total 2026-05-07 17:55:05 +00:00
github-actions[bot] 5d9eadf691 chore: auto-merge develop → main
Triggered by: bcd7580 fix: show price total on dashboard via sessionStorage fallback
2026-05-07 17:50:15 +00:00
github-actions[bot] ffa3daba0e chore: auto-merge develop → main
Triggered by: 1584d40 fix: replace stat-urgent with green price total badge top-right
2026-05-07 17:48:23 +00:00
dadaloop82 bcd7580729 fix: show price total on dashboard via sessionStorage fallback 2026-05-07 17:48:18 +00:00
github-actions[bot] 6c11c0105a chore: auto-merge develop → main
Triggered by: 20192f9 fix: prices cached on tab switch; background price fetch every 2min; stat-price-total bigger
2026-05-07 17:47:11 +00:00
dadaloop82 1584d402e4 fix: replace stat-urgent with green price total badge top-right 2026-05-07 17:46:20 +00:00
dadaloop82 20192f902d fix: prices cached on tab switch; background price fetch every 2min; stat-price-total bigger 2026-05-07 17:44:56 +00:00
github-actions[bot] e06d2d506a chore: auto-merge develop → main
Triggered by: b9082ea fix: log.title emoji; add price estimate total to shopping stat card
2026-05-07 17:43:27 +00:00
dadaloop82 b9082eae52 fix: log.title emoji; add price estimate total to shopping stat card 2026-05-07 17:41:41 +00:00
github-actions[bot] 60da4e6989 chore: auto-merge develop → main
Triggered by: 0de9a62 fix: price estimate for all items, including manually-added ones
2026-05-07 17:39:56 +00:00
dadaloop82 0de9a62058 fix: price estimate for all items, including manually-added ones
- AI prompt: always return a best-guess price (never null/price_not_found)
  for unrecognised items returns generic package estimate with '~' prefix
- Cache key bumped to v3 to invalidate old null-returning cache entries
- JS: manually-added items (no smart match, no spec) default to qty=1/conf
  instead of qty=1/pz so _calcEstimatedTotal treats them as a single pack
- Price badge: shows '~€X.XX' prefix when source_note starts with '~'
  so user knows the price is a rough estimate
2026-05-07 17:38:05 +00:00
github-actions[bot] 3aabaeccb7 chore: auto-merge develop → main
Triggered by: 3a9f0cc fix: bump asset versions to force cache bust; price rate limit own bucket
2026-05-07 17:35:50 +00:00
dadaloop82 3a9f0ccf79 fix: bump asset versions to force cache bust; price rate limit own bucket
- app.js and style.css versioned to 20260507a so browsers load new code
- get_shopping_price / get_all_shopping_prices moved to dedicated 'price'
  rate-limit bucket (60 req/min) separate from general (120 req/min)
  to avoid false 429s during sequential per-item price loading
2026-05-07 17:34:04 +00:00
github-actions[bot] dfe14c1f34 chore: auto-merge develop → main
Triggered by: 5f510c0 feat: AI price estimation for shopping list with per-item real-time display
2026-05-07 17:33:14 +00:00
dadaloop82 5f510c0451 feat: AI price estimation for shopping list with per-item real-time display
- Add get_shopping_price / get_all_shopping_prices API endpoints
- AI (Gemini) estimates retail price per natural unit (pack, piece, bunch)
  instead of always per-kg — avoids absurd totals like €1609
- _calcEstimatedTotal: proper g/ml→package conversion using defQty + regex
  on unit_label; only 'kg'/'l' labels trigger weight/volume math
- Cache key bumped to v2 to invalidate old per-kg cached entries
- Suggested quantity cap lowered from 20 to 10 conf/pz
- Unit mismatch guard: if totalUsed >> buyCount*5 for unit=conf, use
  purchase frequency instead of raw consumption rate
- JS _buildPricePayload: use smartShoppingItems for qty/unit (not Bring! spec)
- JS _cachedPrices: persist in sessionStorage (survives navigation);
  validated by _qty/_unit metadata so stale totals auto-invalidate
- Price display redesigned: right-side column per row (price-col-main +
  price-col-unit) instead of small inline badge
- fetchAllPrices: buttons disabled immediately before guard check;
  running total uses only current shoppingItems (not Object.values cache)
- Background refresh: always silent (removed 90s interaction condition)
- visibilitychange: sets _bgCall=true for shopping before refreshCurrentPage
- .gitignore: add runtime data files (bring_migrate_ts, shopping_price_cache,
  anomaly_dismissed, opened_shelf_cache, shopping_name_cache)
- Remove bring_catalog.json and bring_migrate_ts.json from tracking
2026-05-07 17:31:23 +00:00
github-actions[bot] 7005708e95 chore: auto-merge develop → main
Triggered by: 4196130 feat: AI suggestions, smart shopping qty, shelf life fixes, UX polish
2026-05-07 06:20:38 +00:00
dadaloop82 4196130835 feat: AI suggestions, smart shopping qty, shelf life fixes, UX polish
- bringSuggestItems(): Gemini AI for seasonal/complementary suggestions (6h cache)
- renderSuggestions(): AI badge (🤖 AI) for AI-sourced items + CSS .priority-ai
- smartShopping(): suggested_qty/unit/approx with package-aware tiers
- autoSyncUrgencySpecs(): sync suggested quantities to Bring! spec field
- estimateOpenedExpiryDays(): dairy-outside-fridge rules (panna 3d, yogurt 2d, latte 1d)
- AI shelf-life upper bound tightened to max(rule×4, 30) days
- Opened section: fix 0g display (remainderAmt >= 0.5 threshold, pkgSize guard)
- guessCategoryFromName(): expanded with 50+ new patterns (uova, herbs, vegetables...)
- Suggestions panel: excludes already-added Bring! items
- Shopping list: no re-render while suggestions panel is open
- Translations: remove duplicate 🍳 from dashboard.quick_recipe (all 3 langs)
- Scale icon: always white via filter:brightness(0)invert(1)
- opened_shelf_cache.json: remove 3 bad dairy entries (60d outside fridge)
2026-05-07 06:19:07 +00:00
dadaloop82 eeb2b512ad merge: screensaver timeout setting + gitignore kiosk build artifacts 2026-05-06 15:00:17 +00:00
dadaloop82 ffb0341eb6 feat: screensaver configurable timeout + fix gitignore (exclude kiosk build artifacts) 2026-05-06 15:00:04 +00:00
dadaloop82 459766fa80 merge develop → main: kiosk v1.7.0 OTA + signing + CI + nutrition dashboard + error reporting 2026-05-06 14:53:17 +00:00
dadaloop82 725e2ee5ee docs: update README with kiosk v1.7.0 features, OTA signing fix, Actions CI, nutrition dashboard 2026-05-06 14:53:07 +00:00
dadaloop82 709a8c769b merge: fix false update warning + Actions auto-publish kiosk APK with semver tag 2026-05-06 14:41:41 +00:00
dadaloop82 8535f4d4b9 fix: update check ignores non-semver tags + GitHub Actions builds versioned releases 2026-05-06 14:41:36 +00:00
dadaloop82 6c9478f09d merge: fix APK signing with project keystore 2026-05-06 14:26:04 +00:00
dadaloop82 cbb3f6b288 fix: use project keystore for consistent APK signing (fixes OTA update signature conflict) 2026-05-06 14:25:59 +00:00
dadaloop82 d793682362 merge develop: kiosk update old APK fallback fix 2026-05-06 14:22:05 +00:00
dadaloop82 484b378be9 fix: kiosk update button works in old APK, shows manual steps if installUpdate missing 2026-05-06 14:22:01 +00:00
dadaloop82 f93c5bf111 merge develop: kiosk update fallback message fix 2026-05-06 14:18:33 +00:00
dadaloop82 8d0ffef600 fix: kiosk update panel shows manual download link when APK too old 2026-05-06 14:18:29 +00:00
dadaloop82 3ad1cd6a52 merge develop: kiosk manual update check v1.7.0 2026-05-06 14:17:35 +00:00
dadaloop82 1c890c66ea feat: kiosk manual update check + install from settings
KioskActivity.kt:
- checkForUpdates(forceCheck, jsCallback): accepts force flag + optional
  JS callback to deliver result as JSON to the WebView
- New @JavascriptInterface checkForUpdates(): bypasses 6h throttle,
  calls back window._kioskUpdateResult({has_update, current, latest, apk_url})
- New @JavascriptInterface installUpdate(apkUrl): triggers APK download+install
- Improved error handling: HTTP status check + network error JSON response

app.js:
- window._kioskUpdateResult(): callback receives update check JSON,
  shows green/amber status box with version info, shows install button
- _kioskCheckForUpdates(): triggers native check, shows spinner while waiting
- _kioskInstallUpdate(): passes apk_url to native installUpdate()
- loadSettings(): shows #kiosk-update-panel when in kiosk WebView

index.html:
- #kiosk-update-panel: version label, 'Cerca aggiornamenti' button,
  status box, 'Installa aggiornamento' button (hidden until update found)
- CSS cache bump ?v=20260506e

build.gradle.kts: version 1.6.0 → 1.7.0 (versionCode 10 → 11)
2026-05-06 14:17:31 +00:00
dadaloop82 ed2b792722 merge develop: scale dot fix, kiosk update notice, live weight diag 2026-05-06 14:07:33 +00:00
dadaloop82 891733aa8c fix: scale dot white+glow, kiosk reconfigure fallback, live weight in settings
style.css:
- Connected dot: white fill + green border/glow (was green-on-green, invisible)

app.js:
- _kioskReconfigureScale(): show #kiosk-needs-update-notice + toast when
  kiosk APK is too old and reconfigureScale() method is missing
- _scaleUpdateStatus(): show/hide #scale-live-diag panel, update device + battery
- _scaleOnMessage weight: update #scale-diag-weight in real time
- _scaleOnMessage status: update #scale-diag-proto with BLE protocol

index.html:
- #kiosk-needs-update-notice: amber warning + download link inside kiosk panel
- #scale-live-diag: device name, battery, live weight readout, reconnect info
- CSS cache bump ?v=20260506d
2026-05-06 14:07:29 +00:00
dadaloop82 f3d9bc903c merge develop: nutrition analysis + screensaver pie charts 2026-05-06 14:00:22 +00:00
dadaloop82 e002cc4483 feat: nutrition analysis section + screensaver animated pie charts
app.js:
- _buildNutritionData(): category distribution, health/variety/freshness scores
- _renderNutritionSection(): animated 3D conic-gradient pie + legend + score bars
- _startInsightAlternation(): waste <-> nutrition fade-swap every hour
- _startScreensaverRotation(): facts and nutrition panel alternate every 5 min
- _renderScreensaverNutrition(): 3D animated pie + donut ring scores on screensaver
- _ssDonut(): CSS-only ring donut helper
- Removed two generic filler screensaver facts
- Cleaned up time-of-day screensaver facts (content-aware, no empty greetings)

index.html:
- Wrap waste/nutrition sections in #dashboard-insight-wrap
- Add #screensaver-nutrition slot in screensaver overlay
- Bump CSS cache ?v=20260506c

style.css:
- .ss-pie3d: 3D perspective + cubic-bezier spring + continuous slow spin
- .ss-donut-ring: CSS conic-gradient donut with bobbing animation
- .nutr-card, .nutr-pie-3d: dashboard nutrition card with 3D pie spin
- Score bars with fill transition
2026-05-06 14:00:13 +00:00
dadaloop82 2662e10b29 merge develop into main 2026-05-06 13:44:54 +00:00
dadaloop82 115c966322 fix: scale dot contrast + kiosk scale config panel + download banner in kiosk
style.css:
- Scale connected dot: bright #4ade80 fill + white border + double shadow
  so it pops on the dark green header (was white on green = invisible)

index.html:
- Scale settings tab: add kiosk panel with 'Riconfigura bilancia BLE'
  button (hidden in browser, shown in kiosk mode)
- Wrap gateway download section and WebSocket URL section with IDs
  so JS can hide them in kiosk mode
- CSS cache bust ?v=20260506b

app.js:
- syncSettingsFromDB: in kiosk mode hide scale gateway download section,
  WebSocket URL section and test button; show kiosk BLE panel instead;
  auto-set URL to ws://localhost:8765
- Add _kioskReconfigureScale() helper that calls _kioskBridge.reconfigureScale()

KioskActivity.kt:
- Add reconfigureScale() @JavascriptInterface: stops GatewayService,
  clears saved scale device prefs, launches SetupActivity at step 4
- Import GatewayService
2026-05-06 13:44:50 +00:00
dadaloop82 22bbf46d95 merge develop into main 2026-05-06 11:24:33 +00:00
dadaloop82 f04e227cc0 fix: kiosk title center + location pref 2 uses + update confirm before download
app.js:
- _injectKioskOverlay: move kiosk-mode class assignment BEFORE the
  _kiosk_overlay existence guard — fixes race where Kotlin onPageFinished
  injects buttons during the await api() pause, then JS skips the class
- _PREF_LOC_NEEDED: 3 → 2 (remember use-location after 2 picks, not 3)

KioskActivity.kt:
- showNativeUpdateBanner: remove auto-start of triggerApkDownload;
  banner now shows with 'Scarica' button enabled, download only starts
  when user taps it (confirms before install)
2026-05-06 11:24:29 +00:00
dadaloop82 1013118db3 merge develop into main 2026-05-06 11:18:42 +00:00