Repository navigation
Commit 4997cae
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
File tree
- .changeset
- content/docs/references
- api
- ui
- packages/spec
- authorable-surface
- liveness
- state-counts
- src
- conversions
- entries
- 18
- 19
- migrations
- entries
- retired-keys
- semantic
- ui
- skills/objectstack-ui/references
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2065 | 2065 | | |
2066 | 2066 | | |
2067 | 2067 | | |
2068 | | - | |
| 2068 | + | |
2069 | 2069 | | |
2070 | 2070 | | |
2071 | 2071 | | |
| |||
2145 | 2145 | | |
2146 | 2146 | | |
2147 | 2147 | | |
2148 | | - | |
| 2148 | + | |
2149 | 2149 | | |
2150 | 2150 | | |
2151 | 2151 | | |
| |||
0 commit comments