Skip to content

finding(plugin-form): the same top-level fields silent-drop trap is undocumented on TWO more registrations — form/view:form and object-master-detail-form #8847

Description

@os-warren

Context

objectui#8738 (route 2, closed by objectui#8846) documents object-form's
top-level fields input: members are bare field names, { name } tolerated,
and the spec FormFieldSchema object ({ field: 'note', colSpan: 2 }) —
legal in sections[].fields — resolves to no name and is silently skipped
(SimpleObjectForm in ObjectForm.tsx; buildFlatFields in flatFields.ts).

Re-deriving the read sites for #8738 (against main @ e9d92120a) turned up
the identical, still-undocumented trap on two more ComponentRegistry
registrations in packages/plugin-form/src/index.tsx:

  1. packages/plugin-form/src/index.tsx:292
    ComponentRegistry.register('form', ObjectFormRenderer, …), the
    view:form alias of the exact same ObjectFormRenderer / SimpleObjectForm
    component object-form uses. Its { name: 'fields', type: 'array' } entry
    has no description at all — the same gap finding(plugin-form): object-form carries TWO surfaces spelled fields with different member vocabularies — the spec FormFieldSchema object is silently dropped by the top-level one #8738 closed for object-form,
    left open here.
  2. packages/plugin-form/src/index.tsx:~430
    object-master-detail-form's fields input, documented as 'Which parent fields to show, in order. Ignored when sections is given — sections carry their own field lists.'. MasterDetailForm.tsx's own comment says this is
    'Parent form sections/fields — passed straight through to ObjectForm'
    i.e. the same SimpleObjectForm read site — so the same
    { field: 'note' } silent-drop applies, and the existing description does
    not mention it.

Why this is a category-(c) trap, not a nit

Both entries let an author (or an AI generating metadata) write the spec's
FormFieldSchema object into a fields array that looks identical in shape
to sections[].fields, and get a silent drop with no throw, warning, or
empty-state — exactly the population #8738 was opened to close, just reached
through a different registered type name.

Suggested fix

Same route-2 treatment as #8846: add/extend the description on both entries
to state the bare-name-only vocabulary and the contrast with
sections[].fields, mirroring the text #8846 added to object-form.fields.
Route 1 (whether to also console.warn) is out of scope here too — that
question is still unruled for #8738 and this finding doesn't change that.

Not filed as part of #8846

#8738's dispatch and its pinned probe
(objectFormFieldsMembers-8071.test.tsx) scope specifically to object-form;
widening that PR's diff to other registrations wasn't authorized, so this is
filed separately rather than folded in.

Activity

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdomain:specobjectui spec stream: fix lands on packages/types, schema corpus or spec pin coupling — spec lanepm:dispatched

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions