Repository navigation
fix(console): the named-form page sizes a field from its span, not only its colSpan - #37672
Conversation
…ly its colSpan Claude-Session: https://claude.ai/code/session_01L6bhgWAbKPqt7vTgX5qgUn Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgWAbKPqt7vTgX5qgUn Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA Contract reviewServed-tier: Face: declaration ( ① Derived judgmentsAccept-set and public-surface changes the diff implies:
Findings:
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS The declaration face holds: |
…ultiple; plugin-form root exports resolveColSpan Claude-Session: https://claude.ai/code/session_01L6bhgWAbKPqt7vTgX5qgUn Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA Contract reviewServed-tier: Delta round on the declaration face ( ① Derived judgmentsAccept-set and public-surface changes the net diff implies:
Findings from the earlier record:
New finding:
The ② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS F1 and F2 (should-fix) are closed at this head, and so are nits F3 and F4. The only open item is the nit F5, so this is the final round. F5 is recorded as an accepted deviation on PR prose; correcting it touches only the body. No should-fix or must-fix finding is open. |
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA 席位核对 — ACCEPT · head 7ea307d · card #37559 · area s2-ux-S · 2026-11-26T20:46ZL1 checklist
Tier: S. Landing: ready + auto-merge by this stroke. |
Requested by Sales · project thread
Fixes #37559
Clause-②: yes (widening:
@object-ui/plugin-formexportsresolveColSpanfrom its root and its/coresubpath)Metadata-protocol: none
维护者速读
What changes
ui/apps/console/src/components/FormPage.tsx: each row's width is resolved by the record form's own resolver,resolveColSpan, against the section's column count. Before, the row readcolSpanalone. The precedence is the FormFieldSchemaspancontract:span: 'full'comes first, then an authoredcolSpanclamped to the grid, then thespan: 'auto'wide-type default (textarea, markdown, html, richtext, and a multiple file or image field). The type goes throughmapFieldTypeToFormTypewith the effectivemultiple, the same way the record form'ssectionFields.tsdoes it. This page's grid has a single multi-column tier (sm:grid-cols-N), so onesm:col-span-Nclass is the whole row at every multi-column tier.ui/packages/plugin-form/src/core.tsandui/packages/plugin-form/src/index.tsx: addresolveColSpanto the side-effect-free/coresubpath, so the console can reach it without loading the form renderers. It is also added to the package root's./autoLayoutexport group, which keeps core.ts's header rule (every/corename is also a root name) true, following theFormOwnerLineContextprecedent. The seat's contract review addedindex.tsxto the file surface.multiple, as the spec andsectionFields.tsdo. A form-levelmultiplestill decides the widget, through thetypeargument, but no longer decides the default width.autoLayout.tsis already in that subpath's closure and in theplugin-form-corechunk group, so the bundle split does not change..changeset/37559-form-page-field-span.md: patch for@object-ui/consoleand@object-ui/plugin-form.Read first, by risk:
FormPage.tsx, thecolSpan:entry in the section builder. This is where the precedence is decided.core.ts, the export list. This is the new public name.FormPage.fieldSpan-37559.test.tsx, which pins the rendered class.Tests
New file
ui/apps/console/src/components/FormPage.fieldSpan-37559.test.tsxdrives the real/forms/:nameroute and reads the renderedsm:col-span-Nclass on each row:span: 'full'field and a textarea each take 2 cells in a 2-column section;colSpanwins, so a textarea withcolSpan: 1stays one cell andcolSpan: 2renders 2 cells in a 4-column section;colSpan: 4in a 2-column section clamps to 2 cells;multiple: truetakes the whole row onspan: 'auto';multiple: trueover a single-file object field stays one cell.Pins and ablation readings (head 7ea307d)
vitest run --maxWorkers=2onFormPage.fieldSpan-37559.test.tsx,FormPage.maxLength.test.tsx,FormPage.test.tsandFormPage.fileField.test.tsx(ui root, under the verify lock):VERDICT command-exit 0, Test Files 4 passed (4), Tests 93 passed (93).resolveColSpancall was replaced on disk withcolSpan: override.colSpan ?? 1and the pin re-run:VERDICT command-exit 1, 4 failed and 3 passed (7). The two span pins, the clamp pin and the multi-file pin went red (expected 1 to be 2,expected 1 to be 3,expected 4 to be 2,expected 1 to be 2). The three CONTROLs stayed green.override.multiple ?? def.multipleand the pin re-run:VERDICT command-exit 1, 1 failed and 6 passed (7). Only the form-level-multiple CONTROL went red (expected 2 to be 1).git checkout HEAD --, and the porcelain status was empty.Type-check and gate readings (head 7ea307d)
turbo run build --concurrency=2 --filter='@object-ui/console^...'(Tasks: 79 successful, 79 total). Thenpnpm --filter @object-ui/plugin-form type-checkandpnpm --filter @object-ui/console type-checkboth ran, and the lock printedVERDICT command-exit 0.dispatch-gates --commandsderives the same 38 families as at c219200. At c219200 all 38 ran with exit 0 (--ran: 38 of 38, a derived zero). At 7ea307d I re-ran a declared narrowing of 11, each with exit 0: the changeset gates (adr-0087-registration, changeset-no-major, empty-changeset), sdui-manifest, published-files, the type-check-coverage and type-check-debt ratchets, undeclared-dep-imports, cross-package-test-inputs, test-source-alias and nul-bytes. The other 27 are left to CI on this head.node scripts/pm/overlap-check.mjs:VERDICT clean exit 0. It merges cleanly with origin/main and with fix(console): a named or public form lays its sections out by the form view's own columns #37671, which shares FormPage.tsx, core.ts and index.tsx.Acceptance notes
records-formsacceptance[2] (the width half, knownGaps[2]).repeaterfield onspan: 'auto'gets one cell, though the spec says wide types reach the full row #37677): onspan: 'auto', a repeater resolves to one cell on both form renderers. The spec docblock onFormFieldSchema.spansays a repeater reaches the full row through thefield:gridwidget, butmapFieldTypeToFormTypenow maps repeater tofield:object, which is not inWIDE_FIELD_TYPES. This was read from the code and has not been reproduced.FormFieldSpecdeclarescolSpanbut notspan, so this page reads the served entry'sspanthrough a cast, the same wayresolveColSpandoes.Verification
Two-minute check: run
pnpm exec vitest run apps/console/src/components/FormPage.fieldSpan-37559.test.tsxfromui/. Expected: 4 passed. In the showcase app, open/forms/showcase_task.formand set Priority to Urgent. The Notes field appears (span: 'full') and spans the whole row of its two-column section.🤖 Generated with Claude Code
https://claude.ai/code/session_01L6bhgWAbKPqt7vTgX5qgUn