Repository navigation
Commit 319b06f
feat(spec,ui): object fieldTabs move field groups into their own record-page tabs (#38742)
<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9NN6Y1G4JwByAn5p4uFhymm)_
Fixes #37802
Clause-②: yes (widening)
Metadata-protocol: added
Skills-docs: follow-up #38680
## 维护者速读
- 对象现在可以声明
`fieldTabs`,把指定的字段分组从记录页「概览」里挪出来,单独成一个页签,排在概览后面、关联列表前面;不声明的对象完全照旧。
- 这是记录页布局开关的第二张卡,前一张是 pinOverview(#38679 已合并)。主要场景是长正文、原文导入这类分组占满概览的对象。
-
只影响系统生成的标准记录页,录入表单、打印页和自己写的页面都不变。声明写错了(分组不存在、同一分组写在两个页签里、键重复、用了表单级写法)解析时直接拒收,并告诉作者正确写法;`os
lint` 还会在概览被挪空时给出警告。撤回就是删掉这一行声明。
- 要你做什么:无。
## What changes
- **spec** — `ObjectSchema.fieldTabs:
z.array(ObjectFieldTabSchema).optional()` (ADR-0085's Note of
2026-11-27, a ruled exception), each entry a strict `{ key, groups }`.
The object's superRefine refuses a group the object does not declare, a
group two tabs name, a group with `relatedList`, and a repeated `key`,
each at its own path. The form-level keys (`fields`, `label`, `icon`,
`visibleWhen`) are refused with guidance; the `fields` guidance and the
undeclared-group refusal name `FormSchema.fieldTabs`.
`ObjectExtensionSchema` does not declare the key. The object metadata
form offers it as a repeater row (`key`, `groups`). Types
`ObjectFieldTab` / `ObjectFieldTabParsed` follow ADR-0122. Because the
key is an array, `composeStacks`' `objectConflict: 'merge'` refusal now
names `fieldTabs` too; that refusal set is derived from the shape.
- **@object-ui/types** — `FormSchema.fieldTabs`' refusal of a missing
`fields` (already refused) now names `ObjectSchema.fieldTabs`, so the
object shape written on a form points at the object-level key. No
accept-set changes: a `groups` list beside `fields` still passes through
the loose entry.
- **plugin-detail** — `fieldTabPlacement` in `buildDefaultPageSchema`
takes the named groups out of the overview and places one `fields:<key>`
tab per entry, in declared order. The tabs go right after the overview
and before the related lists, attachments and the stream. A missing
group is skipped, and a tab left with no groups is not placed.
`recordPageColumns` reads `fields:<key>` as a column of its own, and a
field tab counts as an "other tab" for the pin. In `RecordPageColumns`
each field tab has its own empty-field tally and "show empty fields"
row. A tab whose groups are all hidden is not drawn, and the reader
cannot move or hide field tabs. The tab draws its first group's icon
before its title (`RecordTab.icon`, drawn by `RecordTabRow`). A
one-group tab draws no second heading. Inline edit works across tabs: a
draft survives a tab switch, and a refusal on an unopened tab is still
listed. `fieldTabIdOfField` is exported.
- **app-shell** — `RecordDetailView`: a `?section=` that cites a field
inside a field tab opens that tab first (`OpenCitedFieldTab`, a child
component, because the view has early returns before that point).
- **lint** — `object/field-tabs-empty-overview` (a `lintDataModel`
warning) fires when the tabs take every field the overview would draw
out of it. Membership is read as the page reads it
(`readFieldGroupMembership`: a group's own `fields` list first, then a
field's `group`), and hidden fields and ungrouped system fields do not
count.
- **metadata-core** — `OBJECT_REFERENCE_POSITIONS` classifies
`fieldTabs` as `keep` (it names groups, not fields).
- **Liveness ledger** — `packages/spec/liveness/object.json` has a
`fieldTabs: live` row with children `key` and `groups`.
- **Generated** — authorable-surface, api-surface, export-origins,
declaration-map, json-schema manifest, the reference pages, liveness
state-counts, the strictness-ledger counts, and the platform-objects
metadata-form translation bundles. zh-CN, ja-JP and es-ES are translated
by hand; the other seven locales carry translated sub-row labels.
- **Docs** — `content/docs/ui/pages.mdx` (a fieldTabs section with an
example) and the `@object-ui/plugin-detail` README.
- **Changeset** — `.changeset/37802-object-field-tabs.md`:
`@objectstack/spec`, `@object-ui/plugin-detail`, `@object-ui/app-shell`,
`@object-ui/types`, `@objectstack/platform-objects`,
`@objectstack/metadata-core` and `@objectstack/lint`, all minor.
Existing tests changed. Each change is forced by the new key, and each
count bump carries a history line:
- `protocol.meta-types-degenerate-derivation.test.ts`: the served
`object` property count, 54 → 55.
- `object-collapsed-sections-echo-decisions.test.ts`: open leaves, 134 →
140.
- `object-lifecycle-panel-echo-decisions.test.ts`: translated labels, +3
(872 over the first base; 873 over `main` acf3b33, which had moved it
to 870).
- `compose-stacks-merge-collection-refusal.test.ts` and
`compose-stacks-collection-pipe-arm.test.ts`: the derived collection
list gains `fieldTabs` after `relatedLists`, plus one `it.each` row.
## Tests
- `packages/spec/src/data/object.test.ts` — the key parses; each refusal
is reported at its path (undeclared group, a group in two tabs, a
`relatedList` group, a repeated key, the form-level shape, an extension
writing it).
- `ui/packages/types/src/__tests__/form-field-tabs-object-shape.test.ts`
(2) — a form tab that lists fields still parses; an entry naming
`groups` and no `fields` is refused with a message naming
`ObjectSchema.fieldTabs`.
-
`ui/packages/plugin-detail/src/synth/__tests__/fieldTabs-37802.test.ts`
(8) — placement and order, missing groups, a group named twice, an
emptied overview, the column, the pin, and the field-to-tab lookup. Each
case sits beside its no-`fieldTabs` control.
-
`ui/packages/plugin-detail/src/__tests__/RecordPageColumns.fieldTabs-37802.test.tsx`
(11) — through the real registry: two-group order, the first group's
icon on the tab (and none without one), no arrange chevron,
`visibleWhen`, a missing group, per-tab empty rows, the pinned per-tab
tally, the single-group heading, and inline edit across tabs.
-
`ui/packages/app-shell/src/views/RecordDetailView.citedSectionFieldTab-37802.test.tsx`
(3) — a cited section inside a field tab opens that tab first and marks
the heading; without `fieldTabs` it is marked in the overview; a cited
field the overview draws opens no tab.
- `ui/packages/plugin-form/src/fieldTabs.entryForm-37802.test.tsx` (1) —
the entry form draws every group, the tab's included, as the same object
without `fieldTabs` does.
- `packages/lint/src/data-model-rules.field-tabs-37802.test.ts` (5) —
one tab or two tabs taking every group warn at the object's `fieldTabs`;
membership spelled by the groups' `fields` lists warns too (control: one
listed group left out); a hidden field or an ungrouped system field left
behind still warns; a group left in the overview, an ungrouped field, or
no `fieldTabs` is silent.
## Acceptance notes
- Ablations (`scripts/ablation-replace.mjs`, each restored with its blob
equal to HEAD), each run against the new tests:
- `OpenCitedFieldTab` off: 1 test fails.
- Field-tab filter ignoring the group verdict: 2 fail.
- Tabs sharing the page tally: 1 fails.
- Titled-group match off: 1 fails.
- Field-tab rank off: 1 fails.
- The lint rule off: 2 fail.
- Round 2: the lint rule back on `field.group` alone: 2 fail (the
list-spelling and hidden/system cases); the tab icon not handed to
`RecordTab`: 1 fails.
- Off the card's first File surface:
`ui/packages/types/src/zod/form.zod.ts` and its test (the cross-pointing
refusal) and the two compose-stacks tests. The seat added them in the
claim revisions.
- The ADR-0085 Note's `Built by` line is not in this PR (it stays off
governed surfaces); the seat carries it on #38438 after merge.
## Verification
Two-minute check: `pnpm --dir ui exec vitest run
packages/plugin-detail/src/synth/__tests__/fieldTabs-37802.test.ts
packages/plugin-detail/src/__tests__/RecordPageColumns.fieldTabs-37802.test.tsx`
— 18 tests pass.
Read first: `packages/spec/src/data/object.zod.ts`
(`ObjectFieldTabSchema` and the superRefine arm),
`ui/packages/plugin-detail/src/synth/buildDefaultPageSchema.ts`
(`fieldTabPlacement`),
`ui/packages/plugin-detail/src/RecordPageColumns.tsx` (the field-tab
body).
<details><summary>Local runs</summary>
Round 3 (re-merge for L1-b; L2 delta 7278152701), at head `59220bf331`:
`origin/main` acf3b33 merged with `bash scripts/pm/os-regen-merge.sh`.
Conflicts in four `*.source-hashes.generated.ts` and
`object-lifecycle-panel-echo-decisions.test.ts` (main's 870 plus this
PR's 3 = 873) were resolved by hand; the generated surfaces were
regenerated over the merged tree in `e0d5e1c051`. `59220bf331` fixes the
Lint UI `react-hooks/globals` error in the cited-section test. Heavy
runs under `scripts/pm/os-verify-lock.sh`, after a full `pnpm build`
(exit 0).
- Tests, all exit 0: spec 28944 passed (1 todo); lint 10094;
metadata-core 1106; metadata-protocol 23807 (45 skipped);
platform-objects 2221 (echo counts 140 / 873); plugin-detail 4026 (18
skipped); types 10529; plugin-form 2831 (1 skipped); app-shell
`RecordDetailView*` 881.
- Type checks, exit 0: spec and lint `typecheck`; `turbo run type-check`
for app-shell, plugin-detail, types and plugin-form (76 of 76 tasks).
- `check-i18n-bundles`: all bundles in sync.
- `node scripts/pm/dispatch-gates.mjs --commands` at `59220bf331`: 128
derived, 128 run, every one exit 0; `--ran`: 128 run, 0 NOT-MEASURED
(`objectstack-seat3/37802-gates-ran.txt`).
Round 2 (L1 7274781307, L2 7274853609), at head `95f650e868`:
`origin/main` 95ffacc merged with `bash scripts/pm/os-regen-merge.sh`
(no text conflict; the four os-regen artifacts regenerated over the
merged tree in `4c8b464c6a`). Heavy runs under
`scripts/pm/os-verify-lock.sh`; times are shared-box figures.
- Tests: spec 28935 passed; lint 10093; metadata-core 1106;
metadata-protocol 23800 (45 skipped); platform-objects 2221 (echo counts
140 / 872 and the served count 55 unchanged by the merge); plugin-detail
4026 (18 skipped); types 10528; plugin-form 2831; app-shell
`RecordDetailView*` 881. The whole app-shell suite does not finish
inside 57 minutes on this box; CI's Test UI shards are its record.
- Type checks, exit 0: spec and lint `typecheck`; `turbo run type-check`
for app-shell, plugin-detail, types and plugin-form (76 of 76 tasks).
- `check:generated` 14 of 14 up to date; `check-i18n-bundles` in sync.
- `node scripts/pm/dispatch-gates.mjs --commands` at `95f650e868` after
a full `pnpm build`: 128 derived, 128 run, every one exit 0; `--ran`:
128 run, 0 NOT-MEASURED (`objectstack-seat3/37802-gates-ran.txt`).
Round 1, at head `ca2da459dd` on `origin/main` d2caaec:
- `pnpm --filter @objectstack/spec test`: 913 files. At the first full
run, 15 tests in 3 files were red on the new key. All three are fixed
here: the two compose-stacks lists and the item `.meta({ title })`.
Those 3 files were re-run, 355 tests pass.
- `pnpm --filter @objectstack/lint test`: 10059 passed.
- `pnpm --filter @objectstack/metadata-core test`: 1106 passed.
- `pnpm --filter @objectstack/metadata-protocol test`: 23690 passed, 45
skipped.
- `pnpm --filter @objectstack/platform-objects test`: 130 files, 2221
passed. The echo counts are 140 and 872.
- `pnpm --filter @object-ui/plugin-detail test`: 4025 passed, 18
skipped.
- `pnpm --filter @object-ui/plugin-form test`: 2831 passed, 1 skipped.
- `pnpm --filter @object-ui/types test`: 10529 passed.
- `vitest run packages/app-shell/src/views/RecordDetailView`: 103 files,
881 passed. The whole app-shell suite did not finish inside a 57-minute
window on this box, so CI's Test UI shards are its record.
- Type checks, all exit 0:
- `typecheck` for spec, lint, metadata-core, metadata-protocol and
platform-objects (spec re-run after the last source change).
- `turbo run type-check` for `@object-ui/app-shell`,
`@object-ui/plugin-detail`, `@object-ui/types` and
`@object-ui/plugin-form`: 76 of 76 tasks.
- `pnpm --filter @objectstack/spec check:generated`: 14 of 14 up to
date.
- `node scripts/check-i18n-bundles.mjs`: in sync.
- `node scripts/pm/dispatch-gates.mjs --commands`: 128 derived. Run at
the same tree (`5a56bef80d`, whose message differed only by a trailer
line), every one exits 0.
- The first pass found `check:spec-parsed-alias` red on
`ObjectFieldTab`. The fix is the ADR-0122 `z.input` + `Parsed` pair.
- `check:skill-examples` and `check:dual-build-cjs-loads` exited 3 (no
dist) until a full `pnpm build`.
- `pnpm --dir ui exec vitest run scripts/` was SIGKILLed in the batch
both times and passed alone under the lock (172 files, 5159 tests).
- `--ran`: 128 run, 0 NOT-MEASURED
(`objectstack-seat3/37802-gates-ran.txt` in the project files).
- Browser (dogfood-verification) on `examples/app-showcase` at 1440×900,
at `59220bf331`: `os dev --fresh --seed-admin`, with the console from
`ui/` source over the dev proxy. Screenshots are in
`objectstack-seat3/37802-shots/`. For the run only (not in this diff),
two objects got the key, and the server served both
(`/api/v1/meta/object/...` carries them):
- `showcase_field_zoo`: `fieldTabs: [{ key: 'content', groups:
['rich_content', 'media'] }]`, with icons `file-text` and `image` on
those two groups. `content-pinned-full-1440.png`: the page pins; the
right column's tabs are `fields:content*` and timeline, and the tab
draws the `file-text` icon before "Rich Content". The tab holds the Rich
Content group under its own heading, and the empty Media fields sit
behind "Show 5 empty fields". The overview on the left keeps the other
groups.
- `showcase_expense_report`: `pinOverview: false` and `fieldTabs: [{
key: 'totals', groups: ['totals'] }]`, with icon `calculator` on Totals.
`pinoverview-false-full-1440.png`: the page does not pin; tabs are
`overview*` (Details), `fields:totals` with the calculator icon, Expense
Lines, timeline; Totals is gone from the overview.
`pinoverview-false-totals-tab-1440.png`: `?related=fields:totals` holds
the six totals fields in three columns, with no second heading.
- Earlier shots in the same folder (`fieldtabs-*`,
`control-full-1440.png`, round 1) predate the tab icon;
`control-full-1440.png` is still the no-key control.
</details>
<!-- signed: repo:objectstack#3 · os-steve ·
session_01ADHkmS5m6C7eVVzJhUPsav -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent bb86347 commit 319b06f
60 files changed
Lines changed: 1937 additions & 44 deletions
File tree
- .changeset
- content/docs
- references
- data
- ui
- docs/audits/2026-07-unknown-key-strictness-ledger.counts
- packages
- lint/src
- metadata-core/src
- metadata-protocol/src
- platform-objects/src/apps/translations
- spec
- api-surface
- authorable-surface
- declaration-map
- docs/references
- api
- system
- export-origins
- json-schema.manifest
- liveness
- state-counts
- src
- data
- ui/packages
- app-shell/src/views
- plugin-detail
- src
- __tests__
- renderers
- synth
- __tests__
- plugin-form/src
- types/src
- __tests__
- zod
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
| 16 | + | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
| 182 | + | |
182 | 183 | | |
183 | 184 | | |
184 | 185 | | |
| |||
407 | 408 | | |
408 | 409 | | |
409 | 410 | | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
410 | 418 | | |
411 | 419 | | |
412 | 420 | | |
| |||
1036 | 1044 | | |
1037 | 1045 | | |
1038 | 1046 | | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
1039 | 1059 | | |
1040 | 1060 | | |
1041 | 1061 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
| 149 | + | |
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
182 | | - | |
| 182 | + | |
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
318 | 318 | | |
319 | 319 | | |
320 | 320 | | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
321 | 355 | | |
322 | 356 | | |
323 | 357 | | |
| |||
0 commit comments