Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 19 additions & 22 deletions src/components/item-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export function ItemForm({
})
const [stagedFiles, setStagedFiles] = useState<File[]>([])

// Staged marks & notes (create mode only)
// Staged marks & notes
const [stagedMarks, setStagedMarks] = useState<StagedMark[]>([])
const [stagedNotes, setStagedNotes] = useState<StagedNote[]>([])

Expand All @@ -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 = () => {
Expand Down Expand Up @@ -517,27 +518,23 @@ export function ItemForm({
</div>
</CollapsibleSection>

{/* Marks section (create only) */}
{!isEdit && (
<CollapsibleSection
title="Marks"
open={!!openSections.marks}
onOpenChange={(v) => toggleSection("marks", v)}
>
<StagedMarkList marks={stagedMarks} onChange={setStagedMarks} />
</CollapsibleSection>
)}
{/* Marks section */}
<CollapsibleSection
title="Marks"
open={!!openSections.marks}
onOpenChange={(v) => toggleSection("marks", v)}
>
<StagedMarkList marks={stagedMarks} onChange={setStagedMarks} />
</CollapsibleSection>

{/* Notes section (create only) */}
{!isEdit && (
<CollapsibleSection
title="Notes"
open={!!openSections.notes}
onOpenChange={(v) => toggleSection("notes", v)}
>
<StagedNoteList notes={stagedNotes} onChange={setStagedNotes} />
</CollapsibleSection>
)}
{/* Notes section */}
<CollapsibleSection
title="Notes"
open={!!openSections.notes}
onOpenChange={(v) => toggleSection("notes", v)}
>
<StagedNoteList notes={stagedNotes} onChange={setStagedNotes} />
</CollapsibleSection>

<div className="flex justify-end gap-2">
<Button type="submit" disabled={isPending}>
Expand Down
Loading