Skip to content

Commit d33bf5a

Browse files
feat(spec): an object extension places the fields, groups and child lists it brings (place) (#36236)
Fixes #35901 Clause-②: yes (widening) Metadata-protocol: semantic Skills-docs: follow-up #35902 ## 维护者速读 - 扩展包作者可以写明自己带来的字段、分组、子表排在原对象哪一项后面;记录页、表单和 Studio 按同一个结果显示,不写就和以前一样。 - 属于「记录页标签与分组」专题;父对象声明了页签表或分组才生效,没声明时照旧排在末尾并在启动日志里说明。别的包带来的子表不再被父对象的页签表藏掉,没写位置的排在页签末尾。 - 已经声明页签表的对象会多出其他已安装包的子表页签;父对象可以在自己的页签表里点名它来换位置,撤回本改动即恢复原样。 - 无。 ## What changes An `objectExtensions` entry gains `place`, a list of `{ field, group, after | before }`, `{ group: { key, label, … }, after | before }` and `{ list, after | before, label?, columns? }` entries. The registry applies them once, in `foldExtendersOntoDefinition`, after every contributor's fields are merged, so every reader (record page, forms, Studio, the data and metadata doors) gets one arrangement. - **Spec** (`packages/spec/src/data/object.zod.ts`): the three placement shapes and `ObjectExtensionSchema.place`. The parse refuses a field outside the extension's own `fields`, both anchors at once, an item placed twice or next to itself, and a field whose own `group` disagrees with its placement. `defineStack` (`collectExtensionPlacementErrors` in `stack.zod.ts`) refuses a list, or a placed group's `relatedList`, that is not a child object of the extension's own package pointing at the target, a group key the target declares, and a placed field (or a placed group's `fields` entry) the target declares. The extension's `fieldGroups` / `relatedLists` keys now prescribe `place`. The `relatedLists` describe states the cross-package exception. - **Merge** (`packages/objectql/src/registry-extension-placement.ts`, wired into `registry-object-registration.ts#foldExtendersOntoDefinition`): three passes (groups, fields, lists) over the extensions in ascending priority, then package id. A field joins a group's member list (a group with no `fields` gets its current members written out on the served copy first, so its order does not move). A list is spliced into `relatedLists`; no anchor means the end of the tabs, before a trailing `sys_approval_request` / `sys_activity` run. An anchor the object lacks sends the item to the end. An item the object (or the base the fold starts from) already arranges keeps that position, so a folded body re-folds to itself. Notes go once per registry to the boot log (`console.warn`, like `reportFieldPatchMisses`). `engine-registration.ts` carries `place` onto the extension def. - **Arm (a), one switch**: `PLACEMENT_ARRANGES_DECLARED_ONLY` (read only by `arrangementDeclared`). List placements apply only where the target declares a non-empty `relatedLists`; group and field placements only where it declares `fieldGroups`. Elsewhere the automatic arrangement stays and the boot log names the placement, including that a list entry's `label` / `columns` and a field's `after` / `before` are inert, and pointing to `relatedListTitle` / `relatedListColumns` on the child's FK (Fable's three points). - **`os validate`** (`packages/lint/src/validate-extension-placement.ts`, in the reference-integrity suite): `extension-placement-not-applied` and `extension-placement-anchor-missing`, both warnings, with `os explain` entries. It sees a target only when the target is in the same stack, so the boot log stays the main channel; both texts say so. - **Console flip** (`deriveRelatedLists`): on a parent that declares `relatedLists`, a side list whose child belongs to another package than the parent is kept (placed ones sit at the spliced entry; unplaced ones after the listed lists). `arrangeDeclaredTabs` ranks an unnamed related tab before a trailing run of listed approvals / stream tabs. - **Studio** (`RelatedListsEditor`): such a list shows read-only among the unlisted rows with a "from <package>" badge, and the preview draws it where the record page does. The editor still edits only the authored layers, so a save never copies an extension's placements into the owner. - Semantic migration entry `object-extension-place-and-cross-package-lists` (states the flip); the #35897 entry's "a later change" clause now points to it. The two entries name each other by entry id, not by tracker number: `os migrate meta` prints an entry's text verbatim and `packages/cli/test/migrate-meta-engine-guidance.test.ts` refuses a tracker id there (ce3ab59). Dated notes in ADR-0085 §2 and ADR-0146 D10. Changeset carries both declaration lines and narrows #35897's note in its own text. - **ADR-0122 aliases**: `ObjectExtensionFieldPlacement` and `ObjectExtensionListPlacement` have one shape, so they are pinned isomorphic in `packages/spec/src/type-alias-convention.pin.test.ts` (886 → 888, with its history line). `ObjectExtensionGroupPlacement` nests `ObjectFieldGroupSchema`, which has a parsed shape, so it gains `ObjectExtensionGroupPlacementParsed`; `api-surface` and `export-origins` regenerated (33961ec). Rulings applied: 7073014077 (F1 + F2 = 「父对象声明了才生效」; an unplaced other-package list on a declared parent goes at the end of the tabs, 「装了就自动排在末尾」, flipping 7072511859's hiding). Small calls (the thread's, accepted at claim 7072929733): 1. Several items at one anchor: after an anchor they follow it in ascending priority, then package id; before an anchor they precede it in the same order. 2. A field inserted into a group without `fields` gets that group's current members materialised on the served copy, and the field's `group` set to the group. 3. "End of tabs" means before the trailing run of `sys_approval_request` / `sys_activity`; `before:` one of those that the parent leaves unlisted is that same position and is not named as a miss. 4. "Another package" means the child and the parent both belong to a package (not `sys_metadata`) and the two differ; package-less children keep #35897's rule. 5. When the owner already names the list or lists the field, the owner's position wins (silently). 6. Item 4 is enforced at parse, at `defineStack`, and by a skip plus warning in the merge, for every placement shape and whichever door registered the extension (a manifest body reaches the registry unparsed; the stored `object_extension` row is parsed only): a field by where it comes from (the owner's, then the extension folded first), a group's `fields` and its `relatedList`, and a list. The merge skips a list (or a group placing one) only on a positive verdict (the child is registered and owned by another package, or by none); an absent child is never a verdict, since its package may register it later in the boot. 7. A missing anchor puts the item at the end, named in the boot log and by `os validate`. An anchor another placement brings is found whatever order the two are written or registered in (each pass places in rounds), which is what `os validate` already accepted. Follow-up for #35902 (from Fable's review, corrected by the L2): nothing in HotCRM changes meaning today. Its modules use `objectExtensions` (o2c, psa, revenue) but none writes `place`, and none of its objects declares `relatedLists`. About 30 of its objects already declare `fieldGroups`, so a field or group placement there applies as soon as a module writes one; a list placement waits until the parent declares its tab list. ## Review round 1 (reviewed head `ce3ab59e`; fixes in `c151007b`) - **L1-c must-fix 1 / L2 S1**: pass 1 judges a placed group's `relatedList` with the same `childPackageOf` verdict as pass 3 and skips the group, named, on a foreign owner; an unregistered child is no verdict. Pinned for a raw body and for a body parsed by `ObjectExtensionSchema` and registered through `registerObjectExtension` (the stored door, which runs no `defineStack`). The registry can receive an unparsed `place` (the manifest loop in `engine-registration.ts` reads the authored manifest as is), so the merge also drops from a placed group's `fields` any name the extension does not own, named. - **L2 S2**: a field is owned by where it comes from. `placementContributorsOf` takes the owner's field names: an extension owns only the keys of its `fields` that neither the owner nor an extension folded earlier declares. A display-only redeclaration of an owner field therefore cannot place it (merge: skipped, named). `defineStack` refuses such a placement, at the entry and in a placed group's `fields`, where the stack defines the extended object. - **L2 S3**: the merge resolves an anchor another placement brings in any order (`placeInRounds`: rounds in placement order; what still waits when a round places nothing goes to the end, named). `os validate` and the merge now agree. - **L2 S4**: a list placement's `columns` are judged by `validateRelatedListRefs` as a `relatedLists` entry's are (`related-list-column-unknown`, error), top level and package bodies, with the same field / injected-column / path rules; its explanation says so. - **N1** (both reviews): the `place` describe now says what is refused where; another package's same group key is merged once and named, not refused. - **N2**: left as is (no effect on what shows). S1 covers who owns a group's list, not whether a list of the extension's own package points at the extended object; `defineStack` refuses that at build, and on an unbuilt body the served entry names a list the record page places nothing for. - **L1-c nits**: the #35897 entry's sentence is now history ("was hidden too until the parent named it; since object-extension-place-and-cross-package-lists it shows at the end of the tabs"); the ADR-0085 note adds that the parent cannot hide another package's list (only that package's FK `relatedList: false` does). - Changeset and docs: the HotCRM sentence (above), and the own-items, anchor-order and `columns` rules. ## Tests - `packages/spec/src/data/object-extension-place.test.ts`: the three shapes and every parse refusal, at its path. - `packages/spec/src/stack-extension-place.test.ts`: `defineStack` refusals (ADR-0112 envelope) and the missing-anchor no-refusal; round 1: a redeclared owner field placed at the entry or in a group's `fields` is refused, placing its own field beside the redeclaration is not. - `packages/objectql/src/registry-extension-placement.test.ts`: tax_id after industry; before an anchor and at the end; a group that lists members; industry removed → last in the group plus one log line; an added group; lists after / before / at the end; owner position wins; two packages at one anchor by priority, then package name, in both registration orders; uninstall and disable restore the owner's order; re-fold is idempotent; arm (a) for lists and groups with the log text; foreign items skipped and named; an unregistered child is no verdict; the manifest loop carries `place`; the pure function returns by reference. Round 1: a group placing the owner's list (raw and through the stored door) is not added; its own or an unregistered list is (control); a group's foreign field is left out; a redeclared owner field, and a field an earlier extension declares, are not moved; forward anchors for lists, groups across packages and fields; an anchor nobody brings still goes to the end. - `packages/lint/src/validate-extension-placement.test.ts`: control, not-applied for lists and groups, each missing anchor, sibling anchors, package bodies, suite membership. - `packages/lint/src/validate-related-list-refs.test.ts` (round 1): a placement's columns, control, unknown at the top level and in a package body, a child outside the stack unjudged. - `ui/packages/app-shell/src/utils/__tests__/deriveRelatedLists.otherPackage-35901.test.ts`, `ui/packages/plugin-detail/src/synth/__tests__/buildDefaultPageSchema.test.ts` (trailing run), `ui/packages/app-shell/src/views/studio-design/ObjectSettingsPanel.relatedListsOtherPackage-35901.test.tsx`. ## Acceptance notes - With no `place` written, every object is served as before (the fold returns the merged body by reference when no extension carries placements). - A parent with no `relatedLists` / `fieldGroups` keeps its automatic arrangement; nothing is dropped. - First files to read, by risk: `packages/objectql/src/registry-extension-placement.ts` (the splice and the idempotence rule), `ui/packages/app-shell/src/utils/deriveRelatedLists.ts` (the flip branch), `packages/spec/src/stack.zod.ts#collectExtensionPlacementErrors`. - Two-minute check: `pnpm --filter @objectstack/objectql exec vitest run src/registry-extension-placement.test.ts` → 34 passed. ## Verification <details><summary>Local runs</summary> - spec: `vitest run --project local` on the two new files plus every test touching `ObjectExtensionSchema` / `objectExtensions` / `relatedLists` and `src/migrations`: all passed. - objectql: `tsc --noEmit` clean; the new file (23) plus the extension, overlay and engine-registration tests (135): passed. - lint: `tsc --noEmit` clean; the new rule, suite membership and rule explanations (33): passed. - ui: `deriveRelatedLists` and tab-arrangement tests (95) and the Studio tab-list tests: passed. Three app-shell util files fail locally only because `@objectstack/client` was not built in this container; they do not import the changed code. - `pnpm --filter @objectstack/spec check:generated --fix`: regenerated and committed. - `pnpm check:spec-parsed-alias`: OK (888 pinned isomorphic); the pin test passed; `tsc -p tsconfig.test.json` reports nothing in the pin file. - A probe over all 639 semantic entries finds no tracker id in the fields `os migrate meta` prints; spec `src/migrations` tests (198) passed. - CI: every check green on `42d56e66` (74 check-runs: 63 success, 11 skipped), and on `ce3ab59e` before the round-1 fixes. - Round 1: spec placement, `defineStack`, migrations and alias-pin tests (227) passed, `tsc` clean; objectql `tsc` clean, the placement file (34) and every extension / overlay / engine-registration test (23 files, 373) passed; lint `tsc` clean, related-list refs, placement, suite and explanation tests (52) passed; `check:generated --fix` regenerated. - Main merged in `507fac34` (no conflicts); the protocol index regenerated from the merged tree (`42d56e66`). On the merged tree: alias gate OK, 640 semantic entries with no tracker id, objectql extension and placement tests (13 files, 155), lint (52) and spec placement / migrations / object tests (21 files, 657) passed. </details> 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L6bhgUxeTKkCvZ2iariHQf <!-- signed: repo:objectstack#1 · os-sales · session_01L6bhgUxeTKkCvZ2iariHQf --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 3f7fdd0 commit d33bf5a

43 files changed

Lines changed: 2946 additions & 81 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: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
'@objectstack/spec': minor
3+
'@objectstack/objectql': minor
4+
'@objectstack/lint': minor
5+
'@object-ui/app-shell': minor
6+
'@object-ui/plugin-detail': minor
7+
'@object-ui/i18n': minor
8+
---
9+
10+
feat(spec): an object extension says where the fields, groups and child lists it brings go (`place`), and a child list another package brings is no longer hidden by the parent's `relatedLists`
11+
12+
Clause-②: yes (widening)
13+
Metadata-protocol: semantic
14+
15+
An `objectExtensions` entry can now place what it brings on the object it extends:
16+
17+
```ts
18+
objectExtensions: [{
19+
extend: 'account',
20+
fields: { tax_id: { type: 'text', label: 'Tax ID' } },
21+
place: [
22+
{ field: 'tax_id', group: 'basic', after: 'industry' },
23+
{ group: { key: 'tax', label: 'Tax' }, after: 'basic' },
24+
{ list: 'contract', after: 'opportunity', label: 'Contracts', columns: ['name', 'amount'] },
25+
],
26+
}],
27+
```
28+
29+
- **No `place`: nothing moves.** Fields still arrive after the object's own, and an extension that writes no `place` serves exactly what it served before.
30+
- **One merge, every reader.** The registry fold applies the placements once, after every contributor's fields are merged, so the record page, the forms and Studio show one arrangement. Uninstalling or disabling the package takes its items off and leaves the object's own order as it was.
31+
- **Placement arranges what the parent declares.** A list placement applies when the extended object declares `relatedLists`; a group or field placement when it declares `fieldGroups`. On a parent that declares neither, its automatic arrangement stays and nothing is dropped: the list shows in the automatic tab order, and its entry's `label` / `columns` are not applied either (write `relatedListTitle` / `relatedListColumns` on your child object's lookup field to title it on every parent); the field shows among the fields, its `after` / `before` not applied. The boot log names each placement that did not apply, with the object and the package. It is the main channel: `os validate` names it too (`extension-placement-not-applied`, warning) only when the extended object is in the same stack.
32+
- **Anchors and order.** `after` or `before`, not both; neither means the end. An anchor may be an item another placement brings, whatever order the two are written or registered in. An anchor nobody has puts the item at the end of its group, of the groups, or of the tabs (before a trailing approvals / activity-stream run), and `os validate` warns (`extension-placement-anchor-missing`). A list placement's `columns` are fields of the child, checked by `os validate` as a `relatedLists` entry's are (`related-list-column-unknown`). Several packages at one anchor follow ascending `priority`, then package name, so every build gives the same order. When the object itself already names the list or lists the field, its own position wins.
33+
- **An extension places only its own items.** A field outside its own `fields`, a field the extended object declares (also one the extension redeclares to relabel it), a group key the extended object already declares, or a list (placed as a tab or by a group's `relatedList`) that is not a child object of its package pointing at the extended object is refused at parse or at `defineStack`, and skipped by the merge with a warning naming whose item it is, whichever door registered the extension. The extension keys `fieldGroups` and `relatedLists` are refused with a prescription naming `place`.
34+
- **Shipped behaviour change (flips #35897's hiding):** a child list another package brings is no longer hidden by the parent's declared `relatedLists`. Placed, it sits where its package puts it; unplaced, it shows at the end of the tabs. "Another package" means the child and the parent both belong to a package and the two differ; a child of the parent's own package, or one no package owns, is still hidden until an entry names it. This narrows the #35897 note "A child list another package adds is hidden too until the parent names it … letting a package place its own list is a later change": that change is this one.
35+
- **Studio** (object settings, Record page tabs) shows such a list read-only among the unlisted rows with a "from <package>" badge, and the preview draws it where the record page does.
36+
37+
What to check in an app: on an object that declares `relatedLists`, every installed package's child lists of it now show, at the end of the tabs unless placed; name one in the parent's `relatedLists` to put it elsewhere, or set `relatedList: false` on that package's FK to hide it. Nothing in HotCRM changes meaning today: no module writes `place`, and no object declares `relatedLists`. Most HotCRM objects already declare `fieldGroups`, so a field or group placement there applies as soon as a module writes one; a list placement waits until the parent declares its `relatedLists` (follow-up #35902). ADR-0087 semantic entry `object-extension-place-and-cross-package-lists`; ADR-0146 D10 and ADR-0085 notes.

‎content/docs/data-modeling/object-extensions.mdx‎

Lines changed: 59 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ check that spelling first.
6969
| `label` | Replaces the target's label — with one exception, [below](#extensions-and-tenant-customization). A new `label` with no `pluralLabel` beside it also takes the target's plural off, since that plural names the old label: the object is served as one that declares no plural, and lists title it by its label. Set `pluralLabel` too to serve one. A plural the tenant set stays. |
7070
| `pluralLabel` | Same as `label`. |
7171
| `description` | Same as `label`. |
72+
| `place` | **Applied once, after every extension's fields are merged.** Says where the fields, groups and child lists this extension brings go on the target — [below](#placing-what-you-bring). |
7273
| `priority` | Not merged — it *orders* the merge. `0`–`999`, default `200`. |
7374

7475
Added fields are ordinary fields, so everything on the
@@ -77,7 +78,7 @@ Added fields are ordinary fields, so everything on the
7778

7879
### What an extension may **not** contribute
7980

80-
The merge carries the eight keys above and nothing else. These four are not
81+
The merge carries the nine keys above and nothing else. These five are not
8182
"unsupported yet" — there is no slot for them to arrive through, and the schema rejects
8283
each one by name with the alternative to use instead:
8384

@@ -86,13 +87,69 @@ each one by name with the alternative to use instead:
8687
| `actions` | A top-level action with `objectName: '<target>'` in the same stack — it stays in the stack's top-level `actions`, and the engine's schema registry attaches it to the target object wherever the object is served, whichever package registers first; a target no loaded package registers fails the boot |
8788
| `hooks` | A top-level hook in the stack that defines the target object — a hook follows the ownership of its object, and `defineStack()` refuses a top-level hook bound to an object the stack does not define, an extended one included |
8889
| `listViews` | A top-level `view` in the stack that defines the target object — `defineStack()` refuses a top-level `view` whose `list` or `form` data source is an object the stack does not define, an extended one included |
89-
| `fieldGroups` | Add the fields here and declare the groups on the owning object, or assign a Page for the layout |
90+
| `fieldGroups` | A `place` entry: `{ group: { key, label }, after: '<group>' }` adds a group of your own, and `{ field, group, after: '<field>' }` puts a field of yours into one of the target's groups — [below](#placing-what-you-bring) |
91+
| `relatedLists` | A `place` entry `{ list, after: '<tab>' }` for a child object of your own package that points at the target — [below](#placing-what-you-bring). The target's own tab list stays its owner's |
9092

9193
The same holds for any other key: the extension schema is strict, so an unknown key
9294
fails at authoring time with a prescription rather than being dropped in silence.
9395

9496
---
9597

98+
## Placing what you bring
99+
100+
Without `place`, the fields you add arrive after the target's own, and a child list of
101+
yours shows wherever the record page's automatic order puts it. `place` names the item
102+
each one goes next to:
103+
104+
```ts
105+
objectExtensions: [{
106+
extend: 'crm_account',
107+
fields: { tax_id: { type: 'text', label: 'Tax ID' } },
108+
place: [
109+
{ field: 'tax_id', group: 'basic', after: 'industry' },
110+
{ group: { key: 'tax', label: 'Tax' }, after: 'basic' },
111+
{ list: 'acme_contract', after: 'crm_opportunity', label: 'Contracts', columns: ['name', 'amount'] },
112+
],
113+
}],
114+
```
115+
116+
- **`{ field, group, after | before }`** puts a field of *your* `fields` into a group of the
117+
target (or one you add), right after or before a member of that group.
118+
- **`{ group: { key, label, … }, after | before }`** adds a field group of your own, right
119+
after or before one of the target's groups. Its `fields` may name only fields you add.
120+
- **`{ list, after | before, label?, columns? }`** puts a child list of your own package (a
121+
child object of your package with a lookup to the target, or `object.field`) right after
122+
or before one of the target's tabs, with that tab's own title and columns (each column a
123+
field of the child, checked by `os validate` as a `relatedLists` entry's columns are).
124+
125+
Write `after` or `before`, not both; neither means the end. An anchor may be an item
126+
another placement brings, in whatever order the two are written or installed. An anchor
127+
nobody has puts the item at the end of its group, of the groups, or of the tabs (before the
128+
approvals and activity-stream tabs). Several packages at one anchor follow ascending
129+
`priority`, then package name. When the target's owner already names your list or lists
130+
your field, the owner's position wins.
131+
132+
**Placement arranges what the target declares.** A list placement applies when the target
133+
declares `relatedLists`; a group or field placement when it declares `fieldGroups`. On a
134+
target that declares neither, its automatic arrangement stays and nothing is dropped: your
135+
list shows in the automatic tab order (and the entry's `label` / `columns` are not applied
136+
either, so write `relatedListTitle` / `relatedListColumns` on your child object's lookup
137+
field to title the list on every parent), and your field shows among the fields, its
138+
`after` / `before` not applied. The boot log names each placement that did not apply, with
139+
the object and your package; `os validate` names it too when the target is in the same
140+
stack.
141+
142+
A child list your package brings is shown even when the target's `relatedLists` does not
143+
name it: placed, where you put it; unplaced, at the end of the tabs.
144+
145+
**You place only what you bring.** A field of the target or of another package (also one
146+
you redeclare to relabel it), a group key the target already declares, or a list (or a
147+
group placing one) that is not a child object of your package is refused at authoring time, and skipped by the merge with a warning naming whose item it
148+
is. Uninstalling or disabling your package takes its items off and leaves the target's own
149+
order as it was.
150+
151+
---
152+
96153
## Relabelling a vendor field
97154

98155
Replacing a field through `fields` takes it over whole: its type, its options and its

‎content/docs/references/api/metadata.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -963,7 +963,7 @@ Metadata query with filtering, sorting, and pagination
963963
| **titleFormat** | `string \| { dialect: 'template'; source?: string; ast?: any; meta?: object }` | optional | [DEPRECATED → nameField (ADR-0079)] Render-only title template; the server cannot return or query it, and an explicit nameField now takes precedence. An object definition that declares it is refused at the metadata save gate and by os validate; a stored object that carries it still parses and reads. Migrate a single-field title to nameField; a composite title that import, sort or search must match to a stored computed field (a non-formula field with an expression, computed and stored on every write) designated as nameField — a text formula designated as nameField stays legal for a title shown for display only. Placeholders may be written `{{field}}` or `{field}` — the title renderers treat the two as equivalent, normalizing `{{field}}` to `{field}` before substituting; neither spelling is judged at parse time. |
964964
| **imageField** | `string` | optional | The record's picture: names the field the record page header (record chrome) draws beside the title — one object-level declaration every record detail page reads, not a per-page header prop. Must name a field of this object whose type is `image` or `avatar`; any other name is refused. A record whose field is empty shows no picture (no initials or placeholder). |
965965
| **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. |
966-
| **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. That includes a child list another package adds: it is hidden until this object names it, which a build accepts only when that package is in the stack (letting a package place its own list is a later change). 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. |
966+
| **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. |
967967
| **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. |
968968
| **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). |
969969
| **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) |

0 commit comments

Comments
 (0)