Skip to content

4.11: Inline date and dependency editing on Household Item Detail Page #467

@steilerDev

Description

@steilerDev

As a homeowner, I want to edit dates, delivery constraints, and dependencies directly on the Household Item Detail Page so that I can manage scheduling without navigating to a separate edit screen.

Parent Epic: #4
Priority: Should Have

Acceptance Criteria

  • AC 1 — Page restructure into three sections: The Household Item Detail Page is reorganized into three distinct card sections in this order: (1) "Details" box (name, description, category, vendor, URL, room, quantity, tags), (2) "Dates & Delivery" box (schedule, status, order date, actual delivery, earliest/latest constraints), (3) "Dependencies" box (dependency list with add/remove). The current duplicate "Schedule" and "Constraints > Delivery Window" sections are consolidated into the "Dates & Delivery" box.
  • AC 2 — Schedule display logic with target/actual date: In the "Dates & Delivery" box, a "Schedule" row displays: when actualDeliveryDate is null, show "Target Date" with the computed targetDeliveryDate value; when actualDeliveryDate is set, show "Actual Date" with the actual date value followed by the target date in strikethrough text (e.g., "Actual Date: Mar 15, 2026 Mar 10, 2026"). The target date no longer appears elsewhere on the page.
  • AC 3 — Inline editable order date: The "Order Date" field in the "Dates & Delivery" box is inline-editable using a date input with autosave-on-blur (same pattern as Work Item Detail Page date constraints). An AutosaveIndicator shows saving/saved/error state. Clearing the field sends null to the API.
  • AC 4 — Inline editable actual delivery date: The "Actual Delivery Date" field in the "Dates & Delivery" box is inline-editable using a date input with autosave-on-blur. Setting a date triggers a re-fetch of the item (since it may change the computed target date). An AutosaveIndicator shows saving/saved/error state.
  • AC 5 — Inline editable status: The purchase status dropdown remains inline-editable in the "Dates & Delivery" box (current behavior preserved).
  • AC 6 — Inline editable earliest delivery date: In the "Dates & Delivery" box (or "Dependencies" box if grouped with constraints), the "Earliest Delivery Date" field is inline-editable using a date input with autosave-on-blur. Clearing the field sends null to the API. After saving, the item is re-fetched because earliestDeliveryDate affects the computed targetDeliveryDate via the scheduling engine.
  • AC 7 — Inline editable latest delivery date: The "Latest Delivery Date" field is inline-editable using a date input with autosave-on-blur. Clearing the field sends null to the API. An AutosaveIndicator shows saving/saved/error state.
  • AC 8 — Dependencies box with add/remove: The "Dependencies" box is a standalone section below "Dates & Delivery". It contains the dependency list (work items and milestones) with add/remove functionality (current behavior preserved from the existing "Constraints > Dependencies" subsection). The "Add Dependency" modal is retained as-is.
  • AC 9 — Edit page scoped to details only: The Household Item Edit Page (/household-items/:id/edit) no longer includes date fields (orderDate, earliestDeliveryDate, latestDeliveryDate, actualDeliveryDate) or status. It only edits: name, description, category, vendor, URL, room, quantity, and tags. The edit button on the detail page continues to navigate to this reduced edit form.
  • AC 10 — Reuse of Work Item Detail autosave pattern: The inline date editing uses the same autosave-on-blur pattern as the Work Item Detail Page (local state for each field, onBlur handler that PATCHes the API, AutosaveIndicator component for feedback, clear button to set value to null). The AutosaveIndicator component is imported from existing shared components.
  • AC 11 — Target date reflects earliest delivery date: When a user sets or changes the earliestDeliveryDate and saves, the scheduling engine recalculates targetDeliveryDate considering both dependencies AND the earliest delivery constraint (max of dependency-computed date and earliestDeliveryDate). The detail page re-fetches and displays the updated target date. (Note: the backend scheduling engine already implements this logic -- this AC verifies the frontend triggers a re-fetch after saving earliestDeliveryDate so the updated target date is visible.)
  • AC 12 — Accessibility: All inline-editable fields have visible labels, proper aria-label attributes, and keyboard-accessible clear buttons. The autosave indicator uses role="status" for screen reader announcements. Focus management follows existing Work Item Detail patterns.

Notes

  • The backend scheduling engine (schedulingEngine.ts) already factors earliestDeliveryDate into the target date computation (line 926-929). No backend changes are needed for AC 11 -- the fix is ensuring the frontend re-fetches after saving earliestDeliveryDate.
  • The existing AutosaveIndicator component (client/src/components/AutosaveIndicator/AutosaveIndicator.tsx) should be reused.
  • The Work Item Detail Page (client/src/pages/WorkItemDetailPage/WorkItemDetailPage.tsx) lines 220-244 and 734-780 show the autosave pattern to mirror.
  • The current HouseholdItemDetailPage has duplicate date display: "Dates & Delivery" card (lines 751-795) shows order/target/actual dates, and "Schedule" section (lines 797-817) repeats target/actual. The "Constraints > Delivery Window" (lines 819-851) shows earliest/target/latest. All three should be consolidated.
  • Dependencies: This story depends on Story 4.5 (Story 4.5: Household Item Detail Page #391, detail page) being complete.
  • The HouseholdItemEditPage currently includes: name, description, category, status, quantity, vendorId, url, room, orderDate, earliestDeliveryDate, latestDeliveryDate, actualDeliveryDate, tags. AC 9 removes date fields and status from this page.

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    In Progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions