You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(ui): make the pantry page work like the aisle page #652
The pantry page (/pantry) is built differently from the rest of the web UI, and the newer Aisles page (#631, 637cc4d) in particular:
Layout. Items are a grid of tiles, each listing Qty: / Bought: / Expires: / Low at: with a - for every missing value. Other list pages use one row per entry inside a card per group (.card-head, .row, .row-value).
Adding. Adding an item opens a modal with every field. The Aisles page adds inline, at the end of each group and below the list.
Stock state is guessed in the browser, and the guess disagrees with the CLI.
The page marks an item out of stock when its quantity is '', '0', '0%g', '0%kg', '0%ml' or '0%L'. So an item with no quantity shows as out of stock, and 0%tins does not.
It compares against the low mark only when the units match. It never applies the built-in thresholds that cook pantry depleted uses (cookcli_core::pantry::depleted).
Expiry is not shown as such. An expired item looks like any other; only its date is printed.
Filtering is a single "Show only out of stock" checkbox with an untranslated counter.
Proposal
Make the page look and work like the Aisles page:
one card per section, with the name, the item count and the rename pencil in the head;
one row per item: a stock dot, the name with its details underneath, an expiry tag when the date is near or past, and the quantity;
stock and expiry judged by the server with cookcli-core's own rules, the same as cook pantry depleted / cook pantry expiring;
filter pills with counts: All, Running low, Out of stock, Expiring soon;
an inline edit panel under the row, with date pickers;
inline adding: a row at the end of each section, and a form below the list for any section, new ones included.
Activity
Screenshots: pantry rows (cooklang#652)