From 13b55104a19f39dccfcca2729fc4c7a7eaa9f3d2 Mon Sep 17 00:00:00 2001 From: dadaloop82 Date: Thu, 7 May 2026 17:55:05 +0000 Subject: [PATCH] =?UTF-8?q?chore:=20release=20v1.7.4=20=E2=80=94=20AI=20pr?= =?UTF-8?q?ice=20estimation,=20dashboard=20badge,=20real-time=20total?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 15 +++++++++++++++ README.md | 1 + assets/js/app.js | 2 ++ index.html | 2 +- manifest.json | 2 +- 5 files changed, 20 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2dfb3ba..9769e16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,21 @@ All notable changes to EverShelf will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.7.4] - 2026-05-07 + +### Added +- **AI price estimation for shopping list** — Each item on the Bring! shopping list now shows an estimated retail price badge (per unit and total). Prices are fetched from Gemini AI and cached server-side for 3 months (`PRICE_UPDATE_MONTHS`). The running estimated total is displayed both in the shopping tab and as a green pill badge on the dashboard stat card. +- **Dashboard price total badge** — The shopping stat card on the dashboard shows a green `ca. €X.XX` badge (top-right, same position as the old urgency badge). It updates in real-time as prices are calculated and persists across navigation via `sessionStorage`. +- **Background price refresh** — Prices are fetched silently every 2 minutes even when not on the shopping tab, keeping the dashboard badge current without user interaction. +- **Smart quantity estimation** — The price payload uses `smart_shopping` data (consumption patterns) to send the correct buy quantity per item; falls back to Bring! spec parsing, then to `qty=1, unit=conf` for manually-added items. + +### Fixed +- **`stat-price-total` not visible on dashboard** — The total was only computed when `shoppingItems` was populated (i.e. shopping tab had been visited). Now uses `sessionStorage._pricetotal` as fallback so the badge is visible immediately on any page. +- **Price bar reloading on every tab switch** — `renderShoppingItems` now checks if ALL items are already cached with matching qty/unit; if so, it applies prices from cache instantly with no loading bar or API call. +- **`stat-price-total` real-time update** — Dashboard stat now increments as each individual item is priced (not only after the entire fetch completes). +- **Broken emoji in `log.title`** — Corrupted `\uFFFD` character in `it.json` and `de.json` replaced with `📒`. +- **`PRICE_CACHE_PATH` undefined crash** — Server-side constant was used inside functions that were called before the define; moved define to the very top of `api/index.php` (line 19). Affected: all `get_shopping_price` and `get_all_shopping_prices` calls from 16:33–16:40 on 2026-05-07. + ## [1.7.1] - 2026-05-04 ### Fixed diff --git a/README.md b/README.md index c1d54c1..7d30491 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ ## 🌍 Recent Updates +- **AI price estimation for shopping list** — Each Bring! shopping item now shows an estimated retail price badge (unit price + total). Prices are fetched via Gemini AI, cached server-side for 3 months, and stored client-side in `sessionStorage` to survive navigation. The dashboard shopping stat card shows a live green `ca. €X.XX` badge that updates in real-time as prices are calculated — even in background when you're on another tab. - **Kiosk v1.7.0: OTA update system** — "Cerca aggiornamenti" button in Settings triggers a forced GitHub release check; new `installUpdate()` JS bridge calls Android `DownloadManager` directly (lockTask mode blocks external browser links); graceful degradation for older APKs with manual instructions. Automatic OTA check every 6 hours with native update banner. - **Kiosk: consistent APK signing** — Project keystore (`evershelf.jks`) committed to the repo; every build — local or CI — now produces an APK with the same signature, eliminating "APK incompatible / signature conflict" errors on OTA update. - **GitHub Actions: auto-publish kiosk APK** — On every push to `main` that touches `evershelf-kiosk/`, Actions builds the APK and publishes a versioned semver release (`kiosk-X.Y.Z`) plus updates the `kiosk-latest` alias. No more manual release uploads. diff --git a/assets/js/app.js b/assets/js/app.js index 1666940..e6f77dc 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -8979,6 +8979,8 @@ async function fetchAllPrices(forceRefresh = false) { runningTotal += data.estimated_total; pricesFound++; } + // Update dashboard stat card in real-time as each price arrives + _updateDashboardPriceTotal(); } else { if (badge) badge.innerHTML = ``; } diff --git a/index.html b/index.html index 107d34e..841ea56 100644 --- a/index.html +++ b/index.html @@ -1461,6 +1461,6 @@ - + diff --git a/manifest.json b/manifest.json index 89ab6fe..274160b 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "name": "EverShelf", "short_name": "EverShelf", "description": "Gestione completa della dispensa di casa con scansione barcode", - "version": "1.7.3", + "version": "1.7.4", "start_url": "/evershelf/", "display": "standalone", "background_color": "#f0f4e8",