Skip to content

fix(console): the ungrouped field-group bucket renders under its own "Other" heading - #33372

Merged
objectstack-fleet[bot] merged 7 commits into
mainfrom
claude/project-thread-wj4v9l
Nov 14, 2026
Merged

objectstack-fleet[bot] merged 7 commits into
mainfrom
claude/project-thread-wj4v9l

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Leehom · project thread

Fixes #33229

Clause-②: yes (widening)
Metadata-protocol: none

维护者速读

  • 改了什么:对象声明了字段分组时,没有归入任何分组的字段现在在所有分组之后单独成段,带自己的标题「其他 / Other」(按语言翻译);记录详情页、记录抽屉、以及新建/编辑表单(普通、弹窗、抽屉三种)都一样。没有声明任何分组的对象保持原样,不加标题。
  • 为什么改:卡 ui: the derived record layout's ungrouped bucket has no header, so its fields read as part of the group above it — under a collapsed group they look hidden in that group #33229:这些字段原来没有标题,紧跟在最后一个分组下面;最后一个分组折叠时,它们看起来像是那个分组里被折叠的内容,用户会误以为是系统字段或找不到。
  • 风险与回滚:纯界面默认值,不改 spec、不新增可编写的元数据键、不改存储;新增一个语言包键 common.ungroupedSection(11 种语言)。回滚即还原本 PR。
  • 先看:ui/packages/app-shell/src/views/recordDetailSections.ts(详情页给未分组段加标题与卡片边框)、ui/packages/plugin-form/src/fieldGroups.ts 的 deriveFieldGroupSections 第三参数、ui/packages/plugin-form/src/ungroupedFieldSection-11777.test.tsx(原 objectui#11777 断言改为读「字段上方的标题」)。
  • 两分钟验证:pnpm dev 后打开一个声明了 fieldGroups 且有未分组字段的对象记录页,把最后一个分组设为折叠:未分组字段出现在单独的「Other / 其他」标题下,而不是折叠分组的下面;编辑表单同样。
  • 需要你做的:无,席位落地。

What changes

deriveFieldGroupLayout (@objectstack/spec/data, ADR-0085 §5) ends a grouped layout with a keyless bucket of every visible field no declared group claims. It returns null when no declared group applies, so the bucket only ever follows at least one declared group. The spec keeps it keyless; the Console now owns a presentation default for it.

  • Record page and record drawer (RecordDetailView, which the drawer and the split pane embed): deriveRecordDetailSections heads the bucket's primary section with the new labels.ungrouped (the view passes t('common.ungroupedSection', 'Other')) and gives it the card chrome the declared groups have. Long-form ungrouped fields still go to "More details" after it. No name is set, so record:details shows the translated label as written and no per-object _sections key is invented.
  • Forms (ObjectForm, ModalForm, DrawerForm, each on its no-sections field-group fallback): deriveFieldGroupSections(fields, fieldGroups, ungroupedLabel?) labels the trailing bucket, including the case where it is only the re-appended rendered system fields. Each arm passes its translated common.ungroupedSection, so the one row rule draws a divider row for it and the bucket is a titled section like the groups. It has no collapse control.
  • Language packs, all eleven: common.ungroupedSection added ("Other", 「其他」, 「其他」 zh-Hant via gen:zh-hant, "Sonstiges", "Otros", "Autres", "その他", "기타", "Outros", "Прочее", "أخرى"). Nothing reworded or removed. Measured before adding: no existing key says exactly this. The "Other" keys in the tree are each scoped to another surface (capability.group.other, console.reportIndex.otherSection, a marketplace category, an artifact kind).
  • Studio callers of the same derivation (anchors.ts page-create seed, PagePreview.tsx) pass the new label too (UNGROUPED_SECTION_DEFAULT_LABEL / the translated key). They only reach deriveRecordDetailSections when no field groups apply, so what they write and draw is unchanged.
  • Docs: content/docs/ui/create-vs-edit-form.mdx and content/docs/ui/field-grouping-and-order.mdx say the bucket is drawn under its own "Other" heading. Comments that called the derived bucket "untitled, no row" (fieldGroups.ts, ObjectForm.tsx, @object-ui/components splitAtUntitledRuns) now describe the authored untitled section that path still serves.
  • Changeset .changeset/33229-ungrouped-section-heading.md (@object-ui/i18n, @object-ui/plugin-form: patch). @object-ui/app-shell is private; the @object-ui/components edit is comment-only.

Tests

  • RecordDetailView.sectionHeadingsRenderPath-6190.test.tsx, new top-level describe on the existing mounted-RecordDetailView harness (no assigned page, the synthesized page): with the last declared group collapse: 'collapsed', "Other" is on screen, the collapsed member is folded away, the ungrouped field is on screen, and the smallest block holding "Other" and the ungrouped field does not hold the collapsed group's heading; reading order is groups, "Other", its field, then "More details". zh-CN under a real I18nProvider reads 「其他」 and no "Other". CONTROL: an object with no field groups renders no "Other".
  • ungroupedFieldSection-11777.test.tsx, new top-level describe run on all three arms (ObjectForm, ModalForm, DrawerForm): under a collapsed group the bucket's fields sit under their own "Other" row, which follows the group's row and carries no disclosure control; zh-CN reads 「其他」; CONTROL: no declared group applies, no heading; CONTROL: an authored untitled section stays headerless.
  • Ablations (one-off, scripts/ablation-replace.mjs, restored blob equal to HEAD each time; @object-ui/* resolves to src through the vitest aliases, so no rebuild):
    • record page label dropped ({ ...primary, label: labels.ungrouped, showBorder: true } → no label): 2 failed / 5 passed (the collapsed-group and zh-CN rows; the CONTROL stays green).
    • form bucket label dropped in deriveFieldGroupSections: 12 failed / 18 passed (the two rewritten objectui#11777 rows and the two new heading rows, on each of the three arms; the controls stay green).

Acceptance notes

  • The objectui#11777 rows were rewritten, not only extended. They read "the bucket is a separate grid block" (the splitAtUntitledRuns split of an untitled run). The bucket is now a titled section, and the form renderer draws titled sections in one grid separated by their divider rows, as it draws any two groups. So those rows now read "the heading above each ungrouped field is Other, not the group's". The untitled split itself stays pinned by the file's authored-untitled-section row, which is unchanged and green. PagePreview.test.tsx and PagePreview.authoredDetailsValues-27177.test.tsx changed only their label argument, and check:test-source-alias then asked each for the module-top import '@objectstack/lint'; its siblings carry. Two older heading-list pins whose fixtures leave a field ungrouped now expect the bucket's row after the group's on the derived arms: sectionDividerProjection-9849.test.tsx (blocks 1, 2 and 4, via a trailing entry on the three DERIVED arms) and drawerFormSectionDescription-9834.test.tsx row 3.
  • Surfaces checked and left as they are. Studio's page-create seed and its slotted preview, for an object whose field groups apply, write the synthesizer's own { group } references plus an enumerated untitled bucket (fieldGroupSectionReferences in @object-ui/plugin-detail, left so by the earlier page-seed cards). That is an authored page once saved, and its author owns the section's label. Labelling the persisted seed would change what Studio writes, which is outside this card's renderer-only route. The Studio object form designer and canvas keep their own authoring label "Ungrouped". RecordDetailDrawer (inline-edit drawer in @object-ui/plugin-detail) does not read fieldGroups. A record:details node an author writes with an untitled section keeps it untitled.
  • Clause-②: yes (widening), measured on the diff: one added catalogue key in the published @object-ui/i18n. deriveFieldGroupSections is not exported from the @object-ui/plugin-form entry, so its new optional parameter widens no public surface; that package changes only what its arms draw. Nothing removed or renamed. No packages/spec edit and no new authorable key, per the order's route.

Verification

Local gates, suites and type-checks (head bfbc379)
  • dispatch-gates --commands on this diff derives 70 families. All 70 ran on f52c0a1 and exited 0, except check:test-source-alias (exit 1: the two PagePreview tests above). The fix landed as bfbc379; on that head check:test-source-alias and the other test-reading families (cross-package-test-inputs, query-options-erasure, undeclared-dep-imports, nul-bytes, where-matcher, engine-double-contract, driver-memory-census, refd-timer-probe, registry-log-declared, rest-log-spy-declared, watch-hint-literal, type-check-coverage) exit 0. --ran reconciliation: 70 derived, 70 run, 0 NOT-MEASURED, 0 UNRUN.
  • check:skill-examples exited 3 on the first round (stale @objectstack/client-react dist, nothing measured); after building that package it exits 0.
  • Type-check (type-check = tsc --noEmit + tsconfig.test.json): @object-ui/i18n, @object-ui/plugin-form, @object-ui/app-shell, @object-ui/components exit 0 (plugin-form re-run on f52c0a1).
  • Suites, pnpm --dir ui exec vitest run: packages/plugin-form/ 231 files, 2555 passed, 1 skipped (f52c0a1); packages/i18n/ 102 files, 1894 passed, 13 skipped; app-shell narrowed to the record view and the Studio callers (views/RecordDetailView*, views/recordDetailSections*, metadata-admin/previews/PagePreview*, metadata-admin/anchors*) 106 files, 764 passed. The rest of app-shell is CI's sharded Test UI. The two PagePreview files re-run on bfbc379: 10 passed.
  • node scripts/gen-sdui-manifest-node.mjs rewrote nothing.
  • eslint on the touched .ts/.tsx files: 0 errors.

Generated by Claude Code

@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 14, 2026
@objectstack-fleet objectstack-fleet Bot added the needs:contract-review Marker only — PR awaits its at-tier Contract review PASS; no check reads it, the record decides label Nov 14, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#1 · os-project-manager · session_01FEkQ5nWoa1Ze1QzjRTSYXD

Contract review

Served-tier: TIER_DEFAULT
Head-sha: bfbc379fe28c87db19c2934d687b23f0a9010e59
Local-runs: none

Face: declaration (Clause-②: yes (widening) on the PR body and the changeset). No packages/spec/src/** path and no governed path in the 31-file list. Inputs read: card #33229 body and all 3 comments (triage 6873327762, claim 6880383259, os-dev-report 6881826895), the PR #33372 body and file list, the net diff 9f736f2e..bfbc379f, and the check-runs on the head.

① Derived judgments

  • @object-ui/i18n: one added pack key common.ungroupedSection, in all 11 shipped locales. RIGHT. The registry and locales/index.ts ship en, zh-Hans, zh-Hant, ja, ko, de, fr, es, pt-BR, ru and ar. Each of the 11 locale files gains exactly one + line under common: Other, 其他, 其他, その他, 기타, Sonstiges, Autres, Otros, Outros, Прочее, أخرى. No pack line is removed or reworded, so this is a pure widening of a published catalogue.
  • @object-ui/plugin-form: deriveFieldGroupSections(fields, fieldGroups, ungroupedLabel?) (ui/packages/plugin-form/src/fieldGroups.ts:75-79) is package-internal. RIGHT. package.json exports has only "." → dist/index. src/index.tsx does not re-export ./fieldGroups: its only deriveFieldGroupSections text is a doc comment at :139. It re-exports resolveSectionGroupReferences from ./sectionGroups (:154), whose signature does not change. The only callers are ObjectForm, ModalForm and DrawerForm, which pass the label, and sectionGroups.ts:117, which passes none. That caller reads only byKey by name (:198-212), so the keyless bucket is never read there, as the new jsdoc says. The new parameter is unreachable from the entry type graph, and no public surface widens.
  • @object-ui/plugin-form drawn output. RIGHT. The derived trailing bucket now carries label (fieldGroups.ts:95-97, and the leftover push at :130). That holds on the ObjectForm, ModalForm and DrawerForm fallbacks, so the one row rule draws a divider row for it. Explicit and authored sections are untouched. Each arm takes common.ungroupedSection from its own safe translator, with an Other default in formChrome.ts:84, ModalForm.tsx:116 and DrawerForm.tsx:109, and ungroupedLabel is in each useMemo dependency list.
  • @object-ui/app-shell ("private": true). RIGHT. RecordDetailSectionLabels.ungrouped (recordDetailSections.ts:74-81) is a new required field, and UNGROUPED_SECTION_DEFAULT_LABEL (:97) is a new export. Neither is a published accept-set. deriveRecordDetailSections heads the keyless bucket's primary half and gives it card chrome (:192-197). An all-long-form bucket returns one section from splitPrimarySecondary, so no empty labelled card can appear. RecordDetailView.tsx:4098 passes t('common.ungroupedSection','Other'), and t and language are already in the memo dependencies.
  • Studio callers (anchors.ts, PagePreview.tsx). RIGHT, and their output is unchanged. deriveStudioDetailSections returns undefined whenever field groups apply (recordDetailSections.ts:235), so ungrouped is never read on those paths.
  • @object-ui/components form.tsx:222-225. RIGHT. The edit is a docblock only and changes no shipped behaviour.
  • Spec. RIGHT. packages/spec is untouched, the bucket stays keyless, and no authorable key is added, so Metadata-protocol: none holds. The premise "the bucket exists only after at least one declared group" holds on field-group-layout.ts:167 (no declared groups ⇒ null) and :189 (!anyGrouped ⇒ null).

② Semver level

  • Changeset .changeset/33229-ungrouped-section-heading.md: @object-ui/i18n patch and @object-ui/plugin-form patch. MATCHES. AGENTS.md §Before-done 3 says Metadata-protocol: none takes patch, and that a non-protocol widening ships patch. Both packages are in the fixed group, so the published @object-ui/console, which bundles app-shell, moves with them and the record-page change ships.
  • Clause-②: yes (widening) is CORRECT. One catalogue key is added to a published package. Nothing is removed, renamed or tightened, and no (narrowing) arm applies. The changeset carries both declaration lines at line start.
  • Every changeset sentence was checked against the diff and is true:
    • title (record page, record drawer, form arms);
    • Clause-② paragraph (every shipped locale; plugin-form exports unchanged; the adapter is internal);
    • spec paragraph (keyless bucket; exists only after at least one declared group);
    • Record page and drawer bullet (titled card; "More details" still split off);
    • Forms bullet (divider row on the no-sections fallback);
    • Unchanged bullet (no-groups object stays flat; authored sections untouched; spec keyless).
  • nit: @object-ui/app-shell, the package that holds the record-page change, has no changeset entry. Precedent lists it, for example 33111-drawer-level-edit-and-scope.md, 33098-* and 33052-*, and privatePackages.version: true gives it a CHANGELOG. Its own CHANGELOG will therefore miss this line. This does not change the level or what is published, and no gate requires it. Accepted deviation.

③ Boundary flags

  • open_questions: none in the report ([]). Nothing to answer.
  • Deviation 1, existing pins edited (ungroupedFieldSection-11777, sectionDividerProjection-9849, drawerFormSectionDescription-9834): ACCEPTED. Each edit follows directly from the bucket becoming a titled section. The authored-untitled splitAtUntitledRuns row is unchanged, and a CONTROL keeps it headerless. The dev's ablations (record label dropped: 2 failed / 5 passed; form label dropped: 12 failed / 18 passed) are the dev's claim and were not re-run here.
  • Deviation 2, comment-only @object-ui/components edit outside the claim's surface: ACCEPTED. The docblock now describes the authored untitled section that the path still serves. Comment-only, so no changeset is needed.
  • Deviation 3, three app-shell tests touched for the required labels.ungrouped and the @objectstack/lint top import: ACCEPTED. check:test-source-alias asked for the import.
  • Deviation 4, content/docs/ui/*.mdx updated beside the code: ACCEPTED, as prose-face text. nit: field-grouping-and-order.mdx:29 says "renderers draw [the bucket] under its own Other heading". A Studio-seeded page for a grouped object still persists an untitled enumerated bucket (plugin-detail buildDefaultPageSchema.ts:745-757), so "the Console's record page and forms" would be the exact scope.
  • Deviations 5 and 6 (no local test:repo; app-shell type-check last ran on 6458c12e): left to CI. Test UI 1–16/16 and Type Check UI are still running on this head (see below), so neither is green yet.
  • Out-of-scope finding (carrier: none), the Studio page-create seed and slotted preview for grouped objects: ESCALATED to the seat as a follow-up card. It is not a blocker here. For a grouped object, the slotted preview (PagePreview.tsx:321 → undefined → fieldGroupSectionReferences) now draws the bucket untitled while the running record page draws "Other". A page seeded and saved from Studio keeps the headerless bucket, which reproduces ui: the derived record layout's ungrouped bucket has no header, so its fields read as part of the group above it — under a collapsed group they look hidden in that group #33229's symptom on an authored page. The claim's route was renderer-only with no change to what Studio writes, so the boundary holds for this PR. The seat should file it rather than leave it with no carrier.
  • nit: the PagePreview.tsx:311-328 useMemo reads t without listing it in its dependencies. It is unreachable today, since the label is unread when groups apply, so it has no effect.
  • Claim boundary held: no packages/spec edit and no new authorable key. The PR author is objectstack-fleet[bot], so no author-login note is needed.
  • Check-runs on bfbc379f (61 enumerated, API total_count 63; 0 failed):
    • 14 success: Governed Surface Queue Guard, Check Changeset (run 43623862090), PR-body guards, Spec property liveness, Check Documentation Links, Check PR Size, Type Check · workspace, Type Check · debt ledger, Build UI Deps, Live E2E UI, Dogfood Regression Gate, Plan Test UI shards, Plan Test Core shards, Auto Label.
    • 14 skipped, all opt-in or conditional.
    • 33 still RUNNING, NOT counted green: Test UI 1–16/16, Test Core 1–3/8, Type Check UI, Lint UI, Build and E2E UI, Build Docs, Check Changeset (second run 43624131247), Type Check · consumer gates, Type Check · source gates, and Lint (ESLint, PM dispatch-gates, docs and code guards, repo and tooling gates, CI release and engine gates, scoped tooling self-tests, scoped query-options erasure, scoped slot lookup and corpus).
    • Landing check ② stays open until every one of these is green.

Implemented-by: claude/project-thread-wj4v9l
Reviewed-by: session_01FEkQ5nWoa1Ze1QzjRTSYXD

VERDICT: PASS

@objectstack-fleet objectstack-fleet Bot removed the needs:contract-review Marker only — PR awaits its at-tier Contract review PASS; no check reads it, the record decides label Nov 14, 2026
…e to the surfaces that draw it

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5pwmYtS4CYXMQVCxqT
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#1 · os-project-manager · session_01FEkQ5nWoa1Ze1QzjRTSYXD

Regen-provenance: 6881926857 · bfbc379fe28c87db19c2934d687b23f0a9010e59 → d68020c3636d44ce72ebb61e391af8b576ad550c · prose-only hop (patch order 33229-patch-1, the record's nits 1 and 2): .changeset/33229-ungrouped-section-heading.md gains '@object-ui/app-shell': patch (level unchanged, patch), and content/docs/ui/field-grouping-and-order.mdx:29 narrows "renderers" to "the record page, the record drawer and the auto-generated forms". No source or test path moves. The record's escalation (Studio seed) is filed as #33377.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#1 · os-project-manager · session_01FEkQ5nWoa1Ze1QzjRTSYXD

席位核对

Verdict: ACCEPT · head d68020c3 · 2026-11-14T18:29Z

  1. Shape: draft → main, Fixes #33229; 31 files, +346/−53. The root changeset patches @object-ui/i18n, @object-ui/plugin-form and @object-ui/app-shell; app-shell was added in patch 1. Two docs pages under content/docs/ui/ change beside the code. No file lies outside ui/packages/{app-shell,plugin-form,components,i18n}/src/, those docs and the changeset.
  2. Premise:
    • The keyless trailing bucket of deriveFieldGroupLayout (no name) now carries a heading, common.ungroupedSection ("Other" / 「其他」), in two places:
      • on the record page, drawer and split pane (deriveRecordDetailSections), where its primary half becomes a titled card and long-form fields still drop into "More details";
      • on the ObjectForm / ModalForm / DrawerForm field-group fallback (deriveFieldGroupSections's new optional ungroupedLabel), where it gets a divider row.
    • Unchanged: authored sections, objects with no field groups (flat), and the spec, where the bucket stays keyless.
    • Changeset sentences read against the diff: each holds.
  3. Contract record: PASS 6881926857 on bfbc379f (Clause-② yes (widening): one new pack key in all 11 locales; the new argument is package-internal). It is carried to this head by Regen-provenance: 6881965289 (prose-only hop: changeset frontmatter + one docs clause). needs:contract-review is removed.
  4. Gates on head d68020c3: all 62 check runs are success or skipped. They include Lint & Repo Gates, TypeScript Type Check, Type Check UI, Lint UI, Test UI 16/16 shards + Test UI, Test Core 3/3 planned shards, Build & E2E UI, Live E2E UI, Build Docs, Check Documentation Links, Spec property liveness, Check Changeset, Governed Surface Queue Guard and PR-body guards. check-governed-merges.mjs --pr 33372: NOT governed, 399 lines ≤ 3000.
  5. Accepted deviations:
    • The dev's six reported deviations are accepted as the record read them:
      • three existing plugin-form pins were edited because the bucket is now titled;
      • a comment-only @object-ui/components docblock;
      • two PagePreview test lint fixups;
      • the local test:repo and app-shell type-check were left to CI (green).
    • PagePreview.tsx:311-328 reads t in a useMemo that does not list it. That path never reads the label while field groups apply, so it has no effect today.
    • K = 44 first-parent commits since the PR base ⇒ base sync before landing; landing waits for the rerun green.
  6. Out of scope: Studio's page seed and slotted preview still write the bucket untitled for an object with field groups. That is filed as studio: a page seeded for an object with field groups saves the ungrouped fields as an untitled section, so the saved page and its preview lose the "Other" heading the record page now draws #33377 (p3, pm:queue).
  7. Landing under the maintainer's standing authorisation 「按照 pm-dispatch 规则复核过的都授权」 (2026-10-25T11:35Z).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#1 · os-project-manager · session_01FEkQ5nWoa1Ze1QzjRTSYXD

Regen-provenance: 6881926857 · d68020c3636d44ce72ebb61e391af8b576ad550c → b39da5ac59b8f41538e54b3676b4cfc556e0fba0 · base sync only (merge of main at b63c8949). The eleven locale files show different blobs because main had also changed them. The PR's own diff is unchanged: git diff b63c8949 b39da5ac is the PR's 31 files, +346/−53, and its stable patch-id equals the pre-sync net diff's.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#1 · os-project-manager · session_01FEkQ5nWoa1Ze1QzjRTSYXD

Landing · head b39da5ac (base sync of the ACCEPTed d68020c3) · 2026-11-14T18:52Z

reading value
check runs on b39da5ac 62, all success or skipped
contract record PASS 6881926857 on bfbc379f, carried by Regen-provenance: 6881965289 (prose hop) and the line above (merge of main only)

State: ready + auto-merge.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 14, 2026 18:52
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 14, 2026
Merged via the queue into main with commit de476f1 Nov 14, 2026
63 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-wj4v9l branch November 14, 2026 19:49
scbdzhwl pushed a commit to scbdzhwl/objectstack-analysis that referenced this pull request Nov 16, 2026
…with the translated Other heading (objectstack-ai#33470)

<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XCWSFQ2r7bCtNXPUwu3o3ns)_

Fixes objectstack-ai#33377

Clause-②: no
Metadata-protocol: none

Seat `domain:ui#1` · os-project-manager · card thread
`session_01FEkQ5nV6skFMkjLTEGHKL3` · claim 6884066738

## 维护者速读

- 改了什么:在 Studio
里给声明了字段分组的对象新建完整记录页(或把默认页「转为完整页面」)时,未归入任何分组的字段现在写成带标题的分区,标题是「其他 /
Other」的多语言写法(每种内置语言一条),保存后的页面按查看者的语言显示;默认页的预览也显示同样的标题。分组本身的写法不变。
- 为什么改:objectstack-ai#33229 之后运行中的记录页已把这些字段放在「其他」标题下,但 Studio
生成的页面仍写成无标题分区,保存后这些字段又看起来属于上一个分组(objectstack-ai#33229 的症状回来了)。
- 风险与回滚:只改 Studio 生成和预览页面的方式,不改 spec、不改运行中的记录页、不改已保存的页面(不迁移)。标题用的是 spec
已允许的内联多语言写法,没有写死英文。回滚即还原本 PR。
-
先看:ui/packages/app-shell/src/views/recordDetailSections.ts(`deriveStudioDetailSections`
给分组对象的未分组段加标题,`loadPersistedUngroupedHeading`
生成多语言标题)、ui/packages/app-shell/src/views/metadata-admin/previews/PagePreview.tsx(「转为完整页面」等多语言标题加载好才可用)、ui/packages/app-shell/src/views/metadata-admin/anchors.ts(新建完整页的种子)。
- 两分钟验证:pnpm dev,在 Studio 给一个有 fieldGroups 且有未分组字段的对象新建 kind 为 full
的记录页并保存,切到中文打开一条记录:未分组字段在「其他」标题下,而不是挂在上一个分组下面。
- 需要你做的:无,席位落地。

## What changes

`deriveFieldGroupLayout` (`@objectstack/spec/data`, ADR-0085 §5) ends a
grouped layout with a keyless bucket of the fields no declared group
claims. Since objectstack-ai#33372 the running record page draws it under the
translated `common.ungroupedSection` heading. Studio's three page
builders did not:

| Surface | Before | After |
|---|---|---|
| Create page, kind `full` (`anchors.ts` `createSeed`) | bucket written
`{ columns, fields }`, no heading | `{ label, columns, fields }`,
`label` the inline locale map |
| Convert to full page (`PagePreview.tsx` `convertToFull`) | same as the
seed | same as the seed |
| Slotted page preview (`PagePreview.tsx` `renderSchema`) | bucket drawn
untitled | headed with the translated text the running page draws |

- **The form of the persisted heading.** Measured on the spec before
choosing: `record:details` `sections[].label` is an `I18nLabel`, a plain
string or an inline locale map; `name` addresses only the per-object
`objects.OBJECT._sections.NAME.label` bundle key, and no section form
reaches a shell key such as `common.ungroupedSection`. A plain string
would render one language for every viewer (the order bars a literal
"Other"). The inline locale map is the declared translated form, and
`record:details` already resolves it per viewer with `pickLocalized`. So
a persisted page writes `label` as the map of `common.ungroupedSection`
from every catalogue `@object-ui/i18n` ships, keyed by its tag (`en`
"Other", `zh-Hans` 「其他」, `zh-Hant`, `ja`, `ko`, `de`, `fr`, `es`,
`pt-BR`, `ru`, `ar`). A renderer rule that heads an untitled trailing
section was rejected: the spec's `label` describe says an omitted label
is "an untitled, borderless section", so that would be the renderer
overriding a declaration.
- **`recordDetailSections.ts`**: `deriveStudioDetailSections` no longer
returns `undefined` for a grouped object. It returns the synthesizer's
own sections (`resolveDetailSections`: `{ group, columns }` per group,
then the enumerated bucket) with the bucket headed by
`labels.ungrouped`. New `loadPersistedUngroupedHeading(objectDef)`
builds the map through `loadBuiltInLocale`, and only when the object's
field groups apply, so a flat object fetches no catalogue. A catalogue
that fails to load rejects the call rather than saving a partial map.
`RecordDetailSectionLabels.ungrouped` widens from `string` to
`SectionHeading` (`string` or a locale map).
- **`anchors.ts`**: the full-page seed passes the loaded map.
**`PagePreview.tsx`**: the preview passes `t('common.ungroupedSection',
'Other')` (now a memo dependency); "Convert to full page" loads the map
for the schema on screen and is enabled once it is in, as it already
waited for the schema.
- **Docs**: `content/docs/ui/field-grouping-and-order.mdx` names the
Studio-seeded page among the surfaces that draw the heading (the objectstack-ai#33372
contract review's nit).
- **Changeset** `.changeset/33377-studio-seed-ungrouped-heading.md`:
`@object-ui/app-shell` and `@object-ui/console` patch. app-shell is
private, and console's `dist` ships it.

## Tests

- New `recordDetailSections.studioUngroupedHeading-33377.test.tsx`:
- the full seed for a grouped object: the group reference equals the
synthesizer's, the bucket equals the synthesizer's plus `label`, the
label is an object with exactly the shipped language codes, each equal
to that catalogue's `common.ungroupedSection`; the sections parse under
`RecordDetailsProps`;
- CONTROL: a flat object seeds a primary section with no heading, no
section carries a locale map, and the loader answers the English
default;
- rendered through the real `RecordDetailsRenderer` under
`I18nProvider`: the saved seed draws "Other" in `en` and 「其他」 in `zh-CN`
(and not the other language), after the group heading and above the
ungrouped field's value; the preview's sections draw 「其他」 the same way.
- `PagePreview.slottedDefault-27054.test.tsx`, new describe: Convert to
full page on a grouped object writes the group reference unheaded and
the bucket under the full map, and the written page passes
`validateMetadataDraft` and every block's `ComponentPropsMap` row.
- Rewritten, because they pinned the defect: the grouped CONTROL in
`recordDetailSections.agreement-12442.test.ts` (seed equalled the bare
synthesizer output; now every section equals it except the bucket's
added `label`) and in `PagePreview.test.tsx` (preview equalled the bare
synthesizer; now the bucket carries "Other").
- Ablations, one-off through `scripts/ablation-replace.mjs` on 1b987ec
(`@object-ui/*` resolves to `src` through the vitest aliases, so no
rebuild), each restored with the blob equal to HEAD and `git diff HEAD`
empty:
- the bucket heading dropped in `deriveStudioDetailSections`: 7 failed /
20 passed over the 4 files (the seed, both rendered seed rows, the
rendered preview row, convert-to-full, the preview node, the 12442
grouped row);
- the loader answering the plain English default for every object: 3
failed / 24 passed (the seed's map row, the zh-CN rendered seed row,
convert-to-full). The `en` rendered row stays green, as it should: a
plain "Other" reads right in English only.

## Acceptance notes

- **Pages already saved are not migrated.** A full page Studio seeded or
converted before this change keeps its untitled bucket and keeps drawing
those fields under the last group, as it does today. Its author can give
that section a heading in the page designer (`label`, a string or a
per-locale value). A slotted page was never affected at runtime: the
running app synthesizes it with the record page's own sections, which
already carry the heading; only its preview was wrong, and that is fixed
here.
- **`buildDefaultPageSchema` in `@object-ui/plugin-detail` is
unchanged.** Its `fieldGroupSectionReferences` still writes the bucket
untitled for a caller that passes no sections. It has no heading to give
(no translator, and a published API), and the only callers that persist
it are the Studio ones above, which now pass their sections. So
`Clause-②: no`: no exported type or output of a published package
changes; app-shell is private. `Metadata-protocol: none`: no spec edit,
and the written value is one `sections[].label` already accepts.
- **Measured trade-off of the map**: the saved page holds a copy of the
catalogue text as of the save. A later rewording of
`common.ungroupedSection` does not reach pages already saved, and a
language the platform adds later falls back to `en` on those pages
(`pickLocalized`'s `en` limb). The running page, which translates live,
is unaffected.
- Out of scope, noted for the seat: the same seed persists "More
details" (`MORE_DETAILS_DEFAULT_LABEL`) as a plain English string under
`name: 'details'`, so on a saved seeded page of an object with no field
groups that heading is English for a viewer whose object bundle has no
`_sections.details.label`, while the running page translates it through
`detail.sectionMoreDetails`. Read on the code, not driven live.

## Verification

<details><summary>Local gates, type-check and suites (head
8acd49d)</summary>

- `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` derives 68 families. All 68 ran on 1b987ec
and exited 0 except `check:test-source-alias` (exit 1: the edited
convert-to-full test reaches `@objectstack/lint` through
`clientValidation` and lacked the module-top import). 8acd49d adds it;
on 8acd49d `check:test-source-alias` and the other test-reading
families (`cross-package-test-inputs`, `query-options-erasure`,
`undeclared-dep-imports`, `nul-bytes`, `where-matcher`,
`engine-double-contract`, `driver-memory-census`, `refd-timer-probe`,
`registry-log-declared`, `rest-log-spy-declared`, `watch-hint-literal`,
`type-check-coverage`, `tier-file-adoption`) exit 0. `--ran`
reconciliation: 68 derived, 68 run, 0 NOT-MEASURED, 0 UNRUN.
- `pnpm --filter @object-ui/app-shell run type-check` (`tsc --noEmit`
and `tsconfig.test.json`): exit 0 on 8acd49d.
- `pnpm --dir ui exec vitest run`, app-shell narrowed to the record view
and the Studio callers (`views/recordDetailSections*`,
`views/RecordDetailView*`, `metadata-admin/previews/PagePreview*`,
`metadata-admin/anchors*`, two `ResourceEditPage` seed files): 109
files, 777 passed on 1b987ec; the convert-to-full file re-run on
8acd49d: 5 passed. The rest of app-shell is CI's sharded Test UI.
- eslint on the touched files: 0 errors. `pnpm --dir ui
check:new-line-citations`: 0 new.

</details>

---
_Generated by [Claude
Code](https://claude.ai/code/session_01FEkQ5nV6skFMkjLTEGHKL3)_

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: objectstack-fleet[bot] <332303061+objectstack-fleet[bot]@users.noreply.github.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

1 participant