Skip to content

Commit 2df9691

Browse files
fix(plugin-detail): an authored record page folds its all-empty field groups into one closing line (#35161)
Fixes #35019 repo:objectstack#1 · os-warren · session_01JQwxbXBffgVtUPBEY2nLFm Clause-②: no Metadata-protocol: none ## 维护者速读 - 改了什么:自建记录页(如 HotCRM 商机页)的「明细」里,字段全空的分组不再各占一张带边框的卡,而是折进明细末尾的一行「商机叙述 · 备注与下一步 · 2 个空分区 · 展开」,与默认记录页同一个设计;点「展开」后两组回到原位,各自是一张卡(标题加一行「显示 N 个空字段」),从那一行可显示并就地编辑字段。 - 为什么改:新建商机时这两张空卡各占约 80px,看起来像有内容,其实什么都没有;默认记录页早已折成一行,自建页没有跟上。 - 风险与回滚:只改 `record:details` 明细体的只读展示;有内容的分组(含其「显示 N 个空字段」)、编辑态、打印页、独立的 `detail-view` 都不变。回滚即 revert 本 PR,无数据或元数据迁移。 - 先看:`ui/packages/plugin-detail/src/DetailView.tsx`(决定哪些明细体画这一行的判断)、`ui/packages/plugin-detail/src/renderers/record-details.tsx`(`record:details` 打开该判断的包裹)、`packages/spec/src/ui/component.zod.ts`(`hideEmpty` 的 describe 改写)。 - 两分钟验证:`pnpm --dir ui exec vitest run packages/plugin-detail/src/__tests__/EmptySectionsLine.authoredPage-35019.test.tsx`,预期 10 个测试全部通过。 - 需要你做的:无,席位落地。 ## What changes On an authored record page, a `record:details` body drew every group the page keeps with `hideEmpty: false` as its own bordered card even when all its fields were empty: a card holding a heading and one "Show N empty fields" row. The synthesized default page already folds such groups into one closing line (`EmptySectionsLine`, objectstack#27055 Target 2), but `DetailView` drew that line only under `DefaultRecordPageContext`, so an authored page fell to the whole-body fold, which folds only when every group is empty. Scope as corrected on the card (comment 6970082809): draw the same line on authored `record:details` pages, no new design, no new metadata key. - **The switch.** `RecordDetailsRenderer` now wraps the `DetailView` it mounts in a new module-internal `EmptySectionsLineContext` (in `defaultRecordPage.ts`, beside the other record-page face contexts; not re-exported from the barrel, not a prop, not a schema key, the `RecordPageProvenanceContext` precedent). `DetailView` draws `EmptySectionsLine` when that context or `useDefaultRecordPage()` is on and the body has no `sectionGroups`. Every other body keeps `EmptySectionsFold` unchanged. - **Paths an authored `record:details` reaches, and which this covers.** `record:details` always hands `DetailView` a schema with `sections` (or the direct-`fields` fallback), never `autoTabs`, `tabs` or `sectionGroups`, so it always reaches the non-tab sections block, which is the branch this changes. The HotCRM opportunity page's `{ group }` references are resolved to `sections` with `fields` by the renderer, so they arrive as `sections`. Not changed: the `autoTabs` body and `sectionGroups` bodies (reached only by a `detail-view` node), and the direct-`fields` fallback (one section, no fold either way). A bound `record:details` (per-element `dataSource`) draws the line too; measured producers of a bound `record:details` in HotCRM and the showcase/CRM examples: 0. - **The whole-body fold.** On a `record:details` body it is subsumed by the line: a body whose every kept group is empty now draws the line naming them all, where it drew one unnamed "Show N empty fields" row (pinned). Everywhere else it keeps working as before (CONTROL pin, and the objectui#13386 suite, unchanged and green). - **Kept as is.** A group with a value draws as before, its own "Show N empty fields" row included. Edit mode and a print page draw every group. `hideEmpty` keeps its default, and a group the default hides is never named in the line. - **Contract prose the change would make false, restated (ruling 6970082809; ruling C on objectui#13386 is kept as the expanded face).** The `describe()` of `RecordDetailsProps.sections[].hideEmpty` in `@objectstack/spec` said a kept all-empty section renders, read-only, as its heading plus one fold row. On `record:details`, its only renderer, it is now named in the closing line first. Restated there and in its mirrors: the `@object-ui/types` docs (`RecordDetailsProps` section, `DetailViewSection.hideEmpty`), the `record:details` `sections` input description in the component registry, the plugin README. Regenerated, not hand-edited: `content/docs/references/ui/component.mdx` (`check:generated --fix`), `sdui.manifest.json` with `scripts/sdui-manifest.record.json` (`node scripts/gen-sdui-manifest-node.mjs`), `content/docs/ui/components/record.mdx` (`node scripts/gen-sdui-reference.mjs`). - **Two stale pins, updated.** `record-details.emptySectionDefault.test.tsx` and `record-details.hideEmptyRetired-7129.test.tsx` each pinned a kept all-empty section drawing its heading first through `record:details`, the exact face this changes. Both now assert the line names it, expand the line, and then assert the same heading plus fold row as before. ## Tests - New: `ui/packages/plugin-detail/src/__tests__/EmptySectionsLine.authoredPage-35019.test.tsx`, 10 tests, through the real `RecordDetailsRenderer` with no `DefaultRecordPageContext` (the HotCRM opportunity's groups as the fixture): - two all-empty kept groups beside two filled ones: one line, count 2, naming both, after every drawn group; only the two filled groups draw a card; - the partly-filled group keeps its own "Show 5 empty fields" row, before and after expanding; - expanding draws all four groups in their authored order, each empty one as its heading plus its own fold row; collapsing folds them back; - revealing a group's empty fields and double-clicking one enters inline edit, and edit mode draws every group with inputs (no line); - every group empty: the line names them all and no whole-body row is drawn; - a group hidden by the `hideEmpty` default is not named; - a print page draws every group, no line; - CONTROL, a standalone `DetailView`: a card per empty group with its fold row, and the whole-body fold when all are empty. - Ablation (one-off, on commit `61c05ae8`): `DetailView` mutated back to the old gate (`return onDefaultRecordPage && …` in place of `return emptySectionsAsLine && …`) through `scripts/ablation-replace.mjs` with a trap restore: anchor x1 to x0, replacement x0 to x1, blob `03ed8fb5` to `2022a062`; the new file went **7 failed, 3 passed** (the 3 are the print-page case and the two CONTROL cases, which hold either way); restore proven by blob equal to HEAD `03ed8fb5` and an empty `git diff HEAD`. No `dist/` is in the resolution path (the tests import the sources relatively), so no rebuild leg applies. - Red set before the pin updates (on `a0d385a9`, the switch alone): plugin-detail 2 failed files, 383 passed; the two failures are the two pins named above. - Final head `429ee81c`, results under Verification. ## Acceptance notes - **The default page draws this line only for groups a page keeps.** The synthesized default page writes `{ group }` sections with no `hideEmpty`, so `record:details` resolves them to `true` and an all-empty group is hidden outright there; the line has nothing to fold on a synthesized page. It draws where a page keeps a group with `hideEmpty: false`, as the HotCRM opportunity page does. Unchanged by this PR; an observation. - **After expanding, the fields are one more click away**: each empty group draws its heading plus its own "Show N empty fields" row (ruling C on objectui#13386), which is the shipped default-page design ("no new design"). The card's acceptance item "展开后能看到全部空字段,并能就地编辑" holds through that row, and the reader's show-empty choice is per object where the host stores it. - **Beyond the claim's file surface** (DetailView.tsx, EmptySectionsFold.tsx, new tests, `.changeset/`): `renderers/record-details.tsx` (the context provider), `defaultRecordPage.ts` (the context, beside its siblings), the two stale pins, and the contract prose and generated mirrors listed above, which the change would otherwise have left false. - A code comment in app-shell's `RecordDetailView` still lists "the empty-sections line" among the faces only the synthesized page draws; not edited here (another package, comment only). `recordPageV3Face-27055.test.tsx`'s CONTROL is named "outside the default page no line draws"; it renders a bare `DetailView`, which still draws none, so it stays green. - Not browser-verified; the pins drive the real `record:details` renderer. ## Verification All readings on head `429ee81c` (after merging `origin/main` at `aef42cba`). <details> <summary>Tests and type-checks · one verify-lock run · VERDICT command-exit 0</summary> ```text pnpm --dir ui exec vitest run --maxWorkers=2 packages/plugin-detail/ Test Files 386 passed | 1 skipped (387) Tests 3470 passed | 18 skipped (3488) pnpm --dir ui exec vitest run scripts/ Test Files 171 passed | 2 skipped (173) Tests 5092 passed | 2 skipped (5094) pnpm --filter @objectstack/spec exec vitest run src/ui/component.test.ts src/ui/section-group-reference.test.ts src/ui/component-reference-rail.test.ts src/type-alias-convention.pin.test.ts Test Files 4 passed (4) Tests 417 passed (417) pnpm --filter @object-ui/plugin-detail run type-check (tsconfig.test.json lists all 3 touched test files) pnpm --filter @object-ui/types run type-check os-verify-lock: VERDICT command-exit 0 (the five joined with &&) ``` </details> <details> <summary>Derived gate families · 123 derived, 123 run, 0 NOT MEASURED</summary> `node scripts/pm/dispatch-gates.mjs --commands` on this head, each run with its exit code captured before any pipe, then reconciled with `--ran`: "123 derived famil(ies) accounted for — 123 run, 0 NOT-MEASURED (a DERIVED zero — all 123 recorded an exit code and none of them is 3)". ```text exit 0 · node scripts/check-adr-0087-registration.mjs --base origin/main exit 0 · node scripts/check-adr-0087-registration.mjs --self-test exit 0 · node scripts/check-adr-links.mjs exit 0 · node scripts/check-adr-links.mjs --self-test exit 0 · node scripts/check-changeset-no-major.mjs --base origin/main exit 0 · node scripts/check-closing-keyword-parity.mjs exit 0 · node scripts/check-closing-keyword-parity.mjs --self-test exit 0 · node scripts/check-comment-mask-adoption.mjs exit 0 · node scripts/check-comment-mask-adoption.mjs --self-test exit 0 · node scripts/check-comment-mask-corpus.mjs exit 0 · node scripts/check-dev-prereqs.mjs --self-test exit 0 · node scripts/check-doc-route-spelling.mjs --advisory exit 0 · node scripts/check-doc-route-spelling.mjs --self-test exit 0 · node scripts/check-docs-section-name.mjs exit 0 · node scripts/check-docs-section-name.mjs --self-test exit 0 · node scripts/check-dts-emitted.mjs --self-test exit 0 · node scripts/check-empty-changeset.mjs --base origin/main exit 0 · node scripts/check-empty-changeset.mjs --self-test exit 0 · node scripts/check-issue-citations.mjs exit 0 · node scripts/check-plugin-teardown-shape.mjs exit 0 · node scripts/check-plugin-teardown-shape.mjs --self-test exit 0 · node scripts/check-sdui-manifest.mjs exit 0 · node scripts/check-sdui-manifest.mjs --self-test exit 0 · node scripts/check-section-landing-index.mjs exit 0 · node scripts/check-section-landing-index.mjs --self-test exit 0 · node scripts/ci/assert-turbo-remote-cache.mjs --self-test exit 0 · node scripts/ci/plan-test-core-shards.mjs --self-test exit 0 · node scripts/ci/prune-turbo-cache.mjs --self-test exit 0 · node scripts/ci/snapshot-next.mjs --self-test exit 0 · node scripts/docs-audit/check-affected-docs.mjs exit 0 · node scripts/docs-audit/check-drift-comment.mjs exit 0 · node scripts/pm/check-governed-queue-guard.mjs --self-test exit 0 · node scripts/pm/release-rehearsal-clone.mjs --self-test exit 0 · node scripts/release-pending-publish.mjs --self-test exit 0 · pnpm --filter @objectstack/lint run check:doc-formula-expressions exit 0 · pnpm --filter @objectstack/lint run check:doc-security-posture exit 0 · pnpm --filter @objectstack/spec run check:api-surface exit 0 · pnpm --filter @objectstack/spec run check:authorable-surface exit 0 · pnpm --filter @objectstack/spec run check:browser-reachable-entries exit 0 · pnpm --filter @objectstack/spec run check:docs exit 0 · pnpm --filter @objectstack/spec run check:dual-source-exports exit 0 · pnpm --filter @objectstack/spec run check:duration-unit-keys exit 0 · pnpm --filter @objectstack/spec run check:empty-state exit 0 · pnpm --filter @objectstack/spec run check:entry-nameability exit 0 · pnpm --filter @objectstack/spec run check:error-code-provenance exit 0 · pnpm --filter @objectstack/spec run check:export-origins exit 0 · pnpm --filter @objectstack/spec run check:exported-any exit 0 · pnpm --filter @objectstack/spec run check:generated exit 0 · pnpm --filter @objectstack/spec run check:liveness exit 0 · pnpm --filter @objectstack/spec run check:llms-txt exit 0 · pnpm --filter @objectstack/spec run check:skill-examples exit 0 · pnpm --filter @objectstack/spec run check:skill-refs exit 0 · pnpm --filter @objectstack/spec run check:strictness-ledger exit 0 · pnpm --filter @objectstack/spec run check:variant-docs exit 0 · pnpm --filter @objectstack/spec run check:yaml-examples exit 0 · pnpm check:adr-anchors exit 0 · pnpm check:agent-test-spelling exit 0 · pnpm check:authz-resolver exit 0 · pnpm check:bash32-floor exit 0 · pnpm check:changeset-gate-self-tests exit 0 · pnpm check:ci-filter-parity exit 0 · pnpm check:cli-command-ids exit 0 · pnpm check:closed-ceremony-text exit 0 · pnpm check:corpus-claim-drift exit 0 · pnpm check:cross-package-test-inputs exit 0 · pnpm check:dispatcher-error-vocabulary exit 0 · pnpm check:doc-anchors exit 0 · pnpm check:doc-authoring exit 0 · pnpm check:doc-frontmatter exit 0 · pnpm check:docs-audit-scope exit 0 · pnpm check:docs-redirects exit 0 · pnpm check:docs-single-h1 exit 0 · pnpm check:docs-spec-enumerations exit 0 · pnpm check:docs-transcript-drift exit 0 · pnpm check:driver-memory-census exit 0 · pnpm check:dts-closure exit 0 · pnpm check:dual-build-cjs-loads exit 0 · pnpm check:engine-double-contract exit 0 · pnpm check:entry-guard exit 0 · pnpm check:gitlink-declared exit 0 · pnpm check:issue-citations exit 0 · pnpm check:keyed-text-bounds exit 0 · pnpm check:lean-entry-closure exit 0 · pnpm check:logger-receiver-detach exit 0 · pnpm check:merge-driver exit 0 · pnpm check:nul-bytes exit 0 · pnpm check:object-def-param-keys exit 0 · pnpm check:optional-error-sink exit 0 · pnpm check:org-identifier exit 0 · pnpm check:page-declaration-shape exit 0 · pnpm check:parse-guard exit 0 · pnpm check:platform-object-tenancy-census exit 0 · pnpm check:pm-prior-rulings exit 0 · pnpm check:pnpm-filter-targets exit 0 · pnpm check:pnpm-flag-spellings exit 0 · pnpm check:published-files exit 0 · pnpm check:published-readme-links exit 0 · pnpm check:query-options-erasure exit 0 · pnpm check:react-page-adapter-contract exit 0 · pnpm check:refd-timer-probe exit 0 · pnpm check:registry-log-declared exit 0 · pnpm check:rest-log-spy-declared exit 0 · pnpm check:role-word exit 0 · pnpm check:scripts-symbol-anchors exit 0 · pnpm check:sdui-reference exit 0 · pnpm check:settings-bind-window exit 0 · pnpm check:skill-identifier-liveness exit 0 · pnpm check:slot-lookup exit 0 · pnpm check:sourcemap-no-sources-content exit 0 · pnpm check:spec-docblock-symbol-anchors exit 0 · pnpm check:spec-parsed-alias exit 0 · pnpm check:system-context-census exit 0 · pnpm check:test-source-alias exit 0 · pnpm check:tier-file-adoption exit 0 · pnpm check:type-check-coverage exit 0 · pnpm check:type-check-debt exit 0 · pnpm check:undeclared-dep-imports exit 0 · pnpm check:vendor-version-stamps exit 0 · pnpm check:vouch-for-reference-callers exit 0 · pnpm check:watch-hint-literal exit 0 · pnpm check:where-matcher exit 0 · pnpm check:wildcard-fallthrough exit 0 · pnpm --dir ui exec vitest run scripts/ (under the verify lock, chained below) ``` </details> <details> <summary>Generated artifacts, overlap, line citations</summary> ```text pnpm --filter @objectstack/spec build && pnpm --filter @objectstack/spec check:generated (after the merge of origin/main) All 14 generated artifacts are up to date node scripts/gen-sdui-manifest-node.mjs wrote sdui.manifest.json (106 components), re-recorded scripts/sdui-manifest.record.json node scripts/gen-sdui-reference.mjs wrote 106 components on 7 pages node scripts/pm/overlap-check.mjs VERDICT clean exit 0 (origin/main merges cleanly, 0 open PR heads share a file) pnpm --dir ui run check:new-line-citations VERDICT new-cross-file-line-citations: 0 new citation(s) eslint on the 10 touched ui files: 0 errors (warnings are pre-existing; the new context lives in a non-component module, so no new react-refresh warning) ``` </details> Not run locally, CI's: the repo-wide `pnpm lint`, `test:repo`, and the full UI and Core test farms. Local-only family `check:dev-prereqs`: self-test passes; its scan reports this container's workspace as not fully built (10 of 108 packages without `dist/`), a reading about this machine, not the diff. ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic (one `describe()` text and its doc comment). - [x] 2. Every name I added uses the casing for its kind. - [ ] 3. No formatter ran; the repo-wide `pnpm lint` is CI's (eslint on the touched `ui/` files: 0 errors). - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. - [x] 6. `packages/spec` touched: its generated artifacts are regenerated and committed. - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [ ] 8. Title, body and comments are in English, except the 维护者速读 block, which the dispatch contract writes in Chinese. --- _Generated by [Claude Code](https://claude.ai/code/session_01JQwxbXBffgVtUPBEY2nLFm)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 55020c3 commit 2df9691

17 files changed

Lines changed: 414 additions & 42 deletions
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
'@object-ui/plugin-detail': patch
3+
'@object-ui/types': patch
4+
'@objectstack/spec': patch
5+
---
6+
7+
fix(plugin-detail): an authored record page folds its all-empty field groups into one closing line, as the default page does
8+
9+
Clause-②: no
10+
Metadata-protocol: none
11+
12+
On a record page you author, the details body (`record:details`) used to draw every field group the page keeps with `hideEmpty: false` as its own bordered card, even when every field in it was empty: a card holding nothing but its heading and one "Show N empty fields" row. A new opportunity on such a page showed two of these, one per empty group.
13+
14+
Now every `record:details` body does what the default record page already did. The groups whose fields are all empty leave their places, and the body ends in one quiet line that names them, for example "Deal Narrative · Notes & Next Steps · 2 empty sections · Expand". Expanding the line draws each group in its own place, as its heading plus its "Show N empty fields" row, and from there the fields can be shown and edited in place. "Collapse" folds them back.
15+
16+
What does not change:
17+
18+
- A group with at least one value draws as before, its own "Show N empty fields" row included.
19+
- `hideEmpty` keeps its default. An omitted key still hides an all-empty group outright, and such a group is not named in the line.
20+
- Edit mode draws every group with every field as an input, and a print page prints every row.
21+
- A standalone `detail-view` keeps one section per group, and still folds a body whose groups are all empty into one "Show N empty fields" row.
22+
23+
No metadata key, value or default changes. The `@objectstack/spec` `describe()` of `record:details` `sections[].hideEmpty`, the `@object-ui/types` docs and the component manifest now describe the closing line.

‎content/docs/references/ui/component.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1765,7 +1765,7 @@ An any-of group: `{ or: [rule, ...] }` matches a record when ANY of its rules ma
17651765
| **columns** | `integer` | optional | Field-grid columns for this section (1-4). Omitted → the renderer derives the width. |
17661766
| **group** | `string` | optional | Field group key (snake_case) whose members and presentation this section inherits, from the object's `fieldGroups` (ADR-0085 §5 `deriveFieldGroupLayout`). Mutually exclusive with `fields`, and with every key the group itself declares (`name`, `label`, `icon`, `description`, `collapsible`, `defaultCollapsed`). Must name a declared group — checked by reference diagnostics. |
17671767
| **fields** | `string[]` | optional | Field names rendered in this section, in order. Omit only when `group` supplies the members instead. |
1768-
| **hideEmpty** | `boolean` | optional | Whether this section disappears when ALL its fields are empty (renderer default: on — it then renders nothing at all: no heading, no skeleton). Set `false` to keep it on an all-empty record (e.g. a brand-new one): in read-only mode it renders its heading plus one fold row that counts the empty fields and reveals them on request — the same fold a partly-filled section uses; in edit mode it renders every field as an editable row. |
1768+
| **hideEmpty** | `boolean` | optional | Whether this section disappears when ALL its fields are empty (renderer default: on — it then renders nothing at all: no heading, no skeleton). Set `false` to keep it on an all-empty record (e.g. a brand-new one): in read-only mode the details body names it in the one line that closes the body, beside every other all-empty section kept this way, and expanding that line renders each in its place as its heading plus one fold row that counts the empty fields and reveals them on request — the same fold a partly-filled section uses; in edit mode it renders every field as an editable row. |
17691769
| **collapsible** | `boolean` | optional | Render this section as a collapsible card — the heading becomes a chevron toggle, initially expanded (renderer default: off). |
17701770
| **showBorder** | `boolean` | optional | Draw this section's card chrome (renderer default: derived — on for a titled section, off for an untitled one). Set `false` for a borderless titled section, or `true` for a bordered untitled one. |
17711771
| **defaultCollapsed** | `boolean` | optional | Start a `collapsible: true` section collapsed (renderer default: expanded). Consulted only when `collapsible` is on — a non-collapsible section never reads its collapse state. |

‎content/docs/ui/components/record.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Namespace `record`.
5454
| Input | Type | Required | Description |
5555
| :--- | :--- | :--- | :--- |
5656
| `columns` | `enum`: `1`, `2`, `3`, `4` | | Number of columns for field layout (1-4) |
57-
| `sections` | `array` of `object` | | Field groups rendered as the detail body, in order. Every entry is an OBJECT — `{ name?, label?, columns?, fields }` — a bare section-id string is NOT accepted (the spec retired that spelling in objectstack#5611, and the renderer reads name/label/fields off each entry, so a string entry renders no fields at all). `fields` are the field names shown in this section, in order — required unless `group` supplies the members instead (the spec refuses a section carrying neither, and refuses one carrying both). `label` is the section heading; omit it for an untitled, borderless section. `name` is a stable snake_case identifier and the i18n anchor — the heading resolves through objects.\<object>._sections.\<name>.label, so a section without a name shows its authored label in every locale. `columns` (1-4) is THIS section's field-grid width; omit it and the renderer derives the width. Authoring `sections` at all makes it the only source of the detail body; omit it and the body falls back to the object's highlightFields. @objectstack/spec 17.3.0 declares eight more member keys on an entry, and this renderer honours all eight: `icon` (a Lucide name on the section header), `description` (sub-heading copy under the heading), `collapsible` and `defaultCollapsed` (a foldable section and its initial state), `showBorder` (force the Card wrapper on or off, overriding the heading-derived default) and `headerColor` (a header tint from the shared palette) through DetailSection, plus `group` — the ADR-0085 §5 REFERENCE form, the alternative to enumerating `fields`. `{ group: 'contact_info' }` inherits the object's `fieldGroups` entry with that key: its members (every visible field pointing at it, in declaration order), its presentation (label, icon, description, collapse) and its `visibleWhen` all come from the group, so the section restates none of it — the predicate is evaluated against the bound record exactly as the entry form evaluates it, and a group it hides renders nothing (a `visibleWhen` written on a section itself is refused by the spec and not read: gate the group and reference it) and the spec refuses those keys beside `group`; `columns`, `showBorder` and `headerColor` stay yours because they are how THIS page lays the section out. A `group` naming no declared group renders nothing and is reported to the console (`@objectstack/lint` flags it as `page-section-group-unknown`). `hideEmpty` is the eighth, and it decides whether an ALL-empty section exists: it defaults to on, so a section whose fields are every one of them empty renders nothing at all — no heading, no skeleton — and `hideEmpty: false` is the spelling that keeps the section on a brand-new record: in read-only mode as its heading plus one fold row that counts the empty fields and reveals them on request (the same fold a partly-filled section uses, objectui#13386), in edit mode as every field an editable row. It decides ONLY the all-empty case; the empty rows of a section that still has a filled one belong to DetailSection's auto-hide heuristic plus the reader's show-empty toggle, which no authored value overrides in either polarity (objectui#7129 Q2-C), and inline-edit mode renders the section either way so its fields stay reachable. Restored under objectui#8603 (maintainer 2026-09-15) after objectui#7129 retired it on the premise, since falsified upstream, that the spec refused the key. None of the eight has a designer control yet; they are authorable in source mode only, tracked as a deferred feature. @objectstack/spec 18 declares a ninth, `count` (`{ field }`): the renderer fills the heading's `{{ count }}` hole with how many values that multi-value field holds on the current record — `{ name: 'tagging', label: '{{ count }} tags', count: { field: 'tags' }, fields: ['tags'] }` reads `3 tags` when three are selected. An absent or empty value counts 0; `count` changes only the heading, never whether the section renders, so with `hideEmpty` on an all-empty section is still absent. The hole is filled after the heading is translated, so each locale of an inline label map and a translated objects.\<object>._sections.\<name>.label write the same `{{ count }}`. The spec refuses `count` beside `group`, on a section with no `label`, and on a label with no hole; a heading on a section without `count` prints as written. Like the eight, `count` has no designer control yet. |
57+
| `sections` | `array` of `object` | | Field groups rendered as the detail body, in order. Every entry is an OBJECT — `{ name?, label?, columns?, fields }` — a bare section-id string is NOT accepted (the spec retired that spelling in objectstack#5611, and the renderer reads name/label/fields off each entry, so a string entry renders no fields at all). `fields` are the field names shown in this section, in order — required unless `group` supplies the members instead (the spec refuses a section carrying neither, and refuses one carrying both). `label` is the section heading; omit it for an untitled, borderless section. `name` is a stable snake_case identifier and the i18n anchor — the heading resolves through objects.\<object>._sections.\<name>.label, so a section without a name shows its authored label in every locale. `columns` (1-4) is THIS section's field-grid width; omit it and the renderer derives the width. Authoring `sections` at all makes it the only source of the detail body; omit it and the body falls back to the object's highlightFields. @objectstack/spec 17.3.0 declares eight more member keys on an entry, and this renderer honours all eight: `icon` (a Lucide name on the section header), `description` (sub-heading copy under the heading), `collapsible` and `defaultCollapsed` (a foldable section and its initial state), `showBorder` (force the Card wrapper on or off, overriding the heading-derived default) and `headerColor` (a header tint from the shared palette) through DetailSection, plus `group` — the ADR-0085 §5 REFERENCE form, the alternative to enumerating `fields`. `{ group: 'contact_info' }` inherits the object's `fieldGroups` entry with that key: its members (every visible field pointing at it, in declaration order), its presentation (label, icon, description, collapse) and its `visibleWhen` all come from the group, so the section restates none of it — the predicate is evaluated against the bound record exactly as the entry form evaluates it, and a group it hides renders nothing (a `visibleWhen` written on a section itself is refused by the spec and not read: gate the group and reference it) and the spec refuses those keys beside `group`; `columns`, `showBorder` and `headerColor` stay yours because they are how THIS page lays the section out. A `group` naming no declared group renders nothing and is reported to the console (`@objectstack/lint` flags it as `page-section-group-unknown`). `hideEmpty` is the eighth, and it decides whether an ALL-empty section exists: it defaults to on, so a section whose fields are every one of them empty renders nothing at all — no heading, no skeleton — and `hideEmpty: false` is the spelling that keeps the section on a brand-new record: in read-only mode named in the one line that closes the body, beside every other all-empty section kept this way, and expanding that line draws each in its place as its heading plus one fold row that counts the empty fields and reveals them on request (the same fold a partly-filled section uses, objectui#13386), in edit mode as every field an editable row. It decides ONLY the all-empty case; the empty rows of a section that still has a filled one belong to DetailSection's auto-hide heuristic plus the reader's show-empty toggle, which no authored value overrides in either polarity (objectui#7129 Q2-C), and inline-edit mode renders the section either way so its fields stay reachable. Restored under objectui#8603 (maintainer 2026-09-15) after objectui#7129 retired it on the premise, since falsified upstream, that the spec refused the key. None of the eight has a designer control yet; they are authorable in source mode only, tracked as a deferred feature. @objectstack/spec 18 declares a ninth, `count` (`{ field }`): the renderer fills the heading's `{{ count }}` hole with how many values that multi-value field holds on the current record — `{ name: 'tagging', label: '{{ count }} tags', count: { field: 'tags' }, fields: ['tags'] }` reads `3 tags` when three are selected. An absent or empty value counts 0; `count` changes only the heading, never whether the section renders, so with `hideEmpty` on an all-empty section is still absent. The hole is filled after the heading is translated, so each locale of an inline label map and a translated objects.\<object>._sections.\<name>.label write the same `{{ count }}`. The spec refuses `count` beside `group`, on a section with no `label`, and on a label with no hole; a heading on a section without `count` prints as written. Like the eight, `count` has no designer control yet. |
5858
| `fields` | `array` of `string` | | Explicit field list (overrides highlightFields) |
5959
| `hideFields` | `array` of `string` | | Field names to omit from the body — applied to the top-level `fields` list AND to every section's `fields`. Bare field names only. Authors rarely need it: the synth pipeline fills it with the fields already shown in `record:highlights`, and hand-authored pages get the same dedup live from HighlightFieldsContext, so its purpose is suppressing a field you do not want repeated (the page H1 title field is dropped for you too). Hiding every field of a section leaves that section out entirely. |
6060
| `inlineEdit` | `boolean` | | Offer the per-field double-click / pencil inline-edit affordances in the detail body. On by default, and an OPT-OUT only: the value is combined with the object's own editability (system, engine-owned, append-only and better-auth objects are not user-editable unless they opened userActions.edit) and with the server's effective API operation set for the object, so `false` always wins while `true` cannot open editing the platform refuses. The edit session and the atomic Save bar are hosted by the page, so one draft spans the highlights strip and this body. |

‎packages/spec/src/ui/component.zod.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1412,12 +1412,15 @@ export const RecordDetailsProps = strictObject({
14121412
* fold a partly-filled section uses — instead of a column of empty rows;
14131413
* edit mode is unchanged and renders every row, editable. No key, shape or
14141414
* default changed, and the describe() states the ruled rendering, which
1415-
* objectui's `DetailSection` follows. The key governs only the ALL-empty
1415+
* objectui's `DetailSection` follows. Read-only, the details body first
1416+
* names every such section in the one line that closes it, and expanding
1417+
* that line draws them so — one line for all the empty groups instead of a
1418+
* card for each (objectstack#35019). The key governs only the ALL-empty
14161419
* case: a partly-filled section's empty rows follow the renderer's own
14171420
* fold (objectui#7129 Q2-C) in either polarity, so the old lead "hide this
14181421
* section's empty fields" no longer told the two values apart.
14191422
*/
1420-
hideEmpty: z.boolean().optional().describe('Whether this section disappears when ALL its fields are empty (renderer default: on — it then renders nothing at all: no heading, no skeleton). Set `false` to keep it on an all-empty record (e.g. a brand-new one): in read-only mode it renders its heading plus one fold row that counts the empty fields and reveals them on request — the same fold a partly-filled section uses; in edit mode it renders every field as an editable row.'),
1423+
hideEmpty: z.boolean().optional().describe('Whether this section disappears when ALL its fields are empty (renderer default: on — it then renders nothing at all: no heading, no skeleton). Set `false` to keep it on an all-empty record (e.g. a brand-new one): in read-only mode the details body names it in the one line that closes the body, beside every other all-empty section kept this way, and expanding that line renders each in its place as its heading plus one fold row that counts the empty fields and reveals them on request — the same fold a partly-filled section uses; in edit mode it renders every field as an editable row.'),
14211424
/** Collapsible card. Initial state is expanded; the toggle is the heading. */
14221425
collapsible: z.boolean().optional().describe('Render this section as a collapsible card — the heading becomes a chevron toggle, initially expanded (renderer default: off).'),
14231426
/** Card chrome; the renderer derives it from the presence of a title. */

‎scripts/sdui-manifest.record.json‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
],
1414
"source": "built-tree",
1515
"generator": "scripts/gen-sdui-manifest-node.mjs",
16-
"generatedAt": "2026-11-17",
17-
"sha256": "240fb9507b04431628938e1ace914645d6502d5489af6311c638539ea3c335ea",
16+
"generatedAt": "2026-11-18",
17+
"sha256": "d6baeb81803dba3e0e4cdf4f1fa1f3a6340c9ab2e3df5a063ef2dbe453ffd754",
1818
"components": 106,
1919
"inTree": {
2020
"modulesRoot": "ui/apps/console",
21-
"objectuiWorkspaceVersion": "18.5.0"
21+
"objectuiWorkspaceVersion": "18.6.0"
2222
}
2323
}

0 commit comments

Comments
 (0)