Feature request: let the duplicate prompt choose among several matching shopping list items #31
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Idea
When an item name matches more than one item on a shopping list, the duplicate prompt should let the user choose which of them to edit.
Today the prompt can only ever reach one of them. Example: add "Milch" with comment "frisch", then "Milch" with comment "H-Milch" via "Separat hinzufügen". Adding "Milch" a third time and choosing "Bestehenden bearbeiten" always opens the first Milch (frisch). The second one (H-Milch) can't be reached from the prompt, only through its own row (tap → "Bearbeiten").
The reason is the contract: on a match,
POST /shopping-list/:id/add-itemreturns a singleitem, by rule "if several match: the topmost open one, otherwise the most recently ticked one" (api-contract/src/shopping-lists.ts,AddShoppingListItemResponse). The spec has the same gap: "Edit existing: opens the existing item for editing" assumes there is only one match, although "Add separately" is exactly how a list gets several.Proposal
DUPLICATEresponse carries every matching item (open and ticked) in a defined order, instead of a single one. For example,itembecomesmatches: ShoppingListItemDto[]forDUPLICATE, whileADDEDkeeps the new item.The duplicate check stays on the server, as decided in
docs/adr/2026-09-27-shopping-list-contract.md. Re-implementing the matching in the app to find the other items was considered and rejected for that reason.Notes
docs/adr/2026-09-27-shopping-list-contract.md, plus a spec wording change ("Edit existing" with several matches).Found during manual testing of spec 001 (recipe-app#47); postponed to a follow-up.
🤖 Generated with Claude Code