Repository navigation
fix(plugin-form): page form hosts draw an undeclared section as the dialog does (two per row from @md) - #12714
Merged
Conversation
…ialog does @objectstack/spec 18.0.0-next.2 dropped FormSectionSchema.columns' default(1), so a section with no `columns` reaches every sectioned host. The dialog drew it two per row from `@md`; ObjectForm sized it by field count (inferColumns) and SplitForm, TabbedForm and WizardForm drew it one per row, or at the widest declared count. The rule (section columns, else form columns, else 2) now lives once in autoLayout.ts: sectionedGridLayout takes the AUTHORED counts and resolves an undeclared section and form itself, through sectionColumnsFor and sectionedFormColumns. All five hosts hand it the raw declared values; ModalForm's private copy of the rule is gone. A declared `columns` (1 included) is drawn as written. Pins per page host (undeclared, mixed, declared controls) in undeclaredSectionDensity-12592.test.tsx. Claude-Session: https://claude.ai/code/session_013MpUUZWPR76Hx2czmmtfu9 Co-authored-by: Claude <noreply@anthropic.com>
Contributor
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
Contributor
Author
席位核对 · ACCEPT ·
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #12592
Clause-②: no
What changed
A form section that declares no
columnsnow draws two fields per row from the container's@mdtier, and one below it, on every page form host:ObjectForm,SplitForm,TabbedFormandWizardForm. The record dialog already drew it that way. Items 1 and 2 of this card landed through PR #12648; this PR is item 3, and it completes the card.@objectstack/spec@18.0.0-next.2droppedFormSectionSchema.columns'default(1)(spec(view): FormSectionSchema.columns drops default(1) — an undeclared section density is the renderer's (by available width), a declared one is the author's ceiling (objectui#12521 fork) objectstack#23740), so an undeclared section now reaches every sectioned host.packages/plugin-form/src/autoLayout.ts: sectioncolumns, else formcolumns, elseUNDECLARED_SECTION_COLUMNS(2).sectionedGridLayouttakes the AUTHORED counts and resolves undeclared values itself, throughsectionColumnsForandsectionedFormColumns.dialogSectionColumns,sectionedDialogColumns) is deleted.columns,1included, is drawn as written.Measured before the change (jsdom over the real renderer, per row at @md / @2XL / @4XL)
columns: 3columns: 1After the change, every undeclared row reads 2/2/2 on all five hosts, and the declared rows are unchanged.
Tests
undeclaredSectionDensity-12592.test.tsx, 20 tests. Per page host:columns: 3: the dialog's count. WizardForm draws one step per grid, so it uses the plain two-column grid rather than the 12-track one; same count, different classes;columns: 1,columns: 3, and a form-levelcolumns: 3.mixedSectionColumns-12548.test.tsxgains a unit case for the undeclared resolution.pnpm exec vitest run packages/plugin-form/: 189 files, 2314 passed, 1 skipped.schema.columns ?? 1turns that host's rows red, 3 failures each;Browser readings
Showcase on published
18.0.0-next.2, console from this branch and fromefa9cb4fa. HotCRM was not reachable from the container.showcase_new_project_wizard(WizardForm, undeclared)showcase_semantic_zoo/new(ObjectForm, fieldGroup sections)showcase_semantic_zooNew dialog (ModalForm)showcase_task/new(declaredcolumns: 2)@containerquery resolves in a real browser: 2 tracks at 1440 (container 1136 px and 896 px), 1 track at 390.showcase_taskformViews) declarecolumnson every section, so they are declared controls, which the unit pins cover; and no console route to them was found.claude/issue-12592-evidenceunderevidence/12592/(PNGs, per-field JSON, and the before/after table).Acceptance notes
inferColumns.columnsentirely and never calls the shared rule. No author was found declaring more than1on a drawer section, so it is noted only.components/.../form/form.tsxandsectionFields.spec-parity.test.ts. Neither file is touched here.Gates (local, HEAD 83ac907)
@object-ui/plugin-form^...@object-ui/plugin-formbuild@object-ui/plugin-formtype-checkvite build(VITE_BASE_PATH=/console/)check:changeset-claimschangeset:checkcheck:test-path-rootscheck:spec-symbolscheck:doc-example-readerscheck:unreferenced-sourcescheck:handler-key-readscheck-changeset-presenceProvenance: built by the cloud session
session_013MpUUZWPR76Hx2czmmtfu9(claim6216815351) and opened by thedomain:uiseat 1 PM (session_011K9g23W67dy2zwnyzaoB6o) from that session's final message, because a cloud session cannot open a PR from its container. The seat joined the first two lines and replaced the dev's own footer lines with this line.Generated by Claude Code