Skip to content

Commit f644321

Browse files
docs(skills): teach an object extension's place; another package's child list still shows on a declared tab list (#36527)
<!-- claude-projects-attribution: {"github_login":"os-steve"} --> _Requested by **Steve** · [project thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9WF2JA4aXQRy81L1mg6vYtR)_ Fixes #35902 Clause-②: no Metadata-protocol: none ## 维护者速读 - **用户能看到什么变化**:用 AI 搭建应用的人,让自己的扩展包给别人的对象加字段或子表时,AI 现在会写明它们排在哪个字段、哪个页签后面;技能和指南不再说「别的包加的子表会被隐藏」;CRM 示例的客户对象演示了页签清单和分组自己列字段。 - **为什么做**:属于「记录页的页签和字段分组改由父对象一处声明」专题:平台的四种新写法都已合并,这一批补上最后一种(扩展包声明位置)的技能、指南、评测和示例,免得「做了没人知道」。 - **出错会怎样**:AI 可能没写位置或写错,扩展包带来的字段和页签就按默认排在末尾,不丢数据;撤回只需回退这一次合并。 - **要你做什么**:批准合并这份技能与指南的更新。 ## What changes The fourth form of the parent-declared record page, an extension's `place`, reaches the skills, the guide and an eval; the sentence that said another package's child list is hidden goes; one repository example declares a tab list. | File | Change | |:--|:--| | `skills/objectstack-data/SKILL.md` § Object Extension Model | `defineObjectExtension` takes `place`. One example with a field entry and a list entry, the group form `{ group: { key, label }, after }`, `before` as the other anchor, and the condition: placement applies where the target declares `fieldGroups` / `relatedLists`. | | `skills/objectstack-ui/rules/record-page.md` step 2 | "A child list another package adds is hidden by a `relatedLists` that does not name it (no package places its own list yet)" becomes "still shows, after the named lists or where its extension's `place` puts it (objectstack-data)". | | `skills/objectstack-data/evals/objects-fields-relationships.json` case 26, `evals/README.md` | An add-on package puts its Tax ID field after Industry in the account's Basic group and its Contracts tab after Opportunities, on an account whose tab list names another child list after Opportunities, so a missing list placement draws a different page. Expected: two `place` entries on the package's own extension, no redeclared `crm_account`, no `overrides:`. | | `content/docs/ui/pages.mdx`, record page section | The same sentence corrected (shows where the extension places it, or at the end of the tabs, before approvals and the activity stream); a paragraph and a checked `defineObjectExtension` example for `place`, linking the object-extensions guide, which already documents the key. | | `examples/app-crm/src/objects/account.object.ts` | `fieldGroups` listing each group's `fields`, and `relatedLists` naming every tab in order, one entry with its own `columns`, the two built-ins by object name. | | `examples/app-crm/src/translations/crm.translation.ts` | zh-CN labels for the two new groups. | | `.changeset/35902-skills-extension-place.md` | New, `@objectstack/skills` patch. | | `.changeset/35902-skills-related-lists-tabs.md` | DELIBERATE CORRECTION, see below. | What the skills already taught before this change, and is not in the diff: the tab list with the three built-ins, an entry's `label` / `columns`, a group's `fields`, and the group that places a child table, each with its example and its eval (record-page evals 1, 4, 5, 6), and the repository examples of a group placing a child table (the showcase invoice, the CRM example's opportunity). **DELIBERATE CORRECTION of a pending release note.** `.changeset/35902-skills-related-lists-tabs.md` is on main and unreleased. Its first bullet said: "A child list another package adds is hidden by a `relatedLists` that does not name it." The platform change that let a package place its own list made that false before any release carried it. The sentence now reads: "A child list another package adds still shows, after the named lists or where that package's extension places it." Nothing else in the note changed. `Check Changeset` is red on this by design; no `skip-changeset`. ### Skill size readings | | main `316f7571` | This head | |:--|:--|:--| | `skills/objectstack-data/SKILL.md` | 473 lines · 26,832 bytes · 6,703 tokens (ceiling 6,710) | 473 lines · 26,858 bytes · 6,710 tokens (ceiling 6,710, not raised) | | `skills/objectstack-ui/rules/record-page.md` | 64 lines · 3,952 bytes · 988 tokens (ceiling 991) | 64 lines · 3,958 bytes · 990 tokens (ceiling 991, not raised) | | All 14 `SKILL.md` files | 4,950 lines · 261,027 bytes | 4,950 lines · 261,053 bytes | | Ratcheted (authored) tokens | 197,533 | 197,542 | | Eval fixtures (measured, not ratcheted) | 78,177 | 78,658 | | `skills/**`, 114 files | 1,172,198 bytes | 1,174,155 bytes | The data skill's entry file had 7 tokens of headroom and the `place` paragraph costs about 75, so the rest is paid in the same file by shorter wording, no ceiling moved. Every inline code span and every link of the file on main is still in it (compared by script), except the one signature that gained `place`. What the shorter wording no longer says, all prose: "on 31/31 objects in the reference apps" (twice, on `pluralLabel` and `icon`; the instruction to author both stays), "the fundamental data entity in ObjectStack", the lead-in "The full table, per-type config and traps" (the link stays), "stored and read ... on the record" in the multi-value lookup note, "range" before `0–999`, "incorrect/correct" before "examples", and "This axis is distinct from `ownership`, which decides" (now "`ownership` is a separate axis"). ## Tests - No runtime behaviour changes, so no ablation. - **The taught shapes parse.** The skill's example, its group form, the guide's example and a `before` entry go through the built spec's `defineObjectExtension`: 4 of 4 accepted. Control leg: an entry with both `after` and `before`, and an entry with a misspelt key, are both refused, so an accept is a measurement. - `pnpm --filter @objectstack/spec run check:skill-examples`: exit 0, `349 prose examples type-check across 3 surface(s)`, the guide's new block among them, against a spec built at this base (full build under the verify lock, `VERDICT command-exit 0`). - **The example app.** `@objectstack/example-crm`: `typecheck` exit 0; `test` 7 files, 51 tests passed (under the verify lock, `VERDICT command-exit 0`); `validate` "Validation passed", no warning. - **Eval token reachability.** `node ui/scripts/check-skill-eval-tokens.mjs`: exit 0, "Every must_contain token is taught by its own skill bundle." - **Skill evals: NOT MEASURED.** No eval round ran here. The card's "four eval cases pass" and the new case 26 are owed a round: `pnpm --filter @objectstack/scenarios skill-evals --skills objectstack-data,objectstack-ui`. ## Acceptance notes 1. **This slice is the card's last.** Item 5 of the card (HotCRM declares `relatedLists` on its five main objects) lives in another repository and is carried by objectstack-ai/hotcrm#2742, which the seat filed from the hand-off on the card (comment 7082792445); it waits for a release that carries these keys. Seat record: card comment 7083107636. 2. **Overlap.** `overlap-check` at this head exits 1 on two open pull requests. The draft that turns the data skill's entry file into a router, #36158, rewrites `skills/objectstack-data/SKILL.md` whole: this pull request does not wait for it (the seat's call), and whichever lands second merges main and replays its entry-file text. If the router lands first, the `place` paragraph belongs in `references/examples-objects.md` § Object Extension Model, where that draft moves the section, and the wording payments here are dropped. The release pull request (`chore: version packages`) deletes every pending note, so a corrected pending note conflicts with it by construction; the release job regenerates it from main. 3. **A `relatedLists` entry's `label` has no translation key that I could find.** The CRM example's entries carry no `label` for that reason. Read from `packages/spec/src/system/translation.zod.ts`: it has `relatedListTitle` under the child's field and `_sections` for groups, and no key for a tab-list entry's `label`. The console's reading was not traced and nothing was reproduced at run time. The seat filed the observation as #36528. 4. **The example lives in the CRM example, not the showcase.** The showcase account's record page is pinned by an end-to-end shape test, and the CRM example's account had neither key. 5. **The multi-value lookup note keeps its `{record.tags.0}` token.** The router draft above records that the automation skill refuses that token in a value slot and corrects it; this change only shortened the sentence around it. 6. **Merging ends the card while its eval done-when is unmeasured.** The round named under Tests is owed; the seat filed #36535 as its carrier, for the eval lane to run on main after the merge. 7. **Guide example.** The record page section of the guide carries the full Quote example from the parent card already; this change adds the extension half beside it. ## Verification **Read first, by risk:** 1. `skills/objectstack-data/SKILL.md`: the payments. Risky hunk: the Object Extension Model guard, where "`extend` is not object-level `ownership`" replaced a longer sentence; the four enum values stay. 2. `skills/objectstack-ui/rules/record-page.md` step 2: one sentence flips from "hidden" to "still shows". 3. `examples/app-crm/src/objects/account.object.ts`: the declared tab list names all four child lists, so no tab the page had is dropped. **Two-minute check:** `node scripts/check-skills-token-ratchet.mjs`. Expected: the last line reads `✓ check-skills-token-ratchet: 60 authored bundle file(s) within their ceilings`, and the two changed rows read `6710 / 6710` and `990 / 991`. **Head `8c346d66`**, two commits. The readings below were taken at `b9cdb233`; the second commit, from the contract review's finding S1, changes one eval fixture (the prompt's tab list and one sentence of the expected answer) and one comment in the CRM example. Re-run at `8c346d66`: `check-skills-token-ratchet` exit 0, `ui/scripts/check-skill-eval-tokens.mjs` exit 0, `check-nul-bytes` exit 0, the CRM example's `typecheck` exit 0. Exit codes captured before any pipe. **Derived list.** `node scripts/pm/dispatch-gates.mjs --commands` printed 90 commands. All 90 ran at `b9cdb233`: 89 exit 0, 1 exit 1. The exit 1 is `node scripts/check-empty-changeset.mjs --base origin/main`, red by design on the corrected pending note (DELIBERATE CORRECTION above); its other half reads "No empty-frontmatter changeset introduced by this diff (2 declaring changeset(s) added)". Reconciliation: `✓ dispatch-gates --ran: 90 derived famil(ies) accounted for — 90 run, 0 NOT-MEASURED (a DERIVED zero — all 90 recorded an exit code and none of them is 3).` The dist-reading gates in that list read a full build of this tree (`pnpm build`, 13m40s, `VERDICT command-exit 0`). The build ran before the last wording edits to the two skill files and the guide; none of those files is a build input of the packages the gates read, and the gates themselves ran after the final commit. **Outside the derived list:** `node scripts/pm/overlap-check.mjs` exit 1 (Acceptance note 2); the example app's three commands and the eval-token check under Tests. **Not run locally, CI's:** the type-check lanes, `Build Core`, `Test Core`, the repo lint, the docs build. --- _Generated by [Claude Code](https://claude.ai/code/session_01ADHkmTSjgh1xF2oiht7G2Z)_ <!-- signed: repo:objectstack#2 · os-steve · session_01ADHkmTSjgh1xF2oiht7G2Z --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent cd51dbb commit f644321

9 files changed

Lines changed: 106 additions & 24 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
Clause-②: no
6+
Metadata-protocol: none
7+
8+
The skills teach where an object extension's additions go on the object it extends:
9+
10+
- `objectstack-data` Object Extension Model: `place` puts the extension's own fields, groups and child lists after (or before) a named item of the target, where the target declares `fieldGroups` / `relatedLists`. Example: `place: [{ field: 'tax_id', group: 'basic', after: 'industry' }, { list: 'acme_contract', after: 'crm_opportunity' }]`; a group of the extension's own is `{ group: { key, label }, after }`.
11+
- `objectstack-ui` record-page rule: on a parent that declares `relatedLists`, a child list another package adds still shows, after the named lists or where that package's extension places it. The rule no longer says such a list is hidden until the parent names it.
12+
- Eval: a new `objectstack-data` case places an add-on package's field after Industry in the account's Basic group and its child list after the Opportunities tab.

‎.changeset/35902-skills-related-lists-tabs.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Metadata-protocol: none
77

88
The record-page skills teach the parent-declared record page:
99

10-
- `objectstack-ui` record-page rule: the parent's `relatedLists` is the tab list. Without it nothing changes; declared, only the named lists show, in order, with the attachments, approvals and activity tabs named by object (`sys_attachment`, `sys_approval_request`, `sys_activity`), and an entry `{ list, label, columns }` titles one list. "Put the tasks tab first" lists every tab to keep, tasks first, because a list naming only the task hides the rest. A child list another package adds is hidden by a `relatedLists` that does not name it.
10+
- `objectstack-ui` record-page rule: the parent's `relatedLists` is the tab list. Without it nothing changes; declared, only the named lists show, in order, with the attachments, approvals and activity tabs named by object (`sys_attachment`, `sys_approval_request`, `sys_activity`), and an entry `{ list, label, columns }` titles one list. "Put the tasks tab first" lists every tab to keep, tasks first, because a list naming only the task hides the rest. A child list another package adds still shows, after the named lists or where that package's extension places it.
1111
- The same rule's step 1 no longer teaches a stage bar or a key-field strip: the stage is the status tag beside the title, whose menu moves it, and `highlightFields` feed hover cards, pickers and related-list columns. A field group lists its own members in `fields`. The wide full page pins the details left beside the tabs, unless the details hold a child table or there is no other tab; the right summary rail and its switch are gone from the text, and the details column's dragged width joins the reader's own choices.
1212
- A `master_detail` child is a tab by default (`objectstack-data` relationships rule, the record-page rule and an eval); a parent field group naming the child list places its table among the fields, written only when asked, and the list keeps its tab too unless a declared `relatedLists` leaves it out.
1313
- `objectstack-data` field-groups example lists each group's members in `fields`; `objectstack-ui` navigation names `fieldGroups` alone.

‎content/docs/ui/pages.mdx‎

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,10 @@ keys nothing changes.
214214
(the activity stream: when unlisted, last). An entry `{ list, label, columns }` gives one list
215215
its own title and child-field columns, winning over the child field's `relatedListTitle` /
216216
`relatedListColumns`; a built-in is written only as its bare name. To put one tab first, list
217-
every tab the page keeps with that one first. A child list another package adds is hidden by a
218-
`relatedLists` that does not name it (letting a package place its own list is a later change),
219-
and `relatedList: false` on the child's reference field still hides a list.
217+
every tab the page keeps with that one first. A child list another package adds is not hidden
218+
by a `relatedLists` that does not name it: it shows where that package's extension places it
219+
(below), or at the end of the tabs, before the approvals and activity-stream tabs.
220+
`relatedList: false` on the child's reference field still hides a list.
220221
- **A field group lists its fields.** `fieldGroups` are the Details sections, in array order.
221222
A group lists its members, in order, in `fields`; without `fields`, its members are the fields
222223
whose `group` names it, the older spelling, still read.
@@ -260,6 +261,28 @@ export const Quote = ObjectSchema.create({
260261
});
261262
```
262263

264+
A package that adds to an object it does not own says where its additions go, with `place` on
265+
its [object extension](/docs/data-modeling/object-extensions#placing-what-you-bring): a field
266+
into one of the target's groups, a group of its own between the target's, a child list among
267+
the tabs, each right after or before a named item. Placement arranges what the target
268+
declares. Where the target declares no `fieldGroups` (or no `relatedLists`), its automatic
269+
arrangement stays and the additions still show in it. An extension places only what it brings.
270+
271+
{/* os:check */}
272+
```typescript
273+
import { defineObjectExtension, Field } from '@objectstack/spec/data';
274+
275+
// A contracts package adds a field and a child list to `account`, and places both.
276+
export const AccountContractsExtension = defineObjectExtension({
277+
extend: 'account',
278+
fields: { tax_id: Field.text({ label: 'Tax ID' }) },
279+
place: [
280+
{ field: 'tax_id', group: 'basic', after: 'industry' },
281+
{ list: 'contract', after: 'opportunity', columns: ['name', 'amount', 'end_date'] },
282+
],
283+
});
284+
```
285+
263286
### How the page is laid out
264287

265288
The Console lays the page out by the width of the surface it occupies, never by the viewport.

‎examples/app-crm/src/objects/account.object.ts‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,26 @@ export const Account = ObjectSchema.create({
4646
label: 'Website',
4747
}),
4848
},
49+
50+
// The Details sections of the record page and the form. Each group lists its
51+
// own fields, in order, so no field carries a `group` key.
52+
fieldGroups: [
53+
{ key: 'basic', label: 'Basic', fields: ['name', 'industry', 'website'] },
54+
{ key: 'financials', label: 'Financials', fields: ['annual_revenue'] },
55+
],
56+
57+
// The record page's tabs, declared in one place: only the lists named here
58+
// show, in this order. An entry may carry its own columns (fields of the
59+
// child); the built-in tabs are named by object. Leaving a list out hides its
60+
// tab, except a child list another package brings: that one still shows, at
61+
// the end of the tabs or where that package's extension places it. Without
62+
// this key every related list is a tab, in the automatic order.
63+
relatedLists: [
64+
{ list: 'crm_contact', columns: ['full_name', 'email'] },
65+
'crm_opportunity',
66+
'crm_activity',
67+
'crm_lead',
68+
'sys_approval_request',
69+
'sys_activity',
70+
],
4971
});

‎examples/app-crm/src/translations/crm.translation.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,11 @@ export const CrmTranslationBundle = defineTranslationBundle({
128128
website: { label: '官网' },
129129
owner_id: { label: '负责人' },
130130
},
131+
// The account's field groups, keyed by `fieldGroups[].key`.
132+
_sections: {
133+
basic: { label: '基本信息' },
134+
financials: { label: '财务信息' },
135+
},
131136
},
132137
crm_contact: {
133138
label: '联系人',

‎skills/objectstack-data/SKILL.md‎

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ metadata:
5151

5252
### Object Definition
5353

54-
An **Object** is the fundamental data entity in ObjectStack. It maps to a
55-
database table and exposes automatic CRUD APIs. As JSON (in TypeScript the
54+
An **Object** maps to a database table and exposes automatic CRUD APIs. As JSON (in TypeScript the
5655
same literal goes inside `ObjectSchema.create({...})`):
5756

5857
```json
@@ -83,17 +82,17 @@ Choose the posture from the request, not by habit: a business object a team
8382
shares is `public_read_write` (`private` would hide every colleague's records
8483
from everyone else); `private` fits personal or sensitive data only its owner
8584
should see (HR reviews, pay, personal notes); `public_read` fits reference data
86-
everyone reads and the owner maintains (price lists, policies, notices). This
87-
axis is distinct from `ownership`, which decides whether `owner_id` exists at
85+
everyone reads and the owner maintains (price lists, policies, notices).
86+
`ownership` is a separate axis: whether `owner_id` exists at
8887
all (Relationship Patterns below).
8988

9089
**Important optional properties:**
9190

9291
| Property | Default | Description |
9392
|:---------|:--------|:------------|
9493
| `label` | Auto from `name` | Human-readable singular label |
95-
| `pluralLabel` | — | Plural form (e.g., "Accounts") — on 31/31 objects in the reference apps; author it alongside `label` |
96-
| `icon` | — | Icon name for nav, list headers and lookup pickers — on 31/31 objects in the reference apps |
94+
| `pluralLabel` | — | Plural form (e.g., "Accounts"); author it alongside `label` |
95+
| `icon` | — | Icon for nav, list headers and lookup pickers; give every object one |
9796
| `color` | `gray` | Tile colour, one of `gray` `blue` `teal` `green` `amber` `orange` `red` `pink` `purple` (no hex); the console draws `icon` white on it. Give every object one; avoid repeats in one app |
9897
| `highlightFields` | derived | Ordered field keys used as a record's compact face: the columns a **related list** renders on the parent's detail page, and what a lookup picker shows. Declare it on the CHILD object (see [Relationships](./rules/relationships.md)) |
9998
| `namespace` | — | **Not a schema key** — an unknown key is refused, so authoring it is a build error. Embed the prefix directly in `name` instead |
@@ -274,12 +273,11 @@ column by declaring `storage: { notNull: true }`. CLI details: see
274273
### Naming Rules Summary
275274

276275
`snake_case` object names and field keys, `camelCase` schema properties,
277-
lowercase option values — incorrect/correct examples: [rules/naming.md](./rules/naming.md).
276+
lowercase option values — examples: [rules/naming.md](./rules/naming.md).
278277

279278
### Field Type Selection
280279

281-
The full table, per-type config and traps: [rules/field-types.md](./rules/field-types.md).
282-
From here, three to get right: credentials are `secret` (**encrypted-at-rest**, ADR-0100) —
280+
Three to get right here (the rest: [rules/field-types.md](./rules/field-types.md)): credentials are `secret` (**encrypted-at-rest**, ADR-0100) —
283281
never `password`, which on a generic object is **plaintext at rest**; `user` is the person
284282
picker; `formula` takes CEL in `expression` (a `{ dialect: 'cel', source }` envelope —
285283
`F\`...\`` in TypeScript; see **objectstack-formula**).
@@ -312,9 +310,8 @@ picker; `formula` takes CEL in `expression` (a `{ dialect: 'cel', source }` enve
312310
| Approval, review, routing, audit trail | not objects: an approval is a flow node (**objectstack-automation**) and its trail is platform history; model only the people it references (approver, reviewer), as `user` fields beside the owner |
313311
| Record owner | the platform's `owner_id` (`ownership: 'user'`, the default), also when the request says assignee, 负责人 or 处理人 — never a hand-added owner field, a second owner that owner-scoped visibility and "My records" views never read. A handler the request names apart from the owner is a `user` field that grants no access, with a label no other visible field carries, injected ones included: `owner_id` (Owner, 负责人), `created_by` (创建人), `updated_by` (更新人), `created_at` (创建时间), `updated_at` (更新时间). `ownership: 'none'` only for a shared catalog or a pure junction table |
314312

315-
> **`multiple: true` lookup ≠ junction object.** A multi-value lookup is stored
316-
> and read as an **array of ids** on the record — reference elements positionally
317-
> (`{record.tags.0}` in flow values).
313+
> **`multiple: true` lookup ≠ junction object.** Its value is an **array of ids**:
314+
> reference elements positionally (`{record.tags.0}` in flow values).
318315
319316
### Validation Patterns
320317

@@ -359,12 +356,15 @@ database layer.
359356
## Object Extension Model
360357

361358
To add fields/validations/indexes to an object you do not own, author
362-
`defineObjectExtension({ extend, fields, fieldPatches, priority })` and register it on
359+
`defineObjectExtension({ extend, fields, fieldPatches, place, priority })` and register it on
363360
`defineStack({ objectExtensions: [...] })`. `priority` sets merge order (default
364-
`200`, range `0–999`); an extension can add but never remove, except that a new
365-
`label` without `pluralLabel` clears the base plural unless a tenant authored it (set both). ⛔ Not the same key
366-
as object-level `ownership` (the record-ownership enum
367-
`'user' | 'business_unit' | 'org' | 'none'`).
361+
`200`, `0–999`); an extension adds, never removes, except that a new
362+
`label` without `pluralLabel` clears the base plural unless a tenant authored it (set both). ⛔ `extend`
363+
is not object-level `ownership` (`'user' | 'business_unit' | 'org' | 'none'`).
364+
365+
`place: [{ field: 'tax_id', group: 'basic', after: 'industry' }, { list: 'acme_contract', after: 'crm_opportunity' }]`
366+
puts the extension's own fields, groups (`{ group: { key, label }, after }`) and child lists
367+
after (or `before`) a named item, where the target declares `fieldGroups` / `relatedLists`.
368368

369369
**Relabel a field the owner declares with `fieldPatches` — never by redeclaring
370370
it in `fields`**, which takes the field over whole and cuts it off from the

‎skills/objectstack-data/evals/README.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ JSON fixtures in the objectui shape (`skill_name`, `evals[]`: `prompt`,
66
- `objects-fields-relationships.json` — naming, field types (`secret` vs
77
`password`), relationships (junction vs multi-value lookup,
88
`deleteBehavior`, on a `user` field too), validation (`state_machine`, unique **index**),
9-
conditional field rules, the record owner (负责人 is `owner_id`).
9+
conditional field rules, the record owner (负责人 is `owner_id`), an
10+
object extension placing what it brings (`place`).
1011
- `hooks-security-seeds-datasources.json` — search mirrors via hooks,
1112
permission-set scopes, external datasources, seeds (`externalId`,
1213
CEL dynamic values).

‎skills/objectstack-data/evals/objects-fields-relationships.json‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,25 @@
446446
"definePage"
447447
]
448448
}
449+
},
450+
{
451+
"id": 26,
452+
"prompt": "Our add-on package `acme_contracts` depends on HotCRM (`hotcrm`, namespace `crm`). Its extension of `crm_account` adds a `tax_id` text field, and the package ships an `acme_contract` object whose `account` lookup points at `crm_account`. On the account record page, show Tax ID right after Industry in the Basic section, and the Contracts tab right after Opportunities. `crm_account` declares `fieldGroups: [{ key: 'basic', label: 'Basic', fields: ['name', 'industry', 'website'] }]` and `relatedLists: ['crm_contact', 'crm_opportunity', 'crm_lead', 'sys_activity']`. We cannot edit HotCRM.",
453+
"expected_output": "Two `place` entries on the package's own object extension, registered in its stack's `objectExtensions`: `defineObjectExtension({ extend: 'crm_account', fields: { tax_id: Field.text({ label: 'Tax ID' }) }, place: [{ field: 'tax_id', group: 'basic', after: 'industry' }, { list: 'acme_contract', after: 'crm_opportunity' }] })`. `place` arranges only what the extension brings (its own field, its package's child list), each right after (or `before`) an item the account already has, and it applies here because the account declares `fieldGroups` and `relatedLists`. Without it the field arrives after the account's own and the Contracts tab at the end of the tabs, before the activity stream. The extension does not carry `fieldGroups` or `relatedLists` of its own (an extension has neither key), does not redeclare the account, and nothing in HotCRM is edited.",
454+
"files": [],
455+
"assertions": {
456+
"must_contain": [
457+
"defineObjectExtension",
458+
"extend: 'crm_account'",
459+
"place:",
460+
"after: 'industry'",
461+
"after: 'crm_opportunity'"
462+
],
463+
"must_not_contain": [
464+
"name: 'crm_account'",
465+
"overrides:"
466+
]
467+
}
449468
}
450469
]
451470
}

‎skills/objectstack-ui/rules/record-page.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ every related list is a tab, then `sys_attachment` (with `enable.files`),
2020
lists show, in order (unlisted approvals and the stream still follow): "tasks
2121
first" lists every tab to keep, `'task'` first; leaving out `'sys_attachment'`
2222
drops attachments. `{ list, label, columns }` (child field names) titles one list;
23-
a built-in is a bare name. A child list another package adds is hidden by a
24-
`relatedLists` that does not name it (no package places its own list yet). On the
23+
a built-in is a bare name. A child list another package adds still shows, after
24+
the named lists or where its extension's `place` puts it (objectstack-data). On the
2525
CHILD's reference field `relatedList: false` hides the list and
2626
`relatedListFilter` (Query-DSL) is AND-composed with the parent condition;
2727
rows follow the child's default list view `sort`. Only when asked for a child

0 commit comments

Comments
 (0)