Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions content/docs/protocol/objectui/layout-dsl.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,20 @@ Top-level layout structures that define macro organization.

A page is identified by `name` + `label`, and its content lives in `regions`,
each holding typed `components`. There is no `context:` key — the binding is
`object` plus `type` (`record` here).
`object` plus `type` (`record` here). `page:header`'s `actions` are the **ids**
of actions declared on that object — there is no built-in id registry, so
`edit` / `delete` / `share` resolve nowhere (the host draws its own Edit /
Delete chrome). Declare the action, placed at `record_header`, then name it:

{/* os:check-yaml action */}
```yaml
name: send_statement
label: Send Statement
objectName: account
type: flow
target: account_statement
locations: [record_header]
```

{/* os:check-yaml page */}
```yaml
Expand All @@ -93,7 +106,7 @@ regions:
- type: page:header
properties:
title: Customer Details
actions: [edit, delete, share]
actions: [send_statement]
- name: main
components:
- type: record:details
Expand Down Expand Up @@ -994,7 +1007,7 @@ regions:
- type: page:header
properties:
title: Customer
actions: [edit, delete, share]
# `actions:` takes ids declared on `customer` — see Standard Template

- name: main
components:
Expand Down
2 changes: 1 addition & 1 deletion skills/objectstack-ui/evals/views-apps-actions-pages.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
{
"id": 4,
"prompt": "Design a custom lead record page: the Convert action inline in the header, a highlights strip, a stage path over `status`, and the related contacts. Also write a user guide for the `crm` package under src/docs and link it from the nav.",
"expected_output": "`definePage({ name, label, type: 'record', object: 'lead', template: 'three-column', regions: [...] })` with `page:header` (the Action object passed in `properties.actions`, no sibling action node), `record:highlights`, `record:path` (`statusField`, `stages`), `record:related_list`. The guide is a flat, namespace-prefixed `src/docs/crm_user_guide.md` in pure Markdown (MDX and image references are rejected at build), surfaced by a `type: 'url'` nav item pointing at `/docs/crm_user_guide`.",
"expected_output": "`definePage({ name, label, type: 'record', object: 'lead', template: 'three-column', regions: [...] })` with `page:header` (the declared action's id in `properties.actions`, no sibling action node), `record:highlights`, `record:path` (`statusField`, `stages`), `record:related_list`. The guide is a flat, namespace-prefixed `src/docs/crm_user_guide.md` in pure Markdown (MDX and image references are rejected at build), surfaced by a `type: 'url'` nav item pointing at `/docs/crm_user_guide`.",
"files": [],
"assertions": {
"must_contain": ["definePage", "type: 'record'", "regions", "page:header", "record:path", "src/docs/", "/docs/"],
Expand Down
10 changes: 5 additions & 5 deletions skills/objectstack-ui/rules/pages.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ which contain components.

| `type` | Use |
|:---------------------|:----|
| `page:header` | Title + subtitle + breadcrumb + inline `actions: Action[]` |
| `page:header` | Title + subtitle + breadcrumb + `actions: string[]` (action ids) |
| `page:card` | Bordered/un-bordered card with `children: Component[]` (plus an optional `footer: Component[]` slot) |
| `flex` | Generic styleable box (`properties.children`) — the workhorse for custom layout; style via `responsiveStyles` (see Styling below) |
| `element:text` | Text node — `properties.content`; style via `responsiveStyles` |
Expand Down Expand Up @@ -87,7 +87,7 @@ export const LeadDetailPage = definePage({
title: '{first_name} {last_name}',
subtitle: '{company}',
breadcrumb: true,
actions: [ConvertLeadAction], // inline action buttons in header
actions: ['convert_lead'], // ids of `lead`'s actions
},
},
{
Expand Down Expand Up @@ -121,9 +121,9 @@ export const LeadDetailPage = definePage({
> [Date Macros](../SKILL.md#date-macros--filter-placeholders) reference below — the
> full token list is published as `DATE_MACRO_TOKENS` in `@objectstack/spec/data`.

> **Actions in header** — pass full `Action` objects into
> `page:header.properties.actions`; do **not** create a sibling action node.
> The header renders them inline in the action slot.
> **Actions in header** — `properties.actions` takes the **ids** of actions
> declared on the bound object (`'convert_lead'`; no built-in id registry);
> do **not** create a sibling action node.

### AI-authored *source* pages — `kind:'html'` and `kind:'react'` (ADR-0080/0081)

Expand Down
Loading