You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Nested object/array property editing in task-schema-form and schema-property-form (namespaced persistence) #2027
#2009 added a recursive nested (object/array) schema-property editor — nested-field-editor.svelte + nested-property-modal.svelte — and wired it into generic-schema-form.svelte, whose fields persist flat at properties[field.name].
The audit called for in #2009 found that task-schema-form.svelte and schema-property-form.svelte share the same five-case dispatch and fall through to "Unknown field type" on object/array, but persist under different namespaces, so the flat NestedPropertyModal cannot be dropped in as-is:
task-schema-form.svelte writes user fields under properties.task.<field> (updateUserField), with an optimistic nested/flat read bridge.
schema-property-form.svelte writes under properties[nodeType].<field> (updateProperty), with a first-write flat→nested auto-migration; its boolean case is also stubbed ("not yet implemented").
Wiring the flat modal into these would persist nested edits to the wrong location. This was deliberately left out of #2009's scope rather than write to the wrong namespace.
Scope
Give NestedPropertyModal (or NestedFieldEditor's owner) a pluggable read/persist strategy — a read: () => value + persist: (value) => void pair, or a namespace-aware variant — so the same recursive editor can back a namespaced property.
Adopt it in task-schema-form.svelte (properties.task.*) and schema-property-form.svelte (properties[nodeType].*), replacing their object/array fall-through.
The nested editor now reaches all three forms. The modal no longer touches the store — it takes the current value and an onPersist callback — so each form supplies its own reader/writer and persists to its own namespace: flat properties[<field>] for the generic form, properties.task[<field>] for the task form, and properties[<nodeType>][<field>] for the per-type form (through its existing flat→nested migration, titleTemplate recompute and replaceProperties).
Both property forms also render leaves through the shared SchemaFieldLeaf instead of their own copies of the five-case dispatch, which removed both fall-throughs at once — the stubbed boolean and "Unknown field type" — and is most of the ~360 deleted lines. Only the assignee combobox stays hand-rolled. Close-the-popover-on-date-pick moved into the shared leaf, so it now also fixes the generic form and the nested editor, where the calendar used to stay open.
Review caught a real data-loss path while it was in there: getPropertyValue documented a flat fallback it never implemented, so an un-migrated nested value opened an empty editor and the first edit persisted that emptiness over the real object — taking keys the user was never shown. Fixed, with three tests that were each confirmed to fail against the previous read path.
Activity
mstomar125 commentedon Aug 11, 2026
Resolved in #2031 (squash-merged to
main).The nested editor now reaches all three forms. The modal no longer touches the store — it takes the current value and an
onPersistcallback — so each form supplies its own reader/writer and persists to its own namespace: flatproperties[<field>]for the generic form,properties.task[<field>]for the task form, andproperties[<nodeType>][<field>]for the per-type form (through its existing flat→nested migration,titleTemplaterecompute andreplaceProperties).Both property forms also render leaves through the shared
SchemaFieldLeafinstead of their own copies of the five-case dispatch, which removed both fall-throughs at once — the stubbed boolean and "Unknown field type" — and is most of the ~360 deleted lines. Only the assignee combobox stays hand-rolled. Close-the-popover-on-date-pick moved into the shared leaf, so it now also fixes the generic form and the nested editor, where the calendar used to stay open.Review caught a real data-loss path while it was in there:
getPropertyValuedocumented a flat fallback it never implemented, so an un-migrated nested value opened an empty editor and the first edit persisted that emptiness over the real object — taking keys the user was never shown. Fixed, with three tests that were each confirmed to fail against the previous read path.