diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b5b5d3..65bfa3f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **Recipe scraps tips** — During cooking steps, detect "waste" generated (peels, cores, bones, eggshells, coffee grounds, citrus zest, etc.) and surface AI-powered tips on how to reuse them (compost, natural cleaner, broth, candied peel, etc.). Could be shown as an optional collapsible hint card below the step that generates the scrap. +## [1.7.23] - 2026-05-18 + +### Added +- **⚙️ Generali tab** — new first tab in Settings groups all global settings: language, currency, theme, screensaver, zero-waste tips, inventory export. Old Language tab removed. +- **DB auto-cleanup** — `RECIPE_RETENTION_DAYS` (default 7) and `TRANSACTION_RETENTION_DAYS` (default 7) added to `.env`; old rows are deleted automatically every cron cycle, followed by `VACUUM` to compact the database. Manual trigger: `GET /api/?action=db_cleanup`. +- **Vacuum-sealed expiry grace period** — `VACUUM_EXPIRY_EXTENSION_DAYS` (default 30): vacuum-sealed products are only flagged as expired N days *after* the printed date, preventing false alarms on long-lasting items like cured meats. +- **Gemini AI usage tracking** — monthly and yearly token/cost stats now shown in Settings → ℹ️ Info tab, using tracked data from `data/ai_usage.json`. Cost rates configurable via `GEMINI_COST_25F_IN/OUT` and `GEMINI_COST_20F_IN/OUT` in `.env`. + +### Changed +- **Auto theme is now time-based** — "Automatico" mode switches to dark at 20:00 and back to light at 07:00, based on server/device clock (not OS preference). Re-evaluates every 5 minutes; ideal for always-on kiosk displays. +- **`dispensa.db` auto-deleted** — if the legacy empty `dispensa.db` file appears alongside `evershelf.db`, it is now removed automatically by the health check. +- **ZeroWaste tips and screensaver timeout** — these settings were not being persisted to `.env` on save (missing from POST payload); fixed. + ## [1.7.22] - 2026-05-17 ### Fixed diff --git a/README.md b/README.md index f048c1f..3a3d128 100644 --- a/README.md +++ b/README.md @@ -38,10 +38,11 @@ ## ✨ Features -> ♻️ **New in v1.7.19 — Zero-waste cooking tips** -> During cooking, EverShelf shows a contextual ♻️ tip card for each step that generates reusable scraps — peels, cooking water, egg whites, cheese rinds, bread crusts and more. -> Tips are generated by Gemini *as part of the recipe* at zero extra API cost, shown inline in cooking mode, and dismissible per step. -> Enable the toggle in **Settings → Zero-waste tips** (default: off). +> ⚙️ **New in v1.7.23 — Global settings tab, DB auto-cleanup, vacuum-sealed expiry** +> A new **Generali** tab groups all global settings (language, currency, theme, screensaver, zero-waste, export) in one place. +> Recipes older than `RECIPE_RETENTION_DAYS` and transactions older than `TRANSACTION_RETENTION_DAYS` are deleted automatically every cron cycle, followed by a SQLite `VACUUM` to keep the database small. +> Vacuum-sealed products get an extended grace period (`VACUUM_EXPIRY_EXTENSION_DAYS`, default 30 days) before being flagged as expired. +> Auto theme now follows **time of day** (dark 20:00–07:00) instead of the OS setting, making it server-friendly. ### 📦 Inventory Management - **Export inventory** — Download the full inventory as a UTF-8 CSV (Excel-compatible) or open a print-ready page to save as PDF; export button always visible in the inventory page header @@ -50,7 +51,7 @@ - **Smart locations** — Track items across Pantry, Fridge, Freezer, and custom locations - **Expiry tracking** — Automatic shelf-life estimation based on product type and storage - **Opened product tracking** — Reduced shelf-life calculation when packages are opened; opened-product expiry is now also checked when building banner alerts (not just the dashboard section) -- **Vacuum-sealed support** — Extended expiry dates for vacuum-sealed items +- **Vacuum-sealed support** — Extended expiry dates for vacuum-sealed items; products sealed under vacuum are only flagged as expired after a configurable grace period past the printed date (`VACUUM_EXPIRY_EXTENSION_DAYS`, default 30 days, configurable in `.env`) - **Anomaly detection** — Banner alerts for suspicious quantities and consumption predictions with inline correction; dismiss button now shows the current inventory quantity so the action is unambiguous ("Quantity is correct (2 pcs)") ### 🤖 AI-Powered (Google Gemini) @@ -98,9 +99,15 @@ - **Quick-access buttons** — Recently used and most popular products shown on the inventory page for fast access ### 🌙 Appearance -- **Dark mode** — Three modes: Light, Dark, and Auto (follows the OS/browser setting); theme is applied before the first render to prevent a white flash on dark-mode systems; toggle in Settings → Appearance +- **Dark mode** — Three modes: Light, Dark, and Auto (time-based: dark from 20:00 to 07:00, light otherwise); applies immediately without page reload; auto mode re-evaluates every 5 minutes, so night/day transitions happen automatically even on always-on kiosk displays; theme is applied before the first render to prevent a white flash +- **Global settings tab** — A dedicated **⚙️ Generali** tab groups all system-wide settings (language, currency, theme, screensaver, zero-waste tips, export) at the top of the Settings panel -### 📱 Progressive Web App +### �️ Database Maintenance +- **Automatic cleanup** — Recipes older than `RECIPE_RETENTION_DAYS` (default 7) and transactions older than `TRANSACTION_RETENTION_DAYS` (default 7) are deleted automatically on every cron cycle; SQLite `VACUUM` runs after each cleanup to keep the file compact +- **Manual cleanup** — Trigger immediately via `GET /api/?action=db_cleanup` +- **Compact by default** — Fresh installs stay small; large accumulated databases shrink back to a few hundred KB within one cron cycle + +### �📱 Progressive Web App - **Mobile-first design** — Optimized for phones, works on tablets and desktop - **Installable** — Add to home screen for a native app experience - **Multi-device** — All user data (shopping tags, pinned items, location preferences, scan history) is stored server-side in SQLite and shared across every device on the same instance; no data is siloed in a single browser's localStorage @@ -192,6 +199,19 @@ TTS_URL=http://your-home-assistant:8123/api/events/tts_speak TTS_TOKEN=your_long_lived_token TTS_ENABLED=true +# Optional: DB retention and cleanup (applied automatically each cron cycle) +RECIPE_RETENTION_DAYS=7 # delete recipe plans older than N days +TRANSACTION_RETENTION_DAYS=7 # delete stock transactions older than N days + +# Optional: Vacuum-sealed expiry grace period +VACUUM_EXPIRY_EXTENSION_DAYS=30 # extra days before vacuum-sealed items are flagged expired + +# Optional: Gemini cost rates (USD per million tokens, for the Info tab cost estimate) +GEMINI_COST_25F_IN=0.15 +GEMINI_COST_25F_OUT=0.60 +GEMINI_COST_20F_IN=0.10 +GEMINI_COST_20F_OUT=0.40 + # Optional: Security — protect the save_settings endpoint # Set a strong random string; the Settings UI will ask for it before saving SETTINGS_TOKEN= diff --git a/index.html b/index.html index 02e4a52..f5eb4a3 100644 --- a/index.html +++ b/index.html @@ -64,7 +64,7 @@ - v1.7.22 + v1.7.23 @@ -77,7 +77,7 @@

- EverShelfv1.7.22 + EverShelfv1.7.23

@@ -1652,6 +1652,6 @@
- + diff --git a/manifest.json b/manifest.json index fc36dd8..9e559d3 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.22", + "version": "1.7.23", "start_url": "/evershelf/", "display": "standalone", "background_color": "#f0f4e8",