Skip to content

Commit 4997cae

Browse files
feat(spec)!: retire FormView modalSize — no form view opens in a dialog (#38168)
<!-- claude-projects-attribution: {"github_login":"os-tesla"} --> _Requested by **Tesla** · [project thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6JaoEsDWNHBngR2f45xU322DeW)_ Fixes #36544 repo:objectstack#3 · os-tesla · session_01L9qibyCTygnt62jKN3Wmxu Clause-②: yes (narrowing) Metadata-protocol: narrowed Skills-docs: none — no hand-written skills page teaches a form view's `modalSize`; the one skills file that listed it is the generated `skills/objectstack-ui/references/react-blocks.md`, regenerated here, and two evals in `skills/objectstack-ui/evals/views-apps-actions-pages.json` already carry `modalSize:` under `must_not_contain` ## 维护者速读 - 搭建者在表单视图上写「弹窗大小」这一项,现在保存时会被拒绝并被告知删掉它;这一项在 18 版决定新建和编辑弹窗的大小,19 版起已没有任何界面读它。 - 属于「声明了却没人执行的配置,要么执行要么移除」这条清理线,替以为这一项还能调弹窗大小的搭建者和 AI 解决白写的问题。 - 由 18 版升上来的应用会丢失作者设的弹窗大小,改由弹窗自己定,起因是此前「记录弹窗不再读取表单视图」那项改动(#36425)而非本次;本次只让残留的这一项在保存处报错,迁移工具能自动删掉,判断有误可以直接撤回。 - 这是对外的破坏性收窄,并且改到了对外发布的技能包里一份生成的参考表,需要你最终批准。 ## What changes - `packages/spec/src/ui/view.zod.ts`: `FormViewSchema.modalSize` becomes a `retiredKey()` tombstone. The refusal names the removal version, says why (no form view opens in a dialog), tells the author to delete the key, and names what sizes each dialog now. The `form` item (`FormSchema`, ADR-0159) takes the form view's shape by reference, so it refuses the key at that door too. - `packages/spec/src/ui/react-blocks.ts`: the React `ObjectForm` block keeps `modalSize`. It moves from `dataProps` (read off the form view schema) to the block's overlay as a `binding` prop with the same type, and joins `REACT_OVERLAY_SHADOWS.ObjectForm` beside `drawerSide` / `drawerWidth`. The `object-form` page block's own `modalSize` (`ObjectFormPropsSchema`) is untouched. - D2 conversion `form-view-modal-size-removed` (protocol 19, `retiredFromLoadPath: true`, `retiredAfter: '18.6.0'`): deletes the key from `form`, `formViews.*`, a form view item's `config`, a flattened form overlay, the assembled `viewItems` channel and a `forms[]` item. It never walks page components. Wired into `MAJOR_19_CONVERSIONS` at order 4, the last of the major. The list's head comment records the one entry that reads form payloads before this delete applies: over sources, `action-type-ask-ai-removed` takes every string of the stack as a possible action name, a `modalSize` value included, and errs on keeping the action. - Retired-key registry: `ui/FormView:modalSize` and `ui/Form:modalSize` under major 19. D3 entry `ui-form-view-modal-size-retired`: through 18.6.0 the console's New / Edit dialog opened at the authored size; at 19.0.0 that dialog stopped loading a form view (the change recorded by `internal-record-forms-not-loaded`, #36425), so the delete changes nothing a reader sees on 19, and an app that comes from 18.x finds the dialog at the size the dialog chooses. No key restores the authored size; the entry's acceptance line asks the upgrader to look at New and Edit on each object whose form carried the key. The changeset says the same under "Coming from 18.x". The step-19 rationale in `registry.ts.template` gains one sentence. - Liveness ledger: `view.json` `form.modalSize` and `form.json` `modalSize` go `live` → `dead` with a REMOVED note; state counts regenerated (view 75 live / 11 dead, form 27 live / 6 dead / 2 planned). - Two protocol-18 conversion fixtures used `modalSize` as the bystander key that must ride through; they now use `tabPosition` and `columns`. - 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; the sentence now says so. - Regenerated: `packages/spec/authorable-surface/ui.json`, `content/docs/references/ui/view.mdx`, `content/docs/references/api/protocol.mdx`, `skills/objectstack-ui/references/react-blocks.md`. - One changeset: `@objectstack/spec` minor with the BREAKING banner, FROM → TO and the ADR-0087 marker; `@objectstack/skills` patch for the regenerated reference. ## Tests - `packages/spec/src/ui/form-view-drawer-keys-retirement.test.ts`: - "FormView.modalSize — a tombstone at every form-view door": the five former values are refused at a view's `form`, at `formViews.*`, at a form view item, at a flattened form overlay and at a `form` item, each with one issue at `modalSize` carrying the prescription; a control without the key parses at every door; `defineStack` answers `STACK_SCHEMA_INVALID`; `RETIRED_KEYS_BY_MAJOR[19]` holds both rows; two `@ts-expect-error` lines pin the authoring-site type. - "the modal that reads `modalSize` keeps it": the `object-form` page block and the React block overlay still declare it. - "the D2 conversion form-view-modal-size-removed": a stored view, a stored form view item and a stored `form` item lose the key; a page block keeps it; a second pass changes nothing; the entry is off the load path and wired at step 19 with its D3 entry. - The tree-scoped absence walk now judges `modalSize` on a form view and a `defineForm({…})` body too, with its own matcher anti-vacuity test. - `packages/spec/src/ui/form-view-type-layout-retirement.test.ts`: the test that pinned "`modalSize` stays declared" now pins the refusal and its message. - `packages/spec/src/shared/retired-key-removal-version.pin.test.ts`: one join row ties the conversion to the tombstone's removal version. <details><summary>Readings (head named on each line; base origin/main e42520c)</summary> - Head history: fa4a7b4 (first reviewed head) → 067eaa9 (the 18.x wording, contract review S1) → e17b04f (merge of `main` at 9609c13, one hand-resolved conflict in the head comment of `conversions/registry.ts`) → 953a774 (merge of `main` at e42520c, no conflict, no generated path changed on both sides). - Premise at 0e36120, before the change: `modalSize` has 0 hits in the console's `FormPage.tsx` (control `submitBehavior`: 4), 0 in any server package, 0 in `examples/` and `packages/apps` (control: 6). The remaining `ui/` readers are the block's own prop and the host-derived size. At tag `@objectstack/spec@18.6.0` the record dialog still copied the key from the object's form view; that read ended at 19.0.0. - Ablation through `scripts/ablation-replace.mjs`, at 3ae879f: the tombstone line put back to the live enum on the committed change; `vitest run` over the three pin files shows `Test Files 3 failed (3)`, `Tests 12 failed | 160 passed (172)`. Restored: blob equals HEAD and `git diff HEAD` is empty. No later commit touches `view.zod.ts` or the pin files. - At 953a774: `pnpm --filter @objectstack/spec build` exit 0 (the retired-key registration gate runs inside it); `check:generated` exit 0 (`All 14 generated artifacts are up to date`); `vitest run` over the three pin files plus `src/conversions` and `src/migrations`: `Test Files 34 passed (34)`, `Tests 1215 passed (1215)`. `check-platform-checklist --changed-from origin/main` exit 0 (13 anchors judged, 0 lost). - At e17b04f: spec `typecheck` exit 0; `test`: `Test Files 911 passed (911)`, `Tests 28853 passed | 1 todo (28854)`; `test:repo`: `Test Files 94 passed (94)`, `Tests 1604 passed (1604)`. - At e17b04f, derived local gate set: 126 commands from `dispatch-gates --commands`, 126 exit 0; `dispatch-gates --ran`: 126 derived, 126 run, 0 NOT-MEASURED, 0 UNRUN. - At e17b04f, full dogfood battery (owed: the title carries `!`): `os-verify-lock: VERDICT command-exit 0`, `Test Files 491 passed | 3 skipped (494)`, `Tests 4148 passed | 68 skipped (4216)`. - At 953a774 (report comment 7238963623 on the card): spec `typecheck` exit 0; `test`: `Test Files 911 passed (911)`, `Tests 28854 passed | 1 todo (28855)`; `test:repo`: `Test Files 94 passed (94)`, `Tests 1604 passed (1604)`. Derived local gate set: 126 commands, 126 exit 0; `dispatch-gates --ran`: 126 derived, 126 run, 0 NOT-MEASURED, 0 UNRUN. Full dogfood battery: `os-verify-lock: VERDICT command-exit 0`, `Test Files 491 passed | 3 skipped (494)`, `Tests 4148 passed | 68 skipped (4216)`. CI check-runs on this head: 74, each success or skipped, none re-run. - Skills pack at 953a774: `skills/objectstack-ui/references/react-blocks.md` 113 lines / 13751 bytes on `main`, 113 lines / 13725 bytes here (one row moved from the data table to the binding table); all `SKILL.md` files together 4940 lines on `main`, 4940 here. `check-skills-token-ratchet` exit 0: authored files 199826 / 199826 (+0); generator-owned 14846 tokens; bundle total 303536. </details> ## Acceptance notes - File surface beyond the claim, ruled in by the seat on the card (7233916166): the second retired-key row `ui/Form:modalSize` with the conversion's `forms[]` reach, because the `form` item takes the form view's shape by reference; the join row in `retired-key-removal-version.pin.test.ts`; and the one-sentence correction to the protocol-18 D3 entry. - Not edited, by the same ruling: a taxonomy comment in `ui/packages/types/src/objectql.ts` still lists `modalSize` among form view keys. Editing it would pull `ui/` and an `@object-ui/types` patch into this narrowing. - Not edited either: `docs/qa/platform-checklist/areas/studio-authoring.json`, the `view.form` row, still records `modalSize` as a row that fails today. - Both of those edits are carried by the follow-up card #38191. - Left as they are, still true: `packages/lint/src/rule-explanations.ts` and the D3 entry `internal-record-forms-not-loaded` list `modalSize` among keys that steer nothing on the record dialog. - `subforms` on a form view is a separate decision and is not touched here. - hotcrm's uses of the key are not touched here; they meet the refusal when hotcrm moves to spec 19, and `os migrate meta --from 18 --write` deletes them. ## Verification Read first (by risk): 1. `packages/spec/src/ui/view.zod.ts`: `FORM_VIEW_MODAL_SIZE_RETIRED` and the `modalSize` member of `FormViewSchema`. 2. `packages/spec/src/conversions/entries/19/form-view-modal-size-removed.ts`: `apply`, in particular the `viewItems` branch that tells a `config` payload from a flattened overlay, and the `forms` walk. 3. `packages/spec/src/ui/react-blocks.ts`: the `ObjectForm` hunk that moves the prop from `dataProps` to the overlay. Two-minute check: `pnpm --filter @objectstack/spec exec vitest run src/ui/form-view-drawer-keys-retirement.test.ts src/ui/form-view-type-layout-retirement.test.ts src/shared/retired-key-removal-version.pin.test.ts` shows 172 passing; put `z.enum(['sm', 'default', 'lg', 'xl', 'full']).optional()` back on `FormViewSchema.modalSize` and the same command shows 12 failing. --- _Generated by [Claude Code](https://claude.ai/code/session_01L9qibyCTygnt62jKN3Wmxu)_ <!-- signed: repo:objectstack#3 · os-tesla · session_01L9qibyCTygnt62jKN3Wmxu --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent c279520 commit 4997cae

23 files changed

Lines changed: 628 additions & 77 deletions
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
'@objectstack/spec': minor
3+
'@objectstack/skills': patch
4+
---
5+
6+
feat(spec)!: a form view no longer declares `modalSize`; no form view opens in a dialog, so nothing read the key there
7+
8+
Clause-②: yes (narrowing)
9+
10+
Metadata-protocol: narrowed
11+
12+
<!-- adr-0087: registered form-view-modal-size-removed, ui-form-view-modal-size-retired -->
13+
14+
**BREAKING** accept-set narrowing on the form view surface (`@objectstack/spec`), ADR-0049 enforce-or-remove.
15+
16+
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.
17+
18+
- **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'`.
19+
- **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.
20+
- **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.
21+
- **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.
22+
- **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.
23+
24+
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`.
25+
26+
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.
27+
28+
`@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.

‎content/docs/references/api/protocol.mdx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2065,7 +2065,7 @@ The published metadata item body, opaque by ruling (1C). Shape is the item's own
20652065
| **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. |
20662066
| **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. |
20672067
| **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. |
2068-
| **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') |
2068+
| **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. |
20692069
| **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) |
20702070
| **sections** | `{ name?: string; label?: string \| Record<string, string>; description?: string; collapsible?: boolean; … }[]` | optional | |
20712071
| **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`. |
@@ -2145,7 +2145,7 @@ The published metadata item body, opaque by ruling (1C). Shape is the item's own
21452145
| **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. |
21462146
| **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. |
21472147
| **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. |
2148-
| **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') |
2148+
| **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. |
21492149
| **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) |
21502150
| **sections** | `{ name?: string; label?: string \| Record<string, string>; description?: string; collapsible?: boolean; … }[]` | optional | |
21512151
| **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`. |

0 commit comments

Comments
 (0)