Skip to content

Shopping list badges and table rows use different item sets #116

Description

@OffCrazyFreak

What and where

frontend/src/app/(user)/shopping-lists/[id]/components/stores/shopping-list-items-table.tsx:50

The header badges and the table rows now share getPriceExtreme, but not the item set they run over:

  • badges are computed from activeItems, i.e. unchecked items only (use-store-chain-analysis.ts)
  • the table renders all of shoppingList.items

Current behaviour

Check off an item that happens to be cheapest at one chain. Inside that chain's card the row still renders green with the najniža cijena marker, while the card header shows no green arrow, because the badge calculation excluded the checked item.

So the invariant "a chain never earns a badge without a marked row behind it" holds in one direction only: no badge without a row, but a row can exist without a badge.

Expected behaviour

Pick one item set and use it for both. Either filter the table rows to unchecked items too, or render checked rows neutrally so a marked row always has a matching header arrow.

Why it matters

The header arrow and the row marker are meant to be the same signal at two zoom levels. When they disagree the user cannot tell whether the highlight means anything.

How to test

Open a shopping list with prices, note a row marked najniža cijena and its chain's green header arrow, then tick that item as bought. Before the fix the row keeps its marker while the arrow disappears; after, the two agree.

Status

Open. Surfaced by the 2026-07-24 multi-tool review of dev vs main (finding 19) and excluded from the fix pass by the maintainer: the file is not touched by that branch, so this is pre-existing behaviour already in production.

Trail

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions