Skip to content

Commit 319b06f

Browse files
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

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
'@objectstack/spec': minor
3+
'@object-ui/plugin-detail': minor
4+
'@object-ui/app-shell': minor
5+
'@object-ui/types': minor
6+
'@objectstack/platform-objects': minor
7+
'@objectstack/metadata-core': minor
8+
'@objectstack/lint': minor
9+
---
10+
11+
feat: an object can draw field groups as tabs of its record page, with `fieldTabs`
12+
13+
Clause-②: yes (widening) — `ObjectSchema` gains the optional `fieldTabs: [{ key, groups }]`; `@object-ui/plugin-detail` exports `fieldTabIdOfField` and the type `RecordPageFieldTab`, and `DefaultPageColumns` gains the optional `fieldTabs`
14+
Metadata-protocol: added
15+
16+
`fieldTabs: [{ key: 'content', groups: ['content', 'import'] }]` takes the named field groups out of the standard record page's overview and draws them as a tab right after it (`?related=fields:content`), before the related lists and the built-in tabs, in declared order; on a pinned page the first field tab is the one open beside the overview. The tab's title and icon are its first group's, and a one-group tab draws no second heading. The overview keeps the groups no tab names, the ungrouped fields, the body tables and the approval band. Each tab has its own "show empty fields" row; a tab whose groups are all hidden (`visibleWhen`) or missing on the served object is not drawn; the reader cannot move or hide these tabs; a cited `?section=` inside a tab opens that tab first. The entry form, print pages and authored pages are unchanged.
17+
18+
The parse refuses a group the object does not declare, a group two tabs name, a group with `relatedList`, a repeated `key`, and the form-level keys (`fields`, `label`, `icon`, `visibleWhen`); the undeclared-group refusal and the `fields` refusal name the form-level `FormSchema.fieldTabs`, which lists field names. `FormSchema.fieldTabs` in `@object-ui/types` refuses a missing `fields` with a message naming `ObjectSchema.fieldTabs`. An object extension cannot write the key. `composeStacks` with `objectConflict: 'merge'` refuses two declarations of one object whose `fieldTabs` differ, as it does every other object-level collection. The object metadata form offers it as a repeater. `os lint` warns (`object/field-tabs-empty-overview`) when the tabs take every field out of the overview.
19+
20+
Absent: unchanged. Nothing to migrate.

‎content/docs/references/data/object.mdx‎

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Object schema — Data Protocol reference
33
navTitle: Object
4-
description: "Object schemas of the ObjectStack Data Protocol: ApiMethod, ApiOperation, Index and 21 more — each property with its type, default and a TypeScript example."
4+
description: "Object schemas of the ObjectStack Data Protocol: ApiMethod, ApiOperation, Index and 22 more — each property with its type, default and a TypeScript example."
55
---
66

77
{/* ⚠️ AUTO-GENERATED — DO NOT EDIT. Run build-docs.ts to regenerate. Hand-written docs live in the module folders under content/docs/. */}
@@ -13,8 +13,8 @@ description: "Object schemas of the ObjectStack Data Protocol: ApiMethod, ApiOpe
1313
## TypeScript Usage
1414

1515
```typescript
16-
import { ApiMethod, ApiOperationSchema, IndexSchema, LifecycleSchema, LifecycleClassSchema, ObjectSchema, ObjectAccessConfigSchema, ObjectCapabilities, ObjectExtensionSchema, ObjectExtensionFieldPlacementSchema, ObjectExtensionGroupPlacementSchema, ObjectExtensionListPlacementSchema, ObjectExtensionPlacementSchema, ObjectExtensionRelatedListEntrySchema, ObjectExtensionRelatedListEntryObjectSchema, ObjectExternalBindingSchema, ObjectFieldGroupSchema, ObjectOwnershipEnum, ObjectRequiredPermissionsSchema, PerOperationRequiredPermissionsSchema, RelatedListEntrySchema, RelatedListEntryObjectSchema, RowCrudActionOverrideSchema, TenancyConfigSchema } from '@objectstack/spec/data';
17-
import type { ApiMethod, ApiOperation, Lifecycle, LifecycleClass, ObjectAccessConfig, ObjectCapabilities, ObjectExtension, ObjectExtensionFieldPlacement, ObjectExtensionGroupPlacement, ObjectExtensionListPlacement, ObjectExtensionPlacement, ObjectExtensionRelatedListEntry, ObjectExtensionRelatedListEntryObject, ObjectExternalBinding, ObjectFieldGroup, ObjectRequiredPermissions, PerOperationRequiredPermissions, RelatedListEntry, RelatedListEntryObject, RowCrudActionOverride, TenancyConfig } from '@objectstack/spec/data';
16+
import { ApiMethod, ApiOperationSchema, IndexSchema, LifecycleSchema, LifecycleClassSchema, ObjectSchema, ObjectAccessConfigSchema, ObjectCapabilities, ObjectExtensionSchema, ObjectExtensionFieldPlacementSchema, ObjectExtensionGroupPlacementSchema, ObjectExtensionListPlacementSchema, ObjectExtensionPlacementSchema, ObjectExtensionRelatedListEntrySchema, ObjectExtensionRelatedListEntryObjectSchema, ObjectExternalBindingSchema, ObjectFieldGroupSchema, ObjectFieldTabSchema, ObjectOwnershipEnum, ObjectRequiredPermissionsSchema, PerOperationRequiredPermissionsSchema, RelatedListEntrySchema, RelatedListEntryObjectSchema, RowCrudActionOverrideSchema, TenancyConfigSchema } from '@objectstack/spec/data';
17+
import type { ApiMethod, ApiOperation, Lifecycle, LifecycleClass, ObjectAccessConfig, ObjectCapabilities, ObjectExtension, ObjectExtensionFieldPlacement, ObjectExtensionGroupPlacement, ObjectExtensionListPlacement, ObjectExtensionPlacement, ObjectExtensionRelatedListEntry, ObjectExtensionRelatedListEntryObject, ObjectExternalBinding, ObjectFieldGroup, ObjectFieldTab, ObjectRequiredPermissions, PerOperationRequiredPermissions, RelatedListEntry, RelatedListEntryObject, RowCrudActionOverride, TenancyConfig } from '@objectstack/spec/data';
1818

1919
// Validate data
2020
const result = ApiMethod.parse(data);
@@ -179,6 +179,7 @@ const result = ApiMethod.parse(data);
179179
| **highlightFields** | `string[]` | optional | [ADR-0085] Ordered most-important fields; first entry wins where only one fits. Drives default list and related-list columns, cards, hover cards, previews and the record picker; the default record page draws no strip from it. Renamed from compactLayout. |
180180
| **relatedLists** | `(string \| { list: string; label?: string; columns?: string[] })[]` | optional | The record page's tabs beside the overview, in order. Absent: every related list shows (owned master_detail children, then lookup children), then attachments, approvals and the activity stream, as before. Declared: only the lists named here show, in this order; leaving one out hides its tab. A child list another package brings is not hidden by it: that package places the list with its object extension's place entry (an `{ list, after \| before }` entry), and an unplaced one shows at the end of the tabs, before approvals and the activity stream; this object may also name it, which a build accepts only when that package is in the stack, and then its own position wins. Each entry is a child object name (e.g. "task"), object.field when that child has more than one relationship to this object (e.g. "event.related_to"), or a built-in tab: "sys_attachment" (attachments, still only when enable.files is on; not shown when unlisted), "sys_approval_request" (approvals, still only when the record has requests; when unlisted it follows the listed tabs), "sys_activity" (the activity stream of activities, discussion and changes; when unlisted it comes last). An entry may instead be `{ list, label?, columns? }` to give that list its own title and child-field columns (wins over the child FK's relatedListTitle / relatedListColumns, used wherever the list is drawn); a built-in tab is written only as its bare name. relatedList: false on the FK still hides a list; body tables placed by fieldGroups are not hidden by this list. A name whose child is in the stack but has no inbound lookup / master_detail field to this object is refused everywhere; one whose child exists nowhere is refused by os validate / os build (which leave a sys_ / cloud_ / ai_ name to the runtime) and by a metadata write that names no package; a write into a package stores it and the record page places nothing for it. A columns name that resolves to no field of the child (a dotted name is walked through the child's relationships, as relatedListColumns is) is refused. |
181181
| **pinOverview** | `boolean` | optional | Whether the desktop full standard record page pins the overview (the record's own fields) to a left column beside its other tabs. Absent or true: derived as before (a full page wide enough for both columns, with another tab and no related table among the fields, pins). false: the desktop full page never pins, at any width; the overview is its first tab, open by default, and its fields lay out by width in up to three columns, also when the overview holds a related table. Read by the desktop full standard record page alone: the side preview and a phone draw the same either way, and print pages and authored kind: full \| html \| react pages do not read it. Not accepted on an object extension. |
182+
| **fieldTabs** | `{ key: string; groups: string[] }[]` | optional | Field groups the standard record page draws as tabs of their own, right after the overview and before the related-list tabs, in this order. Each entry is `{ key, groups }`: key names the tab (snake_case; its page address is fields:`<key>`), groups lists keys of this object's fieldGroups, drawn in that order and taken out of the overview. The tab's title and icon are its first group's. The reader cannot move or hide these tabs. Refused: a group the object does not declare, a group two tabs name, a group with relatedList (body tables stay in the overview), a repeated key. Absent: unchanged. The entry form, print pages and authored kind: full \| html \| react pages are not affected. Not accepted on an object extension. Not the form-level FormSchema.fieldTabs, which lists field names. |
182183
| **stageField** | `string \| false` | optional | [ADR-0085] Lifecycle stage field (linear/ordered), or false to declare the status field non-linear and suppress stage heuristics. Absent = heuristic detection allowed. When the named field carries options, it must be a single-value `select` / `radio` with inline `options`, each declaring its `kind` ('open' / 'won' / 'lost'); a picklist-backed or multi-value stage field is refused. A name that resolves to no declared field, or a field with no options, is not judged at parse. |
183184
| **editMode** | `Enum<'modal' \| 'page'>` | optional | Edit-interaction intent for records of this object: 'modal' opens the edit form as a dialog over the current view; 'page' navigates to a dedicated full-page edit route. Absent = the renderer picks its own default (objectui defaults to modal). Cross-renderer intent, not pixel styling (family). |
184185
| **listViews** | `Record<string, { name?: string; label?: string \| Record<string, string>; type?: Enum<'grid' \| 'kanban' \| 'gallery' \| 'calendar' \| 'timeline' \| 'gantt' \| 'map' \| …>; data?: object \| object \| object; … }>` | optional | Built-in named list views (segmented tabs) shipped with the object schema — "views" mode, dropdown userFilters allowed, no page-only tabs (ADR-0047) |
@@ -407,6 +408,13 @@ const result = ApiMethod.parse(data);
407408
| **label** | `string` | optional | This list's title on the record page (its tab and its table heading). Wins over the child FK's relatedListTitle; absent = that key, else the child object's plural label. |
408409
| **columns** | `string[]` | optional | This list's columns, as field names of the child object (e.g. ['product', 'quantity', 'amount']). Wins over the child FK's relatedListColumns; absent = that key, else the child object's derived columns. Used wherever this list is drawn: its tab, and the body table a field group places. A name that is no field of the child is refused where the child is known. |
409410

411+
### Nested Shape: `Object.fieldTabs[number]`
412+
413+
| Property | Type | Required | Description |
414+
| :--- | :--- | :--- | :--- |
415+
| **key** | `string` | ✅ | The tab's key (snake_case). The record page addresses the tab as fields:`<key>`. |
416+
| **groups** | `string[]` | ✅ | The field groups this tab holds: keys of this object's fieldGroups, in the order the tab draws them. The first one's label and icon title the tab. |
417+
410418
### Nested Shape: `Object.listViews[string]`
411419

412420
| Property | Type | Required | Description |
@@ -1036,6 +1044,18 @@ External datasource binding (ADR-0015)
10361044
* `developerEditionCreate`
10371045

10381046

1047+
---
1048+
1049+
## ObjectFieldTab
1050+
1051+
### Properties
1052+
1053+
| Property | Type | Required | Description |
1054+
| :--- | :--- | :--- | :--- |
1055+
| **key** | `string` | ✅ | The tab's key (snake_case). The record page addresses the tab as fields:`<key>`. |
1056+
| **groups** | `string[]` | ✅ | The field groups this tab holds: keys of this object's fieldGroups, in the order the tab draws them. The first one's label and icon title the tab. |
1057+
1058+
10391059
---
10401060

10411061
## ObjectOwnershipEnum

‎content/docs/references/index.mdx‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Protocol reference — every schema by module
33
navTitle: Protocol Reference
4-
description: Every schema published by @objectstack/spec — 1749 schemas across 14 protocol modules
4+
description: Every schema published by @objectstack/spec — 1750 schemas across 14 protocol modules
55
---
66

77
{/* ⚠️ AUTO-GENERATED — DO NOT EDIT. Run build-docs.ts to regenerate. Hand-written docs live in the module folders under content/docs/. */}
@@ -25,7 +25,7 @@ counts are sums of the rows they head. Regenerate with
2525
| [AI Protocol](/docs/references/ai) | 18 | 108 | Agents, tools, skills, RAG and knowledge sources, model registry, conversations. |
2626
| [API Protocol](https://github.com/objectstack-ai/objectstack/tree/main/packages/spec/docs/references/api) | 37 | 528 | REST contracts, endpoints, routing, realtime, batch, discovery. |
2727
| [Automation Protocol](/docs/references/automation) | 16 | 82 | Flows and their nodes, approvals, ETL pipelines, webhooks, state machines, execution records. |
28-
| [Data Protocol](/docs/references/data) | 35 | 197 | Objects, fields, queries, filters, datasources and drivers — the ObjectQL layer. |
28+
| [Data Protocol](/docs/references/data) | 35 | 198 | Objects, fields, queries, filters, datasources and drivers — the ObjectQL layer. |
2929
| [Identity Protocol](https://github.com/objectstack-ai/objectstack/tree/main/packages/spec/docs/references/identity) | 5 | 27 | Users and accounts, organizations, positions, SCIM provisioning. |
3030
| [Integration Protocol](https://github.com/objectstack-ai/objectstack/tree/main/packages/spec/docs/references/integration) | 1 | 23 | The single connector protocol (ADR-0097) — catalog descriptors and provider-bound instances. |
3131
| [Kernel Protocol](https://github.com/objectstack-ai/objectstack/tree/main/packages/spec/docs/references/kernel) | 30 | 153 | Plugin lifecycle and manifests, capabilities and security, metadata loading, service registry. |
@@ -36,7 +36,7 @@ counts are sums of the rows they head. Regenerate with
3636
| [Studio Protocol](https://github.com/objectstack-ai/objectstack/tree/main/packages/spec/docs/references/studio) | 3 | 35 | Studio designer metadata — the authoring surfaces for the protocols above. |
3737
| [System Protocol](https://github.com/objectstack-ai/objectstack/tree/main/packages/spec/docs/references/system) | 40 | 298 | The runtime environment — logging, jobs, cache, metrics, notifications, i18n and compliance. |
3838
| [UI Protocol](/docs/references/ui) | 17 | 188 | Apps, pages, views, dashboards, reports, actions and themes — the ObjectUI layer. |
39-
| **Total** | **224** | **1749** | 14 protocol modules |
39+
| **Total** | **224** | **1750** | 14 protocol modules |
4040

4141
---
4242

@@ -146,7 +146,7 @@ Flows and their nodes, approvals, ETL pipelines, webhooks, state machines, execu
146146

147147
## Data Protocol
148148

149-
**Source:** `packages/spec/src/data/` · **Import:** `@objectstack/spec/data` · **35 pages, 197 schemas**
149+
**Source:** `packages/spec/src/data/` · **Import:** `@objectstack/spec/data` · **35 pages, 198 schemas**
150150

151151
Objects, fields, queries, filters, datasources and drivers — the ObjectQL layer.
152152

@@ -179,7 +179,7 @@ Objects, fields, queries, filters, datasources and drivers — the ObjectQL laye
179179
| [`hook-body.zod.ts`](/docs/references/data/hook-body) | `ExpressionBody`, `HookBody`, `HookBodyCapability`, `ScriptBody` |
180180
| [`hook-body-doors.zod.ts`](/docs/references/data/hook-body-doors) | `BodyActivityAppendInput`, `BodyDoorRecordRef`, `BodyMailSendInput` |
181181
| [`mapping.zod.ts`](/docs/references/data/mapping) | `ImportFieldMapping`, `Mapping`, `TransformType` |
182-
| [`object.zod.ts`](/docs/references/data/object) | `ApiMethod`, `ApiOperation`, `Index`, `Lifecycle`, `LifecycleClass`, `Object`, `ObjectAccessConfig`, `ObjectCapabilities`, `ObjectExtension`, `ObjectExtensionFieldPlacement`, `ObjectExtensionGroupPlacement`, `ObjectExtensionListPlacement`, `ObjectExtensionPlacement`, `ObjectExtensionRelatedListEntry`, `ObjectExtensionRelatedListEntryObject`, `ObjectExternalBinding`, `ObjectFieldGroup`, `ObjectOwnershipEnum`, `ObjectRequiredPermissions`, `PerOperationRequiredPermissions`, `RelatedListEntry`, `RelatedListEntryObject`, `RowCrudActionOverride`, `TenancyConfig` |
182+
| [`object.zod.ts`](/docs/references/data/object) | `ApiMethod`, `ApiOperation`, `Index`, `Lifecycle`, `LifecycleClass`, `Object`, `ObjectAccessConfig`, `ObjectCapabilities`, `ObjectExtension`, `ObjectExtensionFieldPlacement`, `ObjectExtensionGroupPlacement`, `ObjectExtensionListPlacement`, `ObjectExtensionPlacement`, `ObjectExtensionRelatedListEntry`, `ObjectExtensionRelatedListEntryObject`, `ObjectExternalBinding`, `ObjectFieldGroup`, `ObjectFieldTab`, `ObjectOwnershipEnum`, `ObjectRequiredPermissions`, `PerOperationRequiredPermissions`, `RelatedListEntry`, `RelatedListEntryObject`, `RowCrudActionOverride`, `TenancyConfig` |
183183
| [`picklist.zod.ts`](/docs/references/data/picklist) | `Picklist`, `PicklistExtension`, `PicklistServedField` |
184184
| [`query.zod.ts`](/docs/references/data/query) | `AggregationFunction`, `AggregationNode`, `DateGranularity`, `FieldNode`, `FullTextSearch`, `GroupByNode`, `Query`, `SortNode` |
185185
| [`recycle-bin.zod.ts`](/docs/references/data/recycle-bin) | `RecycleBinClearedReference`, `RecycleBinEntry`, `RecycleBinRetentionDays`, `RecycleBinRetentionDaysEnv`, `RecycleBinSnapshot`, `RecycleBinSnapshotRow` |

‎content/docs/ui/pages.mdx‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,40 @@ export const Policy = ObjectSchema.create({
318318
});
319319
```
320320

321+
An object can also move some of its field groups out of the details into tabs of their own with
322+
`fieldTabs`. Each entry names a tab `key` and the `groups` it draws, in order; the tabs sit right
323+
after **Details**, in the order they are declared, before the related lists, and on a pinned page
324+
the first of them is the tab open beside the details. A tab takes its title and icon from its
325+
first group, and a tab with one group draws no second heading under the title. **Details** keeps
326+
the groups no tab names, the fields in no group, the related tables and the approval band.
327+
Each tab counts its own empty fields. A tab whose groups are all hidden (their `visibleWhen`) is
328+
not drawn, and a link to a cited section inside a tab opens that tab first. The reader cannot
329+
move or hide these tabs. Only the standard record page reads the key: the entry form, print pages
330+
and authored pages draw every group as before.
331+
332+
```ts
333+
export const Policy = ObjectSchema.create({
334+
name: 'policy',
335+
label: 'Policy',
336+
fieldGroups: [
337+
{ key: 'basic', label: 'Basic' },
338+
{ key: 'content', label: 'Content' },
339+
{ key: 'import', label: 'Original' },
340+
],
341+
fieldTabs: [{ key: 'content', groups: ['content', 'import'] }],
342+
fields: {
343+
title: Field.text({ label: 'Title', group: 'basic' }),
344+
body: Field.markdown({ label: 'Body', group: 'content' }),
345+
source_file: Field.text({ label: 'Source file', group: 'import' }),
346+
},
347+
});
348+
```
349+
350+
The parse refuses a group the object does not declare, a group two tabs name, a group that holds
351+
a related list (body tables stay in **Details**), and a repeated `key`; an object extension cannot
352+
write the key. This is not the form-level `fieldTabs` of a form view, which lists field names.
353+
`os lint` warns when the tabs take every field out of **Details**.
354+
321355
The related lists load in steps, and the details never wait for them. The page asks every
322356
list's count in one request set, sent beside the record read, and draws each list's tab
323357
before those counts land; a list counted at 0 reads no rows, and its tab is muted, with no

0 commit comments

Comments
 (0)