Skip to content

fix(console): a named or public form lays its sections out by the form view's own columns - #37671

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-w3bxjl
Nov 26, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-w3bxjl

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Jack · project thread

Fixes #37665
Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到的变化:表单视图写了整体列数的命名表单和公开表单,发布后按这个列数排版,和 Setup 里的预览一致;没写整体列数的表单排版不变。
  • 属于「让云端内置智能体达到 Claude Code 经轻门效果」专题,执行你对表单整体列数去留的裁决(让表单页照列数显示)。
  • 出错的话,写了整体列数的表单列数会显示得不对,不影响填写和提交;改动只在界面,可直接撤回。
  • 无。

What changes

  • ui/apps/console/src/components/FormPage.tsx: buildSections resolves each section's fields per row through @object-ui/plugin-form's sectionedGridLayout, the rule the Setup canvas, the record dialog, the record form and the tabbed / wizard layouts share. Under the ruling ([Decision] FormViewSchema.columns (form-level) is read only by the Setup preview: enforce it on the form page, or retire it #37638, letter A, ruling comment 7200681767) the form view's columns is the grid width and caps a section's count, and a section that declares none takes the form's count. The hand-rolled normalizeColumns (default 2) is gone; declaredSectionColumns reads only the spec's '1'–'4' string arm as the number its parse gives, and defaults nothing.
  • ui/packages/plugin-form/src/autoLayout.ts: SectionedGridLayout gains sectionColumns(declared), the count one section draws (the clamp layOut already used, now exposed). FormPage draws each section on a grid of its own, so it reads this count rather than the shared field grid.
  • ui/packages/plugin-form/src/core.ts and index.tsx: export sectionedGridLayout and its type. The console imports plugin-form through /core, which did not export it. (File surface widened from the order's autoLayout.ts; accepted by the seat on the card.)
  • packages/spec/liveness/view.json: the form.columns row re-cited to FormPage#buildSections and the Setup preview (ViewPreview.tsx#buildFormPreviewSchema into ObjectForm), both through sectionedGridLayout. The ModalForm / DrawerForm citation was stale.
  • Changeset .changeset/37665-form-page-form-columns.md (@object-ui/plugin-form, @object-ui/console: patch).

No spec or contract change: the spec still accepts any integer from 1 for the form's columns and the renderer clamps at 4, left as found.

Tests

  • FormPage.formViewChrome-26843.test.tsx (the page's form-view-key harness, both routes): new top-level describe on a named form (/forms/:name) and a public form (/f/:slug): form columns: 1 + section columns: 2 draws one column; form columns: 3 + undeclared sections draws three; CONTROL, no form columns: a columns: 1 section draws one, an undeclared one two.
  • FormPage.test.ts: buildSections counts for the same cases plus a declared section narrower than the form; declaredSectionColumns replaces the normalizeColumns block.

Acceptance notes

  • The page keeps its own per-section grid classes (viewport sm: tiers) and its row spans. Moving it onto the container-query twelve-track field renderer the dialog uses would also change forms without a form-level columns (breakpoints, wide fields taking the row), which this card keeps as they are. Only the count per section comes from the shared rule.
  • Off-spec section counts change with the shared rule: a section columns of 5 or more drew 2 and now draws 4 (the clamp every other host applies); a non-numeric string other than '1'–'4' still reads as undeclared. The spec refuses both at parse.

Verification

Local runs, worktree on `origin/main` 05563a5, head 4077b92
  • pnpm --dir ui exec vitest run apps/console/src/components/FormPage.test.ts apps/console/src/components/FormPage.formViewChrome-26843.test.tsx → 2 files, 95 passed (79 + 16).
  • Same plus packages/plugin-form/src/__tests__/mixedSectionColumns-12548.test.tsx and undeclaredSectionDensity-12592.test.tsx → 4 files, 133 passed.
  • Ablation (on-disk edit of the committed fix, buildSections fed the form's columns as undeclared, i.e. section-only): 7 failed / 88 passed, exactly the three buildSections count cases and the four named/public route cases; the CONTROL cases stayed green. Restored with git restore --source=HEAD --staged --worktree, tree clean, re-run green.
  • pnpm exec turbo run type-check --filter=@object-ui/plugin-form --filter=@object-ui/console → 81/81 tasks, exit 0.
  • eslint on the six changed ui files → 0 errors (warnings are pre-existing in those files).
  • pnpm --filter @objectstack/spec check:liveness → exit 0; pnpm --dir ui run check:new-line-citations → 0 new; node scripts/check-nul-bytes.mjs → OK.

Read first: FormPage.tsx buildSections (the sectionedGridLayout call), autoLayout.ts sectionedGridLayout (sectionColumns: density).

Two minutes: pnpm --dir ui exec vitest run apps/console/src/components/FormPage.formViewChrome-26843.test.tsx → 16 passed; the six #37665 cases cover both routes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q4EjjQ8nXPvFqzfN7vdwxR

…columns

FormPage resolves each section's fields-per-row through plugin-form's
sectionedGridLayout, the rule the Setup canvas, the dialog and the record
form share: the form view's columns is the grid width and caps a
section's count, and an undeclared section takes the form's count.

Claude-Session: https://claude.ai/code/session_01Q4EjjQ8nXPvFqzfN7vdwxR
Co-authored-by: Claude <noreply@anthropic.com>
…and liveness citation

Claude-Session: https://claude.ai/code/session_01Q4EjjQ8nXPvFqzfN7vdwxR
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet
objectstack-fleet Bot requested a review from hotlong November 26, 2026 19:31
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

⚠️ 1 changed file(s) yielded no anchor (packages/spec/liveness/view.json), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files. Nothing else in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 1 changed package(s)).

What this run could not see
  • 1 changed file(s) yielded no anchor (packages/spec/liveness/view.json) — pages documenting those are invisible to this run
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 177 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 9a65a48f805dac70b64dc78c54abbe30dc0453d8 → packageMentionDocs.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

epic:#5027#1 · hotlong · session_01Q4EjjMUfmNYTem26rXLFUf

维护者速读

Seat opinion: land.

席位核对

Seat L1 verdict: ACCEPT · head e663051fa154 · 2026-11-26T20:39Z · Fixes #37665.

  • Shape: draft, base main, Fixes #37665 only. 9 files, +137/−25. The fence was widened to plugin-form/src/core.ts and index.tsx, the export the console imports through /core, which the seat accepted on the card. A docs-only README sentence came from the docs-drift note. Changeset: @object-ui/plugin-form and @object-ui/console, patch. Clause-②: no, Metadata-protocol: none.
  • Diff read: FormPage.tsx buildSections resolves each section's count through sectionedGridLayout, the rule the Setup canvas, the record dialog and the record form share. The form view's columns is the grid width and caps a section, and a section that declares none takes the form's count. normalizeColumns (default 2) is gone. declaredSectionColumns reads only the spec's '1'–'4' arm. SectionedGridLayout.sectionColumns exposes the clamp layOut already used. The liveness row form.columns is re-cited to the hosts that now read it.
  • Clause-② no: right. No spec or accept-set change; the ruling ([Decision] FormViewSchema.columns (form-level) is read only by the Setup preview: enforce it on the form page, or retire it #37638, letter A) makes an existing declared key do what it says. Off-spec counts (≥5) now clamp to 4, as on every other host; the spec refuses them at parse.
  • Tests: FormPage 95/95 (79 + 16, both routes, named and public), 133/133 with the two plugin-form layout suites. Ablation: 7 red / 88 green, with the controls green. type-check plugin-form + console 81/81. eslint 0 errors. check:liveness green.
  • Gates: head check-runs all success or skipped. One Test Core (5/10) timeout in @objectstack/cli start-deployment-durability.integration.test.ts (spawnSync, 5 s default, no file of this diff) passed on one run_rerun_failed. mergeable_state clean.
  • Landing tier: check-governed-merges --pr 37671: 0 of 9 paths governed, +137/−25. landing-k OK, K = 7.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

epic:#5027#1 · hotlong · session_01Q4EjjMUfmNYTem26rXLFUf

Landing · 2026-11-26T20:39Z · head e663051fa154

Probe Reading
check-governed-merges --pr 37671 NOT governed; +137/−25
landing-k --pr 37671 OK, K = 7
head check-runs all success / skipped (one Test Core shard re-run green after an unrelated CLI timeout)

State change: ready + auto-merge; Fixes #37665 closes the card at MERGED.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 26, 2026 20:39
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 26, 2026
Merged via the queue into main with commit 5314575 Nov 26, 2026
113 of 115 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-w3bxjl branch November 26, 2026 21:11
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…ly its colSpan (objectstack-ai#37672)

<!-- claude-projects-attribution: {"github_login":"os-sales"} -->
_Requested by **Sales** · [project
thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuBUGgrNWoBUQKbyS4GaX5vM)_

Fixes objectstack-ai#37559

Clause-②: yes (widening: `@object-ui/plugin-form` exports
`resolveColSpan` from its root and its `/core` subpath)
Metadata-protocol: none

## 维护者速读

- 在具名表单页上填表的用户会看到:标为整行的字段和多行文本类字段占满一整行,不再挤在一格里。
- 不属于任何 epic;替按表单视图配置字段宽度的应用作者兑现规格里已经声明的宽度规则。
- 出错时只影响该页字段的宽度排布,不影响数据与提交,回退本次合并即可撤回。
- 无

## 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 read `colSpan` alone. The
precedence is the FormFieldSchema `span` contract: `span: 'full'` comes
first, then an authored `colSpan` clamped to the grid, then the `span:
'auto'` wide-type default (textarea, markdown, html, richtext, and a
multiple file or image field). The type goes through
`mapFieldTypeToFormType` with the effective `multiple`, the same way the
record form's `sectionFields.ts` does it. This page's grid has a single
multi-column tier (`sm:grid-cols-N`), so one `sm:col-span-N` class is
the whole row at every multi-column tier.
- `ui/packages/plugin-form/src/core.ts` and
`ui/packages/plugin-form/src/index.tsx`: add `resolveColSpan` to the
side-effect-free `/core` subpath, so the console can reach it without
loading the form renderers. It is also added to the package root's
`./autoLayout` export group, which keeps core.ts's header rule (every
`/core` name is also a root name) true, following the
`FormOwnerLineContext` precedent. The seat's contract review added
`index.tsx` to the file surface.
- The wide default reads only the OBJECT field's `multiple`, as the spec
and `sectionFields.ts` do. A form-level `multiple` still decides the
widget, through the `type` argument, but no longer decides the default
width. `autoLayout.ts` is already in that subpath's closure and in the
`plugin-form-core` chunk group, so the bundle split does not change.
- `.changeset/37559-form-page-field-span.md`: patch for
`@object-ui/console` and `@object-ui/plugin-form`.

Read first, by risk:
1. `FormPage.tsx`, the `colSpan:` entry in the section builder. This is
where the precedence is decided.
2. `core.ts`, the export list. This is the new public name.
3. `FormPage.fieldSpan-37559.test.tsx`, which pins the rendered class.

## Tests

New file
`ui/apps/console/src/components/FormPage.fieldSpan-37559.test.tsx`
drives the real `/forms/:name` route and reads the rendered
`sm:col-span-N` class on each row:
- a `span: 'full'` field and a textarea each take 2 cells in a 2-column
section;
- the same two take 3 cells in a 3-column section;
- CONTROL: a plain text field stays one cell;
- CONTROL: an authored `colSpan` wins, so a textarea with `colSpan: 1`
stays one cell and `colSpan: 2` renders 2 cells in a 4-column section;
- `colSpan: 4` in a 2-column section clamps to 2 cells;
- a file field whose object field declares `multiple: true` takes the
whole row on `span: 'auto'`;
- CONTROL: a form-level `multiple: true` over a single-file object field
stays one cell.

<details><summary>Pins and ablation readings (head 7ea307d)</summary>

- `vitest run --maxWorkers=2` on `FormPage.fieldSpan-37559.test.tsx`,
`FormPage.maxLength.test.tsx`, `FormPage.test.ts` and
`FormPage.fileField.test.tsx` (ui root, under the verify lock): `VERDICT
command-exit 0`, Test Files 4 passed (4), Tests 93 passed (93).
- Ablation 1, the pre-fix line: the `resolveColSpan` call was replaced
on disk with `colSpan: override.colSpan ?? 1` and 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.
- Ablation 2, the stash: the wide-default stash was put back to
`override.multiple ?? def.multiple` and 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`).
- After each ablation the file was restored with `git checkout HEAD --`,
and the porcelain status was empty.

</details>

<details><summary>Type-check and gate readings (head
7ea307d)</summary>

- I built the closure with `turbo run build --concurrency=2
--filter='@object-ui/console^...'` (Tasks: 79 successful, 79 total).
Then `pnpm --filter @object-ui/plugin-form type-check` and `pnpm
--filter @object-ui/console type-check` both ran, and the lock printed
`VERDICT command-exit 0`.
- `dispatch-gates --commands` derives 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 objectstack-ai#37671, which shares FormPage.tsx,
core.ts and index.tsx.

</details>

## Acceptance notes

- Follow-up reading: after this lands, re-score platform-checklist
`records-forms` acceptance[2] (the width half, knownGaps[2]).
- Not in this PR (filed by the seat as objectstack-ai#37677): on `span: 'auto'`, a
repeater resolves to one cell on both form renderers. The spec docblock
on `FormFieldSchema.span` says a repeater reaches the full row through
the `field:grid` widget, but `mapFieldTypeToFormType` now maps repeater
to `field:object`, which is not in `WIDE_FIELD_TYPES`. This was read
from the code and has not been reproduced.
- Noted, not filed: the app-shell authoring type `FormFieldSpec`
declares `colSpan` but not `span`, so this page reads the served entry's
`span` through a cast, the same way `resolveColSpan` does.

## Verification

Two-minute check: run `pnpm exec vitest run
apps/console/src/components/FormPage.fieldSpan-37559.test.tsx` from
`ui/`. Expected: 4 passed. In the showcase app, open
`/forms/showcase_task.form` and 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.com/claude-code)

https://claude.ai/code/session_01L6bhgWAbKPqt7vTgX5qgUn

<!-- signed: repo:objectstack#2 · os-sales ·
session_01L6bhgWAbKPqt7vTgX5qgUn -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ui: the console form page ignores a form view's own columns, so a published form draws a different layout than its Setup preview (ruled #37638 A)

2 participants