diff --git a/skills/objectstack-ui/SKILL.md b/skills/objectstack-ui/SKILL.md index 3d9f5919f80..b4ae49a4942 100644 --- a/skills/objectstack-ui/SKILL.md +++ b/skills/objectstack-ui/SKILL.md @@ -74,16 +74,14 @@ custom page or form config. Prefer, in order: relationship didn't mark inline: ```typescript - formViews: { - default: { - type: 'simple', - sections: [{ group: 'invoice_header' }], // a declared fieldGroup - subforms: [ - { childObject: 'invoice_line', // relationshipField + columns are - title: 'Line Items', // derived from the child object; - addLabel: 'Add line' }, // set `columns` here only to override. - ], - }, + form: { + type: 'simple', + sections: [{ group: 'invoice_header' }], // a declared fieldGroup + subforms: [ + { childObject: 'invoice_line', // relationshipField + columns are + title: 'Line Items', // derived from the child object; + addLabel: 'Add line' }, // set `columns` here only to override. + ], }, ``` diff --git a/skills/objectstack-ui/evals/views-apps-actions-pages.json b/skills/objectstack-ui/evals/views-apps-actions-pages.json index 07a9e93c508..6ca5afc65e2 100644 --- a/skills/objectstack-ui/evals/views-apps-actions-pages.json +++ b/skills/objectstack-ui/evals/views-apps-actions-pages.json @@ -4,7 +4,7 @@ { "id": 1, "prompt": "Create `src/views/support-case.view.ts`: a default grid (subject linking to the record, status, priority, owner, due date), a 'My Open Cases' list, a kanban by status, and a simple edit form.", - "expected_output": "One `defineView({ list, listViews, formViews })` container — never a bare flat view object. `data: { provider: 'object', object: 'support_case' }`, `columns` with `link: true` on `subject`, a `listViews.my_open` entry with `filter` triples (`{ field: 'assigned_to', operator: 'equals', value: '{current_user_id}' }`), a kanban entry with the required top-level `columns` plus `kanban: { groupByField: 'status' }` (no top-level `groupBy`), and `formViews.edit` with `type: 'simple'` and `sections` referencing a declared field group.", + "expected_output": "One `defineView({ list, form, listViews })` container — never a bare flat view object. `data: { provider: 'object', object: 'support_case' }`, `columns` with `link: true` on `subject`, a `listViews.my_open` entry with `filter` triples (`{ field: 'assigned_to', operator: 'equals', value: '{current_user_id}' }`), a kanban entry with the required top-level `columns` plus `kanban: { groupByField: 'status' }` (no top-level `groupBy`), and `form` with `type: 'simple'` and `sections` referencing a declared field group.", "files": [], "assertions": { "must_contain": ["defineView", "provider: 'object'", "listViews", "groupByField", "link: true", "{current_user_id}"], diff --git a/skills/objectstack-ui/rules/list-views.md b/skills/objectstack-ui/rules/list-views.md index 542c0a04a03..ac05460fcd5 100644 --- a/skills/objectstack-ui/rules/list-views.md +++ b/skills/objectstack-ui/rules/list-views.md @@ -11,8 +11,8 @@ ### The `defineView` container (`*.view.ts` file shape) Views ship **inside a `defineView` container** — one per object, aggregating -the default `list`, named `listViews`, and `formViews`. The loader expands it -into `.` view items that power the view switcher. +the default `list` and `form`, named `listViews`, and `formViews`. The loader +expands it into `.` view items that power the view switcher. ```typescript @@ -22,20 +22,18 @@ const data = { provider: 'object' as const, object: 'support_case' }; export const CaseViews = defineView({ list: { label: 'All Cases', type: 'grid', data, columns: ['subject', 'status'] }, + form: { type: 'simple', data, sections: [{ group: 'case_detail' }] }, listViews: { open: { label: 'Open', type: 'grid', data, columns: ['subject', 'status'], filter: [{ field: 'status', operator: 'equals', value: 'open' }] }, }, - formViews: { - edit: { type: 'simple', data, sections: [{ group: 'case_detail' }] }, - }, }); ``` > **Never export a bare flat view object** (`{ name, label, type, columns }` > at top level). It is not a valid view container — nothing registers and no -> view appears in the switcher. Every view lives under `list` / `listViews` / -> `formViews`, exactly as in the `defineView` example above. +> view appears in the switcher. Every view lives under `list` / `form` / +> `listViews` / `formViews`, exactly as in the `defineView` example above. ### Data Source (`data`)