Skip to content

feat(ui): make the pantry page work like the aisle page #652

Closed

Description

@LeMyst

Problem

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions