Skip to content

Nested object/array property editing in task-schema-form and schema-property-form (namespaced persistence) #2027

Closed

Description

@mstomar125

Context

#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.
  • While there: schema-property-form.svelte's boolean case is stubbed; implement it (the shared SchemaFieldLeaf from No UI for viewing or editing nested (object/array) schema properties #2009 already handles boolean).

Acceptance

  • Opening a node whose task/custom schema has an object/array field shows the nested editor instead of "Unknown field type"
  • Nested edits persist to the correct namespace (properties.task.* / properties[nodeType].*) and round-trip
  • schema-property-form.svelte boolean fields render/persist
  • bun run test:all green, bun run quality:fix clean

Follows up #2009.

Activity

  1. added
    enhancement
    on Aug 11, 2026
  2. self-assigned this
    on Aug 11, 2026
  3. mstomar125 commented on Aug 11, 2026

    @mstomar125
    ContributorAuthor

    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 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementui

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions