#127 — Masterpackliste — neues Item über eigenen Popup mit Tags + Mengentyp statt Inline-Zeile #130

Closed
opened 2026-08-18 13:14:19 +02:00 by lena · 2 comments
lena commented 2026-08-18 13:14:19 +02:00 (Migrated from git.butzei.de)

Story: Masterpackliste — neues Item über eigenen Popup mit Tags + Mengentyp statt Inline-Zeile

As a Nutzer, der der Masterpackliste ein neues Item hinzufügt,
I want to direkt beim Anlegen alle relevanten Eigenschaften (Category, Priority, Quantity,
Climate-/Travel-Type-Tags, Mengentyp) in einem eigenen Dialog eingeben können,
so that ich nicht erst das neu angelegte Item wieder aufklappen und einzeln nachpflegen muss.

Background

Verifiziert im Code: MasterPackingListPage.tsxs addItem legt ein Item aktuell nur mit name an
(CreateMasterPackItemCommand({masterPackingListId, name})), über eine einzelne Inline-Eingabezeile.
Category/Priority/Quantity/Labels müssen danach über das Aufklappen der Zeile in
MasterPackItemRow.tsx einzeln nachgetragen werden.

Neuer Aspekt aus diesem Request: ein Mengentyp-Feld ("insgesamt" vs. "pro Tag") — bislang gibt es nur
ein einzelnes quantity-Feld ohne Bedeutung, ob es sich auf die ganze Reise oder pro Tag bezieht. Wird
Grundlage für #128 (Tage-Abfrage beim Checkout).

AC

  • Neuer "Item hinzufügen"-Dialog (ersetzt/ergänzt die bisherige Inline-Eingabezeile in
    MasterPackingListPage.tsx) mit Feldern: Name, Category, Priority, Quantity, Mengentyp
    (Total | PerDay, Default Total), sowie direkte Mehrfachauswahl bestehender Climate-/
    Travel-Type-Labels (analog zur bestehenden renderLabelGroup-Logik aus MasterPackItemRow.tsx,
    inkl. Möglichkeit ein neues Label direkt anzulegen).
  • CreateMasterPackItemCommand erweitert um optionale category, priority, quantity,
    quantityType, labelIds — Backend legt Item inkl. Tags in einem Aufruf an (statt Anlegen +
    mehrere Folge-Requests).
  • Neues Feld QuantityType (Total | PerDay) auf MasterPackItemEntity/MasterPackItemDto,
    Default Total für bereits bestehende Items (Migration).
  • MasterPackItemRow.tsxs bestehende Inline-Bearbeitung bleibt für spätere Änderungen erhalten, zeigt
    zusätzlich den Mengentyp an/editierbar.

Out of scope

  • Die Tage-Abfrage beim Checkout selbst und die daraus resultierende Mengen-Skalierung — das ist #128,
    blockiert durch diese Story (braucht das QuantityType-Feld).
# Story: Masterpackliste — neues Item über eigenen Popup mit Tags + Mengentyp statt Inline-Zeile **As a** Nutzer, der der Masterpackliste ein neues Item hinzufügt, **I want to** direkt beim Anlegen alle relevanten Eigenschaften (Category, Priority, Quantity, Climate-/Travel-Type-Tags, Mengentyp) in einem eigenen Dialog eingeben können, **so that** ich nicht erst das neu angelegte Item wieder aufklappen und einzeln nachpflegen muss. ## Background Verifiziert im Code: `MasterPackingListPage.tsx`s `addItem` legt ein Item aktuell nur mit `name` an (`CreateMasterPackItemCommand({masterPackingListId, name})`), über eine einzelne Inline-Eingabezeile. Category/Priority/Quantity/Labels müssen danach über das Aufklappen der Zeile in `MasterPackItemRow.tsx` einzeln nachgetragen werden. Neuer Aspekt aus diesem Request: ein Mengentyp-Feld ("insgesamt" vs. "pro Tag") — bislang gibt es nur ein einzelnes `quantity`-Feld ohne Bedeutung, ob es sich auf die ganze Reise oder pro Tag bezieht. Wird Grundlage für `#128` (Tage-Abfrage beim Checkout). ## AC - Neuer "Item hinzufügen"-Dialog (ersetzt/ergänzt die bisherige Inline-Eingabezeile in `MasterPackingListPage.tsx`) mit Feldern: Name, Category, Priority, Quantity, Mengentyp (`Total` | `PerDay`, Default `Total`), sowie direkte Mehrfachauswahl bestehender Climate-/ Travel-Type-Labels (analog zur bestehenden `renderLabelGroup`-Logik aus `MasterPackItemRow.tsx`, inkl. Möglichkeit ein neues Label direkt anzulegen). - `CreateMasterPackItemCommand` erweitert um optionale `category`, `priority`, `quantity`, `quantityType`, `labelIds` — Backend legt Item inkl. Tags in einem Aufruf an (statt Anlegen + mehrere Folge-Requests). - Neues Feld `QuantityType` (`Total` | `PerDay`) auf `MasterPackItemEntity`/`MasterPackItemDto`, Default `Total` für bereits bestehende Items (Migration). - `MasterPackItemRow.tsx`s bestehende Inline-Bearbeitung bleibt für spätere Änderungen erhalten, zeigt zusätzlich den Mengentyp an/editierbar. ## Out of scope - Die Tage-Abfrage beim Checkout selbst und die daraus resultierende Mengen-Skalierung — das ist `#128`, blockiert durch diese Story (braucht das `QuantityType`-Feld).
lena commented 2026-08-19 07:03:54 +02:00 (Migrated from git.butzei.de)

Claiming this. Plan: add a QuantityType enum (Total|PerDay, default Total) to MasterPackItemEntity/Dto with a schema migration; extend CreateMasterPackItemCommand with optional category/priority/quantity/quantityType/labelIds so the item and its label associations are created in one call; new "Add item" dialog in the frontend with all these fields plus multi-select over existing Climate/Travel-Type labels (reusing MasterPackItemRow.tsx's existing label-group rendering) replacing the current name-only inline add row; MasterPackItemRow.tsx's existing inline edit gets a QuantityType control too.

Claiming this. Plan: add a QuantityType enum (Total|PerDay, default Total) to MasterPackItemEntity/Dto with a schema migration; extend CreateMasterPackItemCommand with optional category/priority/quantity/quantityType/labelIds so the item and its label associations are created in one call; new "Add item" dialog in the frontend with all these fields plus multi-select over existing Climate/Travel-Type labels (reusing MasterPackItemRow.tsx's existing label-group rendering) replacing the current name-only inline add row; MasterPackItemRow.tsx's existing inline edit gets a QuantityType control too.
lena commented 2026-08-21 19:00:12 +02:00 (Migrated from git.butzei.de)

Done. Replaced the name-only inline add-row on the Masterpackliste with a full "Add item" dialog (Name, Category, Priority, Quantity, a new QuantityType select [Total for the trip / Per day], and Climate/Travel-Type label tagging including inline new-label creation), plus a matching QuantityType control in the existing row-edit view.

Backend: new MasterPackItemQuantityType enum (Total/PerDay, stored as string with a pinned sentinel), added to MasterPackItemEntity/MasterPackItemDto, EF migration AddMasterPackItemQuantityType. CreateMasterPackItemCommand gained QuantityType and an optional LabelIds list (tags the item with existing labels at creation time, IDOR-checked against the item's own list, same pattern as Tag/UntagMasterPackItemCommandHandler). UpdateMasterPackItemCommand gained QuantityType as a required field (no silent default, matching every other field's contract).

Frontend: new AddMasterPackItemDialog.tsx wired into MasterPackingListPage.tsx; MasterPackItemRow.tsx's expanded edit view got a QuantityType select using the same stale-closure-safe override pattern already used for Priority. Hand-maintained API mirrors (dtos.ts, valueTypes.ts) updated to match the regenerated OpenAPI schema.

Tests: 8 new backend handler tests (Create: defaults, explicit QuantityType, label tagging, cross-list label rejection, duplicate-id handling; Update: field update, QuantityType change, cross-list rejection), 5 new/updated frontend component tests (dialog creation flow, quantity type + label selection, disabled-while-saving, Escape/backdrop guard, row QuantityType save, name-fallback behavior).

/code-review findings, all fixed:

  • Duplicate valid label ids in LabelIds were falsely rejected as "not found" (count compared against non-deduplicated input) — fixed by deduping before the comparison.
  • Escape key / backdrop click on the Add-item dialog bypassed the same isSaving guard already applied to the Cancel button — fixed, and form fields are now disabled while saving too.
  • MasterPackItemRow.save() silently dropped a concurrent Priority/QuantityType change whenever the Name field was transiently empty — now falls back to the last-saved name instead of no-op'ing.
  • UpdateMasterPackItemCommand.QuantityType had a stray default value inconsistent with every other field's "caller must state the full entity" contract — default removed.
  • Aligned the new label-id-not-found error with the existing EntityNotFound.Create<T> convention used by Tag/UntagMasterPackItemCommandHandler instead of a raw exception string.

A few reuse/simplification items (duplicated label-picker UI across three dialog components, the two-param save() override pattern, an avoidable refetch after inline label creation) and the single-commit-per-feature question were logged but left as-is — real but out of scope for this cycle, see the review report and ai/roles/memory/07_team_coach_memory.md's open question.

CI green on master: https://git.butzei.de/robert/todo/actions/runs/321 (all jobs incl. all 4 E2E legs).

Done. Replaced the name-only inline add-row on the Masterpackliste with a full "Add item" dialog (Name, Category, Priority, Quantity, a new QuantityType select [Total for the trip / Per day], and Climate/Travel-Type label tagging including inline new-label creation), plus a matching QuantityType control in the existing row-edit view. **Backend:** new `MasterPackItemQuantityType` enum (Total/PerDay, stored as string with a pinned sentinel), added to `MasterPackItemEntity`/`MasterPackItemDto`, EF migration `AddMasterPackItemQuantityType`. `CreateMasterPackItemCommand` gained `QuantityType` and an optional `LabelIds` list (tags the item with existing labels at creation time, IDOR-checked against the item's own list, same pattern as Tag/UntagMasterPackItemCommandHandler). `UpdateMasterPackItemCommand` gained `QuantityType` as a required field (no silent default, matching every other field's contract). **Frontend:** new `AddMasterPackItemDialog.tsx` wired into `MasterPackingListPage.tsx`; `MasterPackItemRow.tsx`'s expanded edit view got a QuantityType select using the same stale-closure-safe override pattern already used for Priority. Hand-maintained API mirrors (`dtos.ts`, `valueTypes.ts`) updated to match the regenerated OpenAPI schema. **Tests:** 8 new backend handler tests (Create: defaults, explicit QuantityType, label tagging, cross-list label rejection, duplicate-id handling; Update: field update, QuantityType change, cross-list rejection), 5 new/updated frontend component tests (dialog creation flow, quantity type + label selection, disabled-while-saving, Escape/backdrop guard, row QuantityType save, name-fallback behavior). **`/code-review` findings, all fixed:** - Duplicate valid label ids in `LabelIds` were falsely rejected as "not found" (count compared against non-deduplicated input) — fixed by deduping before the comparison. - Escape key / backdrop click on the Add-item dialog bypassed the same `isSaving` guard already applied to the Cancel button — fixed, and form fields are now disabled while saving too. - `MasterPackItemRow.save()` silently dropped a concurrent Priority/QuantityType change whenever the Name field was transiently empty — now falls back to the last-saved name instead of no-op'ing. - `UpdateMasterPackItemCommand.QuantityType` had a stray default value inconsistent with every other field's "caller must state the full entity" contract — default removed. - Aligned the new label-id-not-found error with the existing `EntityNotFound.Create<T>` convention used by Tag/UntagMasterPackItemCommandHandler instead of a raw exception string. A few reuse/simplification items (duplicated label-picker UI across three dialog components, the two-param save() override pattern, an avoidable refetch after inline label creation) and the single-commit-per-feature question were logged but left as-is — real but out of scope for this cycle, see the review report and `ai/roles/memory/07_team_coach_memory.md`'s open question. CI green on master: https://git.butzei.de/robert/todo/actions/runs/321 (all jobs incl. all 4 E2E legs).
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#130
No description provided.