Massive PantrLytics Update

Just pushed a BIG update for PantrLytics. Below were all the changes. Feel free to ask me any questions.

Download: https://github.com/Psychman52OS/PantrLytics

Major Update: v2026.03.28

This is the biggest update to PantrLytics yet. Basically every part of the app has been touched — the UI, the reports page, swipe gestures, photos, admin settings, and the backup system. Here’s what’s new.

REPORTS ARE ACTUALLY USEFUL NOW

The old reports page had some bar charts and a compliance percentage. That was it. The new one gives you real, actionable data.

Inventory Health Score — A single 0–100 score (graded A through F) that tells you how well your pantry is managed. It weighs use-by compliance (50%), how many of your items actually have dates set (30%), and how recently items have been audited (20%). If your pantry is a mess, you’ll know immediately.

What Needs Attention — A priority action list at the top of the page. It tells you things like “12 items are expired and still in stock” or “47 items have no use-by date set.” If everything is fine, it says so. No more hunting through the page to find problems.

Interactive charts — The old charts were just colored CSS boxes. The new ones use Chart.js and actually respond to hover, show tooltips, and scale properly:

  • Compliance donut (compliant vs expired)

  • Aging distribution bar chart

  • Depletion trend line (past 12 weeks)

  • Most consumed items bar chart

Category and Location Compliance Tables — See which categories and storage locations have the most expired or undated items. Sorted worst-first so the biggest problems are at the top. Each row has an inline percent bar so you can scan it quickly.

Waste Rate — Tracks the percentage of depletions that happened after the item’s use-by date. If you’re regularly throwing things away expired, this will show you.

Depletion Velocity — How many items you’ve been consuming per week over the past 12 weeks. Good for spotting patterns in high-turnover categories.

Top Consumed Items — Which items you go through the most. Useful for knowing what to prioritize when adding new stock.

Bulk “Mark All Expired Depleted” — One button to mark every expired item as depleted with reason “Expired.” Cleans up your inventory without going item by item.

Export to CSV — Download a filtered view of your inventory (by horizon, category, or location) as a spreadsheet.

SWIPE GESTURES, DONE RIGHT

Swipe gestures were added previously but had some rough edges. This update finishes the job.

Configurable actions — In Admin settings, you can now choose what happens on left-swipe and right-swipe independently. Options: Edit, Mark Depleted, Open Details, Print Label, or No Action. The overlays update dynamically to show whatever you’ve configured.

Desktop support — Swipe now works on touchscreen workstations (and any desktop) via click-drag. Just click and drag left or right on any card. You’ll see the grab cursor on cards to hint that they’re draggable.

List view swipe — Previously, swiping in list view just gave a background tint. Now it shows the same icon/label overlay as grid cards — a color-coded panel slides in from the edge with the action icon and label.

UI OVERHAUL

A lot changed here. Here are the biggest pieces:

AJAX Live Search — Searching the inventory no longer reloads the page. Results swap in place as you type (350ms debounce). The URL updates so results are shareable/bookmarkable.

List/Grid Toggle — Switch between the compact table view and a responsive card grid with photo thumbnails. Your preference is remembered across sessions.

Mobile Bottom Tab Bar — On mobile, the navigation is now a sticky bottom bar (Items, New, Designer, Reports, More) instead of a hamburger menu. The “More” tab opens a slide-up sheet with Admin, Backup, and Depleted Items. Much more thumb-friendly.

Deplete From the List — You can now mark items as depleted directly from the home page without opening the item. A small dialog lets you set the date/time and reason.

Sidebar Action Panel — On the item detail page, all the actions (print, deplete, edit, delete) are now grouped in a sidebar that stays visible as you scroll through the item details.

PHOTOS & THUMBNAILS

Set Primary Thumbnail — When an item has multiple photos, you can click the ★ star on any photo in the edit form to set it as the card grid thumbnail. The grid immediately reflects the change.

Default Item Icon — Instead of the default 📦 emoji, you can now set a custom default icon for items without photos. Choose from a grid of 40 food/pantry emojis in Admin, or upload a custom PNG/JPG.

ADMIN & SETTINGS

Font Size Controls — Set a global base font size, with separate overrides for the inventory list and item detail pages. Useful for touchscreen deployments where you want everything larger.

Unit Management — Add, edit, reorder, and delete units from Admin. Toggle which units show quantity +/− buttons on item cards.

BACKUP & RESTORE

The backup and restore system went through a significant hardening pass. Several edge cases that caused restore failures have been fixed:

  • Backups now use VACUUM INTO for WAL-safe snapshots (no more consistency issues with WAL/SHM files)

  • Restore correctly disposes database connections before swapping the file, then restarts cleanly using os.execv

  • Stale WAL/SHM files are cleaned up after restore

  • A “waiting” page with JS polling replaces the blind 45-second redirect delay — you’re redirected automatically when the app is back online

  • CSV imports no longer silently skip rows due to an internal column label/key mismatch

BUG FIXES

  • Sticky header — The navigation menu would disappear after scrolling more than one screen height. Fixed by correcting a body { height: 100% } CSS issue that was limiting the sticky constraint.

  • Grid card dropdown menus were being clipped by overflow: hidden on the card container

  • Admin section collapse didn’t work for sections with display: flex layout

  • Thumbnail star button broke under HA ingress due to a URL scheme mismatch (now uses pathname-only fetch)

  • Item detail sidebar centering was unreliable under CSS Grid; switched to Flexbox

  • Quick-filter panel toggle was being overridden by display: flex

INSTALLATION

Update through the Home Assistant Add-on Store. No database migrations required — everything is backward compatible.

As always, if you run into issues, leave comment .