From 7d94223de0cf6b5616c94d75f36507548c979c99 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 9 Sep 2026 17:08:44 +0000 Subject: [PATCH] docs(plugin-form): document embeddable-form fields member vocabulary (objectui#8847) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `embeddable-form`'s top-level `fields` registration input had no description, leaving the same trap #8738/#8846 already closed for `object-form`: an author writing the spec `FormFieldSchema` object (`{ field: 'note' }`, legal in `sections[].fields`) into this key resolves to no name and is silently skipped. Add the description, modelled on `object-form` and `form`'s. `EmbeddableForm` passes `config.fields` straight into `` with no `sections`, so it renders through the same `SimpleObjectForm` read site — measured with a throwaway render probe (not committed) that it already inherits route 1's `console.warn` (objectui#8738/#8859): fires once for `fields: [{ field: 'note' }]`, does not fire for `fields: ['note']`. No behaviour change. Description text only. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01Jmxdo7bmeqCQHLSfmLVX9w --- ...8847-embeddable-form-fields-description.md | 20 +++++++++++++++++++ packages/plugin-form/src/index.tsx | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 .changeset/8847-embeddable-form-fields-description.md diff --git a/.changeset/8847-embeddable-form-fields-description.md b/.changeset/8847-embeddable-form-fields-description.md new file mode 100644 index 0000000000..96862bc096 --- /dev/null +++ b/.changeset/8847-embeddable-form-fields-description.md @@ -0,0 +1,20 @@ +--- +'@object-ui/plugin-form': patch +--- + +`embeddable-form`'s top-level `fields` input now documents its member +vocabulary (objectui#8847, the last of the registrations #8738 opened — the +same trap already documented on `object-form`, `form` / `view:form`, and +`object-master-detail-form`'s parent `fields`). + +The registration declared `{ name: 'fields', type: 'array' }` with no +description, so an author had nowhere to read that this key's members are +**bare field names** — a different vocabulary from `sections[].fields`, which +also accepts the spec `FormFieldSchema` object (identity key `field`, e.g. +`{ field: 'note', colSpan: 2 }`). `EmbeddableForm` passes `config.fields` +straight through to `` with no `sections`, so it renders through +the same `SimpleObjectForm` read path as `object-form`; moving one of those +objects into `embeddable-form`'s `fields` resolves to no name and is silently +skipped. Behaviour is unchanged — this only adds the description text, and +records (measured, not assumed) that this surface already inherits the +`console.warn` route 1 (objectui#8738/#8859) added at that same read site. diff --git a/packages/plugin-form/src/index.tsx b/packages/plugin-form/src/index.tsx index 95e2c53ce5..5cf7e9c7a5 100644 --- a/packages/plugin-form/src/index.tsx +++ b/packages/plugin-form/src/index.tsx @@ -343,7 +343,7 @@ ComponentRegistry.register('embeddable-form', EmbeddableFormRenderer, { { name: 'objectName', type: 'string', required: true }, { name: 'title', type: 'string' }, { name: 'description', type: 'string' }, - { name: 'fields', type: 'array' }, + { name: 'fields', type: 'array', description: 'Bare field names to show, in order (each looked up in the object schema; `{ name }` is tolerated). NOT the same vocabulary as `sections[].fields`, which also accepts the spec `FormFieldSchema` object (identity key `field`, e.g. `{ field: "note", colSpan: 2 }`) — that shape resolves to no name HERE and is silently skipped (`EmbeddableForm` passes this array straight through to `` with no `sections`, so it renders through the same `SimpleObjectForm` as `object-form` above — see its `fields` description).' }, { name: 'allowMultiple', type: 'boolean' }, ] });