diff --git a/.changeset/form-view-columns-every-host.md b/.changeset/form-view-columns-every-host.md new file mode 100644 index 000000000..9ccce1ead --- /dev/null +++ b/.changeset/form-view-columns-every-host.md @@ -0,0 +1,21 @@ +--- +"@object-ui/plugin-form": patch +--- + +fix(form): a tabbed/split form honours the form view's own `columns` + +`FormView.columns` is a spec key, but only `ObjectForm`'s simple path and +`ModalForm` read it. `TabbedForm` and `SplitForm` derived the grid width from the +per-section `columns` alone, so a view declaring `columns: 3` rendered 3 columns +in a modal and **single-column** as a tab or split — the same metadata laying out +differently depending on which host picked it up. + +Both now resolve the grid the way the other hosts already did: + + explicit form `columns` ?? widest section's `columns` ?? 1 + +The two keys answer different questions and the precedence reflects that: the +view's `columns` is how wide the grid is, a section's `columns` is how densely +that section fills it (via per-field `colSpan`). `columns` is declared on +`TabbedFormSchema` / `SplitFormSchema` accordingly — `ObjectForm` already spread +it through, it was simply being dropped on arrival. diff --git a/content/docs/plugins/plugin-form.mdx b/content/docs/plugins/plugin-form.mdx index 6b2cf498f..75beca9a2 100644 --- a/content/docs/plugins/plugin-form.mdx +++ b/content/docs/plugins/plugin-form.mdx @@ -62,6 +62,17 @@ interface FormField { } ``` +### Column width of a sectioned form + +A sectioned form renders as ONE grid. The form view's `columns` (spec +`FormView.columns`) sets how wide that grid is; a section's `columns` sets how +densely that section fills it. The view's value wins; without it the grid takes +the widest section's density, and without either it is single-column. + +`ObjectForm` (simple), `ModalForm`, `TabbedForm` and `SplitForm` all resolve it +that way, so the same metadata lays out identically in every host. The grid is +applied to the field container inside the form, never wrapped around the `