Einkaufsliste - Manuelles Hinzufuegen direkt mit Anzahl- und Kategorie-Fenster (ein Schritt statt zwei) #227

Closed
opened 2026-09-30 09:35:21 +02:00 by lena · 2 comments
Collaborator

Story: Produkt manuell in einem Schritt mit Anzahl und Kategorie hinzufuegen

As a Nutzer, der auf der Einkaufsliste ein Produkt von Hand eintraegt,
I want to direkt ein Fenster mit Anzahl und Kategorie bekommen,
so that ich nicht zwei Fenster nacheinander durchklicken muss, in denen die Kategorie doppelt vorkommt.

Kontext (vom Nutzer beschrieben):

  • Heute wird beim manuellen Hinzufuegen zuerst in einem Fenster nach der Kategorie gefragt und danach in einem zweiten Fenster nach der Anzahl, in dem die Kategorie noch einmal angezeigt wird (ShoppingProductQuantityDialog).

Acceptance criteria:

  • Beim manuellen Hinzufuegen entfaellt das erste Fenster (nur Kategorie). Es erscheint direkt ein einziges Fenster mit Anzahl und Kategorie.
  • Die Anzahl ist mit 1 vorbelegt.
  • Die Kategorie-Auswahl ist im Fenster bereits ausgeklappt, sodass direkt eine Kategorie gewaehlt werden kann; ein vorhandener Kategorie-Vorschlag (eigene Liste / app-weite Wissensbasis, #212) ist vorausgewaehlt.
  • Bestaetigen legt das Produkt mit Anzahl und Kategorie an; Abbrechen legt nichts an.
  • Andere Wege, die heute das Anzahl-Fenster oeffnen (z. B. Produkt aus dem Verlauf reaktivieren), bleiben unveraendert.

Verwandt: #212, #90

## Story: Produkt manuell in einem Schritt mit Anzahl und Kategorie hinzufuegen **As a** Nutzer, der auf der Einkaufsliste ein Produkt von Hand eintraegt, **I want to** direkt ein Fenster mit Anzahl und Kategorie bekommen, **so that** ich nicht zwei Fenster nacheinander durchklicken muss, in denen die Kategorie doppelt vorkommt. **Kontext (vom Nutzer beschrieben):** - Heute wird beim manuellen Hinzufuegen zuerst in einem Fenster nach der Kategorie gefragt und danach in einem zweiten Fenster nach der Anzahl, in dem die Kategorie noch einmal angezeigt wird (`ShoppingProductQuantityDialog`). **Acceptance criteria:** - [ ] Beim manuellen Hinzufuegen entfaellt das erste Fenster (nur Kategorie). Es erscheint direkt ein einziges Fenster mit Anzahl und Kategorie. - [ ] Die Anzahl ist mit 1 vorbelegt. - [ ] Die Kategorie-Auswahl ist im Fenster bereits ausgeklappt, sodass direkt eine Kategorie gewaehlt werden kann; ein vorhandener Kategorie-Vorschlag (eigene Liste / app-weite Wissensbasis, #212) ist vorausgewaehlt. - [ ] Bestaetigen legt das Produkt mit Anzahl und Kategorie an; Abbrechen legt nichts an. - [ ] Andere Wege, die heute das Anzahl-Fenster oeffnen (z. B. Produkt aus dem Verlauf reaktivieren), bleiben unveraendert. Verwandt: #212, #90
lena self-assigned this 2026-09-30 13:51:00 +02:00
Author
Collaborator

Claimed by session "Go [6a981e]"

Starting work: replace the two-step manual add (category dialog, then quantity dialog) with a single dialog showing quantity (default 1) and an expanded category picker with the suggestion preselected.

Claimed by session "Go [6a981e]" Starting work: replace the two-step manual add (category dialog, then quantity dialog) with a single dialog showing quantity (default 1) and an expanded category picker with the suggestion preselected.
Author
Collaborator

Done by session "Go [6a981e]" - commits fc81ea5b, 61064761, 46f6912b on master.

Scope

  • Manually adding a product that does not exist on the list yet now opens ONE window: quantity (prefilled with 1, or with a typed prefix like "3 Bananen") plus the category list, already expanded, with a suggestion preselected and scrolled into view.
  • The product is only created when the window is confirmed - Cancel/Escape creates nothing and keeps the typed text in the input.
  • Suggestion order: this list's own knowledge, then the app-wide knowledge (#212); the "Category: ...?" chip's category when the user accepted it; the chip's guess as fallback for "Change".
  • Unchanged: products that already exist (re-activated via the add box, "Did you mean", restore from history) keep the existing edit popup - but they never get the separate category-only window any more. A typed quantity plus a known category still adds without any popup (#103). Offline keeps the plain queued add. Multi-line paste (#108) uses the same one window per new line; cancelling it stops the remaining lines.

Key decisions

  • New read-only SuggestShoppingCategoryForProductNameQuery (list-access authorized). The existing resolver can create a learned section as a side effect; the lookup half was split out so a merely shown suggestion never writes anything. A learned section the list no longer has is not suggested (the create path still re-creates it if the user confirms without a category, as before).
  • Not changed: while the AI model is still loading (or on devices where it is off), the add box keeps the plain instant add without any window - pre-existing, deliberate behavior.
  • Known edge: the "does this product already exist" check uses the list as loaded in the browser; if another member adds the same name at the same moment, a duplicate is possible (same as the old chip path).

Tests

  • Backend: 7 new handler tests (own-list / app-wide priority, prefix stripping, no section creation, no cross-list knowledge). Full backend suite green (1308).
  • Frontend: SmartAddInput tests rewritten for the new flow (26), new ShoppingNewProductDialog tests (6). Full suite green (1576), build + lint clean.
  • Verified live in the review container: new product with chosen category/quantity, server-suggested category preselected (Milch -> Kuehlregal), Cancel creates nothing.
  • Security review: no findings.
Done by session "Go [6a981e]" - commits fc81ea5b, 61064761, 46f6912b on master. **Scope** - Manually adding a product that does not exist on the list yet now opens ONE window: quantity (prefilled with 1, or with a typed prefix like "3 Bananen") plus the category list, already expanded, with a suggestion preselected and scrolled into view. - The product is only created when the window is confirmed - Cancel/Escape creates nothing and keeps the typed text in the input. - Suggestion order: this list's own knowledge, then the app-wide knowledge (#212); the "Category: ...?" chip's category when the user accepted it; the chip's guess as fallback for "Change". - Unchanged: products that already exist (re-activated via the add box, "Did you mean", restore from history) keep the existing edit popup - but they never get the separate category-only window any more. A typed quantity plus a known category still adds without any popup (#103). Offline keeps the plain queued add. Multi-line paste (#108) uses the same one window per new line; cancelling it stops the remaining lines. **Key decisions** - New read-only `SuggestShoppingCategoryForProductNameQuery` (list-access authorized). The existing resolver can create a learned section as a side effect; the lookup half was split out so a merely shown suggestion never writes anything. A learned section the list no longer has is not suggested (the create path still re-creates it if the user confirms without a category, as before). - Not changed: while the AI model is still loading (or on devices where it is off), the add box keeps the plain instant add without any window - pre-existing, deliberate behavior. - Known edge: the "does this product already exist" check uses the list as loaded in the browser; if another member adds the same name at the same moment, a duplicate is possible (same as the old chip path). **Tests** - Backend: 7 new handler tests (own-list / app-wide priority, prefix stripping, no section creation, no cross-list knowledge). Full backend suite green (1308). - Frontend: SmartAddInput tests rewritten for the new flow (26), new ShoppingNewProductDialog tests (6). Full suite green (1576), build + lint clean. - Verified live in the review container: new product with chosen category/quantity, server-suggested category preselected (Milch -> Kuehlregal), Cancel creates nothing. - Security review: no findings.
lena closed this issue 2026-09-30 15:02:43 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
robert/todo#227
No description provided.