From 0ae766d89892038cb93c015b88422ad49f12b7b8 Mon Sep 17 00:00:00 2001 From: Amr Gaber Date: Fri, 6 Feb 2026 18:41:45 -0600 Subject: [PATCH] Unify add/edit item form with marks and notes sections Remove the create-only restriction on marks and notes sections in ItemForm, and update EditItemDialog to handle creating marks and notes after a successful edit. --- src/components/item-form.tsx | 41 ++++++------- src/pages/items/item-detail-page.tsx | 86 ++++++++++++++++++++++++++-- 2 files changed, 99 insertions(+), 28 deletions(-) diff --git a/src/components/item-form.tsx b/src/components/item-form.tsx index 97a3189..b0d3734 100644 --- a/src/components/item-form.tsx +++ b/src/components/item-form.tsx @@ -127,7 +127,7 @@ export function ItemForm({ }) const [stagedFiles, setStagedFiles] = useState([]) - // Staged marks & notes (create mode only) + // Staged marks & notes const [stagedMarks, setStagedMarks] = useState([]) const [stagedNotes, setStagedNotes] = useState([]) @@ -144,7 +144,8 @@ export function ItemForm({ "provenance", ...(typeDef && typeDef.fields.length > 0 ? ["typeFields"] : []), "dimensions", - ...(!isEdit ? ["marks", "notes"] : []), + "marks", + "notes", ] const allExpanded = sectionKeys.every((k) => openSections[k]) const toggleAll = () => { @@ -517,27 +518,23 @@ export function ItemForm({ - {/* Marks section (create only) */} - {!isEdit && ( - toggleSection("marks", v)} - > - - - )} + {/* Marks section */} + toggleSection("marks", v)} + > + + - {/* Notes section (create only) */} - {!isEdit && ( - toggleSection("notes", v)} - > - - - )} + {/* Notes section */} + toggleSection("notes", v)} + > + +