Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .changeset/36544-form-view-modal-size-retired.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
'@objectstack/spec': minor
'@objectstack/skills': patch
---

feat(spec)!: a form view no longer declares `modalSize`; no form view opens in a dialog, so nothing read the key there

Clause-②: yes (narrowing)

Metadata-protocol: narrowed

<!-- adr-0087: registered form-view-modal-size-removed, ui-form-view-modal-size-retired -->

**BREAKING** accept-set narrowing on the form view surface (`@objectstack/spec`), ADR-0049 enforce-or-remove.

The one reader of a form view's `modalSize` was the console's New / Edit record dialog, which copied it from the object's internal form view. Through 18.6.0 that dialog opened at the authored size. From 19.0.0 it loads no form view (the `internal-record-forms-not-loaded` entry): it lays a record out by the object's `fieldGroups` and chooses its own size. A form opened by name, or by a public link, gets a page of its own. So on 19 a form view saved with `modalSize: 'lg'` is accepted, served and drawn exactly as one without it.

- **FROM → TO.** `form: { …, modalSize }` (and `formViews.<key>`, a form view item's `config`, a `form` item) → `form: { … }`. Nothing on the form replaces it. The record dialog picks its size from the number of fields it draws, and the person filling it in can maximize it; a React page that opens a form in a modal writes the prop on the block, `ObjectForm` with `formType='modal'`.
- **The one-line fix.** Delete `modalSize` from the form view. `os migrate meta --from 18` lists the edits for existing sources, and `--write` applies them. A stored `sys_metadata` row is converted when it is read (the `form-view-modal-size-removed` conversion), so a form view saved with the key keeps loading, and deleting it changes nothing a reader sees on 19.
- **Coming from 18.x.** A New or Edit dialog whose form set `modalSize` opened at that size through 18.6.0. On 19 it opens at the size the dialog chooses from the number of fields it draws. No key restores the authored size.
- **What the parse says.** "`view.form.modalSize` was removed in @objectstack/spec 19.0.0 (ADR-0049) — no form view opens in a dialog, so nothing reads it from a form view. …", at every form view door (a view's `form` and `formViews.*`, a form view item record, a flattened form overlay, a `form` item) and at `defineStack` as `STACK_SCHEMA_INVALID` / 422. TypeScript rejects the key at the authoring site.
- **Unchanged.** The React `ObjectForm` block still takes `modalSize` for the modal it opens with `formType='modal'`: the react-tier contract now declares it on the block itself, with the same type. The `object-form` page block keeps it in its own props. A form view's `subforms` is not touched by this change.

The retirement kit: the `retiredKey()` tombstone on `FormViewSchema` (the `form` item takes it by reference); the D2 conversion `form-view-modal-size-removed` (protocol 19, retired from the load path, reaching `form`, `formViews.*`, form view items, flattened form overlays and `forms[]`); `RETIRED_KEYS_BY_MAJOR[19]` rows `ui/FormView:modalSize` and `ui/Form:modalSize`; the D3 entry `ui-form-view-modal-size-retired`; the liveness rows `view.json` `form.modalSize` and `form.json` `modalSize`, now `dead`.

Also corrected: the protocol-18 D3 entry `ui-form-view-type-layout-only` said the console's New and Edit dialogs were "sized by `modalSize`". They choose their own size, and the entry now says so.

`@objectstack/skills`: `skills/objectstack-ui/references/react-blocks.md` is regenerated. `<ObjectForm>`'s `modalSize` is listed as a binding prop from the block's overlay, no longer as a data prop from the form view schema.
4 changes: 2 additions & 2 deletions content/docs/references/api/protocol.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2065,7 +2065,7 @@ The published metadata item body, opaque by ruling (1C). Shape is the item's own
| **splitResizable** | `never` | optional | [REMOVED] `view.form.splitResizable` was removed in @objectstack/spec 18.3.0 (ADR-0050) — it made the panes of a `type: 'split'` form resizable, and `split` left the form view `type` in the same release, so no form view draws panes. Delete the key. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. |
| **drawerSide** | `never` | optional | [REMOVED] `view.form.drawerSide` was removed in @objectstack/spec 18.3.0 (ADR-0049) — no form view opens in a drawer, so no form view ever read it. Delete the key: an object's list opens a record in its drawer from the hover icon, and the React `ObjectForm` block keeps its own `drawerSide` prop for the drawer it opens with `formType='drawer'`. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. |
| **drawerWidth** | `never` | optional | [REMOVED] `view.form.drawerWidth` was removed in @objectstack/spec 18.3.0 (ADR-0049) — no form view opens in a drawer, so no form view ever read it, and a pixel width cannot be chosen without knowing the client viewport. Delete the key: a list's record drawer takes its starting width from the `navigation.size` bucket, and the React `ObjectForm` block keeps its own `drawerWidth` prop for the drawer it opens. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. |
| **modalSize** | `Enum<'sm' \| 'default' \| 'lg' \| 'xl' \| 'full'>` | optional | Size bucket of the dialog a caller opens this form in: the console's New / Edit dialog, or the modal container of the React `ObjectForm` block (formType 'modal') |
| **modalSize** | `never` | optional | [REMOVED] `view.form.modalSize` was removed in @objectstack/spec 19.0.0 (ADR-0049) — no form view opens in a dialog, so nothing reads it from a form view. Delete the key: the console's New and Edit dialogs lay a record out by the object's `fieldGroups` and choose their own size, a form opened by name gets a page of its own, and the React `ObjectForm` block keeps its own `modalSize` prop for the modal it opens with `formType='modal'`. Run `os migrate meta --from 18` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. |
| **data** | `{ provider: 'object'; object: string } \| { provider: 'value'; items: any[] } \| { provider: 'schema'; schemaId: string; schema?: Record<string, any> }` | optional | Data source configuration (defaults to "object" provider) |
| **sections** | `{ name?: string; label?: string \| Record<string, string>; description?: string; collapsible?: boolean; … }[]` | optional | |
| **groups** | `{ name?: string; label?: string \| Record<string, string>; description?: string; collapsible?: boolean; … }[]` | optional | [LEGACY ALIAS → `sections`] Accepted for back-compat and folded onto `sections` at parse; `sections` wins when both are present. Prefer `sections`. |
Expand Down Expand Up @@ -2145,7 +2145,7 @@ The published metadata item body, opaque by ruling (1C). Shape is the item's own
| **splitResizable** | `never` | optional | [REMOVED] `view.form.splitResizable` was removed in @objectstack/spec 18.3.0 (ADR-0050) — it made the panes of a `type: 'split'` form resizable, and `split` left the form view `type` in the same release, so no form view draws panes. Delete the key. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. |
| **drawerSide** | `never` | optional | [REMOVED] `view.form.drawerSide` was removed in @objectstack/spec 18.3.0 (ADR-0049) — no form view opens in a drawer, so no form view ever read it. Delete the key: an object's list opens a record in its drawer from the hover icon, and the React `ObjectForm` block keeps its own `drawerSide` prop for the drawer it opens with `formType='drawer'`. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. |
| **drawerWidth** | `never` | optional | [REMOVED] `view.form.drawerWidth` was removed in @objectstack/spec 18.3.0 (ADR-0049) — no form view opens in a drawer, so no form view ever read it, and a pixel width cannot be chosen without knowing the client viewport. Delete the key: a list's record drawer takes its starting width from the `navigation.size` bucket, and the React `ObjectForm` block keeps its own `drawerWidth` prop for the drawer it opens. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. |
| **modalSize** | `Enum<'sm' \| 'default' \| 'lg' \| 'xl' \| 'full'>` | optional | Size bucket of the dialog a caller opens this form in: the console's New / Edit dialog, or the modal container of the React `ObjectForm` block (formType 'modal') |
| **modalSize** | `never` | optional | [REMOVED] `view.form.modalSize` was removed in @objectstack/spec 19.0.0 (ADR-0049) — no form view opens in a dialog, so nothing reads it from a form view. Delete the key: the console's New and Edit dialogs lay a record out by the object's `fieldGroups` and choose their own size, a form opened by name gets a page of its own, and the React `ObjectForm` block keeps its own `modalSize` prop for the modal it opens with `formType='modal'`. Run `os migrate meta --from 18` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. |
| **data** | `{ provider: 'object'; object: string } \| { provider: 'value'; items: any[] } \| { provider: 'schema'; schemaId: string; schema?: Record<string, any> }` | optional | Data source configuration (defaults to "object" provider) |
| **sections** | `{ name?: string; label?: string \| Record<string, string>; description?: string; collapsible?: boolean; … }[]` | optional | |
| **groups** | `{ name?: string; label?: string \| Record<string, string>; description?: string; collapsible?: boolean; … }[]` | optional | [LEGACY ALIAS → `sections`] Accepted for back-compat and folded onto `sections` at parse; `sections` wins when both are present. Prefer `sections`. |
Expand Down
Loading
Loading