Skip to content

Pantry quantities are only subtracted when the unit is written the same way (cup/cups, g/kg, fractions) #199

Open

Description

@dubadub

I see that at least my garlic is not on the list (expected behavior with both units as cloves). However, I have milk and half-and-half in cups on the recipe ingredient and in the pantry, yet it's still on the shopping list. The other ingredients (carrots, flour, sugar) do not have units in the pantry, so the limitation you mentioned makes sense for those.

The other issue is why it doesn't pick up on the unsalted butter at all. I made the units match, and I tried giving the aisle.conf a line for "unsalted butter | unsalted_butter". From what I can see, this happens with any pantry item that isn't a single word.

Image Image

also I just realized my ingredient for the butter says "tbps" while the pantry says "tbsp". I fixed it, but it didn't change anything regarding the issue.

Activity

  1. added
    bug
    on Nov 28, 2025
  2. mawo66 commented on Dec 6, 2025

    @mawo66
    Contributor

    Could you please share the recipe to reproduce the issues?
    What I saw so far is that the pantry's half-and-half is in "oz" and the recipe my use "cups". And you are right, the synonyms seem not to work here correctly, but no matter if single word or not.

  3. changed the title [-]Pantry issues[/-] [+]Pantry items with multi-word names or units are ignored in the shopping list[/+] on Aug 7, 2026
  4. added
    area: pantry
    area: shopping-list
    on Aug 7, 2026
  5. added
    upstream
    on Oct 10, 2026
  6. changed the title [-]Pantry items with multi-word names or units are ignored in the shopping list[/-] [+]Pantry quantities are only subtracted when the unit is written the same way (cup/cups, g/kg, fractions)[/+] on Oct 10, 2026
  7. LeMyst commented on Oct 10, 2026

    @LeMyst
    Collaborator

    Retitled: half of this is fixed, the unit half is not.

    Multi-word names work now. On current main (6e22411, cooklang 0.19.0), with

    [fridge]
    "unsalted butter" = "10%tbsp"
    "heavy cream" = "1%cup"
    milk = "1%cup"
    "half-and-half" = "1/2%cup"
    yogurt = "1%kg"

    and Mix @unsalted butter{2%tbsp}, @heavy cream{1/2%cup}, @milk{2%cups}, @half-and-half{1/4%cup} and @yogurt{100%g}., cook shopping-list leaves out the butter and the cream. The web pantry page (#629, #653) also writes multi-word names quoted, as above.

    Units are still compared as written:

    WARN Unit mismatch for 'milk': recipe needs 'cups', pantry has 'cup'
    WARN Cannot parse pantry quantity for 'half-and-half': 1/2%cup
    WARN Unit mismatch for 'yogurt': recipe needs 'g', pantry has 'kg'
    milk          2 cups
    half-and-half 0.25 cup
    yogurt        100 g
    
    • cup and cups, g and kg, ml and l do not match: the full amount stays on the list (IngredientList::subtract_pantry in cooklang-rs).
    • A fraction in the pantry (1/2%cup) cannot be read, because pantry quantities are parsed as plain numbers (parse_quantity in cooklang-rs).
    • @mawo66's case: half-and-half in oz in the pantry against cups in the recipe is the same mismatch.
    • An aisle synonym (unsalted butter | butter) is used for grouping the list but not for the pantry lookup: that part is Make aisle aliases (A|B) work globally, not just for shopping-list grouping #435.

    The fix belongs in cooklang-rs: plurals and conversion between units of the same kind, and fractions in pantry quantities. Hence the upstream label.

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

    area: pantryarea: shopping-listbugupstream

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions