diff --git a/.changeset/35902-skills-related-lists-tabs.md b/.changeset/35902-skills-related-lists-tabs.md new file mode 100644 index 00000000000..1ad9056b55f --- /dev/null +++ b/.changeset/35902-skills-related-lists-tabs.md @@ -0,0 +1,14 @@ +--- +'@objectstack/skills': patch +--- + +Clause-②: no +Metadata-protocol: none + +The record-page skills teach the parent-declared record page: + +- `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. +- 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. +- 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. +- `objectstack-data` field-groups example lists each group's members in `fields`; `objectstack-ui` navigation names `fieldGroups` alone. +- Evals: the tasks-first case now writes the full tab list; new cases remove the attachments tab, place a Tax ID field after Industry in its group's list, and put a quote's line items above its amount section. diff --git a/content/docs/ui/pages.mdx b/content/docs/ui/pages.mdx index e22bca62dac..1a9c17e76ab 100644 --- a/content/docs/ui/pages.mdx +++ b/content/docs/ui/pages.mdx @@ -182,9 +182,13 @@ replacement. A record page needs no authoring. With no page assigned, the Console synthesizes one from the object: a header, the record's **details** (the **Details** tab), and one tab per related list, then **Attachments** for an object with `enable: { files: true }`, **Approvals** when the -record has approval requests, and **动态** (Activity) last, each with its count. A relationship -whose child field declares `relatedList: 'primary'` is part of the record's body: its list is a -full-width table in the details, after the first field section, with no tab of its own. **动态** +record has approval requests, and **动态** (Activity) last, each with its count. Every related +list is a tab by default, a `master_detail` child's too. The header carries the title +(`nameField`) and, for an object with a `stageField`, a status tag whose menu moves the stage; +the page draws no stage bar and no key-field strip (`highlightFields` feed hover cards, pickers +and related-list columns). A relationship whose child field declares `relatedList: 'primary'` +is part of the record's body: its list is a full-width table in the details, after the field +sections drawn open, with no tab of its own. **动态** (`?related=timeline`) holds the record's system entries: its activity and, with `enable: { trackHistory: true }`, its field changes; there is no separate History tab. On the desktop the record's comments are not in it but in the comment panel, opened from the @@ -194,9 +198,69 @@ whole table (`?related=.`). The tab row shows as many tabs as its rest into a **+N** menu; the open tab is always on the row. The related tabs are the reader's to arrange: move one before or after its neighbour, hide one, and bring hidden ones back. The arrangement is kept per user and object, never in the object's declaration. -Moving a child table into the record's body is therefore a one-word change on the -relationship field, not a page-authoring task, and `relatedList: false` leaves a child off the -page. +Moving a child table into the record's body is therefore a declaration on the parent (a field +group naming the list, below), not a page-authoring task, and `relatedList: false` leaves a +child off the page. + +### Declaring the tabs and the field groups + +The parent object declares its record page's tabs and sections in one place. Without these +keys nothing changes. + +- **`relatedLists` is the tab list.** Declared, only the related lists it names show, in its + order; leaving one out hides its tab. The three built-in tabs are named by object: + `sys_attachment` (attachments: shown only when listed, and only with files enabled), + `sys_approval_request` (approvals: when unlisted, after the listed tabs) and `sys_activity` + (the activity stream: when unlisted, last). An entry `{ list, label, columns }` gives one list + its own title and child-field columns, winning over the child field's `relatedListTitle` / + `relatedListColumns`; a built-in is written only as its bare name. To put one tab first, list + every tab the page keeps with that one first. A child list another package adds is hidden by a + `relatedLists` that does not name it (letting a package place its own list is a later change), + and `relatedList: false` on the child's reference field still hides a list. +- **A field group lists its fields.** `fieldGroups` are the Details sections, in array order. + A group lists its members, in order, in `fields`; without `fields`, its members are the fields + whose `group` names it, the older spelling, still read. +- **A group can place a child table among the fields.** A group that names a child list + (`relatedList: 'quote_line'`, with no `fields`) draws that list's table at its position in the + details, and the record's create and edit forms enter the child rows with the record. The + list keeps its tab as well unless a declared `relatedLists` leaves it out. Write such a group + only where the table belongs among the fields; without one the list is only a tab. + +{/* os:check */} +```typescript +import { ObjectSchema, Field } from '@objectstack/spec/data'; + +export const Quote = ObjectSchema.create({ + name: 'quote', + label: 'Quote', + sharingModel: 'private', + fields: { + name: Field.text({ label: 'Quote Name', required: true }), + account: Field.lookup('account', { label: 'Account' }), + valid_until: Field.date({ label: 'Valid Until' }), + discount: Field.percent({ label: 'Discount' }), + total: Field.currency({ label: 'Total' }), + terms: Field.textarea({ label: 'Terms' }), + }, + fieldGroups: [ + { key: 'basic', label: 'Basic Information', fields: ['name', 'account', 'valid_until'] }, + // Only where the line items belong among the fields; without it they are a tab. + { key: 'lines', label: 'Line Items', relatedList: 'quote_line' }, + { key: 'amount', label: 'Amount', fields: ['discount', 'total'] }, + { key: 'terms', label: 'Terms', fields: ['terms'] }, + ], + relatedLists: [ + // Named here as well, so the line items also keep a tab, with these columns. + { list: 'quote_line', label: 'Line Items', columns: ['product', 'quantity', 'unit_price', 'amount'] }, + 'task', + 'sys_attachment', + 'sys_approval_request', + 'sys_activity', + ], +}); +``` + +### How the page is laid out The Console lays the page out by the width of the surface it occupies, never by the viewport. On a full page wide enough for a 320 px details column beside 400 px of tabs, the details are diff --git a/skills/objectstack-data/references/examples-objects.md b/skills/objectstack-data/references/examples-objects.md index 635bc70d5dc..8649176f6a9 100644 --- a/skills/objectstack-data/references/examples-objects.md +++ b/skills/objectstack-data/references/examples-objects.md @@ -3,9 +3,9 @@ ## Field Groups (MVP) - Declare groups on `ObjectSchema.fieldGroups` — **array order is the display order**. -- Assign each field to a group via `Field.group`, which references an - `ObjectFieldGroup.key`. In-group display order equals the traversal order - of `fields`. +- A group lists its members, in display order, in its own `fields`. Absent, + its members are the fields whose `group` names its `key` (older, still read). + A field listed by two groups, or listed while its `group` names another, is refused. - Group keys must be `snake_case`. - Optional per-group: `icon`, `description`, and `collapse` (`'none'` always open · `'expanded'` collapsible, starts open · @@ -31,19 +31,19 @@ export default ObjectSchema.create({ sharingModel: 'private', fieldGroups: [ - { key: 'contact_info', label: 'Contact Information', icon: 'user' }, - { key: 'billing', label: 'Billing', collapse: 'collapsed' }, - { key: 'system', label: 'System' }, + { key: 'contact_info', label: 'Contact Information', icon: 'user', fields: ['name', 'email', 'phone'] }, + { key: 'billing', label: 'Billing', collapse: 'collapsed', fields: ['vat_id', 'billing_address'] }, + { key: 'system', label: 'System', fields: ['created_at', 'created_by'] }, ], fields: { - name: { type: 'text', required: true, group: 'contact_info' }, - email: { type: 'email', group: 'contact_info' }, - phone: { type: 'phone', group: 'contact_info' }, - vat_id: { type: 'text', group: 'billing' }, - billing_address: { type: 'address', group: 'billing' }, - created_at: { type: 'datetime', readonly: true, group: 'system' }, - created_by: { type: 'user', readonly: true, group: 'system' }, + name: { type: 'text', required: true }, + email: { type: 'email' }, + phone: { type: 'phone' }, + vat_id: { type: 'text' }, + billing_address: { type: 'address' }, + created_at: { type: 'datetime', readonly: true }, + created_by: { type: 'user', readonly: true }, }, }); ``` diff --git a/skills/objectstack-data/rules/relationships.md b/skills/objectstack-data/rules/relationships.md index 3109d864bb7..278f66375fe 100644 --- a/skills/objectstack-data/rules/relationships.md +++ b/skills/objectstack-data/rules/relationships.md @@ -345,37 +345,34 @@ InvoiceLine = { ### Detail-page related lists (the read-side mirror) You usually don't declare the **related list** on the parent's record detail page: every child relationship -is shown **by default** — a `master_detail` child as a body table, a `lookup` -child as a panel. `inlineEdit` plays no part: it governs entry in the parent's -form only. The relationship flags *refine* that: +is shown **by default** as a tab with its count, a `master_detail` child too. The +relationship flags *refine* that: ```typescript project: { type: 'master_detail', - reference: 'project', // no relatedList: a body table + reference: 'project', relatedListTitle: 'Tasks', relatedListColumns: ['title', 'status', 'priority', 'due_date'], }, - -// Suppress a noisy association from the detail page entirely: audit_ref: { type: 'master_detail', reference: 'invoice', relatedList: false }, ``` -`relatedList` is tri-state — placement: - -- `'primary'` — a full-width table in the record's detail body. Default for a `master_detail` FK. -- `false` — the child object is not shown on the parent record page. -- `true` — an auxiliary panel on the record page. Default for a `lookup` FK. -- Order is the parent's: `relatedLists: ['task', 'event.related_to']` (child, or - `object.field`) lists those first. A child in the stack with no inbound FK is - refused everywhere; one that exists nowhere is refused by `os validate` / - `os build` (which leave a `sys_` / `cloud_` / `ai_` or sibling-artifact name - to the runtime) and by a metadata write naming no package — a write into a - package stores it, and the page places nothing. - -`relatedListTitle` / `relatedListColumns` override the derived title / columns; -otherwise columns auto-derive from the child object's -`highlightFields`. Audit FKs +- `relatedList: false` — the child object is not shown on the parent record page. +- `'primary'` — a full-width table in the record's details, with no tab. A parent field + group naming a `master_detail` child (`relatedList: 'quote_line'`, written only when asked) + places its table there too; its tab stays unless a declared `relatedLists` omits it. +- The parent's `relatedLists` is the tab list (objectstack-ui Record Page): absent, + nothing changes; declared, only the named lists show, in order, built-ins by name + (`sys_attachment`, `sys_approval_request`, `sys_activity`). An entry is the child, + `object.field` or `{ list, label, columns }`. A child in the stack with no inbound FK + is refused everywhere; one that exists nowhere is refused by `os validate` / + `os build` (bar a platform or sibling-artifact name) and by a metadata + write naming no package (one into a package is stored, placing nothing). + +`relatedListTitle` / `relatedListColumns` override the derived title / columns +(an entry's `label` / `columns` win); otherwise columns auto-derive from +the child object's `highlightFields`. Audit FKs (`created_by`/`updated_by`/`owner_id`) never become related lists. A child that references the parent through several FKs (e.g. `primary_account` + `partner_account`) yields **one related list per FK**; a self-referential FK diff --git a/skills/objectstack-ui/evals/README.md b/skills/objectstack-ui/evals/README.md index 3bfea55d099..b371fc98caa 100644 --- a/skills/objectstack-ui/evals/README.md +++ b/skills/objectstack-ui/evals/README.md @@ -11,11 +11,14 @@ view / page / dashboard / report metadata. in-page `` needs no dataset at all, and a dataset authored for a Chinese brief, whose members carry Chinese `synonyms` and a one-sentence `description`. -- `record-page.json` — the record page as the object declares it: a child - body table ordered first by `relatedLists` (no page file), - `navigation: { mode: 'page' }` on the list view with the reader's own - open choice left out of metadata, and `placedActions: true` on a full - page's `page:header` so packaged header actions draw without an id list. +- `record-page.json` — the record page as the object declares it: a tab + put first, and the attachments tab removed, by the parent's `relatedLists` + naming every tab it keeps (no page file); a field placed in its group's + own `fields`; a child table placed between field sections by a group's + `relatedList`; `navigation: { mode: 'page' }` on the list view with the + reader's own open choice left out of metadata; and `placedActions: true` + on a full page's `page:header` so packaged header actions draw without an + id list. - `report-period-export.json` — a non-`joined` report's `dateRange` (one `type: 'date'` dataset dimension) and `exportOptions` (csv / xlsx under the base object's `allowExport` permission). diff --git a/skills/objectstack-ui/evals/record-page.json b/skills/objectstack-ui/evals/record-page.json index 4f7e8e98374..174eaa750db 100644 --- a/skills/objectstack-ui/evals/record-page.json +++ b/skills/objectstack-ui/evals/record-page.json @@ -3,19 +3,22 @@ "evals": [ { "id": 1, - "prompt": "On the lead record page, put the tasks first: our reps want the open tasks table before anything else when they open a lead. The `task` object already has a `lead` master_detail field.", - "expected_output": "No page file and no placement flag: `task.lead` is a `master_detail` with no `relatedList`, so it is already a full-width body table, drawn after the lead's open field sections. `relatedListFilter: { status: { $ne: 'done' } }` on `task.lead` keeps it to open tasks, and the lead's `relatedLists: ['task', ...]` puts it first among the tables, directly under those field sections. Not `inlineEdit` (form entry, not the page), not a `definePage` with `kind: 'full'`, and never a `slots.tabs`.", + "prompt": "On the lead record page, put the Tasks tab first: our reps want the open tasks before anything else when they open a lead. The `task` object already has a `lead` master_detail field, `event` has a `lead` lookup, and leads keep their attachments.", + "expected_output": "No page file. The lead's `relatedLists` is its record page's tab list, so it names every tab the page keeps, Tasks first: `relatedLists: ['task', 'event', 'sys_attachment', 'sys_approval_request', 'sys_activity']`. Once declared, only the named lists show: listing the task alone would take the Events and Attachments tabs away. `relatedListFilter: { status: { $ne: 'done' } }` on `task.lead` keeps the tab to open tasks. Not a field group naming the task list (that moves the table into the Details, which was not asked), not `inlineEdit`, not a `kind: 'full'` page, and no tabs slot.", "files": [], "assertions": { "must_contain": [ - "relatedListFilter", - "relatedLists" + "relatedLists", + "'sys_attachment'", + "relatedListFilter" ], "must_not_contain": [ + "relatedLists: ['task'],", + "relatedLists: ['task'] }", + "relatedList: 'task'", "inlineEdit:", "definePage(", - "slots: { tabs", - "kind: 'full'," + "slots: { tabs" ] } }, @@ -52,6 +55,63 @@ "actions: ['" ] } + }, + { + "id": 4, + "prompt": "Nobody attaches files to opportunities. Remove the Attachments tab from the opportunity record page, and keep every other tab as it is. Today the page shows Quotes (`quote.opportunity`), Contact roles (`opportunity_contact_role.opportunity`), Attachments, Approvals and Activity.", + "expected_output": "Declare the tab list on `opportunity` and leave the attachments built-in out: `relatedLists: ['quote', 'opportunity_contact_role', 'sys_approval_request', 'sys_activity']`. A declared list shows only the lists it names, and the attachments tab shows only when named, so it goes and the rest stay in their order. The files capability (`enable.files`) can stay. No page file, and not `relatedList: false` on a child's reference field (that hides a related list, not the attachments tab).", + "files": [], + "assertions": { + "must_contain": [ + "relatedLists", + "'quote'", + "'sys_activity'" + ], + "must_not_contain": [ + "'sys_attachment',", + "'sys_attachment']", + "definePage(", + "kind: 'full'" + ] + } + }, + { + "id": 5, + "prompt": "Add a Tax ID field to the account, and show it right after Industry on the record page. The account declares `fieldGroups: [{ key: 'basic', label: 'Basic', fields: ['name', 'industry', 'website'] }]`.", + "expected_output": "A `tax_id` text field on `account`, and the `basic` group's own list names it after Industry: `fields: ['name', 'industry', 'tax_id', 'website']`. The group's `fields` decides the order inside the section, so the field's position among the object's `fields` does not matter, and the field carries no `group` key of its own (one naming another group than the list that names it is refused). No page file and no form sections.", + "files": [], + "assertions": { + "must_contain": [ + "tax_id", + "'industry', 'tax_id'" + ], + "must_not_contain": [ + "group: 'basic',", + "group: 'basic' }", + "definePage(", + "sections:" + ] + } + }, + { + "id": 6, + "prompt": "On the quote record page, show the line items table above the Amount section instead of as a tab. The quote declares `fieldGroups: [{ key: 'basic', label: 'Basic', fields: ['name', 'account'] }, { key: 'amount', label: 'Amount', fields: ['subtotal', 'total'] }]` and no `relatedLists`; `quote_line` has a `quote` master_detail field, and the page's tabs today are Line items, Tasks (`task.quote`), Attachments, Approvals and Activity.", + "expected_output": "Two declarations on `quote`. A field group that names the child list, placed between the two sections: `fieldGroups: [{ key: 'basic', ... }, { key: 'lines', label: 'Line items', relatedList: 'quote_line' }, { key: 'amount', ... }]`; such a group carries no `fields`, and the line table is then drawn at that position in the Details, with the quote's create and edit forms inlining the lines. And a tab list that leaves the lines out, because a group-placed table keeps its tab while the parent declares no `relatedLists`: `relatedLists: ['task', 'sys_attachment', 'sys_approval_request', 'sys_activity']`. The master_detail field needs no `relatedList` value. No page file and no full page.", + "files": [], + "assertions": { + "must_contain": [ + "relatedList: 'quote_line'", + "fieldGroups", + "relatedLists: ['task'" + ], + "must_not_contain": [ + "relatedList: 'primary',", + "relatedList: 'primary' }", + "definePage(", + "kind: 'full'", + "relatedLists: ['quote_line'" + ] + } } ] } diff --git a/skills/objectstack-ui/rules/navigation.md b/skills/objectstack-ui/rules/navigation.md index c9f8c814a77..d5bcf7257c5 100644 --- a/skills/objectstack-ui/rules/navigation.md +++ b/skills/objectstack-ui/rules/navigation.md @@ -178,9 +178,9 @@ at runtime from the client viewport, because an author in a modal). - **Column count.** Not authored. The form grid follows its **real rendered width** via container queries — the same form is 1 column in a narrow drawer and up to 4 - on a wide page. Author *grouping* with `fieldGroups` + `Field.group`. + on a wide page. Author *grouping* with `fieldGroups`. - **`sections` are the escape hatch — reach for them last.** The ladder, in - order: (1) **derive** — declare `fieldGroups` + `Field.group` and author no + order: (1) **derive** — declare `fieldGroups` and author no `sections` at all; (2) **reference** — when one surface needs a local arrangement, a section may name a declared group, `{ group: 'contact_info' }`, and inherits its members, label and presentation (restating a key the group diff --git a/skills/objectstack-ui/rules/record-page.md b/skills/objectstack-ui/rules/record-page.md index 16cc7b21475..ff2afcb3485 100644 --- a/skills/objectstack-ui/rules/record-page.md +++ b/skills/objectstack-ui/rules/record-page.md @@ -4,63 +4,61 @@ Read in order — each step is the remedy for the one before it; author `*.page. **1 · The object's declarations produce the page.** With no page assigned, the Console synthesizes the record page from the object alone: `nameField` is the -title, `highlightFields` the strip under it, `stageField` the stage path (each -option declares `kind: 'open' | 'won' | 'lost'`; `false` suppresses it), -`fieldGroups` + `Field.group` the detail sections, `relatedLists` the business -order of the related lists, `editMode` (`'modal'` | `'page'`) how Edit opens. -Layout follows the width of the surface the page occupies, never a key (the -object's `detail` block and `relatedLayout` are removed, ADR-0085): two columns -from 760 px (details | Activity and the related panels), three-column sections -from 1120 px, one column below; a tab row under the header (Overview, Activity, -one tab per panel with its count) enlarges a panel at `?related=object.field`. +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 +pins the details left of the tabs, unless they hold a child table or no other +tab exists; else one column, Details first. -**2 · Relationship flags shape the related column.** On the CHILD object's -reference field: `relatedList: 'primary'` draws the child as a full-width body -table in the details after the open field sections (the default for a -`master_detail`); `true` (a `lookup`'s default) is a panel in the right -column; `false` leaves the child off the page. `relatedListTitle` / -`relatedListColumns` (child field names) replace the derived title / columns; -`relatedListFilter` (Query-DSL) is AND-composed -with the parent condition, and the panel's count honours it. Rows follow the -child's default list view `sort` (`isDefault`, else the first declared); the -parent's `relatedLists` orders tables and panels alike. "Put the tasks first on -the lead page" is `relatedLists: ['task']` on `lead` — no page file. +**2 · The parent's `relatedLists` is the tab list.** Without it nothing changes: +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 +first" lists every tab to keep, `'task'` first; leaving out `'sys_attachment'` +drops attachments. `{ list, label, columns }` (child field names) titles one list; +a built-in is a bare name. A child list another package adds is hidden by a +`relatedLists` that does not name it (no package places its own list yet). On the +CHILD's reference field `relatedList: false` hides the list and +`relatedListFilter` (Query-DSL) is AND-composed with the parent condition; +rows follow the child's default list view `sort`. Only when asked for a child +table among the fields, a parent group `{ key, label, relatedList: 'quote_line' }` +(no `fields`) places it there; its tab stays unless a declared `relatedLists` omits it. **3 · A slotted page overrides one slot.** `kind: 'slotted'` replaces only the slots it names — `header`, `actions`, `alerts`, `highlights`, `details`, -`discussion` — each whole; the synthesizer fills the rest. There +`discussion` — each whole. There is 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 record page -that looks nothing like the default — a filtered split (Open vs Closed), a chart tab, a -bespoke strip — is `kind: 'full'`: `regions` drawn as authored ([Pages](./pages.md)). +that looks nothing like the default — a chart tab, a bespoke strip — is `kind: 'full'`: `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_more`. **5 · The drawer, unless the object declares `page`.** A clicked row opens the record in the drawer (always the standard page), which expands to the full page; -`navigation: { mode: 'page' }` on the object's list view opens it as the full page -(`new_window`, `none` are the other members). `modal` / `split` / `popover` were -removed in @objectstack/spec 18.3.0 (ADR-0087 D2) and are refused with their fix. -Field count never decides; a phone always pages. +`navigation: { mode: 'page' }` on the object's list view opens it as the full page; +`modal` / `split` / `popover` are refused with their fix. A phone always pages. **6 · The reader's own choices are not metadata.** ⛔ Never author these: the -Display menu's **Open records** (drawer or full page, for a drawer-mode object), the -⊟ right-column switch (per object), the related panels' order and hidden set (per -user × object), the drawer's dragged width and ⤢. On `navigation` only the `size` -bucket (`sm`…`full`) nudges the drawer's starting width (`width` / `drawerWidth` -deprecated). +Display menu's **Open records**, the +tabs' order and hidden set (per user × object), the details column's dragged width, +the drawer's dragged width and ⤢. On `navigation` only the `size` +bucket (`sm`…`full`) nudges the drawer's starting width. ```typescript -import { Field, ObjectSchema } from '@objectstack/spec/data'; +import { ObjectSchema } from '@objectstack/spec/data'; -export const Task = ObjectSchema.create({ - name: 'task', sharingModel: 'controlled_by_parent', - fields: { - lead: Field.masterDetail('lead', { relatedListFilter: { status: { $ne: 'done' } } }), // a body table - }, +export const Quote = ObjectSchema.create({ + name: 'quote', sharingModel: 'private', + fields: { name: { type: 'text' }, amount: { type: 'currency' } }, + fieldGroups: [{ key: 'basic', label: 'Basic', fields: ['amount', 'name'] }], + relatedLists: [{ list: 'quote_line', label: 'Lines', columns: ['product'] }, 'sys_activity'], }); ```