diff --git a/.changeset/38680-record-page-skill-keys.md b/.changeset/38680-record-page-skill-keys.md new file mode 100644 index 00000000000..551b09852db --- /dev/null +++ b/.changeset/38680-record-page-skill-keys.md @@ -0,0 +1,11 @@ +--- +'@objectstack/skills': patch +--- + +docs(skills): the objectstack-ui record-page rule teaches `pinOverview` and the object-level `fieldTabs` + +Clause-②: no +Metadata-protocol: none + +`skills/objectstack-ui/rules/record-page.md`: step 1 no longer says the record page's layout follows "never a key". It now teaches the two object keys that re-arrange the standard record page. `pinOverview: false` keeps the desktop full page from pinning the details, which become its first tab; the side preview and a phone are unchanged. `fieldTabs: [{ key, groups }]` draws named field groups as tabs of their own right after the details; the note lists what the parse refuses and says this is not the form-level `FormSchema.fieldTabs`, which lists field names. Print pages and authored `kind: 'full' | 'html' | 'react'` pages read neither key, and an object extension is refused both. The example declares both keys. `relatedLists` stays the related-tab list. `evals/record-page.json` gains one case per key. +The file's token ceiling moves from 990 to 1244: four clauses of the same file (one false, three restating) are deleted first, and the row moves by the measured remainder. diff --git a/scripts/check-skills-token-ratchet.mjs b/scripts/check-skills-token-ratchet.mjs index e744a1f17e1..81999816d62 100644 --- a/scripts/check-skills-token-ratchet.mjs +++ b/scripts/check-skills-token-ratchet.mjs @@ -2218,7 +2218,21 @@ export const CEILINGS = new Map([ // labels it (Activity) in place of the Chinese word, and step 5's "(one page at two // widths)" aside — step 1 already says layout follows the surface's width — is gone; the // ceiling follows the file down to the measurement (3961 bytes). - ['skills/objectstack-ui/rules/record-page.md', 990], // -1 to the measurement (was 991) + // 991 -> 990: -1 to the measurement. + // 990 -> 1244 (card #38680): step 1 teaches the two object keys that re-arrange the + // standard record page, `pinOverview` and the object-level `fieldTabs` (what each does on + // the desktop full page, the surfaces that do not read them, the object-extension refusal, + // the four `fieldTabs` parse refusals and the form-level `FormSchema.fieldTabs` it is not), + // and the one checked example declares both. Raise path the standing ruling + // 「A:先削重复,余额按实测提高」 (ruling record 6513306068, letter B). PAID DOWN FIRST, 81 + // bytes of restatement beside the 13 of step 1's false clause "never a key": step 1's "the + // Console synthesizes it from the object alone" (the title and the step's own heading say it), step 2's "nothing changes" + // (the default it introduces follows it), and step 4's second "is `kind: 'full'`" (its + // heading says it). Arithmetic against `main`'s 3959 bytes (headroom 0): the file is + // 3959 -> 4974 bytes, so the row moves +254, the measured remainder only. Pinned AT the + // measurement. + // ceil($(wc -c < skills/objectstack-ui/rules/record-page.md) / 4) == ceil(4974 / 4) + ['skills/objectstack-ui/rules/record-page.md', 1244], // ── 2026-09-22 the #19715 split — decision batch #213 item 1 ───────────── // The maintainer ruled the four over-500-line published SKILL.md files split diff --git a/skills/objectstack-ui/evals/record-page.json b/skills/objectstack-ui/evals/record-page.json index d6dc3e37404..d9584f211ab 100644 --- a/skills/objectstack-ui/evals/record-page.json +++ b/skills/objectstack-ui/evals/record-page.json @@ -114,6 +114,44 @@ "relatedLists: ['quote_line'" ] } + }, + { + "id": 7, + "prompt": "Our policy records are long documents. On a desktop the policy record page pins the details in a narrow left column beside the tabs; stop that, so the details are the first tab and use the page's width. The `policy` object is defined in our own package and has Tasks and Attachments tabs today.", + "expected_output": "One key on the `policy` object: `pinOverview: false`. The desktop full page then never pins, at any width: Details is the first tab, open by default, and its fields lay out by width in up to three columns; the Tasks and Attachments tabs follow as before. Absent or `true` the pin is derived from the width, so the key is written only for this. The side preview and a phone draw the same either way. It is declared on the object itself (an object extension is refused it). No page file, no full or slotted page, and no `relatedLists` change.", + "files": [], + "assertions": { + "must_contain": [ + "pinOverview: false" + ], + "must_not_contain": [ + "pinOverview: true", + "definePage(", + "kind: 'full',", + "kind: 'slotted',", + "slots: { tabs" + ] + } + }, + { + "id": 8, + "prompt": "On the policy record page, put the Content and Original field groups on a tab of their own, titled Content, right after the details; Basic stays in the details. The policy declares `fieldGroups: [{ key: 'basic', label: 'Basic', fields: ['title', 'owner'] }, { key: 'content', label: 'Content', fields: ['body'] }, { key: 'import', label: 'Original', fields: ['source_file'] }]`.", + "expected_output": "One key on the `policy` object, beside the `fieldGroups` it already declares: `fieldTabs: [{ key: 'content', groups: ['content', 'import'] }]`. An entry names field GROUPS, not fields: the two groups leave Details and draw as one tab right after it, before the related-list tabs, and the tab takes its title and icon from its first group, so `content` comes first and the entry carries no `label`. Basic stays in Details because no tab names it, and `relatedLists` is untouched (it is still the related-tab list). This is not the form-level `FormSchema.fieldTabs`, which shares the name and lists field names: `fields` on an entry here is refused. No page file, no full page, no form view sections.", + "files": [], + "assertions": { + "must_contain": [ + "fieldTabs", + "groups: ['content', 'import']" + ], + "must_not_contain": [ + "fieldTabs: [{ label", + "label: 'Content', groups", + "definePage(", + "kind: 'full',", + "slots: { tabs", + "sections:" + ] + } } ] } diff --git a/skills/objectstack-ui/rules/record-page.md b/skills/objectstack-ui/rules/record-page.md index ec48c879944..ae3251de236 100644 --- a/skills/objectstack-ui/rules/record-page.md +++ b/skills/objectstack-ui/rules/record-page.md @@ -2,19 +2,32 @@ Read in order: each step is the remedy for the one before it; author `*.page.ts` only at step 3 or 4 (ADR-0085). -**1 · The object's declarations produce the page.** With no page assigned, the -Console synthesizes it from the object alone: `nameField` is the -title, `stageField` the status tag beside it whose menu moves the stage (each +**1 · The object's declarations produce the page.** With no page assigned, +`nameField` is the title, `stageField` the status tag beside it whose menu moves the stage (each option declares `kind: 'open' | 'won' | 'lost'`; `false` suppresses it); there is no stage bar or key-field strip (`highlightFields` feeds hover cards, pickers and related-list columns). `fieldGroups` are the Details sections in array order, each listing its members in `fields` (absent: the fields whose `group` names it); `editMode` (`'modal'` | `'page'`) is how Edit opens. Layout follows the surface's -width, never a key: a full page fitting 320 px of details beside 400 px of tabs +width: a full page fitting 320 px of details beside 400 px of tabs pins the details left of the tabs, unless they hold a child table or no other tab exists; else one column, Details first. -**2 · The parent's `relatedLists` is the tab list.** Without it nothing changes: +Two object keys re-arrange the standard page; write one only when asked. Print +and `kind: 'full' | 'html' | 'react'` pages read neither; an object extension is +refused both (the defining package declares them). +- `pinOverview: false`: the desktop full page never pins: Details is its first + tab, open by default, fields in up to three columns by width, child table or + not (`true` forces nothing). The side preview, a phone and a narrow page never + pin either way. +- `fieldTabs: [{ key, groups }]`: the named `fieldGroups` leave Details for one + tab per entry, right after it and before the step 2 tabs, in order; readers + cannot move or hide them. The first group's `label` and `icon` title the tab. + Refused: an undeclared group, a group in two tabs, a `relatedList` group, a + repeated `key`, and `fields` (the form-level `FormSchema.fieldTabs`, same + name, lists field names). The entry form is unchanged. + +**2 · The parent's `relatedLists` is the tab list.** Without it every related list is a tab, then `sys_attachment` (with `enable.files`), `sys_approval_request`, `sys_activity`. Declared, only the named lists show, in order (unlisted approvals and the stream still follow): "tasks @@ -33,8 +46,8 @@ slots it names (`header`, `actions`, `alerts`, `highlights`, `details`, `discussion`), each whole. No `tabs` slot: `slots.tabs`, `slots.related` and `slots.relatedLists` are refused by name. `isDefault: true` makes it the object's default record page. -**4 · `kind: 'full'` is the escape hatch, on the desktop full page.** A page -that looks nothing like the default (a chart tab, a bespoke strip) is `kind: 'full'`: `regions` drawn as authored ([Pages](./pages.md)). +**4 · `kind: 'full'` is the escape hatch, on the desktop full page.** For a page +that looks nothing like the default (a chart tab, a bespoke strip): `regions` drawn as authored ([Pages](./pages.md)). A phone and the drawer draw the standard page (steps 1–3); no key keeps a full page there, only a page named in the URL (a print page) draws everywhere. The standard page draws no `record_section` action: one that must show there also lists `record_page`. @@ -57,8 +70,12 @@ import { ObjectSchema } from '@objectstack/spec/data'; export const Quote = ObjectSchema.create({ name: 'quote', sharingModel: 'private', - fields: { name: { type: 'text' }, amount: { type: 'currency' } }, - fieldGroups: [{ key: 'basic', label: 'Basic', fields: ['amount', 'name'] }], + fields: { name: { type: 'text' }, amount: { type: 'currency' }, terms: { type: 'textarea' } }, + fieldGroups: [ + { key: 'basic', label: 'Basic', fields: ['amount', 'name'] }, + { key: 'terms', label: 'Terms', fields: ['terms'] }, + ], + pinOverview: false, fieldTabs: [{ key: 'terms', groups: ['terms'] }], // each only when asked relatedLists: [{ list: 'quote_line', label: 'Lines', columns: ['product'] }, 'sys_activity'], }); ```