This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
Commit 7b5e558
fix(plugin-form): a record dialog with no authored layout opens bounded with a two-column grid (objectui#12521) (#12546)
Fixes #12521
Clause-②: no. No type, prop, export or spec declaration changes: the
console's interim is one module-private function in `AppContent.tsx`,
and the dialog's new helpers are module-private in `ModalForm.tsx`.
Implemented by the dispatched dev of the `domain:ui` seat 1 PM loop,
rework round 1, session
`https://claude.ai/code/session_01JZnppgHRp4sREcouhkQYDB`. It executes
letter B (comment 6203721639), its section-`columns` fork (6204264665)
and the interim ruled in 6205068311 on the maintainer's 「可以,12521
走快速方案」. This PR now closes the card. The interim's deletion is a
follow-up card the seat files.
## What lands
### 1. The console's interim desktop bound (`@object-ui/app-shell`)
- `deriveRecordFlowSurface` (installed `@objectstack/spec`
18.0.0-next.1, re-exported by `@object-ui/plugin-view`) answers `size:
'full'` for a create, edit, child-create or child-edit flow on an object
with 12 or more authorable fields. `AppContent` spread that into
`modalSize: 'full'`, so HotCRM Leads → New opened at 1368 × 810 (95vw).
- One module-private function, `interimBoundedTaskFlowSurface`, now
wraps the derivation's answer at its one call site. It maps `size:
'full'` to `size: 'auto'`, the shape letter B makes the spec derive
(objectstack-ai/objectstack#23734). So the dialog is handed no derived
`modalSize`, and `ModalForm`'s own bounded default decides: `xl` or
`lg`, never `full`.
- Its docblock cites the interim (6205068311) and names its exit: delete
the function and call `deriveRecordFlowSurface` directly once objectui
installs a spec carrying objectstack-ai/objectstack#23734.
- **The exit is pinned.**
`AppContent.recordDialogInterimBound-12521.test.tsx` calls the installed
`deriveRecordFlowSurface` for a 14-field object on a desktop `create`
flow, the way `AppContent` calls it (no viewport). While it answers
`full`, the test asserts the interim applies. Once it answers anything
else, the test fails with a message naming the deletion. So the bump
that installs the new spec cannot land with the interim in place. There
is no skip or todo; it is a real assertion today.
- **Phone: no posture check is needed** (A1 below). The phone sheet is
`ModalForm`'s own presentation below `sm`, and no `modalSize` reaches
it.
### 2. The dialog's own defaults (`@object-ui/plugin-form`, `ModalForm`)
- **Size** (round 1, unchanged). With no `modalSize`, the dialog picks
`lg` or `xl` from the grid it renders and its field count, never `full`.
The rule is `inferModalSize(min(columns, inferColumns(fieldCount)))`. An
authored `modalSize`, `'full'` included, is used as written.
- **Flat grid** (round 1, unchanged). A form with no `columns` and no
sections draws two per row from the container's `@md` tier (`grid gap-4
grid-cols-1 @md:grid-cols-2`). Each field takes one cell; a wide kind or
a `span: 'full'` field takes the row. The object's `fieldGroups`
fallback lays out the same way.
- **Section density** (new, the fork's renderer side). In a form that
declares no `columns`, a section that declares none draws two per row
from `@md`. A declared count, `1` included, is drawn as written. The
rule lives in two module-private helpers:
- `dialogSectionColumns` gives a section's count: declared, else the
form's declared `columns`, else 2;
- `sectionedDialogColumns` gives the grid width: the form's `columns`,
else the widest section count.
Both feed objectui#12548's `sectionedGridLayout`. When every count fits
the widest grid, the grid stays `CONTAINER_GRID_COLS`'. Otherwise it
switches to the 12-track grid, where an undeclared section's fields span
6 at `@md` and a wide kind or `span: 'full'` spans 12. Below `@md` it is
one column, as before.
- Undeclared beside `columns: 1`: the grid is two wide; the undeclared
fields take one cell, the `columns: 1` fields `@md:col-span-2`.
- Undeclared beside `columns: 3`: `grid gap-4 grid-cols-1
@md:grid-cols-12`. The undeclared fields carry `@md:col-span-6`, two per
row at every tier. The `columns: 3` fields carry `@md:col-span-6
@2XL:col-span-4`.
- A form-level `columns` still sets an undeclared section's count,
exactly as before.
- Everything declared draws the classes `main` draws.
### 3. The merge with `main`
`main` was merged in as a merge commit (no rebase, no force-push).
`ModalForm.tsx` conflicted with PR #12556 (objectui#12548, the
per-section 12-track grid) and PR #12571 (objectui#12559, the
dialog-owned `Suspense`). The resolution keeps both landed behaviours:
every sectioned dialog lays out through `sectionedGridLayout`, and the
body's `Suspense` boundary is untouched. The round-1 CONTROL pin (a
HotCRM-shaped `columns: 2` + `columns: 3` form) now asserts the classes
PR #12556 draws on `main`.
## Measurements behind the route
- **A1, the phone path.** `AppContent` calls the derivation with no
`viewport`, so it only ever receives the desktop answer. Every
`ModalForm` size class is `sm:`-prefixed (`sm:max-w-2xl`,
`sm:max-w-5xl`, `sm:max-w-[95vw] sm:w-full`). `MobileDialogContent`'s
base classes are `fixed inset-0 w-full h-[100dvh]`. So below `sm` the
dialog is a full-screen sheet whatever `modalSize` says.
- Pinned: the real dialog's classes with no responsive prefix are
identical with the interim and under the old `modalSize: 'full'`.
- Measured in Chromium at 390 × 844: both are 390 × 844 at (0, 0), and
every field is 358 px wide, one per row.
- So the interim needs no posture signal, and it carries none.
- **A2, where the section default is applied: upstream, at the authoring
producer.** `@objectstack/spec` `FormSectionSchema.columns` is
`.default(1)`. Probed on the installed spec 18.0.0-next.1, a section
with no `columns`:
- `FormViewSchema.parse` answers `[1, 1, 3]` for sections declaring
nothing, `1` and `3`;
- `defineView`, the call HotCRM's `lead.view.ts` uses, answers `[1, 1,
3]` too;
- `defineStack` in strict mode returns the parse's `result.data`.
objectui never parses form views client-side; `resolveFormViewLayout`
hands `objectDef.form.sections` through as served. So a section from an
authored stack reaches the dialog DECLARED `columns: 1` and draws one
column. **The undeclared rule is correct but takes effect only after the
spec drops the default (objectstack-ai/objectstack#23740).** It is not
worked around: a declared `1` is never read as undeclared, and a pin
holds that. NOT MEASURED: the HTTP leg (a live server's served JSON),
and whether a view saved through the metadata API at runtime is parsed
on save. Neither objectstack nor hotcrm is installed in this container.
- **A3, the merge.** Resolved as above; PR #12556's and PR #12571's own
pins were re-run as CONTROLs, all green (see Tests).
- **A4, the no-section default against `default(1)`.** With the fork
ruled, the only remaining question is A2. A form with no sections never
meets `FormSectionSchema`, so its two-per-row default is unaffected. The
fieldGroups fallback stamps its own `columns` on the sections it
derives, so it is unaffected too.
## Tests (local, head `91fd2dbe68`)
Every vitest run went through objectstack's `os-verify-lock.sh`.
-
`packages/app-shell/src/console/__tests__/AppContent.recordDialogInterimBound-12521.test.tsx`
(new, 8 cases), on a real `AppContent` mount with the real `ModalForm`
where a case reads the dialog:
- the 14-field object is field-heavy (the installed
`deriveRecordSurface` pages it);
- desktop `create`: no `modalSize` is handed over, and the dialog is
`sm:max-w-5xl`, not `sm:max-w-[95vw]`;
- `edit`, `child-create` and `child-edit`: no derived `modalSize` is
handed over;
- phone: the classes that apply below `sm` are identical to those of the
old 95vw dialog, the sheet's `fixed inset-0 w-full h-[100dvh]` included,
and no `max-w-*` reaches a phone;
- CONTROL: a `modalSize: 'full'` handed to the dialog still opens at
95vw;
- EXIT: the installed derivation still answers `full`, and while it does
the interim applies.
-
`packages/plugin-form/src/__tests__/dialogDefaultLayout-12521.test.tsx`
(14 cases, 5 new): the round-1 cases; the CONTROL re-expressed on PR
#12556's classes; and the density cases. Those are: undeclared beside
`columns: 1`; undeclared beside `columns: 3` on the 12-track grid; a
`columns: 3` section draws three; every section at `columns: 1` (what
the spec's parse writes today) draws one column; and a form-level
`columns` still sets an undeclared section's count.
- **Ablation** of the interim: `interimBoundedTaskFlowSurface` made the
identity through objectstack's `scripts/ablation-replace.mjs` (anchor 1
→ 0, blob `91e724d1d8` → `a9cf6e490d`), trap-protected. Result: **5
failed, 3 passed**.
- Red: the create, edit, child-create and child-edit cells, and the EXIT
cell, each at `expected 'full' to be undefined`.
- Green: the precondition, the phone cell and the authored-size CONTROL.
- Restore proven: the blob equals HEAD (`91e724d1d8`) and `git diff
HEAD` is empty.
- **The exit message, simulated once.** The exit cell's own read was
mutated to answer `size: 'auto'`, as a spec carrying
objectstack-ai/objectstack#23734 would. The cell then fails with: "The
installed @objectstack/spec no longer derives `size: 'full'` for a
field-heavy desktop task flow: objectstack-ai/objectstack#23734 is
installed. Delete the interim `interimBoundedTaskFlowSurface` in
packages/app-shell/src/console/AppContent.tsx, call
`deriveRecordFlowSurface` directly at its call site, and delete this
file (objectui#12521, interim ruled in comment 6205068311).: expected
'auto' to be 'full'". Restore was proven the same way. No permanent test
file.
- CONTROLs plus the new pins in one run, 8 files, **123 passed**:
- PR #12556's `mixedSectionColumns-12548.test.tsx` and
`form-twelve-track-span-12548.test.tsx`;
- PR #12571's `modalSectionToggleSuspense-12559.test.tsx` and
`sectionedFormValues.test.tsx`;
- the two new pin files, `autoLayout.test.ts` and `plugin-view`'s
`recordSurface.test.ts`.
- The whole `packages/plugin-form/` plus
`form-twelve-track-span-12548.test.tsx`: **187 files, 2294 passed, 1
skipped**, vitest exit 0.
- Dialog hosts plus the census and ratchet sweep, **88 files, 2558
passed**, `VERDICT command-exit 0`. The set is:
- every `packages/app-shell` and `apps/console` test that `git grep -l
-E
"ModalForm|useActionModal|openRecordForm|form=new|createTitle|editTitle|formType:
.modal.|resolveFormViewLayout|deriveRecordFlowSurface"` finds on the
merged tree (40, the new file included);
- the designer `ObjectManager` tests and `ObjectFormDesigner.test.tsx`;
- the `packages/types` files that read `ModalForm`, and `plugin-view`'s
`ObjectView.formTitleI18n` and `recordSurface` tests;
- the 43 census and ratchet files (`git grep -l -E
"census|ratchet|WRITE_SITES|AFFORDANCE_GRANTS"`) whose subject this diff
touches (`AppContent`, `ModalForm`, `autoLayout`, the changesets, the
docs page).
- `type-check` for `@object-ui/plugin-form` and `@object-ui/app-shell`:
exit 0, after `turbo run build --filter='@object-ui/app-shell^...'` (29
packages, `VERDICT command-exit 0`). Each runs `tsc --noEmit` and `tsc
-p tsconfig.test.json`, whose include `src/**/*.test.tsx` covers both
pin files.
## Gates (local subset, each exit code captured before any pipe)
All exit 0:
- changeset gates: `check-changeset-presence` ("6 source file(s) of 2
released package(s) changed, and this change declares 2 changeset(s)"),
`-no-major`, `-overwrite`, `-fixed`, `check:changeset-claims`,
`check:pending-changeset-literals`;
- `check:control-bytes` and `check:new-line-citations` ("0 new
citation(s)");
- doc gates: `check:doc-snippets` ("796 of 796 block(s) judged, 0
failed"), `check-doc-links`, `check:doc-fences`, `check:doc-json`,
`check:doc-types`, `check-doc-expression-carriage`,
`check:doc-example-ids`. `check:doc-snippets` first answered
PRECONDITION NOT MET (exit 2, read as not measured) and passed after its
scoped build;
- `check:spec-symbols`, `check:installed-pin-claims`;
- `check-test-path-roots` and the three `vi.mock` gates;
- eslint on the six changed TS files: 0 errors, warnings only, all
`no-explicit-any`;
- `check-governed-queue-guard --test` on the nine paths: NOT GOVERNED.
Left to CI: the full farm, including repo-wide `pnpm lint` and
`performance-budget`.
## What the landing seat's browser reading should show
Expected values below come from the DOM the real `ModalForm` renders for
a HotCRM-Leads-shaped form (sections `columns` 2 / 3 / 2 / 1 / 2,
`last_name` `span: 'full'`). It was measured in headless Chromium
against a Tailwind 4.3.3 compile of that DOM's own classes, not the
console's full sheet.
- **HotCRM Leads → New at 1440 × 900:** the dialog is within the `xl`
bound, 1024 × 810 (it was 1368 × 810). The sections are drawn as
authored:
- Contact Information two per row, 455 px each, with `last_name` on its
own row at 926 px;
- Lead Classification three per row, 298 px each;
- a `columns: 2` section two per row; Additional Information (`columns:
1`) one per row.
Collapsed sections open in place.
- **At 390 × 844:** the sheet is unchanged. It is a full-screen 390 ×
844 sheet with every field 358 px wide, one per row, the same as before
the interim.
- **Between `sm` and `xl`:** at a 1024-wide window the dialog fills the
width, 1024 px (it was 973 px at 95vw).
## Acceptance notes
- **The undeclared-section rule is dormant on authored stacks until
objectstack-ai/objectstack#23740** (A2). Today every parsed section
carries `columns: 1` and draws one column. This PR does not work around
that.
- **While the interim stands, it also bounds a field-heavy form with an
embedded child table.** Letter B item 2 asks the spec seat to measure
that case first, and the spec may keep it full-screen. On the exit,
whatever objectstack-ai/objectstack#23734 derives takes over.
- **The console's global record dialog reads neither
`FormView.modalSize` nor `FormView.columns`.** `resolveFormViewLayout`
passes sections, `contentLayout` and subforms only. So "an authored
form-view size still wins" has no path at this host, before or after
this PR. No producer writes `FormView.modalSize`: zero hits in hotcrm,
objectstack `examples/`, and objectui `examples/` and `apps/`. Noted,
not filed; carrier: none (承接者:无).
- **The other sectioned hosts keep an undeclared section at the grid's
width**, single-column when nothing declares a count. That is
`ObjectForm`'s page form, `SplitForm`, `TabbedForm` and `WizardForm`.
This round is dialog-only, as round 1 was. Once
objectstack-ai/objectstack#23740 lands, those hosts will meet undeclared
sections too. Noted for the follow-up; carrier: the seat.
- **The PR title still names `plugin-form` only.** The title is outside
this round's write budget.
- From round 1, still standing: `plugin-form.mdx`'s "single-column in
every host" sentence is loose for `ObjectForm`'s simple path, which
falls back to `inferColumns`.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01JZnppgHRp4sREcouhkQYDB)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent ae923ec commit 7b5e558
9 files changed
Lines changed: 749 additions & 55 deletions
File tree
- .changeset
- content/docs/plugins
- packages
- app-shell/src/console
- __tests__
- plugin-form/src
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
181 | 205 | | |
182 | 206 | | |
183 | 207 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
105 | 135 | | |
106 | 136 | | |
107 | 137 | | |
| |||
1191 | 1221 | | |
1192 | 1222 | | |
1193 | 1223 | | |
1194 | | - | |
1195 | | - | |
1196 | | - | |
1197 | | - | |
1198 | | - | |
1199 | | - | |
1200 | | - | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
1201 | 1232 | | |
1202 | 1233 | | |
1203 | 1234 | | |
1204 | 1235 | | |
1205 | | - | |
| 1236 | + | |
1206 | 1237 | | |
1207 | 1238 | | |
1208 | 1239 | | |
| |||
0 commit comments