From df25275560cdc1987cebfacf93688f35126783cf Mon Sep 17 00:00:00 2001 From: Zaldimmar Date: Sat, 21 Nov 2026 17:29:57 -0600 Subject: [PATCH] Admin: a section's hero, blog and countdown settings read and save again The sections editor read and wrote a field like hero.backdrop as a flat key, but the settings sit nested under the section's hero. The form showed blanks and Default: brand, edits went to a key the server ignores, and a save sent the old hero back. Repeated rows now follow dotted paths with getPath and setPath, as top-level fields do. Co-Authored-By: Claude Opus 5.5 --- src/components/admin/fields.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/admin/fields.tsx b/src/components/admin/fields.tsx index fd54d40..20dca5b 100644 --- a/src/components/admin/fields.tsx +++ b/src/components/admin/fields.tsx @@ -236,9 +236,9 @@ function withHiddenCleared(spec, row, parent?) { // `detail`); a value is only hidden when none of them is showing. const shownPaths = new Set(spec.fields.filter((f) => fieldShown(f, row, parent)).map((f) => f.path)); for (const field of spec.fields) { - const value = next[field.path]; + const value = getPath(next, field.path); if (!shownPaths.has(field.path) && value != null && value !== "") { - next = { ...next, [field.path]: "" }; + next = setPath(next, field.path, ""); } } for (const nested of spec.children ?? []) { @@ -853,12 +853,12 @@ export function Repeater({ field={field} row={row} parentRow={parentRow} - value={row[field.path]} + value={getPath(row, field.path)} // Its own lent options too: a map block's // Locations with a slide (095). options={spec.lends ? { ...options, ...spec.lends(row, options) } : options} error={errors?.[`${errorPrefix}${index}.${field.path}`]} - onChange={(value) => update(index, { ...row, [field.path]: value })} + onChange={(value) => update(index, setPath(row, field.path, value))} onPatch={(patch) => update(index, { ...row, ...patch })} /> ))}