diff --git a/.changeset/36495-action-locations-acted-on.md b/.changeset/36495-action-locations-acted-on.md new file mode 100644 index 00000000000..f767b54dfbe --- /dev/null +++ b/.changeset/36495-action-locations-acted-on.md @@ -0,0 +1,62 @@ +--- +'@objectstack/spec': major +'@object-ui/types': major +'@objectstack/lint': minor +'@objectstack/runtime': minor +'@objectstack/platform-objects': minor +'@object-ui/core': minor +'@object-ui/components': minor +'@object-ui/plugin-detail': minor +'@object-ui/app-shell': minor +'@object-ui/i18n': minor +'@objectstack/cli': patch +'@objectstack/cloud-connection': patch +'@objectstack/objectql': patch +'@objectstack/metadata-protocol': patch +'@objectstack/plugin-approvals': patch +'@objectstack/scenarios': patch +'@objectstack/service-datasource': patch +'@objectstack/service-messaging': patch +'@objectstack/verify': patch +'@object-ui/console': patch +'@object-ui/fields': patch +'@object-ui/layout': patch +'@object-ui/plugin-grid': patch +'@object-ui/plugin-list': patch +'@object-ui/react': patch +--- + +feat(spec)!: an action's `locations` say what it acts on, not the part of the page it sits in + +**BREAKING** (19.0.0): `ACTION_LOCATIONS` is `list`, `record`, `record_page`, `record_row`, `record_related`, `record_section`. The four words that named a part of a page are retired: `list_toolbar`, `list_item`, `record_header` and `record_more`. `record` is new: the action acts on one record, so it is drawn on the record page's header and in each list row's menu. Which actions are buttons and in what order stays the object's `actionLayout`. + +Clause-②: yes (narrowing) +Metadata-protocol: narrowed +Skills-docs: follow-up #37895 + + + +A replacement with a registered conversion, so `yes (narrowing)` as on main's precedents (`.changeset/pre/37086-define-metadata-form-rename.md`, `.changeset/pre/37304-knowledge-source-governed-type.md`). Narrowed: the four retired words are refused wherever a location is read. Widened in the same change: the four newly accepted values `list`, `record`, `record_page` and `record_row` at the same positions; the new `@object-ui/types` export `actionFoldedIntoMenu`; and eight new `@object-ui/i18n` Studio keys for the location labels (en, zh), which replace the eight keys of the retired words. + +FROM → TO (each action is drawn in exactly the places it was drawn before): + +- `locations: ['list_toolbar']` → `locations: ['list']`. +- `locations: ['list_item']` → `locations: ['record_row']`. +- `locations: ['record_header']` or `['record_more']` → `locations: ['record_page']`. +- `record_header` or `record_more` beside `list_item` → `locations: ['record']`. +- `locations: ['record_more']` without `record_header` (the action lived only in the record header's ⋯ menu) → `locations: ['record_page'], component: 'action:menu'`. The fold is the action's `component`, the key that already sends an action into an action bar's overflow menu. +- A component's single `location` (`record:quick_actions`, `action:group`, `action:bar`): `list_toolbar` → `list`, `list_item` → `record_row`, `record_header` → `record_page`. + +An old word is refused at authoring with the word to write instead. `os migrate meta --from 18 --write` rewrites sources (ADR-0087 conversion `action-locations-acted-on`, retired from the load path from day one, as every protocol-19 entry). Stored items (`applyConversionsToStoredItem`, `os migrate meta --stored`) and built artifacts replay the same conversion. It leaves a TODO, and changes nothing, where no lossless rewrite exists: a `record_more`-only action also on `list_toolbar` that does not already carry `component: 'action:menu'` (the list toolbar folds `action:menu` too); an action at `record_header` with an authored `component: 'action:menu'` (the record page header folded it into its ⋯ menu while a `record:quick_actions` bar at `record_header` drew it as a button, and `record_page` has one state for both); a component whose `location` is `record_more`; and an `action:group` at `record_header` with a `record_more`-only member. A site left as stored keeps its old word, which a protocol-19 runtime matches to no surface: that action or block is drawn nowhere until it is rewritten by hand. The protocol-19 upgrade guide carries the same step as the semantic entry `action-locations-page-parts-retired`. + +Also in this change: + +- `@object-ui/types`: `actionRendersAt` reads `record` as covering `record_page` and `record_row`. The new `actionFoldedIntoMenu(action)` answers whether an action is folded into the ⋯ (`component: 'action:menu'`). `arrangedHeaderActions` pins and unpins through `component` and no longer writes locations. +- `@object-ui/components`: the record `page:header` routes every folded action to its ⋯ menu, and every other `record_page` action takes the inline budget, as `record_header` actions did. +- `@object-ui/plugin-detail`: `record:quick_actions` defaults to `record_page` and leaves folded actions out at that location, as it left out `record_more`-only ones. The related list reads `record` as a row action. +- `@object-ui/core`, `@objectstack/runtime`: the record-scoped checks (`isRecordScopedAction`, `requiresRecord`) accept `record`. +- `@objectstack/lint`: the record-page header, related-list and action-layout rules read the new words. +- Studio: the action inspector, the `record:quick_actions` location dropdown and the action preview offer `record` and draw the fold as "record_page · ⋯". +- `@objectstack/platform-objects`, the examples and every other package: declarations and prose rewritten to the new words. The packages listed as `patch` change comments, test fixtures or authoring copy, except three that ship rewritten words: `@objectstack/plugin-approvals` and `@objectstack/service-datasource` (their declared actions' `locations`) and `@object-ui/layout` (a location literal it passes at runtime). + +Not moved: #37895 (the `skills/**` teaching of the new words; Blocked-by this change). diff --git a/content/docs/getting-started/build-with-claude-code.mdx b/content/docs/getting-started/build-with-claude-code.mdx index e6e21789448..727a45327eb 100644 --- a/content/docs/getting-started/build-with-claude-code.mdx +++ b/content/docs/getting-started/build-with-claude-code.mdx @@ -175,7 +175,7 @@ export const ResolveTicketAction = defineAction({ // to write or register; the platform performs the update. operation: 'update', patch: { status: 'resolved' }, - locations: ['record_header', 'list_item'], + locations: ['record'], // Only offer "Resolve" on tickets that aren't already resolved or closed. // Predicates are CEL, record-scoped — `record.status`, never bare `status`. // `has()` guards the sparse list row; the rule and its guard table live in diff --git a/content/docs/protocol/objectui/actions.mdx b/content/docs/protocol/objectui/actions.mdx index a0d2b05524a..bcbe09f45a3 100644 --- a/content/docs/protocol/objectui/actions.mdx +++ b/content/docs/protocol/objectui/actions.mdx @@ -162,7 +162,7 @@ refreshAfter: true **Request body shaping:** - `bodyShape` — `'flat'` (default) sends collected params at the top level; `{ wrap: 'data' }` nests user params under that key. - `bodyExtra` — constant fields merged into the request, applied last so they always win (e.g. `bodyExtra: { resend: true }`). -- `recordIdParam` / `recordIdField` — inject the current row id (or another row field) into a body key when the action runs from a `list_item` location. +- `recordIdParam` / `recordIdField` — inject the current row id (or another row field) into a body key when the action runs from a `record_row` location. ### Form Actions @@ -273,15 +273,15 @@ Action `name` is the configuration ID and **must** be lowercase `snake_case` (`a ### Action Locations -The `locations` array declares where an action surfaces. The canonical enum (`ACTION_LOCATIONS`) is: +The `locations` array declares what an action acts on, and so where it surfaces. The canonical enum (`ACTION_LOCATIONS`) is: | Location | Where it renders | | --- | --- | -| `list_toolbar` | Header/toolbar of a list view (bulk actions, "New", export) | -| `list_item` | Per-row action on a list/grid row | -| `record_header` | Primary actions in the record-detail title bar | -| `record_more` | Overflow ("More" / ⋯) menu on a record | -| `record_related` | Per-row action on each row of a related-list section inside a parent record, in that parent's context only — unlike `list_item`, never on the object's own list views. Declared, not yet placed: the console does not render it on those rows yet | +| `list` | Header/toolbar of a list view (bulk actions, "New", export) — acts on no record | +| `record` | Both record surfaces: the record-detail title bar and each list/grid row | +| `record_page` | Actions in the record-detail title bar; with `component: 'action:menu'`, straight into its overflow ("More" / ⋯) menu | +| `record_row` | Per-row action on a list/grid row | +| `record_related` | Per-row action on each row of a related-list section inside a parent record, in that parent's context only — unlike `record_row`, never on the object's own list views. Declared, not yet placed: the console does not render it on those rows yet | | `record_section` | Actions inside a body section/tab of a record | ```yaml @@ -290,18 +290,18 @@ label: Export icon: download type: api target: /api/customers/export -locations: [list_toolbar] +locations: [list] ``` ### Ordering & the Primary Button -Within each location group, actions render in **`order`** sequence — **lower comes first / more prominent**. In `record_header` the first visible action becomes the **primary button** and the rest fall into the `⋯` overflow menu, so `order` is how you decide which action holds the primary slot. +Within each location group, actions render in **`order`** sequence — **lower comes first / more prominent**. In `record_page` the first visible action becomes the **primary button** and the rest fall into the `⋯` overflow menu, so `order` is how you decide which action holds the primary slot. ```yaml # Approve holds the primary button even though the app action registered first. name: approve_request label: Approve -locations: [record_header] +locations: [record_page] variant: primary order: -10 # negative → floats ahead of app actions (order defaults to 0) ``` @@ -364,7 +364,7 @@ An action the reader toggles, such as a "Helpful" vote on a knowledge article, s name: mark_article_helpful label: Helpful type: script -locations: [record_header] +locations: [record_page] pressed: "has(record.viewer) && record.viewer.vote == 'helpful'" ``` @@ -382,14 +382,14 @@ disabled: "record.status == 'converted'" # preferred — works on every surfac disabled: "status == 'converted'" # bare field — also resolves to the record ``` -Prefer the `record.` form: it reads unambiguously and resolves identically on **every** surface an action renders (`record_header`, `record_more`, `list_item`, related lists). The bare-field form is supported for brevity but is easy to confuse with a local variable. +Prefer the `record.` form: it reads unambiguously and resolves identically on **every** surface an action renders (`record`, `record_page`, `record_row`, related lists). The bare-field form is supported for brevity but is easy to confuse with a local variable. Beyond `record`, action predicates also expose the authenticated user as `ctx.user` (e.g. `record.id == ctx.user.id`) and public feature flags as `features.*` (see [Capability gates](#capability-gates-requiresfeature)) — they are not limited to the record. [record-alert](/docs/protocol/objectui/record-alert) conditions surface the analogous identity values under the `os.*` namespace (`os.user` / `os.org` / `os.env`) instead. **The bound record is SPARSE — guard every read with `has()`.** Unlike a validation or hook predicate, an action predicate is evaluated against whatever -record the client already fetched. On `list_item` that is the row the view's +record the client already fetched. On `record_row` that is the row the view's `$select` projected, so a column the view did not ask for is **absent**, not `null` — and CEL aborts the whole expression at key resolution (`No such key: status`). The abort is fail-closed, so the button simply is not offered, which @@ -630,7 +630,7 @@ ai: icon: pause-circle variant: secondary mode: custom - locations: [list_item, record_header] + locations: [record_row, record_page] type: api method: POST target: /api/v1/auth/admin/oauth2/toggle-disabled @@ -650,7 +650,7 @@ ai: icon: refresh-cw variant: secondary mode: custom - locations: [record_header, record_more] + locations: [record, record_page] type: api method: POST target: /api/v1/auth/sys-oauth-application/rotate-secret diff --git a/content/docs/protocol/objectui/concept.mdx b/content/docs/protocol/objectui/concept.mdx index 0789d4b2ea0..f115ea265f4 100644 --- a/content/docs/protocol/objectui/concept.mdx +++ b/content/docs/protocol/objectui/concept.mdx @@ -611,7 +611,7 @@ actions: **1. The predicate is bare CEL, and the bound record is sparse — guard every read with** **`has()`.** A filter object (`{ status: { $ne: 'locked' } }` — Mongo query syntax) is in none of the three arms `visible`/`disabled` declare, so it is a parse error. And the - record an action predicate sees is whatever the client already fetched: on `list_item` + record an action predicate sees is whatever the client already fetched: on `record_row` that is only what the view's `$select` projected, so an unprojected column is *absent*, not `null`, and CEL aborts the whole expression at key resolution. Here the abort is **fail-closed** — the button is simply not offered, which looks exactly like the diff --git a/content/docs/protocol/objectui/layout-dsl.mdx b/content/docs/protocol/objectui/layout-dsl.mdx index 1df028612d4..5edd4428939 100644 --- a/content/docs/protocol/objectui/layout-dsl.mdx +++ b/content/docs/protocol/objectui/layout-dsl.mdx @@ -90,12 +90,11 @@ each holding typed `components`. There is no `context:` key — the binding is 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). The list is the whole set the header draws: an action that -declares `record_header` but is not named is not drawn there, and a header with +declares `record_page` but is not named is not drawn there, and a header with no `actions` draws none of the object's own actions. `placedActions: true` in -place of the list asks for every action placed at `record_header` / -`record_more`, read live, so an action another package places on the object is +place of the list asks for every action placed at `record` / `record_page`, read live, so an action another package places on the object is drawn without editing the page; it is refused beside a list. Declare the action, -placed at `record_header`, then name it: +placed at `record_page`, then name it: {/* os:check-yaml action */} ```yaml @@ -104,7 +103,7 @@ label: Send Statement objectName: account type: flow target: account_statement -locations: [record_header] +locations: [record_page] ``` {/* os:check-yaml page */} diff --git a/content/docs/references/data/object.mdx b/content/docs/references/data/object.mdx index 763b50a3663..63bced317b6 100644 --- a/content/docs/references/data/object.mdx +++ b/content/docs/references/data/object.mdx @@ -202,8 +202,8 @@ const result = ApiMethod.parse(data); | Property | Type | Required | Description | | :--- | :--- | :--- | :--- | -| **list** | `{ pinned: string[]; more?: string[] }` | optional | The list scope's arrangement: actions of the object placed at `list_toolbar`, as drawn on the list page toolbar, and `$import` / `$export` as pinned buttons (not pinned, they stay in the page's own Import / Export menu). Omit to draw it as before. | -| **record** | `{ pinned: string[]; more?: string[] }` | optional | The record scope's arrangement: actions of the object placed at `record_header` or `record_more`, as drawn in the record header (record page, side preview, a phone's bottom bar). The same order leads the actions a grid row already offers, adding none: the row's ⋮ menu, its right-click menu and, on a list page, the selection bar's actions for one selected record (`pinned` names first, then `more` names, then the rest as before). The selection bar's buttons, at most three, are the first of that order; a row's own inline button does not change. Omit to draw each as before. | +| **list** | `{ pinned: string[]; more?: string[] }` | optional | The list scope's arrangement: actions of the object placed at `list`, as drawn on the list page toolbar, and `$import` / `$export` as pinned buttons (not pinned, they stay in the page's own Import / Export menu). Omit to draw it as before. | +| **record** | `{ pinned: string[]; more?: string[] }` | optional | The record scope's arrangement: actions of the object placed at `record` or `record_page`, as drawn in the record header (record page, side preview, a phone's bottom bar). The same order leads the actions a grid row already offers, adding none: the row's ⋮ menu, its right-click menu and, on a list page, the selection bar's actions for one selected record (`pinned` names first, then `more` names, then the rest as before). The selection bar's buttons, at most three, are the first of that order; a row's own inline button does not change. Omit to draw each as before. | ### Nested Shape: `Object.userActions` @@ -521,7 +521,7 @@ const result = ApiMethod.parse(data); | **description** | `string \| { dialect: 'template'; source?: string; ast?: any; meta?: object } \| string \| Record` | optional | Explanatory line shown under the title in the action's param dialog. Carries the confirm question for an action that collects params (one dialog, not two). Not the LLM-facing `ai.description`. It is a `template` slot (ADR-0032): a bare string is shorthand for `{ dialect: 'template', source }`, and text with no hole is shown as written. Holes are `{{ path }}` or `{{ path \| formatter[:arg] }}` over `record`, the record the action runs against (the clicked row on a list, else the page's record); the values the dialog collects are not bound, since the line shows before they exist. Formatters come from the template engine's whitelist (`TEMPLATE_FORMATTERS`, `@objectstack/formula`); a hole holds no logic (no CEL, no arithmetic). Example: 'Choose the new role for `{{ record.name }}`.'. A hole over any other root, a `${…}` or single-brace `{x}` token (each named with its `{{ }}` spelling), a hole holding logic or an unknown formatter, and a blank sentence are named and refused at `objectstack validate`, `compile` and the publish gate; the text still parses, so a stored one loads until its next save. An inline locale map (`{ en, "zh-CN" }`) is accepted too, each value such a sentence. | | **objectName** | `string` | optional | Target object this action belongs to. When set, the action is auto-merged into the object's actions array by defineStack(). | | **icon** | `string` | optional | Icon name | -| **locations** | `Enum<'list_toolbar' \| 'list_item' \| 'record_header' \| 'record_more' \| …>[]` | optional | Locations where this action is visible. `record_section` is drawn only by an authored record page block that renders it; the standard record page (on a phone, in the side preview, and for an object with no authored page) does not draw it, so an action that must reach every surface adds `record_more` as well. | +| **locations** | `Enum<'list' \| 'record' \| 'record_page' \| 'record_row' \| 'record_related' \| 'record_section'>[]` | optional | Locations where this action is visible. `record_section` is drawn only by an authored record page block that renders it; the standard record page (on a phone, in the side preview, and for an object with no authored page) does not draw it, so an action that must reach every surface adds `record_page` as well, with `component: 'action:menu'` to sit in the record page's ⋯ menu rather than be a header button. `list` acts on no record (the list page toolbar); `record` acts on one record, on the record page and on each list row; `record_page` and `record_row` are one of those two only. | | **component** | `Enum<'action:button' \| 'action:icon' \| 'action:menu' \| 'action:group'>` | optional | Visual component override | | **type** | `Enum<'script' \| 'url' \| 'modal' \| 'flow' \| 'api' \| 'form' \| 'ask_ai'>` | optional (default: `"script"`) | Action functionality type — the dispatch route. The declarative single-record field write is not a type: it is `operation: 'update'` + `patch` on the default `script` route. | | **target** | `string` | optional | URL, Script Name, Flow ID, or API Endpoint. Supports $`{param.X}` and $`{ctx.X}` interpolation. For type:'url': an http:// or https:// URL, a mailto: address, or an in-app path starting with / or ./ (a console route; a record is /apps/APP/OBJECT/record/ID, APP being the app's route segment — see onSuccess.navigate) — every other scheme and a protocol-relative //host are refused. | @@ -536,7 +536,7 @@ const result = ApiMethod.parse(data); | **submitText** | `string \| Record` | optional | Label of the submit button in the action's param dialog, the verb the button performs (e.g. "Send", "Log Call"), in place of the default "Confirm" — the default-language string, or an inline locale map; translated at `objects.OBJECT._actions.ACTION.submitText` (`globalActions.ACTION.submitText` for an object-less action). Only on an action with a non-empty `params`: without one no param dialog opens, so it is refused. Not `confirmText`, which is the message of a param-less action's confirm dialog. A blank label is refused. | | **cancelText** | `string \| Record` | optional | Label of the dismiss button on the dialog the action opens before it runs — the confirm dialog of a param-less action that declares `confirmText`, or the param dialog of an action with a non-empty `params` — in place of the default "Cancel". Name what dismissing keeps where the action's own verb is "Cancel …" or "Close …" (e.g. "Keep invitation" beside "Cancel Invitation"). The default-language string, or an inline locale map; translated at `objects.OBJECT._actions.ACTION.cancelText` (`globalActions.ACTION.cancelText` for an object-less action). Only on an action that opens one of those dialogs: with neither `confirmText` nor a non-empty `params` no dialog opens, so it is refused. The dismiss twin of `submitText`, as on `object-form`. A blank label is refused. | | **variant** | `Enum<'primary' \| 'secondary' \| 'danger' \| 'ghost' \| 'link'>` | optional | Button visual variant for styling (primary = highlighted, danger = destructive, ghost = transparent) | -| **order** | `number` | optional | Sort order within a location group (lower = higher). Promotes/demotes an action toward the record_header primary button; stable, so actions without `order` keep their registration order. | +| **order** | `number` | optional | Sort order within a location group (lower = higher). Promotes/demotes an action toward the record page header's primary button; stable, so actions without `order` keep their registration order. | | **confirmText** | `string \| { dialect: 'template'; source?: string; ast?: any; meta?: object } \| string \| Record` | optional | Confirmation message before execution — a `template` slot (ADR-0032): a bare string is shorthand for `{ dialect: 'template', source }`, and text with no hole is shown as written. Holes are `{{ path }}` or `{{ path \| formatter[:arg] }}` over `record`, the record the action runs against (the clicked row on a list, else the page's record), and — only when the action's `params` is an object of static values — `params` (`{{ params.tier }}`); an input list binds nothing, since its values are collected after the confirmation. Formatters come from the template engine's whitelist (`TEMPLATE_FORMATTERS`, `@objectstack/formula`); a hole holds no logic (no CEL, no arithmetic). Example: 'Delete `{{ record.name }}`?'. A hole over any other root, a `${…}` or single-brace `{x}` token (each named with its `{{ }}` spelling), a hole holding logic or an unknown formatter, and a blank sentence are named and refused at `objectstack validate`, `compile` and the publish gate; the text still parses, so a stored one loads until its next save. An inline locale map (`{ en, "zh-CN" }`) is accepted too, each value such a sentence. Pairing this with a non-empty `params` is refused — that opens a second dialog for one decision; put the question on `description` instead. Correct on a param-LESS action, where the confirm is the only dialog there is. | | **successMessage** | `string \| { dialect: 'template'; source?: string; ast?: any; meta?: object } \| string \| Record` | optional | Success message shown after the action succeeds — a `template` slot (ADR-0032): a bare string is shorthand for `{ dialect: 'template', source }`, and text with no hole is shown as written. Holes are `{{ path }}` or `{{ path \| formatter[:arg] }}` over `result`, the payload the action's handler answered (`{{ result.email }}`; for an `api` or `script` action the server response), and `record`, the record the action ran against. Formatters come from the template engine's whitelist (`TEMPLATE_FORMATTERS`, `@objectstack/formula`); a hole holds no logic (no CEL, no arithmetic). Example: 'Invitation sent to `{{ result.email }}`'. A hole over any other root, a `${…}` or single-brace `{x}` token (each named with its `{{ }}` spelling), a hole holding logic or an unknown formatter, and a blank sentence are named and refused at `objectstack validate`, `compile` and the publish gate; the text still parses, so a stored one loads until its next save. An inline locale map (`{ en, "zh-CN" }`) is accepted too, each value such a sentence. On a registered action that declares `outcomeMessages`, the entry named by the response's `outcome` is shown instead, and this message is the fallback. | | **outcomeMessages** | `Record>` | optional | Success copy per handler outcome, for type:'api' and type:'script' actions: keys are the snake_case `outcome` values the handler returns in its success payload (e.g. archived, already_archived), values the message shown for that outcome. Each message is a `template` slot (ADR-0032): a bare string is shorthand for `{ dialect: 'template', source }`, and text with no hole is shown as written. Holes are `{{ path }}` or `{{ path \| formatter[:arg] }}` over `result`, the payload the action's handler answered (`{{ result.email }}`), and `record`, the record the action ran against — the roots `successMessage` reads. Formatters come from the template engine's whitelist (`TEMPLATE_FORMATTERS`, `@objectstack/formula`); a hole holds no logic (no CEL, no arithmetic). Example: 'Invitation resent to `{{ result.email }}`'. A hole over any other root, a `${…}` or single-brace `{x}` token (each named with its `{{ }}` spelling), a hole holding logic or an unknown formatter, and a blank sentence are named and refused at `objectstack validate`, `compile` and the publish gate; the text still parses, so a stored one loads until its next save. An inline locale map (`{ en, "zh-CN" }`) is accepted too, each value such a sentence. An outcome with no entry here falls back to `successMessage`, then to the default text. Not allowed beside `resultDialog` (which suppresses the success toast) or `operation: 'update'` (no handler, so no outcome). | @@ -553,7 +553,7 @@ const result = ApiMethod.parse(data); | **pressed** | `string \| { dialect: Enum<'cel' \| 'cron' \| 'template'>; source: string; ast?: any; meta?: object }` | optional | Pressed-state predicate (CEL string or `{dialect, source}` envelope) over the same scope as `visible`: the action surface draws the button as already pressed for this reader (a toggle face, `aria-pressed`) while it evaluates TRUE. Display only — it never gates, greys or routes the action. A per-reader fact (e.g. the reader's own vote) is read from a block the object declares under `attachedOnRead`, as `has(record.viewer) && record.viewer.vote == 'helpful'`. A boolean literal is refused: a constant is a style, not a reader's state. Omit = never drawn pressed. | | **requiredPermissions** | `string[]` | optional | [ADR-0066 D4] Capabilities required to invoke this action. Enforced with 403 on every call the platform action door (`POST /actions/:object/:action` and MCP `run_action`) dispatches, and mirrored as a UI hide. ADR-0066 D4, as amended 2026-10-29, brings a `type: api` action whose declared `target` is a same-origin platform path (exactly one leading `/`, followed by neither `/` nor a backslash, with a path after it) under that door; its `target` endpoint stays directly reachable, so it MUST still enforce this capability itself, the door's gate being the added check. A `type: api` action with an off-origin `target` is browser-only and not gated server-side. | | **ai** | `{ exposed?: boolean; description?: string; category?: Enum<'data' \| 'action' \| 'flow' \| 'integration' \| 'vector_search' \| 'analytics' \| 'utility'>; paramHints?: Record; … }` | optional | AI exposure (opt-in). Set ai.exposed=true + ai.description to make this callable by agents. | -| **recordIdParam** | `string` | optional | Body key to inject the row id into when running from a list_item context. | +| **recordIdParam** | `string` | optional | Body key to inject the row id into when running from a list row (`record_row` / `record`). | | **recordIdField** | `string` | optional | Row field whose value seeds recordIdParam. Defaults to "id". | | **bodyShape** | `'flat' \| { wrap: string }` | optional | Body wrapping: flat (default) or `{ wrap: key }` to nest user-collected params under a key. | | **method** | `Enum<'POST' \| 'PATCH' \| 'PUT' \| 'DELETE'>` | optional | HTTP method for type:"api" actions. Defaults to POST. | @@ -743,8 +743,8 @@ const result = ApiMethod.parse(data); | Property | Type | Required | Description | | :--- | :--- | :--- | :--- | -| **list** | `{ pinned: string[]; more?: string[] }` | optional | The list scope's arrangement: actions of the object placed at `list_toolbar`, as drawn on the list page toolbar, and `$import` / `$export` as pinned buttons (not pinned, they stay in the page's own Import / Export menu). Omit to draw it as before. | -| **record** | `{ pinned: string[]; more?: string[] }` | optional | The record scope's arrangement: actions of the object placed at `record_header` or `record_more`, as drawn in the record header (record page, side preview, a phone's bottom bar). The same order leads the actions a grid row already offers, adding none: the row's ⋮ menu, its right-click menu and, on a list page, the selection bar's actions for one selected record (`pinned` names first, then `more` names, then the rest as before). The selection bar's buttons, at most three, are the first of that order; a row's own inline button does not change. Omit to draw each as before. | +| **list** | `{ pinned: string[]; more?: string[] }` | optional | The list scope's arrangement: actions of the object placed at `list`, as drawn on the list page toolbar, and `$import` / `$export` as pinned buttons (not pinned, they stay in the page's own Import / Export menu). Omit to draw it as before. | +| **record** | `{ pinned: string[]; more?: string[] }` | optional | The record scope's arrangement: actions of the object placed at `record` or `record_page`, as drawn in the record header (record page, side preview, a phone's bottom bar). The same order leads the actions a grid row already offers, adding none: the row's ⋮ menu, its right-click menu and, on a list page, the selection bar's actions for one selected record (`pinned` names first, then `more` names, then the rest as before). The selection bar's buttons, at most three, are the first of that order; a row's own inline button does not change. Omit to draw each as before. | ### Nested Shape: `ObjectExtension.indexes[number]` diff --git a/content/docs/references/kernel/metadata-plugin.mdx b/content/docs/references/kernel/metadata-plugin.mdx index 38293fc8070..13e114ec3a6 100644 --- a/content/docs/references/kernel/metadata-plugin.mdx +++ b/content/docs/references/kernel/metadata-plugin.mdx @@ -331,7 +331,7 @@ const result = MetadataBulkResultSchema.parse(data); | **description** | `string \| { dialect: 'template'; source?: string; ast?: any; meta?: object } \| string \| Record` | optional | Explanatory line shown under the title in the action's param dialog. Carries the confirm question for an action that collects params (one dialog, not two). Not the LLM-facing `ai.description`. It is a `template` slot (ADR-0032): a bare string is shorthand for `{ dialect: 'template', source }`, and text with no hole is shown as written. Holes are `{{ path }}` or `{{ path \| formatter[:arg] }}` over `record`, the record the action runs against (the clicked row on a list, else the page's record); the values the dialog collects are not bound, since the line shows before they exist. Formatters come from the template engine's whitelist (`TEMPLATE_FORMATTERS`, `@objectstack/formula`); a hole holds no logic (no CEL, no arithmetic). Example: 'Choose the new role for `{{ record.name }}`.'. A hole over any other root, a `${…}` or single-brace `{x}` token (each named with its `{{ }}` spelling), a hole holding logic or an unknown formatter, and a blank sentence are named and refused at `objectstack validate`, `compile` and the publish gate; the text still parses, so a stored one loads until its next save. An inline locale map (`{ en, "zh-CN" }`) is accepted too, each value such a sentence. | | **objectName** | `string` | optional | Target object this action belongs to. When set, the action is auto-merged into the object's actions array by defineStack(). | | **icon** | `string` | optional | Icon name | -| **locations** | `Enum<'list_toolbar' \| 'list_item' \| 'record_header' \| 'record_more' \| …>[]` | optional | Locations where this action is visible. `record_section` is drawn only by an authored record page block that renders it; the standard record page (on a phone, in the side preview, and for an object with no authored page) does not draw it, so an action that must reach every surface adds `record_more` as well. | +| **locations** | `Enum<'list' \| 'record' \| 'record_page' \| 'record_row' \| 'record_related' \| 'record_section'>[]` | optional | Locations where this action is visible. `record_section` is drawn only by an authored record page block that renders it; the standard record page (on a phone, in the side preview, and for an object with no authored page) does not draw it, so an action that must reach every surface adds `record_page` as well, with `component: 'action:menu'` to sit in the record page's ⋯ menu rather than be a header button. `list` acts on no record (the list page toolbar); `record` acts on one record, on the record page and on each list row; `record_page` and `record_row` are one of those two only. | | **component** | `Enum<'action:button' \| 'action:icon' \| 'action:menu' \| 'action:group'>` | optional | Visual component override | | **type** | `Enum<'script' \| 'url' \| 'modal' \| 'flow' \| 'api' \| 'form' \| 'ask_ai'>` | optional (default: `"script"`) | Action functionality type — the dispatch route. The declarative single-record field write is not a type: it is `operation: 'update'` + `patch` on the default `script` route. | | **target** | `string` | optional | URL, Script Name, Flow ID, or API Endpoint. Supports $`{param.X}` and $`{ctx.X}` interpolation. For type:'url': an http:// or https:// URL, a mailto: address, or an in-app path starting with / or ./ (a console route; a record is /apps/APP/OBJECT/record/ID, APP being the app's route segment — see onSuccess.navigate) — every other scheme and a protocol-relative //host are refused. | @@ -346,7 +346,7 @@ const result = MetadataBulkResultSchema.parse(data); | **submitText** | `string \| Record` | optional | Label of the submit button in the action's param dialog, the verb the button performs (e.g. "Send", "Log Call"), in place of the default "Confirm" — the default-language string, or an inline locale map; translated at `objects.OBJECT._actions.ACTION.submitText` (`globalActions.ACTION.submitText` for an object-less action). Only on an action with a non-empty `params`: without one no param dialog opens, so it is refused. Not `confirmText`, which is the message of a param-less action's confirm dialog. A blank label is refused. | | **cancelText** | `string \| Record` | optional | Label of the dismiss button on the dialog the action opens before it runs — the confirm dialog of a param-less action that declares `confirmText`, or the param dialog of an action with a non-empty `params` — in place of the default "Cancel". Name what dismissing keeps where the action's own verb is "Cancel …" or "Close …" (e.g. "Keep invitation" beside "Cancel Invitation"). The default-language string, or an inline locale map; translated at `objects.OBJECT._actions.ACTION.cancelText` (`globalActions.ACTION.cancelText` for an object-less action). Only on an action that opens one of those dialogs: with neither `confirmText` nor a non-empty `params` no dialog opens, so it is refused. The dismiss twin of `submitText`, as on `object-form`. A blank label is refused. | | **variant** | `Enum<'primary' \| 'secondary' \| 'danger' \| 'ghost' \| 'link'>` | optional | Button visual variant for styling (primary = highlighted, danger = destructive, ghost = transparent) | -| **order** | `number` | optional | Sort order within a location group (lower = higher). Promotes/demotes an action toward the record_header primary button; stable, so actions without `order` keep their registration order. | +| **order** | `number` | optional | Sort order within a location group (lower = higher). Promotes/demotes an action toward the record page header's primary button; stable, so actions without `order` keep their registration order. | | **confirmText** | `string \| { dialect: 'template'; source?: string; ast?: any; meta?: object } \| string \| Record` | optional | Confirmation message before execution — a `template` slot (ADR-0032): a bare string is shorthand for `{ dialect: 'template', source }`, and text with no hole is shown as written. Holes are `{{ path }}` or `{{ path \| formatter[:arg] }}` over `record`, the record the action runs against (the clicked row on a list, else the page's record), and — only when the action's `params` is an object of static values — `params` (`{{ params.tier }}`); an input list binds nothing, since its values are collected after the confirmation. Formatters come from the template engine's whitelist (`TEMPLATE_FORMATTERS`, `@objectstack/formula`); a hole holds no logic (no CEL, no arithmetic). Example: 'Delete `{{ record.name }}`?'. A hole over any other root, a `${…}` or single-brace `{x}` token (each named with its `{{ }}` spelling), a hole holding logic or an unknown formatter, and a blank sentence are named and refused at `objectstack validate`, `compile` and the publish gate; the text still parses, so a stored one loads until its next save. An inline locale map (`{ en, "zh-CN" }`) is accepted too, each value such a sentence. Pairing this with a non-empty `params` is refused — that opens a second dialog for one decision; put the question on `description` instead. Correct on a param-LESS action, where the confirm is the only dialog there is. | | **successMessage** | `string \| { dialect: 'template'; source?: string; ast?: any; meta?: object } \| string \| Record` | optional | Success message shown after the action succeeds — a `template` slot (ADR-0032): a bare string is shorthand for `{ dialect: 'template', source }`, and text with no hole is shown as written. Holes are `{{ path }}` or `{{ path \| formatter[:arg] }}` over `result`, the payload the action's handler answered (`{{ result.email }}`; for an `api` or `script` action the server response), and `record`, the record the action ran against. Formatters come from the template engine's whitelist (`TEMPLATE_FORMATTERS`, `@objectstack/formula`); a hole holds no logic (no CEL, no arithmetic). Example: 'Invitation sent to `{{ result.email }}`'. A hole over any other root, a `${…}` or single-brace `{x}` token (each named with its `{{ }}` spelling), a hole holding logic or an unknown formatter, and a blank sentence are named and refused at `objectstack validate`, `compile` and the publish gate; the text still parses, so a stored one loads until its next save. An inline locale map (`{ en, "zh-CN" }`) is accepted too, each value such a sentence. On a registered action that declares `outcomeMessages`, the entry named by the response's `outcome` is shown instead, and this message is the fallback. | | **outcomeMessages** | `Record>` | optional | Success copy per handler outcome, for type:'api' and type:'script' actions: keys are the snake_case `outcome` values the handler returns in its success payload (e.g. archived, already_archived), values the message shown for that outcome. Each message is a `template` slot (ADR-0032): a bare string is shorthand for `{ dialect: 'template', source }`, and text with no hole is shown as written. Holes are `{{ path }}` or `{{ path \| formatter[:arg] }}` over `result`, the payload the action's handler answered (`{{ result.email }}`), and `record`, the record the action ran against — the roots `successMessage` reads. Formatters come from the template engine's whitelist (`TEMPLATE_FORMATTERS`, `@objectstack/formula`); a hole holds no logic (no CEL, no arithmetic). Example: 'Invitation resent to `{{ result.email }}`'. A hole over any other root, a `${…}` or single-brace `{x}` token (each named with its `{{ }}` spelling), a hole holding logic or an unknown formatter, and a blank sentence are named and refused at `objectstack validate`, `compile` and the publish gate; the text still parses, so a stored one loads until its next save. An inline locale map (`{ en, "zh-CN" }`) is accepted too, each value such a sentence. An outcome with no entry here falls back to `successMessage`, then to the default text. Not allowed beside `resultDialog` (which suppresses the success toast) or `operation: 'update'` (no handler, so no outcome). | @@ -363,7 +363,7 @@ const result = MetadataBulkResultSchema.parse(data); | **pressed** | `string \| { dialect: Enum<'cel' \| 'cron' \| 'template'>; source: string; ast?: any; meta?: object }` | optional | Pressed-state predicate (CEL string or `{dialect, source}` envelope) over the same scope as `visible`: the action surface draws the button as already pressed for this reader (a toggle face, `aria-pressed`) while it evaluates TRUE. Display only — it never gates, greys or routes the action. A per-reader fact (e.g. the reader's own vote) is read from a block the object declares under `attachedOnRead`, as `has(record.viewer) && record.viewer.vote == 'helpful'`. A boolean literal is refused: a constant is a style, not a reader's state. Omit = never drawn pressed. | | **requiredPermissions** | `string[]` | optional | [ADR-0066 D4] Capabilities required to invoke this action. Enforced with 403 on every call the platform action door (`POST /actions/:object/:action` and MCP `run_action`) dispatches, and mirrored as a UI hide. ADR-0066 D4, as amended 2026-10-29, brings a `type: api` action whose declared `target` is a same-origin platform path (exactly one leading `/`, followed by neither `/` nor a backslash, with a path after it) under that door; its `target` endpoint stays directly reachable, so it MUST still enforce this capability itself, the door's gate being the added check. A `type: api` action with an off-origin `target` is browser-only and not gated server-side. | | **ai** | `{ exposed?: boolean; description?: string; category?: Enum<'data' \| 'action' \| 'flow' \| 'integration' \| 'vector_search' \| 'analytics' \| 'utility'>; paramHints?: Record; … }` | optional | AI exposure (opt-in). Set ai.exposed=true + ai.description to make this callable by agents. | -| **recordIdParam** | `string` | optional | Body key to inject the row id into when running from a list_item context. | +| **recordIdParam** | `string` | optional | Body key to inject the row id into when running from a list row (`record_row` / `record`). | | **recordIdField** | `string` | optional | Row field whose value seeds recordIdParam. Defaults to "id". | | **bodyShape** | `'flat' \| { wrap: string }` | optional | Body wrapping: flat (default) or `{ wrap: key }` to nest user-collected params under a key. | | **method** | `Enum<'POST' \| 'PATCH' \| 'PUT' \| 'DELETE'>` | optional | HTTP method for type:"api" actions. Defaults to POST. | diff --git a/content/docs/references/ui/action.mdx b/content/docs/references/ui/action.mdx index 10d40d785ab..d70f7c966b0 100644 --- a/content/docs/references/ui/action.mdx +++ b/content/docs/references/ui/action.mdx @@ -48,7 +48,7 @@ const result = ActionSchema.parse(data); | **description** | `string \| { dialect: 'template'; source?: string; ast?: any; meta?: object } \| string \| Record` | optional | Explanatory line shown under the title in the action's param dialog. Carries the confirm question for an action that collects params (one dialog, not two). Not the LLM-facing `ai.description`. It is a `template` slot (ADR-0032): a bare string is shorthand for `{ dialect: 'template', source }`, and text with no hole is shown as written. Holes are `{{ path }}` or `{{ path \| formatter[:arg] }}` over `record`, the record the action runs against (the clicked row on a list, else the page's record); the values the dialog collects are not bound, since the line shows before they exist. Formatters come from the template engine's whitelist (`TEMPLATE_FORMATTERS`, `@objectstack/formula`); a hole holds no logic (no CEL, no arithmetic). Example: 'Choose the new role for `{{ record.name }}`.'. A hole over any other root, a `${…}` or single-brace `{x}` token (each named with its `{{ }}` spelling), a hole holding logic or an unknown formatter, and a blank sentence are named and refused at `objectstack validate`, `compile` and the publish gate; the text still parses, so a stored one loads until its next save. An inline locale map (`{ en, "zh-CN" }`) is accepted too, each value such a sentence. | | **objectName** | `string` | optional | Target object this action belongs to. When set, the action is auto-merged into the object's actions array by defineStack(). | | **icon** | `string` | optional | Icon name | -| **locations** | `Enum<'list_toolbar' \| 'list_item' \| 'record_header' \| 'record_more' \| 'record_related' \| 'record_section'>[]` | optional | Locations where this action is visible. `record_section` is drawn only by an authored record page block that renders it; the standard record page (on a phone, in the side preview, and for an object with no authored page) does not draw it, so an action that must reach every surface adds `record_more` as well. | +| **locations** | `Enum<'list' \| 'record' \| 'record_page' \| 'record_row' \| 'record_related' \| 'record_section'>[]` | optional | Locations where this action is visible. `record_section` is drawn only by an authored record page block that renders it; the standard record page (on a phone, in the side preview, and for an object with no authored page) does not draw it, so an action that must reach every surface adds `record_page` as well, with `component: 'action:menu'` to sit in the record page's ⋯ menu rather than be a header button. `list` acts on no record (the list page toolbar); `record` acts on one record, on the record page and on each list row; `record_page` and `record_row` are one of those two only. | | **component** | `Enum<'action:button' \| 'action:icon' \| 'action:menu' \| 'action:group'>` | optional | Visual component override | | **type** | `Enum<'script' \| 'url' \| 'modal' \| 'flow' \| 'api' \| 'form' \| 'ask_ai'>` | optional (default: `"script"`) | Action functionality type — the dispatch route. The declarative single-record field write is not a type: it is `operation: 'update'` + `patch` on the default `script` route. | | **target** | `string` | optional | URL, Script Name, Flow ID, or API Endpoint. Supports $`{param.X}` and $`{ctx.X}` interpolation. For type:'url': an http:// or https:// URL, a mailto: address, or an in-app path starting with / or ./ (a console route; a record is /apps/APP/OBJECT/record/ID, APP being the app's route segment — see onSuccess.navigate) — every other scheme and a protocol-relative //host are refused. | @@ -63,7 +63,7 @@ const result = ActionSchema.parse(data); | **submitText** | `string \| Record` | optional | Label of the submit button in the action's param dialog, the verb the button performs (e.g. "Send", "Log Call"), in place of the default "Confirm" — the default-language string, or an inline locale map; translated at `objects.OBJECT._actions.ACTION.submitText` (`globalActions.ACTION.submitText` for an object-less action). Only on an action with a non-empty `params`: without one no param dialog opens, so it is refused. Not `confirmText`, which is the message of a param-less action's confirm dialog. A blank label is refused. | | **cancelText** | `string \| Record` | optional | Label of the dismiss button on the dialog the action opens before it runs — the confirm dialog of a param-less action that declares `confirmText`, or the param dialog of an action with a non-empty `params` — in place of the default "Cancel". Name what dismissing keeps where the action's own verb is "Cancel …" or "Close …" (e.g. "Keep invitation" beside "Cancel Invitation"). The default-language string, or an inline locale map; translated at `objects.OBJECT._actions.ACTION.cancelText` (`globalActions.ACTION.cancelText` for an object-less action). Only on an action that opens one of those dialogs: with neither `confirmText` nor a non-empty `params` no dialog opens, so it is refused. The dismiss twin of `submitText`, as on `object-form`. A blank label is refused. | | **variant** | `Enum<'primary' \| 'secondary' \| 'danger' \| 'ghost' \| 'link'>` | optional | Button visual variant for styling (primary = highlighted, danger = destructive, ghost = transparent) | -| **order** | `number` | optional | Sort order within a location group (lower = higher). Promotes/demotes an action toward the record_header primary button; stable, so actions without `order` keep their registration order. | +| **order** | `number` | optional | Sort order within a location group (lower = higher). Promotes/demotes an action toward the record page header's primary button; stable, so actions without `order` keep their registration order. | | **confirmText** | `string \| { dialect: 'template'; source?: string; ast?: any; meta?: object } \| string \| Record` | optional | Confirmation message before execution — a `template` slot (ADR-0032): a bare string is shorthand for `{ dialect: 'template', source }`, and text with no hole is shown as written. Holes are `{{ path }}` or `{{ path \| formatter[:arg] }}` over `record`, the record the action runs against (the clicked row on a list, else the page's record), and — only when the action's `params` is an object of static values — `params` (`{{ params.tier }}`); an input list binds nothing, since its values are collected after the confirmation. Formatters come from the template engine's whitelist (`TEMPLATE_FORMATTERS`, `@objectstack/formula`); a hole holds no logic (no CEL, no arithmetic). Example: 'Delete `{{ record.name }}`?'. A hole over any other root, a `${…}` or single-brace `{x}` token (each named with its `{{ }}` spelling), a hole holding logic or an unknown formatter, and a blank sentence are named and refused at `objectstack validate`, `compile` and the publish gate; the text still parses, so a stored one loads until its next save. An inline locale map (`{ en, "zh-CN" }`) is accepted too, each value such a sentence. Pairing this with a non-empty `params` is refused — that opens a second dialog for one decision; put the question on `description` instead. Correct on a param-LESS action, where the confirm is the only dialog there is. | | **successMessage** | `string \| { dialect: 'template'; source?: string; ast?: any; meta?: object } \| string \| Record` | optional | Success message shown after the action succeeds — a `template` slot (ADR-0032): a bare string is shorthand for `{ dialect: 'template', source }`, and text with no hole is shown as written. Holes are `{{ path }}` or `{{ path \| formatter[:arg] }}` over `result`, the payload the action's handler answered (`{{ result.email }}`; for an `api` or `script` action the server response), and `record`, the record the action ran against. Formatters come from the template engine's whitelist (`TEMPLATE_FORMATTERS`, `@objectstack/formula`); a hole holds no logic (no CEL, no arithmetic). Example: 'Invitation sent to `{{ result.email }}`'. A hole over any other root, a `${…}` or single-brace `{x}` token (each named with its `{{ }}` spelling), a hole holding logic or an unknown formatter, and a blank sentence are named and refused at `objectstack validate`, `compile` and the publish gate; the text still parses, so a stored one loads until its next save. An inline locale map (`{ en, "zh-CN" }`) is accepted too, each value such a sentence. On a registered action that declares `outcomeMessages`, the entry named by the response's `outcome` is shown instead, and this message is the fallback. | | **outcomeMessages** | `Record>` | optional | Success copy per handler outcome, for type:'api' and type:'script' actions: keys are the snake_case `outcome` values the handler returns in its success payload (e.g. archived, already_archived), values the message shown for that outcome. Each message is a `template` slot (ADR-0032): a bare string is shorthand for `{ dialect: 'template', source }`, and text with no hole is shown as written. Holes are `{{ path }}` or `{{ path \| formatter[:arg] }}` over `result`, the payload the action's handler answered (`{{ result.email }}`), and `record`, the record the action ran against — the roots `successMessage` reads. Formatters come from the template engine's whitelist (`TEMPLATE_FORMATTERS`, `@objectstack/formula`); a hole holds no logic (no CEL, no arithmetic). Example: 'Invitation resent to `{{ result.email }}`'. A hole over any other root, a `${…}` or single-brace `{x}` token (each named with its `{{ }}` spelling), a hole holding logic or an unknown formatter, and a blank sentence are named and refused at `objectstack validate`, `compile` and the publish gate; the text still parses, so a stored one loads until its next save. An inline locale map (`{ en, "zh-CN" }`) is accepted too, each value such a sentence. An outcome with no entry here falls back to `successMessage`, then to the default text. Not allowed beside `resultDialog` (which suppresses the success toast) or `operation: 'update'` (no handler, so no outcome). | @@ -80,7 +80,7 @@ const result = ActionSchema.parse(data); | **pressed** | `string \| { dialect: Enum<'cel' \| 'cron' \| 'template'>; source: string; ast?: any; meta?: object }` | optional | Pressed-state predicate (CEL string or `{dialect, source}` envelope) over the same scope as `visible`: the action surface draws the button as already pressed for this reader (a toggle face, `aria-pressed`) while it evaluates TRUE. Display only — it never gates, greys or routes the action. A per-reader fact (e.g. the reader's own vote) is read from a block the object declares under `attachedOnRead`, as `has(record.viewer) && record.viewer.vote == 'helpful'`. A boolean literal is refused: a constant is a style, not a reader's state. Omit = never drawn pressed. | | **requiredPermissions** | `string[]` | optional | [ADR-0066 D4] Capabilities required to invoke this action. Enforced with 403 on every call the platform action door (`POST /actions/:object/:action` and MCP `run_action`) dispatches, and mirrored as a UI hide. ADR-0066 D4, as amended 2026-10-29, brings a `type: api` action whose declared `target` is a same-origin platform path (exactly one leading `/`, followed by neither `/` nor a backslash, with a path after it) under that door; its `target` endpoint stays directly reachable, so it MUST still enforce this capability itself, the door's gate being the added check. A `type: api` action with an off-origin `target` is browser-only and not gated server-side. | | **ai** | `{ exposed?: boolean; description?: string; category?: Enum<'data' \| 'action' \| 'flow' \| 'integration' \| 'vector_search' \| 'analytics' \| 'utility'>; paramHints?: Record; … }` | optional | AI exposure (opt-in). Set ai.exposed=true + ai.description to make this callable by agents. | -| **recordIdParam** | `string` | optional | Body key to inject the row id into when running from a list_item context. | +| **recordIdParam** | `string` | optional | Body key to inject the row id into when running from a list row (`record_row` / `record`). | | **recordIdField** | `string` | optional | Row field whose value seeds recordIdParam. Defaults to "id". | | **bodyShape** | `'flat' \| { wrap: string }` | optional | Body wrapping: flat (default) or `{ wrap: key }` to nest user-collected params under a key. | | **method** | `Enum<'POST' \| 'PATCH' \| 'PUT' \| 'DELETE'>` | optional | HTTP method for type:"api" actions. Defaults to POST. | @@ -260,10 +260,10 @@ L2 sandboxed JS body — runs inside an isolated VM with declared capabilities ### Allowed Values -* `list_toolbar` -* `list_item` -* `record_header` -* `record_more` +* `list` +* `record` +* `record_page` +* `record_row` * `record_related` * `record_section` diff --git a/content/docs/references/ui/component.mdx b/content/docs/references/ui/component.mdx index 97721ea6aff..69670a39660 100644 --- a/content/docs/references/ui/component.mdx +++ b/content/docs/references/ui/component.mdx @@ -43,7 +43,7 @@ const result = ActionButtonPropsSchema.parse(data); | **method** | `string` | optional | HTTP method for an `api` action, forwarded to the runner | | **bodyExtra** | `any` | optional | Static request-body fields for an `api` action, forwarded to the runner | | **bodyShape** | `any` | optional | How an `api` action shapes its request body, forwarded to the runner | -| **operation** | `Enum<'update'>` | optional | Declarative single-record write: `ActionSchema`'s own `operation`, whose one member is `update`. The row runs the declared action its `name` names. The runner reads `operation` before any executor and posts the row's values to the platform action route under that `name`; the route resolves that action by name and writes ITS `patch`, so the row has no `patch` of its own and needs a `name`. What the row's `params` supply rides the request as params, written only where that action declares them and otherwise refused by the route. Judged as `ActionSchema` judges it: beside it the executor key is absent or `script`, `target`, `method`, `bodyExtra`, `bodyShape`, `recordIdField` and `onSuccess` are refused, and `list_toolbar` is not a location | +| **operation** | `Enum<'update'>` | optional | Declarative single-record write: `ActionSchema`'s own `operation`, whose one member is `update`. The row runs the declared action its `name` names. The runner reads `operation` before any executor and posts the row's values to the platform action route under that `name`; the route resolves that action by name and writes ITS `patch`, so the row has no `patch` of its own and needs a `name`. What the row's `params` supply rides the request as params, written only where that action declares them and otherwise refused by the route. Judged as `ActionSchema` judges it: beside it the executor key is absent or `script`, `target`, `method`, `bodyExtra`, `bodyShape`, `recordIdField` and `onSuccess` are refused, and `list` is not a location | | **patch** | `never` | optional | [REMOVED] An `action:button`'s `patch` was removed in @objectstack/spec 18 (ADR-0110 D2) — a page action row's `operation: 'update'` runs the declared action its `name` names, and the platform action route resolves that action by name and writes ITS `patch`, so the row's own `patch` was never sent and never written. Move the values into the `patch` of the action the row's `name` names, then delete the key. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | | **confirmText** | `string \| { dialect: 'template'; source?: string; ast?: any; meta?: object } \| string` | optional | Confirmation question asked before the action runs — a `template` slot (ADR-0032): a bare string is shorthand for `{ dialect: 'template', source }`, and text with no hole is shown as written. Holes are `{{ path }}` or `{{ path \| formatter[:arg] }}` over `record`, the record the action runs against (the clicked row on a list, else the page's record), and — only when the action's `params` is an object of static values — `params` (`{{ params.tier }}`); an input list binds nothing, since its values are collected after the confirmation. Formatters come from the template engine's whitelist (`TEMPLATE_FORMATTERS`, `@objectstack/formula`); a hole holds no logic (no CEL, no arithmetic). Example: 'Delete `{{ record.name }}`?'. A hole over any other root, a `${…}` or single-brace `{x}` token (each named with its `{{ }}` spelling), a hole holding logic or an unknown formatter, and a blank sentence are named and refused at `objectstack validate`, `compile` and the publish gate; the text still parses, so a stored one loads until its next save. Beside a non-empty array `params` it is refused — the runner would show the confirm and then the param dialog, two dialogs for one decision; put the question on `description` instead. Correct with no `params`, beside `params: []`, and beside an object `params` (static values, no param dialog) | | **successMessage** | `string \| { dialect: 'template'; source?: string; ast?: any; meta?: object } \| string` | optional | Toast shown when the action succeeds — a `template` slot (ADR-0032): a bare string is shorthand for `{ dialect: 'template', source }`, and text with no hole is shown as written. Holes are `{{ path }}` or `{{ path \| formatter[:arg] }}` over `result`, the payload the action's handler answered (`{{ result.email }}`; for an `api` or `script` action the server response), and `record`, the record the action ran against. Formatters come from the template engine's whitelist (`TEMPLATE_FORMATTERS`, `@objectstack/formula`); a hole holds no logic (no CEL, no arithmetic). Example: 'Invitation sent to `{{ result.email }}`'. A hole over any other root, a `${…}` or single-brace `{x}` token (each named with its `{{ }}` spelling), a hole holding logic or an unknown formatter, and a blank sentence are named and refused at `objectstack validate`, `compile` and the publish gate; the text still parses, so a stored one loads until its next save. | @@ -51,7 +51,7 @@ const result = ActionButtonPropsSchema.parse(data); | **refreshAfter** | `boolean` | optional | Refresh the surrounding data after the action runs | | **undoable** | `boolean` | optional | Offer an Undo affordance after an update action | | **recordIdField** | `string` | optional | Row field whose value identifies the record the action acts on | -| **locations** | `Enum<'list_toolbar' \| 'list_item' \| 'record_header' \| 'record_more' \| 'record_related' \| 'record_section'>[]` | optional | Action locations, forwarded to the runner — the console uses them to tell a record-scoped action from an object-level one | +| **locations** | `Enum<'list' \| 'record' \| 'record_page' \| 'record_row' \| 'record_related' \| 'record_section'>[]` | optional | Action locations, forwarded to the runner — the console uses them to tell a record-scoped action from an object-level one | | **toast** | `any` | optional | Toast behaviour, forwarded to the runner | | **resultDialog** | `any` | optional | One-shot result dialog for a value the response shows exactly once, forwarded to the runner | | **onSuccess** | `{ navigate: string; openIn?: Enum<'self' \| 'newTab'> }` | optional | Post-success navigation, forwarded to the runner: `ActionSchema`'s own `{ navigate, openIn }` block. Taken beside an `api`, `script` or `flow` executor (for `flow`, only a run that completes: a run that pauses at a screen or ends refused performs no navigation), or a handler a host registers under another name; refused beside the built-ins `url`, `navigation`, `modal` and `form`, on a row that names no executor, and beside `operation: 'update'`, whose write the runner performs before any executor. `navigate` is an http:// or https:// URL, a mailto: address, an in-app path starting with / or ./, or a template that opens with ${, judged after interpolation — every other scheme and a protocol-relative //host are refused; `openIn` is `self` (default) or `newTab` | @@ -75,7 +75,7 @@ const result = ActionButtonPropsSchema.parse(data); | :--- | :--- | :--- | :--- | | **actions** | `{ name?: string; label?: string; icon?: string; type?: string; … }[]` | optional | The actions in this group, in order — each an action object the group draws and runs itself (`name`, `label`, `icon`, `type`, `target`, `visible`, `disabled`, `size`, …); a member's executor is its `type` | | **display** | `Enum<'inline' \| 'dropdown'>` | optional | Display mode: `inline` renders every action as a button row; `dropdown` renders one trigger button and lists the actions in its menu (renderer default: `inline`) | -| **location** | `Enum<'list_toolbar' \| 'list_item' \| 'record_header' \| 'record_more' \| 'record_related' \| 'record_section'>` | optional | Render only the members whose `locations` include this location. Omit to render every member | +| **location** | `Enum<'list' \| 'record' \| 'record_page' \| 'record_row' \| 'record_related' \| 'record_section'>` | optional | Render only the members whose `locations` include this location. Omit to render every member | | **label** | `string` | optional | Dropdown trigger text (renderer default: `Actions`). Inline mode renders no group label. A literal string — localize through the translation bundle entry for this component id | | **icon** | `string` | optional | Lucide icon name on the dropdown trigger. Inline mode renders no group icon | | **variant** | `Enum<'default' \| 'danger' \| 'outline' \| 'secondary' \| 'ghost' \| 'link'>` | optional | Button variant for the dropdown trigger and for every inline member that sets none — the Button primitive's vocabulary with its destructive arm spelled `danger`, the action runner's word (renderer default: `outline`) | @@ -101,13 +101,13 @@ const result = ActionButtonPropsSchema.parse(data); | **method** | `string` | optional | HTTP method for an `api` action, forwarded to the runner | | **bodyExtra** | `any` | optional | Static request-body fields for an `api` action, forwarded to the runner | | **bodyShape** | `any` | optional | How an `api` action shapes its request body, forwarded to the runner | -| **operation** | `Enum<'update'>` | optional | Declarative single-record write: `ActionSchema`'s own `operation`, whose one member is `update`. The row runs the declared action its `name` names. The runner reads `operation` before any executor and posts the row's values to the platform action route under that `name`; the route resolves that action by name and writes ITS `patch`, so the row has no `patch` of its own and needs a `name`. What the row's `params` supply rides the request as params, written only where that action declares them and otherwise refused by the route. Judged as `ActionSchema` judges it: beside it the executor key is absent or `script`, `target`, `method`, `bodyExtra`, `bodyShape` and `onSuccess` are refused, and `list_toolbar` is not a location | +| **operation** | `Enum<'update'>` | optional | Declarative single-record write: `ActionSchema`'s own `operation`, whose one member is `update`. The row runs the declared action its `name` names. The runner reads `operation` before any executor and posts the row's values to the platform action route under that `name`; the route resolves that action by name and writes ITS `patch`, so the row has no `patch` of its own and needs a `name`. What the row's `params` supply rides the request as params, written only where that action declares them and otherwise refused by the route. Judged as `ActionSchema` judges it: beside it the executor key is absent or `script`, `target`, `method`, `bodyExtra`, `bodyShape` and `onSuccess` are refused, and `list` is not a location | | **patch** | `never` | optional | [REMOVED] An `action:group` or `action:menu` member's `patch` was removed in @objectstack/spec 18 (ADR-0110 D2) — a page action row's `operation: 'update'` runs the declared action its `name` names, and the platform action route resolves that action by name and writes ITS `patch`, so the row's own `patch` was never sent and never written. Move the values into the `patch` of the action the row's `name` names, then delete the key. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | | **confirmText** | `string \| { dialect: 'template'; source?: string; ast?: any; meta?: object } \| string` | optional | Confirmation question asked before the action runs — a `template` slot (ADR-0032): a bare string is shorthand for `{ dialect: 'template', source }`, and text with no hole is shown as written. Holes are `{{ path }}` or `{{ path \| formatter[:arg] }}` over `record`, the record the action runs against (the clicked row on a list, else the page's record), and — only when the action's `params` is an object of static values — `params` (`{{ params.tier }}`); an input list binds nothing, since its values are collected after the confirmation. Formatters come from the template engine's whitelist (`TEMPLATE_FORMATTERS`, `@objectstack/formula`); a hole holds no logic (no CEL, no arithmetic). Example: 'Delete `{{ record.name }}`?'. A hole over any other root, a `${…}` or single-brace `{x}` token (each named with its `{{ }}` spelling), a hole holding logic or an unknown formatter, and a blank sentence are named and refused at `objectstack validate`, `compile` and the publish gate; the text still parses, so a stored one loads until its next save. Beside a non-empty array `params` it is refused — the runner would show the confirm and then the param dialog, two dialogs for one decision; put the question on `description` instead. Correct with no `params`, beside `params: []`, and beside a `type: 'api'` member's object `params` (its request payload, no param dialog) | | **successMessage** | `string \| { dialect: 'template'; source?: string; ast?: any; meta?: object } \| string` | optional | Toast shown when the action succeeds — a `template` slot (ADR-0032): a bare string is shorthand for `{ dialect: 'template', source }`, and text with no hole is shown as written. Holes are `{{ path }}` or `{{ path \| formatter[:arg] }}` over `result`, the payload the action's handler answered (`{{ result.email }}`; for an `api` or `script` action the server response), and `record`, the record the action ran against. Formatters come from the template engine's whitelist (`TEMPLATE_FORMATTERS`, `@objectstack/formula`); a hole holds no logic (no CEL, no arithmetic). Example: 'Invitation sent to `{{ result.email }}`'. A hole over any other root, a `${…}` or single-brace `{x}` token (each named with its `{{ }}` spelling), a hole holding logic or an unknown formatter, and a blank sentence are named and refused at `objectstack validate`, `compile` and the publish gate; the text still parses, so a stored one loads until its next save. | | **errorMessage** | `string \| { dialect: 'template'; source?: string; ast?: any; meta?: object } \| string` | optional | Toast shown when the action fails, in place of the raw error — a `template` slot (ADR-0032) that binds no root: a bare string is shorthand for `{ dialect: 'template', source }`, and the text is shown as written, so a `{{ }}` hole, a `${…}` or a `{x}` token in it is literal text. Each of those, and a blank sentence, is named and refused at `objectstack validate`, `compile` and the publish gate; the text still parses, so a stored one loads until its next save. | | **refreshAfter** | `boolean` | optional | Refresh the surrounding data after the action runs | -| **locations** | `Enum<'list_toolbar' \| 'list_item' \| 'record_header' \| 'record_more' \| …>[]` | optional | Action locations, forwarded to the runner — an `action:group` with a `location` draws only the members that list it, and the console uses them to tell a record-scoped action from an object-level one | +| **locations** | `Enum<'list' \| 'record' \| 'record_page' \| 'record_row' \| 'record_related' \| 'record_section'>[]` | optional | Action locations, forwarded to the runner — an `action:group` with a `location` draws only the members that list it, and the console uses them to tell a record-scoped action from an object-level one | | **toast** | `any` | optional | Toast behaviour, forwarded to the runner | | **resultDialog** | `any` | optional | One-shot result dialog for a value the response shows exactly once, forwarded to the runner | | **onSuccess** | `{ navigate: string; openIn?: Enum<'self' \| 'newTab'> }` | optional | Post-success navigation, forwarded to the runner: `ActionSchema`'s own `{ navigate, openIn }` block. Taken beside an `api`, `script` or `flow` executor (for `flow`, only a run that completes: a run that pauses at a screen or ends refused performs no navigation), or a handler a host registers under another name; refused beside the built-ins `url`, `navigation`, `modal` and `form`, on a row that names no executor, and beside `operation: 'update'`, whose write the runner performs before any executor. `navigate` is an http:// or https:// URL, a mailto: address, an in-app path starting with / or ./, or a template that opens with ${, judged after interpolation — every other scheme and a protocol-relative //host are refused; `openIn` is `self` (default) or `newTab` | @@ -137,13 +137,13 @@ const result = ActionButtonPropsSchema.parse(data); | **method** | `string` | optional | HTTP method for an `api` action, forwarded to the runner | | **bodyExtra** | `any` | optional | Static request-body fields for an `api` action, forwarded to the runner | | **bodyShape** | `any` | optional | How an `api` action shapes its request body, forwarded to the runner | -| **operation** | `Enum<'update'>` | optional | Declarative single-record write: `ActionSchema`'s own `operation`, whose one member is `update`. The row runs the declared action its `name` names. The runner reads `operation` before any executor and posts the row's values to the platform action route under that `name`; the route resolves that action by name and writes ITS `patch`, so the row has no `patch` of its own and needs a `name`. What the row's `params` supply rides the request as params, written only where that action declares them and otherwise refused by the route. Judged as `ActionSchema` judges it: beside it the executor key is absent or `script`, `target`, `method`, `bodyExtra`, `bodyShape` and `onSuccess` are refused, and `list_toolbar` is not a location | +| **operation** | `Enum<'update'>` | optional | Declarative single-record write: `ActionSchema`'s own `operation`, whose one member is `update`. The row runs the declared action its `name` names. The runner reads `operation` before any executor and posts the row's values to the platform action route under that `name`; the route resolves that action by name and writes ITS `patch`, so the row has no `patch` of its own and needs a `name`. What the row's `params` supply rides the request as params, written only where that action declares them and otherwise refused by the route. Judged as `ActionSchema` judges it: beside it the executor key is absent or `script`, `target`, `method`, `bodyExtra`, `bodyShape` and `onSuccess` are refused, and `list` is not a location | | **patch** | `never` | optional | [REMOVED] An `action:icon`'s `patch` was removed in @objectstack/spec 18 (ADR-0110 D2) — a page action row's `operation: 'update'` runs the declared action its `name` names, and the platform action route resolves that action by name and writes ITS `patch`, so the row's own `patch` was never sent and never written. Move the values into the `patch` of the action the row's `name` names, then delete the key. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | | **confirmText** | `string \| { dialect: 'template'; source?: string; ast?: any; meta?: object } \| string` | optional | Confirmation question asked before the action runs — a `template` slot (ADR-0032): a bare string is shorthand for `{ dialect: 'template', source }`, and text with no hole is shown as written. Holes are `{{ path }}` or `{{ path \| formatter[:arg] }}` over `record`, the record the action runs against (the clicked row on a list, else the page's record), and — only when the action's `params` is an object of static values — `params` (`{{ params.tier }}`); an input list binds nothing, since its values are collected after the confirmation. Formatters come from the template engine's whitelist (`TEMPLATE_FORMATTERS`, `@objectstack/formula`); a hole holds no logic (no CEL, no arithmetic). Example: 'Delete `{{ record.name }}`?'. A hole over any other root, a `${…}` or single-brace `{x}` token (each named with its `{{ }}` spelling), a hole holding logic or an unknown formatter, and a blank sentence are named and refused at `objectstack validate`, `compile` and the publish gate; the text still parses, so a stored one loads until its next save. Beside a non-empty array `params` it is refused — the runner would show the confirm and then the param dialog, two dialogs for one decision; put the question on `description` instead. Correct with no `params`, beside `params: []`, and beside an object `params` (static values, no param dialog) | | **successMessage** | `string \| { dialect: 'template'; source?: string; ast?: any; meta?: object } \| string` | optional | Toast shown when the action succeeds — a `template` slot (ADR-0032): a bare string is shorthand for `{ dialect: 'template', source }`, and text with no hole is shown as written. Holes are `{{ path }}` or `{{ path \| formatter[:arg] }}` over `result`, the payload the action's handler answered (`{{ result.email }}`; for an `api` or `script` action the server response), and `record`, the record the action ran against. Formatters come from the template engine's whitelist (`TEMPLATE_FORMATTERS`, `@objectstack/formula`); a hole holds no logic (no CEL, no arithmetic). Example: 'Invitation sent to `{{ result.email }}`'. A hole over any other root, a `${…}` or single-brace `{x}` token (each named with its `{{ }}` spelling), a hole holding logic or an unknown formatter, and a blank sentence are named and refused at `objectstack validate`, `compile` and the publish gate; the text still parses, so a stored one loads until its next save. | | **errorMessage** | `string \| { dialect: 'template'; source?: string; ast?: any; meta?: object } \| string` | optional | Toast shown when the action fails, in place of the raw error — a `template` slot (ADR-0032) that binds no root: a bare string is shorthand for `{ dialect: 'template', source }`, and the text is shown as written, so a `{{ }}` hole, a `${…}` or a `{x}` token in it is literal text. Each of those, and a blank sentence, is named and refused at `objectstack validate`, `compile` and the publish gate; the text still parses, so a stored one loads until its next save. | | **refreshAfter** | `boolean` | optional | Refresh the surrounding data after the action runs | -| **locations** | `Enum<'list_toolbar' \| 'list_item' \| 'record_header' \| 'record_more' \| 'record_related' \| 'record_section'>[]` | optional | Action locations, forwarded to the runner — the console uses them to tell a record-scoped action from an object-level one | +| **locations** | `Enum<'list' \| 'record' \| 'record_page' \| 'record_row' \| 'record_related' \| 'record_section'>[]` | optional | Action locations, forwarded to the runner — the console uses them to tell a record-scoped action from an object-level one | | **toast** | `any` | optional | Toast behaviour, forwarded to the runner | | **resultDialog** | `any` | optional | One-shot result dialog for a value the response shows exactly once, forwarded to the runner | | **onSuccess** | `{ navigate: string; openIn?: Enum<'self' \| 'newTab'> }` | optional | Post-success navigation, forwarded to the runner: `ActionSchema`'s own `{ navigate, openIn }` block. Taken beside an `api`, `script` or `flow` executor (for `flow`, only a run that completes: a run that pauses at a screen or ends refused performs no navigation), or a handler a host registers under another name; refused beside the built-ins `url`, `navigation`, `modal` and `form`, on a row that names no executor, and beside `operation: 'update'`, whose write the runner performs before any executor. `navigate` is an http:// or https:// URL, a mailto: address, an in-app path starting with / or ./, or a template that opens with ${, judged after interpolation — every other scheme and a protocol-relative //host are refused; `openIn` is `self` (default) or `newTab` | @@ -191,13 +191,13 @@ const result = ActionButtonPropsSchema.parse(data); | **method** | `string` | optional | HTTP method for an `api` action, forwarded to the runner | | **bodyExtra** | `any` | optional | Static request-body fields for an `api` action, forwarded to the runner | | **bodyShape** | `any` | optional | How an `api` action shapes its request body, forwarded to the runner | -| **operation** | `Enum<'update'>` | optional | Declarative single-record write: `ActionSchema`'s own `operation`, whose one member is `update`. The row runs the declared action its `name` names. The runner reads `operation` before any executor and posts the row's values to the platform action route under that `name`; the route resolves that action by name and writes ITS `patch`, so the row has no `patch` of its own and needs a `name`. What the row's `params` supply rides the request as params, written only where that action declares them and otherwise refused by the route. Judged as `ActionSchema` judges it: beside it the executor key is absent or `script`, `target`, `method`, `bodyExtra`, `bodyShape` and `onSuccess` are refused, and `list_toolbar` is not a location | +| **operation** | `Enum<'update'>` | optional | Declarative single-record write: `ActionSchema`'s own `operation`, whose one member is `update`. The row runs the declared action its `name` names. The runner reads `operation` before any executor and posts the row's values to the platform action route under that `name`; the route resolves that action by name and writes ITS `patch`, so the row has no `patch` of its own and needs a `name`. What the row's `params` supply rides the request as params, written only where that action declares them and otherwise refused by the route. Judged as `ActionSchema` judges it: beside it the executor key is absent or `script`, `target`, `method`, `bodyExtra`, `bodyShape` and `onSuccess` are refused, and `list` is not a location | | **patch** | `never` | optional | [REMOVED] An `action:group` or `action:menu` member's `patch` was removed in @objectstack/spec 18 (ADR-0110 D2) — a page action row's `operation: 'update'` runs the declared action its `name` names, and the platform action route resolves that action by name and writes ITS `patch`, so the row's own `patch` was never sent and never written. Move the values into the `patch` of the action the row's `name` names, then delete the key. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | | **confirmText** | `string \| { dialect: 'template'; source?: string; ast?: any; meta?: object } \| string` | optional | Confirmation question asked before the action runs — a `template` slot (ADR-0032): a bare string is shorthand for `{ dialect: 'template', source }`, and text with no hole is shown as written. Holes are `{{ path }}` or `{{ path \| formatter[:arg] }}` over `record`, the record the action runs against (the clicked row on a list, else the page's record), and — only when the action's `params` is an object of static values — `params` (`{{ params.tier }}`); an input list binds nothing, since its values are collected after the confirmation. Formatters come from the template engine's whitelist (`TEMPLATE_FORMATTERS`, `@objectstack/formula`); a hole holds no logic (no CEL, no arithmetic). Example: 'Delete `{{ record.name }}`?'. A hole over any other root, a `${…}` or single-brace `{x}` token (each named with its `{{ }}` spelling), a hole holding logic or an unknown formatter, and a blank sentence are named and refused at `objectstack validate`, `compile` and the publish gate; the text still parses, so a stored one loads until its next save. Beside a non-empty array `params` it is refused — the runner would show the confirm and then the param dialog, two dialogs for one decision; put the question on `description` instead. Correct with no `params`, beside `params: []`, and beside a `type: 'api'` member's object `params` (its request payload, no param dialog) | | **successMessage** | `string \| { dialect: 'template'; source?: string; ast?: any; meta?: object } \| string` | optional | Toast shown when the action succeeds — a `template` slot (ADR-0032): a bare string is shorthand for `{ dialect: 'template', source }`, and text with no hole is shown as written. Holes are `{{ path }}` or `{{ path \| formatter[:arg] }}` over `result`, the payload the action's handler answered (`{{ result.email }}`; for an `api` or `script` action the server response), and `record`, the record the action ran against. Formatters come from the template engine's whitelist (`TEMPLATE_FORMATTERS`, `@objectstack/formula`); a hole holds no logic (no CEL, no arithmetic). Example: 'Invitation sent to `{{ result.email }}`'. A hole over any other root, a `${…}` or single-brace `{x}` token (each named with its `{{ }}` spelling), a hole holding logic or an unknown formatter, and a blank sentence are named and refused at `objectstack validate`, `compile` and the publish gate; the text still parses, so a stored one loads until its next save. | | **errorMessage** | `string \| { dialect: 'template'; source?: string; ast?: any; meta?: object } \| string` | optional | Toast shown when the action fails, in place of the raw error — a `template` slot (ADR-0032) that binds no root: a bare string is shorthand for `{ dialect: 'template', source }`, and the text is shown as written, so a `{{ }}` hole, a `${…}` or a `{x}` token in it is literal text. Each of those, and a blank sentence, is named and refused at `objectstack validate`, `compile` and the publish gate; the text still parses, so a stored one loads until its next save. | | **refreshAfter** | `boolean` | optional | Refresh the surrounding data after the action runs | -| **locations** | `Enum<'list_toolbar' \| 'list_item' \| 'record_header' \| 'record_more' \| …>[]` | optional | Action locations, forwarded to the runner — an `action:group` with a `location` draws only the members that list it, and the console uses them to tell a record-scoped action from an object-level one | +| **locations** | `Enum<'list' \| 'record' \| 'record_page' \| 'record_row' \| 'record_related' \| 'record_section'>[]` | optional | Action locations, forwarded to the runner — an `action:group` with a `location` draws only the members that list it, and the console uses them to tell a record-scoped action from an object-level one | | **toast** | `any` | optional | Toast behaviour, forwarded to the runner | | **resultDialog** | `any` | optional | One-shot result dialog for a value the response shows exactly once, forwarded to the runner | | **onSuccess** | `{ navigate: string; openIn?: Enum<'self' \| 'newTab'> }` | optional | Post-success navigation, forwarded to the runner: `ActionSchema`'s own `{ navigate, openIn }` block. Taken beside an `api`, `script` or `flow` executor (for `flow`, only a run that completes: a run that pauses at a screen or ends refused performs no navigation), or a handler a host registers under another name; refused beside the built-ins `url`, `navigation`, `modal` and `form`, on a row that names no executor, and beside `operation: 'update'`, whose write the runner performs before any executor. `navigate` is an http:// or https:// URL, a mailto: address, an in-app path starting with / or ./, or a template that opens with ${, judged after interpolation — every other scheme and a protocol-relative //host are refused; `openIn` is `self` (default) or `newTab` | @@ -1574,8 +1574,8 @@ An any-of group: `{ or: [rule, ...] }` matches a record when ANY of its rules ma | **title** | `string \| Record` | optional | Page title. Omit to let the renderer derive the heading from the record (the default for record pages) — set explicitly on non-record pages (dashboard, landing) with no record to derive from. | | **subtitle** | `string \| Record` | optional | Page subtitle | | **breadcrumb** | `never` | optional | [REMOVED] `page:header` property `breadcrumb` was removed in @objectstack/spec 17 (ADR-0087 D2) — no renderer ever drew a trail for it: objectui drew an empty slot and nothing filled it, and the navigation trail is drawn once, by the app shell's header. Delete the key, whether it was `true` or `false`; the shell's trail is unchanged. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | -| **actions** | `string[]` | optional | Action IDs the header draws, resolved against the actions declared on the page's object. An authored list is the whole set: an action that declares `record_header` (or `record_more`) in its `locations` but is not named here is not drawn, and a header with neither this key nor `placedActions: true` draws none of the object's actions. `placedActions: true` is the other way to say which actions the header draws (every one placed at `record_header` / `record_more`, read live), and the two are refused together. A named action that declares neither location renders nowhere. The host's own Edit / Share / Delete chrome is separate from this list. | -| **placedActions** | `boolean` | optional | Draw every action of the page's object whose `locations` include `record_header` or `record_more`, read live from the object's metadata, in place of an authored `actions` list: an action added to the object later, by any package, is drawn without editing the page. Omit it, or set false, to keep the `actions` list as the whole set. Refused as `true` beside an authored `actions` list: keep one. | +| **actions** | `string[]` | optional | Action IDs the header draws, resolved against the actions declared on the page's object. An authored list is the whole set: an action that declares `record` or `record_page` in its `locations` but is not named here is not drawn, and a header with neither this key nor `placedActions: true` draws none of the object's actions. `placedActions: true` is the other way to say which actions the header draws (every one placed at `record` / `record_page`, read live), and the two are refused together. A named action that declares neither location renders nowhere. The host's own Edit / Share / Delete chrome is separate from this list. | +| **placedActions** | `boolean` | optional | Draw every action of the page's object whose `locations` include `record` or `record_page`, read live from the object's metadata, in place of an authored `actions` list: an action added to the object later, by any package, is drawn without editing the page. Omit it, or set false, to keep the `actions` list as the whole set. Refused as `true` beside an authored `actions` list: keep one. | | **recordChrome** | `boolean` | optional (default: `true`) | Render the record chrome — the title as a record chip with its copy-id button. Set false on a non-record page (dashboard, landing) to fall back to the bare heading layout. | | **showStar** | `never` | optional | [REMOVED] `page:header` property `showStar` was removed in @objectstack/spec 18 (ADR-0087 D2) — the console draws the record's star from the host's favorites toggle, never from metadata, so the key switched nothing. Delete the key, whether it was `true` or `false`; the page draws the same star without it. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | | **showCopyId** | `boolean` | optional (default: `true`) | Show the copy-record-id button beside the record title. Part of the record chrome — no effect when `recordChrome` is false. | @@ -1996,7 +1996,7 @@ Sort field and direction pair | :--- | :--- | :--- | :--- | | **actionNames** | `string[]` | optional | Names of actions declared on this object (`actions[]`), in display order. The engine still location-filters named actions. Measured: when omitted (and the host supplies nothing) the bar resolves NO actions and renders its empty placeholder — it does not fall back to "every action at this location", whatever the registration's input list claims. | | **requiredPermissions** | `string[]` | optional | [ADR-0066] Capabilities the user must ALL hold — names that permission sets grant through `systemPermissions`, not object actions: `read` or `update` here is an ordinary capability name, not the object's read or edit permission. When the client has resolved the user's capabilities and any of these is missing, this block does not render its content; wherever it would otherwise render, an insufficient-permissions notice takes its place. Presentation only: it authorises nothing, and the data API still serves the same data to the same user. A client that cannot resolve the user's capabilities (no permission provider, or one that does not report `systemPermissions`) renders this block as if they were held — it fails open. | -| **location** | `Enum<'list_toolbar' \| 'list_item' \| 'record_header' \| 'record_more' \| 'record_related' \| 'record_section'>` | optional | Which declared action location this bar renders (renderer default: `record_header`). | +| **location** | `Enum<'list' \| 'record' \| 'record_page' \| 'record_row' \| 'record_related' \| 'record_section'>` | optional | Which declared action location this bar renders (renderer default: `record_page`). At `record_page` it draws the record page's actions that are not folded into its ⋯ menu (`component: 'action:menu'`); an action placed at `record` is drawn at `record_page` and at `record_row`. | | **align** | `Enum<'start' \| 'center' \| 'end'>` | optional | Horizontal alignment of the button row (renderer default: `end`). | | **inline** | `boolean` | optional | Render in the flow instead of pulling up into the record-header band. The page header sets this itself when it hosts the bar in its own action slot. | | **variant** | `Enum<'default' \| 'destructive' \| 'outline' \| 'secondary' \| 'ghost' \| 'link'>` | optional | Button variant for every action — the Button primitive's own vocabulary; a per-action `variant` on the resolved def wins (renderer default: `default`). | diff --git a/content/docs/references/ui/page.mdx b/content/docs/references/ui/page.mdx index 24672ab4aa9..583cf04a63a 100644 --- a/content/docs/references/ui/page.mdx +++ b/content/docs/references/ui/page.mdx @@ -232,7 +232,7 @@ An any-of group: `{ or: [rule, ...] }` matches a record when ANY of its rules ma | **interfaceConfig** | `{ source?: string; columns?: string[] \| object[]; sort?: object[]; filterBy?: (object \| object)[]; … }` | optional | Interface-level page configuration (for Airtable-style interface pages) | | **aria** | `{ ariaLabel?: string \| Record; ariaDescribedBy?: string; role?: string }` | optional | ARIA accessibility attributes | | **print** | `{ paperSize?: Enum<'A4' \| 'A5' \| 'Letter' \| 'Legal'>; orientation?: Enum<'portrait' \| 'landscape'>; margins?: object; repeatHeader?: boolean; … }` | optional | Print declaration — makes this page a print page, a document authored in the page's own blocks: paper size and orientation, margins in millimetres, the running header and footer (the page's own `header` / `footer` regions), page numbers and page-break hints, each mapped to print CSS. A print page is a `kind: 'full'` page of `type: 'record'`, `'home'` or `'app'` with its blocks in `regions`, and every block in it must come from the printable block subset: containers that draw every child (`page:section`, `page:card`, `page:footer`), field blocks (`record:details`, `record:highlights`), the child-record table `record:line_items`, `element:text`, `element:image`, `element:divider`, `element:definition-list`, `element:repeater`, `element:number` and `object-metric`; `os validate` / `os build` / `os lint` and the metadata save door refuse any other block inside it. Applied by the console's browser print rendering, which prints the page through the browser's own print dialog (where it can be saved as PDF); the server-side PDF renderer is to follow. A list view's print button is `allowPrinting`, not this. | -| **kind** | `Enum<'full' \| 'slotted' \| 'html' \| 'react'>` | optional (default: `"full"`) | Page override mode. full \| slotted = structured authoring; html = author-written constrained JSX compiled (parsed, never executed) to the tree (ADR-0080; ADR-0081 named it html), styled by the registered components' structured props plus a JSON `style` object with hsl(var(--token)) theme colors; react = real-React source executed at render by the runtime (ADR-0081), styled by inline `style` with the same token colors; it runs author JS, so it is gated by a host capability that defaults OFF and is turned on server-side via the OS_PAGE_REACT_ENABLED=true env toggle. Do not author Tailwind classes in page source in either tier: `source` is runtime metadata the build-time Tailwind never scans, so utility classNames silently produce no CSS (ADR-0065; ADR-0080). Where it is drawn: an object's assigned record page of kind 'full', 'html' or 'react' (its `isDefault` page, or an app's page named by `apps`) is drawn on the desktop full record page only. On a phone and in the side preview (the drawer a list opens, a split pane, an interface page's preview) the record opens on the standard record page, built from the object's own metadata, so the page's layout and what lives only on it (its own blocks, tabs and sections, and `record_section` actions, which the standard page does not draw; give such an action `record_more` as well) do not appear there. A page named in the URL (a print page and other named page routes) is drawn wherever that route opens, the platform's own approval request and user pages keep their page on every surface, and a `kind: 'slotted'` page is the standard page with its slots filled, on every surface. | +| **kind** | `Enum<'full' \| 'slotted' \| 'html' \| 'react'>` | optional (default: `"full"`) | Page override mode. full \| slotted = structured authoring; html = author-written constrained JSX compiled (parsed, never executed) to the tree (ADR-0080; ADR-0081 named it html), styled by the registered components' structured props plus a JSON `style` object with hsl(var(--token)) theme colors; react = real-React source executed at render by the runtime (ADR-0081), styled by inline `style` with the same token colors; it runs author JS, so it is gated by a host capability that defaults OFF and is turned on server-side via the OS_PAGE_REACT_ENABLED=true env toggle. Do not author Tailwind classes in page source in either tier: `source` is runtime metadata the build-time Tailwind never scans, so utility classNames silently produce no CSS (ADR-0065; ADR-0080). Where it is drawn: an object's assigned record page of kind 'full', 'html' or 'react' (its `isDefault` page, or an app's page named by `apps`) is drawn on the desktop full record page only. On a phone and in the side preview (the drawer a list opens, a split pane, an interface page's preview) the record opens on the standard record page, built from the object's own metadata, so the page's layout and what lives only on it (its own blocks, tabs and sections, and `record_section` actions, which the standard page does not draw; give such an action `record_page` as well, with `component: 'action:menu'` to keep it in the ⋯ menu) do not appear there. A page named in the URL (a print page and other named page routes) is drawn wherever that route opens, the platform's own approval request and user pages keep their page on every surface, and a `kind: 'slotted'` page is the standard page with its slots filled, on every surface. | | **slots** | `{ header?: object \| object[]; actions?: object \| object[]; alerts?: object \| object[]; highlights?: object \| object[]; … }` | optional | Slot override map for slotted pages | | **source** | `string` | optional | Page source text. For kind==='html' it is constrained JSX compiled to the tree by @objectstack/sdui-parser at save time (parse, never execute), styled by the registered components' structured props plus a JSON `style` object with hsl(var(--token)) theme colors. For kind==='react' it is real React/JSX executed at render by @object-ui/react-runtime (trusted tier), styled by inline `style` with the same token colors. Do not author Tailwind classes in page source in either tier: `source` is runtime metadata the build-time Tailwind never scans, so utility classNames silently produce no CSS (ADR-0065; ADR-0080). Authoritative over `regions` in both. | | **requires** | `string[]` | optional | Plugin namespaces the page's source uses, derived from the source at save — omit it. The key exists only on a kind==='html' page, the kind whose source is compiled at save; on a 'react', 'full' or 'slotted' page — and a page that omits kind, which is 'full' — it is refused at parse. On a server that has the deployment's SDUI component manifest, saving an html page compiles its source and stores the namespaces it uses here; a written list that disagrees with the source is refused (422 INVALID_METADATA, page-requires-disagrees-with-source) — on a draft save it is kept until the draft's publish, which refuses it. At load, a stored page whose list names a plugin no component in that manifest carries is reported, page and plugin named, and is still served. A server with no manifest checks neither and says so once at boot. | diff --git a/content/docs/ui/actions.mdx b/content/docs/ui/actions.mdx index a6f3c1f57c8..98780b17727 100644 --- a/content/docs/ui/actions.mdx +++ b/content/docs/ui/actions.mdx @@ -47,7 +47,7 @@ export const CompleteTaskAction = defineAction({ icon: 'check-circle', type: 'script', target: 'completeTask', // resolved to the handler registered below - locations: ['record_header', 'list_item'], + locations: ['record'], successMessage: 'Task marked as complete!', refreshAfter: true, ai: { @@ -95,7 +95,7 @@ export const MarkDoneAction = defineAction({ }, successMessage: 'Task marked done.', visible: 'has(record.done) && record.done != true', - locations: ['list_item', 'record_header', 'record_section'], + locations: ['record', 'record_section'], refreshAfter: true, }); ``` @@ -365,16 +365,29 @@ is collected, then the body runs with those values as its `input`. ## Bind it to the UI -`locations` is the primary binding — the action appears wherever it declares: +`locations` is the primary binding. Each word says what the action acts on, and the action +appears on every surface that word covers: -| Location | Where the button renders | -|:---|:---| -| `list_toolbar` | List view toolbar (no record context) | -| `list_item` | Per-row menu in list views | -| `record_header` | Record page header | -| `record_more` | Record page overflow ("…") menu | -| `record_related` | Each row of a related list inside a parent record — there only, never on the object's own list views (unlike `list_item`). Declared, not yet placed: the console does not draw it on those rows yet | -| `record_section` | Named action bars on record pages | +| Location | Acts on | Where the button renders | +|:---|:---|:---| +| `list` | No record | List view toolbar | +| `record` | One record | Record page header **and** the per-row menu in list views | +| `record_page` | One record, opened | Record page header | +| `record_row` | One record, in a list | Per-row menu in list views | +| `record_related` | One record, in its parent | Each row of a related list inside a parent record — there only, never on the object's own list views (unlike `record_row`). Declared, not yet placed: the console does not draw it on those rows yet | +| `record_section` | One record | Named action bars on record pages | + +`record_related` takes the "One record" cell too. To keep a record page action out of the +header's buttons and put it straight into the header's 「More」 (`⋯`) menu, set +`component: 'action:menu'` on it. + + +Protocol 19 replaced the page-part words: `list_toolbar` is `list`, `list_item` is +`record_row`, `record_header` and `record_more` are `record_page` (`record` when the action +was on list rows as well), and an action that was only in the `⋯` menu keeps that place with +`component: 'action:menu'`. Run `os migrate meta --from 18` to list the mechanical edits for existing +sources; `--write` applies the ones it can prove, and you apply the rest by hand. + ### Choose the header's buttons @@ -388,9 +401,9 @@ ObjectSchema.create({ name: 'crm_opportunity', // ... actionLayout: { - // the list scope: actions placed at list_toolbar, drawn on the list page toolbar + // the list scope: actions placed at list, drawn on the list page toolbar list: { pinned: ['mass_assign', '$export'], more: ['send_digest'] }, - // the record scope: actions placed at record_header or record_more + // the record scope: actions placed at record or record_page record: { pinned: ['mark_won', 'mark_lost'], more: ['clone', 'share'] }, }, }); @@ -611,7 +624,7 @@ is a spec proposal for a properly named key, not a values map under this one. 1. **Always prefix record fields** — `record.status != "closed"`, never a bare `status`, which faults as an undeclared identifier. - 2. **Guard with `has()`** — a record-scoped predicate on `list_item` binds a + 2. **Guard with `has()`** — a record-scoped predicate on `record_row` binds a LIST ROW, which carries only the columns that view projects. Reading a field the list does not show aborts the expression with `No such key`, and fail-closed means the button simply is not offered — indistinguishable from diff --git a/content/docs/ui/components/action.mdx b/content/docs/ui/components/action.mdx index ec4725f10e7..6c7f4b7ae9d 100644 --- a/content/docs/ui/components/action.mdx +++ b/content/docs/ui/components/action.mdx @@ -41,7 +41,7 @@ Namespace `action`. | `successMessage` | `string` | | Toast text when the action succeeds; a `${result.*}` token reads the handler's answer (e.g. `${result.id}`) | | `errorMessage` | `string` | | Toast text when the action fails, in place of the raw error | | `refreshAfter` | `boolean` | | Refresh the surrounding data after the action succeeds | -| `locations` | `array` of `string` | | The placements the action declares (`list_toolbar`, `list_item`, `record_header`, …). A `script` or `flow` action declared record-scoped (`list_item`, `record_header`, `record_more` or `record_section`) refuses to run when no record or single selection is in scope, instead of running without one | +| `locations` | `array` of `string` | | The placements the action declares (`list`, `record_row`, `record_page`, …). A `script` or `flow` action declared record-scoped (`record_row`, `record`, `record_page` or `record_section`) refuses to run when no record or single selection is in scope, instead of running without one | | `toast` | `object` | | Toast behaviour: `{ showOnSuccess?, showOnError?, duration? }` — `false` suppresses that toast, `duration` is handed to the toast | | `resultDialog` | `object` | | One-shot result dialog for a value the response shows exactly once (a 2FA code, a fresh secret); it replaces the success toast | | `onSuccess` | `object` | | Post-success navigation `{ navigate, openIn? }`: `navigate` is a route template that can read `${result.*}`, `openIn` is `self` (the default) or `newTab` | @@ -59,7 +59,7 @@ Namespace `action`. | `icon` | `string` | | — | | `actions` | `array` of `object` | | The actions in this group, in order. Each member is an action object the group draws and runs itself (`name`, `label`, `icon`, `type`, `target`, `locations`, `visible`, `disabled`, …); a member's executor is its own `type` | | `display` | `enum`: `inline`, `dropdown` | | — | -| `location` | `enum`: `list_toolbar`, `list_item`, `record_header`, `record_more`, `record_related`, `record_section` | | Render only the members whose `locations` include this location. Omit to render every member | +| `location` | `enum`: `list`, `record`, `record_page`, `record_row`, `record_related`, `record_section` | | Render only the members whose `locations` include this location. Omit to render every member | | `variant` | `enum`: `default`, `secondary`, `outline`, `ghost` | | — | | `size` | `enum`: `default`, `sm`, `lg`, `icon` | | Button size for the dropdown trigger and for every inline member that sets none | | `visible` | `boolean` \| `string` \| `object` | | Visibility predicate for the whole group: `true`/`false`, a bare CEL expression, or the `{ dialect: 'cel', source }` envelope, evaluated against the row the host binds. Omit for always-visible | @@ -91,7 +91,7 @@ Namespace `action`. | `successMessage` | `string` | | Toast text when the action succeeds; a `${result.*}` token reads the handler's answer (e.g. `${result.id}`) | | `errorMessage` | `string` | | Toast text when the action fails, in place of the raw error | | `refreshAfter` | `boolean` | | Refresh the surrounding data after the action succeeds | -| `locations` | `array` of `string` | | The placements the action declares (`list_toolbar`, `list_item`, `record_header`, …). A `script` or `flow` action declared record-scoped (`list_item`, `record_header`, `record_more` or `record_section`) refuses to run when no record or single selection is in scope, instead of running without one | +| `locations` | `array` of `string` | | The placements the action declares (`list`, `record_row`, `record_page`, …). A `script` or `flow` action declared record-scoped (`record_row`, `record`, `record_page` or `record_section`) refuses to run when no record or single selection is in scope, instead of running without one | | `toast` | `object` | | Toast behaviour: `{ showOnSuccess?, showOnError?, duration? }` — `false` suppresses that toast, `duration` is handed to the toast | | `resultDialog` | `object` | | One-shot result dialog for a value the response shows exactly once (a 2FA code, a fresh secret); it replaces the success toast | | `onSuccess` | `object` | | Post-success navigation `{ navigate, openIn? }`: `navigate` is a route template that can read `${result.*}`, `openIn` is `self` (the default) or `newTab` | diff --git a/content/docs/ui/components/page.mdx b/content/docs/ui/components/page.mdx index 9402eeefbaf..89f4a3f4da8 100644 --- a/content/docs/ui/components/page.mdx +++ b/content/docs/ui/components/page.mdx @@ -51,11 +51,11 @@ Namespace `page`. | :--- | :--- | :--- | :--- | | `title` | `string` \| `object` | | Supports \{field\} interpolation and inline translation maps; falls back to the record title | | `subtitle` | `string` \| `object` | | Same interpolation as Title | -| `actions` | `array` of `string` | | Action IDS — the names of actions declared on the object's own metadata — rendered in the header before any host-injected system actions. An id whose action declares neither record_header nor record_more in its locations renders nowhere. | -| `placedActions` | `boolean` | | Set true to draw every action of the object placed at record_header or record_more, read live from the object's metadata, in place of an Actions list: an action another package adds to the object is drawn without editing the page. Refused beside an authored Actions list: keep one. | +| `actions` | `array` of `string` | | Action IDS — the names of actions declared on the object's own metadata — rendered in the header before any host-injected system actions. An id whose action declares neither record nor record_page in its locations renders nowhere. | +| `placedActions` | `boolean` | | Set true to draw every action of the object placed at record or record_page, read live from the object's metadata, in place of an Actions list: an action another package adds to the object is drawn without editing the page. Refused beside an authored Actions list: keep one. | | `recordChrome` | `boolean` | | Set false for the bare h1 header on non-record pages | | `showCopyId` | `boolean` | | — | -| `maxVisible` | `number` | | How many header actions render as inline buttons on desktop before the rest fold into the overflow menu. A positive integer, defaulting to 3 — the contract rejects 0 and fractional values. In a record page's header bar, actions that do not fit its width fold too, so a narrow drawer shows fewer. Two kinds of action are routed to the overflow menu regardless of this budget and never occupy an inline slot: an action whose locations declare record_more without record_header, and any action with component action:menu. The host's own buttons (the record page's Edit) take no slot and never fold. The first inline action, or the one declaring variant primary, is the one filled primary button; the others are outline buttons. The host's Edit is always an outline button: on a record with no header action of its own the row has no filled button. An action declaring variant danger is never the primary: inline it is a destructive button, and in the overflow menu it is a red row below a separator. | +| `maxVisible` | `number` | | How many header actions render as inline buttons on desktop before the rest fold into the overflow menu. A positive integer, defaulting to 3 — the contract rejects 0 and fractional values. In a record page's header bar, actions that do not fit its width fold too, so a narrow drawer shows fewer. An action with component action:menu (the record page's fold) is routed to the overflow menu regardless of this budget and never occupies an inline slot. The host's own buttons (the record page's Edit) take no slot and never fold. The first inline action, or the one declaring variant primary, is the one filled primary button; the others are outline buttons. The host's Edit is always an outline button: on a record with no header action of its own the row has no filled button. An action declaring variant danger is never the primary: inline it is a destructive button, and in the overflow menu it is a red row below a separator. | | `mobileMaxVisible` | `number` | | The same inline-button budget on mobile viewports, where horizontal room is scarce. A positive integer, defaulting to 1, or 2 in a record page's bottom action bar on a phone, which holds the page's actions (the record's Edit is in the top bar's overflow menu there); the desktop half is Max Inline Actions, and the overflow routing rules stated there apply unchanged. | ## `page:section` [#page-section] diff --git a/content/docs/ui/components/record.mdx b/content/docs/ui/components/record.mdx index 67203f82fdd..cb3e240a1d9 100644 --- a/content/docs/ui/components/record.mdx +++ b/content/docs/ui/components/record.mdx @@ -142,7 +142,7 @@ Namespace `record`. | :--- | :--- | :--- | :--- | | `actionNames` | `array` of `string` | | Action names to expose, in order — resolved from the actions declared on the object. With no names (and no host-supplied actions) nothing is looked up: the bar renders its empty placeholder on a design / preview surface and nothing at runtime | | `requiredPermissions` | `array` of `string` | | [ADR-0066] Capabilities the user must ALL hold — names that permission sets grant through `systemPermissions`, not object actions: `read` or `update` here is an ordinary capability name, not the object's read or edit permission. When the client has resolved the user's capabilities and any of these is missing, this block does not render its content; wherever it would otherwise render, an insufficient-permissions notice takes its place. Presentation only: it authorises nothing, and the data API still serves the same data to the same user. A client that cannot resolve the user's capabilities (no permission provider, or one that does not report `systemPermissions`) renders this block as if they were held — it fails open. | -| `location` | `enum`: `list_toolbar`, `list_item`, `record_header`, `record_more`, `record_related`, `record_section` | | Which declared action location this bar renders | +| `location` | `enum`: `list`, `record`, `record_page`, `record_row`, `record_related`, `record_section` | | Which declared action location this bar renders | | `align` | `enum`: `start`, `center`, `end` | | — | | `inline` | `boolean` | | Render in the flow instead of folding into the record header | | `variant` | `string` | | Passed to the Button primitive; a per-action variant overrides it | diff --git a/content/docs/ui/pages.mdx b/content/docs/ui/pages.mdx index c20b4f45264..39a5436e4d4 100644 --- a/content/docs/ui/pages.mdx +++ b/content/docs/ui/pages.mdx @@ -358,11 +358,12 @@ drawer lands on the authored one. There is no setting that keeps an authored pag or in the drawer. What carries over is what the object declares: its field groups and their order, field -permissions and visibility, the actions placed at `record_header` and `record_more`, one tab per +permissions and visibility, the actions placed at `record` and `record_page`, one tab per child table, the stage and the approval state. What does not is the page's own layout and anything that lives only on it: its tabs and sections, a related list or block placed only on the page, a banner, and `record_section` actions, which the standard page does not draw. To keep -such an action reachable off the full page, add `record_more` to its `locations`, and leave it +such an action reachable off the full page, add `record_page` to its `locations` with +`component: 'action:menu'` (so it sits in the header's `⋯` menu), and leave it out of the page header's `actions` list so the full page still draws it once. So the record's title and its main button should come from the object, which both pages read. @@ -401,7 +402,7 @@ such an object (`403 FEEDS_DISABLED`). a user's column sort is sent to the server. A list that declares `columns` fetches only the declared columns the user can read. - **Actions are ids.** By default a related list draws the child object's own actions: those - placed at `list_toolbar` as header buttons, and those at `list_item` or `record_related` in + placed at `list` as header buttons, and those at `record_row` or `record_related` in each row's menu (`record_related` shows only inside a parent record). Declaring `actions: ['export_contacts', 'send_welcome']` in the block's `properties` replaces that set, in that order; each action is still placed by its own `locations`, and `[]` shows @@ -418,15 +419,15 @@ unknown or retired key (`description`, `icon`, `breadcrumb`, `showStar`) is refu | :--- | :--- | :--- | | `title` | Derived from the record on a record page | Heading; `{field}` tokens interpolate against the record, and a token that resolves to nothing renders empty. Set it on a non-record page | | `subtitle` | — | The line under the title, interpolated the same way | -| `actions` | — | Ids of actions declared on the page's object. An authored list is the whole set: an action that declares `record_header` but is not named is not drawn, and omitting the key draws none of the object's actions. `placedActions` is the other way to say which actions | -| `placedActions` | — | `true` asks for every action of the object placed at `record_header` / `record_more`, read live, in place of an `actions` list, so an action another package adds is drawn without editing the page. Refused beside an authored `actions` list: keep one. The platform's user, organization and approval request pages set it | +| `actions` | — | Ids of actions declared on the page's object. An authored list is the whole set: an action that declares `record_page` but is not named is not drawn, and omitting the key draws none of the object's actions. `placedActions` is the other way to say which actions | +| `placedActions` | — | `true` asks for every action of the object placed at `record` / `record_page`, read live, in place of an `actions` list, so an action another package adds is drawn without editing the page. Refused beside an authored `actions` list: keep one. The platform's user, organization and approval request pages set it | | `recordChrome` | `true` | Draw the title as the record chip (object label, copy-id button, the record's picture when the object names an `imageField`); `false` keeps a bare heading | | `showCopyId` | `true` | The copy-record-id button in the chip | | `maxVisible` / `mobileMaxVisible` | 3 on every header (in a record page's header bar the number, authored or not, is an upper bound: actions that do not fit the bar's width fold as well) / 2 in a phone record page's bottom bar (the page's own actions; Edit is in the top bar's `⋯` there), 1 elsewhere | How many actions render inline before the rest fold into the `⋯` menu | | `aria` | — | ARIA attributes (`ariaLabel`, `ariaDescribedBy`, …) for the `
` element | -A named action renders only if its `locations` include `record_header` (inline) or -`record_more` (straight into `⋯`); an id that names no action renders nothing and is reported +A named action renders only if its `locations` include `record` or `record_page` (inline, +or straight into `⋯` when it sets `component: 'action:menu'`); an id that names no action renders nothing and is reported once in the browser console. Which actions take the inline slots is metadata too: actions are sorted by `order` (lower first; the host's Edit / Share / Delete use 100 and above, so authored actions outrank them), `variant: 'primary'` breaks ties, `variant: 'danger'` draws a diff --git a/content/docs/ui/print-pages.mdx b/content/docs/ui/print-pages.mdx index 5ecd1ba7dbc..d4f2d9136ff 100644 --- a/content/docs/ui/print-pages.mdx +++ b/content/docs/ui/print-pages.mdx @@ -199,7 +199,7 @@ export const GenerateInvoicePdf = defineAction({ method: 'POST', recordIdParam: 'recordId', // the clicked record's id bodyExtra: { app: 'sales', object: 'invoice', page: 'invoice_document' }, - locations: ['list_item'], + locations: ['record_row'], refreshAfter: true, }); ``` diff --git a/examples/app-crm/src/actions/convert-lead.action.ts b/examples/app-crm/src/actions/convert-lead.action.ts index e5801236156..f2cd9e46847 100644 --- a/examples/app-crm/src/actions/convert-lead.action.ts +++ b/examples/app-crm/src/actions/convert-lead.action.ts @@ -13,7 +13,7 @@ export const ConvertLeadAction = defineAction({ objectName: 'crm_lead', type: 'flow', target: 'crm_convert_lead_wizard', - locations: ['list_item', 'record_header', 'record_more'], + locations: ['record'], recordIdParam: 'recordId', // Conditional visibility (CEL): hide the action once the lead is already // converted — so the button disappears rather than the user clicking it and @@ -21,7 +21,7 @@ export const ConvertLeadAction = defineAction({ // guard as a server-side backstop. // // The `has()` half guards the SPARSE action face (#8990): this action reaches - // `list_item`, where the bound record is the row the view's `$select` + // `record_row`, where the bound record is the row the view's `$select` // projected. Without it, a lead list that does not project `status` aborts // the predicate at key resolution (`No such key: status`) and the button // silently vanishes for every row. `has()` alone is the guard because the diff --git a/examples/app-crm/test/action-predicate-sparse-face.test.ts b/examples/app-crm/test/action-predicate-sparse-face.test.ts index 361b530b946..e1385b9e81f 100644 --- a/examples/app-crm/test/action-predicate-sparse-face.test.ts +++ b/examples/app-crm/test/action-predicate-sparse-face.test.ts @@ -3,7 +3,7 @@ /** * #8990 — the CRM example's row action survives the SPARSE action face. * - * `crm_convert_lead` reaches `list_item`, so its `visible` predicate binds a + * `crm_convert_lead` reaches `record_row`, so its `visible` predicate binds a * LIST ROW carrying only the view's `$select` projection — not a total record. * Unguarded, `record.status != "converted"` aborts at key resolution on any * lead list that does not project `status`, and CEL's fault is fail-closed: the @@ -39,8 +39,8 @@ const source = describe('#8990 — crm_convert_lead visible on a sparse list row', () => { - it('reaches list_item, so the sparse binding is the real one', () => { - expect(ConvertLeadAction.locations).toContain('list_item'); + it('reaches the list row (`record` covers `record_row`), so the sparse binding is the real one', () => { + expect(ConvertLeadAction.locations).toContain('record'); }); it('is has()-guarded on the column it reads', () => { diff --git a/examples/app-showcase/src/ui/actions/index.ts b/examples/app-showcase/src/ui/actions/index.ts index be0fd4a42d7..e30d89a8557 100644 --- a/examples/app-showcase/src/ui/actions/index.ts +++ b/examples/app-showcase/src/ui/actions/index.ts @@ -81,7 +81,7 @@ export const MarkDoneAction = defineAction({ // the action. // // #8990 — `has()` guards the SPARSE action face: this action reaches - // `list_item`, so its predicate binds a list row carrying only the view's + // `record_row`, so its predicate binds a list row carrying only the view's // `$select` projection, and CEL aborts with `No such key: done` on any task // list that does not project the column (fail-closed, the button silently // is not offered). The comparison is `!= true` rather than the older @@ -92,7 +92,7 @@ export const MarkDoneAction = defineAction({ visible: 'has(record.done) && record.done != true', // No `record_section`: the Task Detail header already draws it, and its // quick-actions bar carries only what the header does not (one action row). - locations: ['list_item', 'record_header'], + locations: ['record'], refreshAfter: true, }); @@ -118,14 +118,14 @@ export const ReopenTaskAction = defineAction({ operation: 'update', patch: { done: false }, execution: 'perRecord', - // #8990 — `has()` guards the sparse `list_item` face, as on Mark Done. + // #8990 — `has()` guards the sparse `record_row` face, as on Mark Done. visible: 'has(record.done) && record.done == true', // The task list's row menu only. The Task Detail page's header lists its // action ids explicitly (`showcase_task_detail`, `kind: 'full'`), and // `test/record-action-location-hosts.test.ts` holds that list equal to the - // task's `record_header` / `record_more` set, so adding `record_header` here + // task's `record` / `record_page` set, so adding `record_page` here // means adding the id to that header too. - locations: ['list_item'], + locations: ['record_row'], refreshAfter: true, }); @@ -137,12 +137,12 @@ export const OpenDocsAction = defineAction({ objectName: task, type: 'url', target: 'https://objectstack.ai', - locations: ['record_more'], + locations: ['record_page'], component: 'action:menu', refreshAfter: false, }); /** - * flow — launch the Reassign screen-flow wizard. Row-level (`list_item`) so the + * flow — launch the Reassign screen-flow wizard. Row-level (`record_row`) so the * row's `recordId` flows into the flow, which collects `new_assignee` via a * `screen` node and writes it back with `update_record`. The objectui * FlowRunner renders the screen and resumes the run. @@ -154,7 +154,7 @@ export const BulkReassignAction = defineAction({ objectName: task, type: 'flow', target: 'showcase_reassign_wizard', - locations: ['list_item', 'list_toolbar'], + locations: ['record_row', 'list'], refreshAfter: true, }); @@ -166,7 +166,7 @@ export const QuickViewAction = defineAction({ objectName: task, type: 'modal', target: 'showcase_component_gallery', - locations: ['list_item'], + locations: ['record_row'], refreshAfter: false, }); @@ -191,13 +191,14 @@ export const RecalcEstimateAction = defineAction({ successMessage: "Estimate recalculated for {{ record.title | default:'the task' }}.", // `record_section`: the Task Detail page's `record:quick_actions` bar names // it, and the engine location-filters even explicitly-named actions. And - // `record_more` (objectstack#36150): the authored page is drawn on the + // `record_page` folded into the header's ⋯ (`component: 'action:menu'`, + // formerly `record_more`; objectstack#36150): the authored page is drawn on the // desktop full page only, and on a phone or in the side drawer the task // takes the standard page, which draws no `record_section` action — the // ⋯ overflow is where the action is found there. The authored header lists // its action ids and leaves this one out, so the full page still draws it // once, in the bar. - locations: ['record_section', 'record_more'], + locations: ['record_section', 'record_page'], component: 'action:menu', // The endpoint is record-scoped and rejects a body without an id. On a // record surface the page supplies it; invoked from a LIST ROW (see the // `legacy_row_actions` view) nothing else can, so name the body key the @@ -230,7 +231,7 @@ export const RecalcEstimateAction = defineAction({ * warns about (`packages/lint/src/validate-action-locations.ts`), and `[]` is * that same nowhere said deliberately (see NewTaskAction). * - * So `record_more` here is an explicit SINGLE-RECORD placement, not a way of + * So `record_page` folded into the ⋯ here is an explicit SINGLE-RECORD placement, not a way of * dodging an everywhere-default: it puts the action in the record overflow * menu, where the dispatch carries exactly one id and the recalc endpoint's * flow reads it as a list of one (via `recordIdParam`). Placement being @@ -258,7 +259,7 @@ export const RecalcSelectionAction = defineAction({ // `result`, never the selection. So it names the record it ran against, and // says "the whole selection" only when no record is bound. successMessage: "Estimates recalculated for {{ record.title | default:'the whole selection' }}.", - locations: ['record_more'], + locations: ['record_page'], component: 'action:menu', recordIdParam: 'recordId', refreshAfter: true, }); @@ -275,7 +276,7 @@ export const LogTimeAction = defineAction({ // implicitly claims the `default` key), so pointing a form action there opens // a list as a form — now a build error (#2554). target: 'showcase_task.form', - locations: ['record_header', 'record_related'], + locations: ['record_page', 'record_related'], refreshAfter: true, }); @@ -291,7 +292,7 @@ export const AskAboutTaskAction = defineAction({ icon: 'sparkles', objectName: task, type: 'ask_ai', - locations: ['record_header'], + locations: ['record_page'], }); /** @@ -365,11 +366,11 @@ export const SubmitForSignoffAction = defineAction({ successMessage: "{{ record.name | default:'Invoice' }} submitted for finance + legal sign-off.", // Only on invoices not yet sent. `record.`-prefixed comparison, per the // ActionEngine's fail-closed CEL evaluation (see MarkDoneAction's note). - // #8990 — `has()` guards the sparse face this reaches via `list_item`; the + // #8990 — `has()` guards the sparse face this reaches via `record_row`; the // `!=` against a literal never faults on a projected NULL, so `has()` alone // is the whole guard. visible: "has(record.status) && record.status != 'sent'", - locations: ['list_item', 'record_header'], + locations: ['record'], refreshAfter: true, }); @@ -394,8 +395,8 @@ export const SubmitForSignoffAction = defineAction({ * `OS_PRINT_BROWSER_ENDPOINT`, and `OS_PRINT_CONSOLE_URL`), a record they may * not edit (attaching needs it), an impersonation session. * - * `list_item` puts it in the invoice list's row menu, where the console draws - * it. `record_header` is its record-page placement, beside Submit for Sign-off. + * `record_row` puts it in the invoice list's row menu, where the console draws + * it. `record_page` is its record-page placement, beside Submit for Sign-off. * ⚠️ The console draws record-header actions in a page's `page:header`, and a * print page may not hold one, so on the invoice's record page (a print page) * neither action is drawn until the console gives a print page a header host. @@ -413,7 +414,7 @@ export const GenerateInvoicePdfAction = defineAction({ recordIdParam: 'recordId', bodyExtra: { app: 'com.example.showcase', object: invoice, page: 'showcase_invoice_document' }, successMessage: 'The PDF is attached to the invoice.', - locations: ['list_item', 'record_header'], + locations: ['record'], refreshAfter: true, }); @@ -484,7 +485,7 @@ export const ActionParamGalleryAction = defineAction({ capabilities: [], }, successMessage: 'Params received — every widget type rendered through the shared field-widget map.', - locations: ['record_header', 'list_item'], + locations: ['record'], refreshAfter: false, }); @@ -522,7 +523,7 @@ export const ArchiveTaskAction = defineAction({ // "Not available for this record", which names neither. Display only; it // never gates the dispatch. disabledReason: 'Mark the task done first.', - locations: ['record_header'], + locations: ['record_page'], refreshAfter: false, }); diff --git a/examples/app-showcase/src/ui/actions/predicate-matrix.action.ts b/examples/app-showcase/src/ui/actions/predicate-matrix.action.ts index b8c889dd5e0..746a4debd12 100644 --- a/examples/app-showcase/src/ui/actions/predicate-matrix.action.ts +++ b/examples/app-showcase/src/ui/actions/predicate-matrix.action.ts @@ -21,8 +21,8 @@ * | surface | where it renders | * |---|---| * | list toolbar | above the list — no record in scope | - * | row kebab (`list_item`) | the `⋮` menu on each row | - * | record header (`record_header` / `record_more`) | the detail page | + * | row kebab (`record_row`) | the `⋮` menu on each row | + * | record header (`record` / `record_page`) | the detail page | * | selection bar | after ticking rows, from the view's `bulkActions` | * * They have drifted before, in both directions: the selection bar ignored @@ -96,7 +96,7 @@ * all evaluate on the record header and in its `⋯` overflow. Where the same * action is also declared elsewhere it agrees: the row `⋮` menu matches the * header on both specimens, and so does the selection bar for the six - * specimens the view names in `bulkActions`. `record_header` / `record_more` + * specimens the view names in `bulkActions`. `record` / `record_page` * hand the predicate to `evalRowPredicate` WHOLE, so the * `{ dialect: 'cel' }` envelope `defineAction` normalizes to is routed to * the canonical engine rather than flattened onto a dialect guess. @@ -146,8 +146,12 @@ const echo = { capabilities: [], }; -/** The four record-scoped surfaces, so one action can be compared across them. */ -const RECORD_SURFACES = ['list_item', 'record_header', 'record_more'] as const; +/** + * The record-scoped surfaces, so one action can be compared across them: + * `record` is the record page's header and each list row's menu + * (objectstack#36495 — formerly `record_row` + `record_page` + `record_more`). + */ +const RECORD_SURFACES = ['record'] as const; // ─────────────────────────────────────────────────────────────────────────── // 1 — Surface parity: ONE predicate over a relation field, on every surface @@ -251,8 +255,8 @@ export const ZooUserIdentityGateAction = defineAction({ * * | surface | Specimen — Full | Specimen — Minimal | * |---|---|---| - * | record header `⋯` (`record_more`) | OFFERED | absent | - * | row `⋮` menu (`list_item`) | OFFERED | absent | + * | record header `⋯` (`record`) | OFFERED | absent | + * | row `⋮` menu (`record`) | OFFERED | absent | * * ⚠️ The selection bar is deliberately NOT a row of that table: this action is * not named in either view's `bulkActions` (`field-zoo.view.ts`), so it never @@ -298,7 +302,7 @@ export const ZooDialectSplitAction = defineAction({ }); /** - * The toolbar twin. A `list_toolbar` action is evaluated with NO record in + * The toolbar twin. A `list` action is evaluated with NO record in * scope — there is no row it belongs to — so a record-scoped predicate here * would be an authoring error, not a demo. This one gates on identity alone, * which is the only kind of predicate the toolbar can honestly answer. @@ -312,7 +316,7 @@ export const ZooToolbarGateAction = defineAction({ body: echo, successMessage: 'Toolbar gate passed.', visible: 'os.user.id != null', - locations: ['list_toolbar'], + locations: ['list'], refreshAfter: false, }); @@ -372,7 +376,7 @@ export const ZooDisabledAction = defineAction({ type: 'script', body: echo, disabled: 'has(record.f_rating) && record.f_rating != null && record.f_rating < 4', - locations: ['record_header', 'record_section'], + locations: ['record_page', 'record_section'], refreshAfter: false, }); @@ -485,7 +489,7 @@ const zooTypeGate = (name: string, label: string, visible: string) => type: 'script', body: echo, visible, - locations: ['record_more'], + locations: ['record_page'], component: 'action:menu', refreshAfter: false, }); diff --git a/examples/app-showcase/src/ui/pages/project-detail.page.ts b/examples/app-showcase/src/ui/pages/project-detail.page.ts index 50088df66f4..7fd5ba3cb76 100644 --- a/examples/app-showcase/src/ui/pages/project-detail.page.ts +++ b/examples/app-showcase/src/ui/pages/project-detail.page.ts @@ -34,7 +34,7 @@ export const ProjectDetailPage = definePage({ width: 'full', components: [ // The title bar. A full page renders exactly the nodes it declares; - // `showcase_project` declares no `record_header` / `record_more` + // `showcase_project` declares no `record` / `record_page` // action, so the header carries none, as the synthesized one did. { type: 'page:header' }, // Explicit highlights strip — exercises the page editor's field-list picker @@ -130,7 +130,7 @@ export const ProjectDetailPage = definePage({ // // It is the same `record:related_list` node the synthesizer emits, // under the same record page, so its rows carry what a synthesized - // list's rows carry: the task's `list_item` actions, plus its + // list's rows carry: the task's `record_row` actions, plus its // `record_related` ones, which only render on a related list // inside a parent record. No `actions` key on purpose — authoring // one would replace those host-supplied actions with the list diff --git a/examples/app-showcase/src/ui/pages/review-queue.page.ts b/examples/app-showcase/src/ui/pages/review-queue.page.ts index 707960b3285..d82aef8fa14 100644 --- a/examples/app-showcase/src/ui/pages/review-queue.page.ts +++ b/examples/app-showcase/src/ui/pages/review-queue.page.ts @@ -14,7 +14,7 @@ import { definePage } from '@objectstack/spec/ui'; * (`has(record.done) && record.done != true`, #8990) has nothing to evaluate * against and the button would render * regardless of state. `MarkDoneAction.locations` already includes - * `list_item`, so it correctly appears per-row (with that row's record bound) + * `record_row`, so it correctly appears per-row (with that row's record bound) * instead. Tabs let the reviewer pivot to urgent or blocked work. */ export const ReviewQueuePage = definePage({ @@ -35,7 +35,7 @@ export const ReviewQueuePage = definePage({ appearance: { showDescription: true, allowedVisualizations: ['grid'] }, userActions: { sort: true, search: true, filter: false, rowHeight: false, addRecordForm: false }, // No `buttons:` entry here — see file header comment: "Mark Done" is a - // record-scoped action and belongs per-row (`list_item`), not as an + // record-scoped action and belongs per-row (`record_row`), not as an // unbound page-toolbar button. // Click a row → drawer with the full record to review before deciding. recordAction: 'drawer', diff --git a/examples/app-showcase/src/ui/pages/task-detail.page.ts b/examples/app-showcase/src/ui/pages/task-detail.page.ts index ea25cbcc485..537bb2e4e78 100644 --- a/examples/app-showcase/src/ui/pages/task-detail.page.ts +++ b/examples/app-showcase/src/ui/pages/task-detail.page.ts @@ -5,9 +5,9 @@ import { definePage } from '@objectstack/spec/ui'; /** * Task Detail — a record page that exercises the record-layout component set * beyond the basics: - * • `page:header` — the record title bar: the task's `record_header` - * actions inline and its `record_more` actions - * under the ⋯ overflow (see the node below). + * • `page:header` — the record title bar: the task's `record_page` + * actions inline and its folded ones + * (`component: 'action:menu'`) under the ⋯ overflow (see the node below). * • `record:path` — Salesforce-style status stepper across the task * lifecycle (Backlog → … → Done). * • `record:alert` — a conditional banner shown only while the task is @@ -38,20 +38,20 @@ export const TaskDetailPage = definePage({ components: [ // The title bar, composed explicitly. A `kind: 'full'` page renders // exactly the nodes it declares, and the header is one of them: with - // no `page:header` node the page has no title bar, so neither the - // `record_header` nor the `record_more` location has a surface here. + // no `page:header` node the page has no title bar, so the + // `record_page` location, inline or folded, has no surface here. // The synthesized default page (and a `kind: 'slotted'` page that // leaves the `header` slot alone) gets one automatically; this page // does not. // // `actions` are action IDS, resolved against `showcase_task`'s own // metadata, and the header still places each by its `locations`: - // `record_header` actions render as inline buttons, and an action - // declaring `record_more` without `record_header` always goes under - // the ⋯ overflow. The list is the object's whole `record_header` / - // `record_more` set, which is what the synthesized header would carry, - // less the actions the section bar below draws (they declare - // `record_more` only for the standard page a phone or the side drawer + // `record_page` actions render as inline buttons, and one folded with + // `component: 'action:menu'` (formerly `record_more`) always goes + // under the ⋯ overflow. The list is the object's whole `record_page` + // set, which is what the synthesized header would carry, less the + // actions the section bar below draws (they declare a folded + // `record_page` only for the standard page a phone or the side drawer // shows, objectstack#36150); `test/record-action-location-hosts.test.ts` // holds the two equal. // The host still appends its own Edit / Share / Delete after these. @@ -60,13 +60,13 @@ export const TaskDetailPage = definePage({ type: 'page:header', properties: { actions: [ - // record_header — inline buttons. + // record_page — inline buttons. 'showcase_mark_done', 'showcase_log_time', // ask_ai — opens the in-app assistant on this task (ADR-0160 D7). 'showcase_ask_about_task', 'showcase_archive_task', - // record_more only — the ⋯ overflow (url, api). + // record_page folded (action:menu) — the ⋯ overflow (url, api). 'showcase_open_docs', 'showcase_recalc_selection', ], diff --git a/examples/app-showcase/src/ui/views/task.view.ts b/examples/app-showcase/src/ui/views/task.view.ts index 6c7bb76e758..9690d9bad2f 100644 --- a/examples/app-showcase/src/ui/views/task.view.ts +++ b/examples/app-showcase/src/ui/views/task.view.ts @@ -131,12 +131,12 @@ export const TaskViews = defineView({ // action NAMES rather than defs. Both cases the client has to handle are // present here on purpose: // - // `showcase_recalc_estimate` — declared on the object at `record_more` / - // `record_section`, i.e. NOT a `list_item` action, so nothing derives a + // `showcase_recalc_estimate` — declared on the object at `record_page` (folded) / + // `record_section`, i.e. NOT a `record_row` action, so nothing derives a // def for it. The client must resolve the name against the object's // actions or the entry is a dead menu item. // - // `showcase_quick_view` — already a `list_item` action, so the client + // `showcase_quick_view` — already a `record_row` action, so the client // derives a def for it independently. Naming it here too must NOT // produce a second, dead copy alongside the working one. // @@ -179,7 +179,7 @@ export const TaskViews = defineView({ // (its flow runs the per-task recalculation for each). This is the "one zip for N devices" // dispatch shape; results are all-or-nothing, no per-row retry. // - // None declares `list_toolbar`: a bulk action is not a toolbar action, + // None declares `list`: a bulk action is not a toolbar action, // it needs a selection. Naming it here is the whole declaration. bulk_actions: { label: 'Bulk Actions', diff --git a/examples/app-showcase/test/action-predicate-sparse-face.test.ts b/examples/app-showcase/test/action-predicate-sparse-face.test.ts index 5ce35419851..8d5332639fe 100644 --- a/examples/app-showcase/test/action-predicate-sparse-face.test.ts +++ b/examples/app-showcase/test/action-predicate-sparse-face.test.ts @@ -4,7 +4,7 @@ * #8990 — the showcase's authored predicates survive the SPARSE action face. * * `predicate-matrix.action.ts` is a LIVE browser specimen: every gate in it is - * declared on `list_item` / `record_more`, so its `visible` binds a LIST ROW + * declared on `record` (the row and the record page), so its `visible` binds a LIST ROW * carrying only the view's `$select` projection — not a total record. Unguarded, * a predicate reading a column the list does not show aborts at key resolution, * and CEL's fault is fail-closed: the button silently is not offered, which diff --git a/examples/app-showcase/test/record-action-location-hosts.test.ts b/examples/app-showcase/test/record-action-location-hosts.test.ts index 3c27e000983..9d6bb130bf4 100644 --- a/examples/app-showcase/test/record-action-location-hosts.test.ts +++ b/examples/app-showcase/test/record-action-location-hosts.test.ts @@ -10,13 +10,14 @@ import { Task } from '../src/data/objects/task.object.js'; * Fixture gate: the showcase hosts the three record action locations for * `showcase_task` (objectstack#22030). * - * `records-forms.action-location-matrix` reads actions at `record_header`, - * `record_more` and `record_related` on `showcase_task`. A location needs a + * `records-forms.action-location-matrix` reads actions at `record_page` + * (inline and folded into the ⋯, `component: 'action:menu'`) and + * `record_related` on `showcase_task`. A location needs a * surface on a page the console actually renders, and the showcase had none: * * - Task Detail is `kind: 'full'`. Such a page renders exactly the nodes it * declares, and it declared no `page:header`, so there was no title bar for - * `record_header` actions and no ⋯ overflow for `record_more` ones. + * `record_page` actions and no ⋯ overflow for folded ones. * - Project Detail authors its own tab strip with a `record:line_items` grid * (a `kind: 'full'` page; until #27053 a slotted page's `tabs` slot). An * authored strip replaces the synthesized one, so the synthesized Tasks @@ -34,7 +35,7 @@ type AnyComponent = { [k: string]: unknown; }; type AnyPage = Record & { name?: unknown; type?: unknown; object?: unknown }; -type AnyAction = { name?: unknown; type?: unknown; objectName?: unknown; locations?: unknown }; +type AnyAction = { name?: unknown; type?: unknown; objectName?: unknown; locations?: unknown; component?: unknown }; /** Every component on a page — regions and slots alike, tab panels and children included. */ function allComponents(page: AnyPage): AnyComponent[] { @@ -75,6 +76,11 @@ const taskActions = ((stack.actions ?? []) as AnyAction[]).filter((a) => a.objec const locationsOf = (a: AnyAction): string[] => Array.isArray(a.locations) ? (a.locations as string[]) : []; const declares = (location: string) => (a: AnyAction): boolean => locationsOf(a).includes(location); +/** `declares`, plus `record` covering `record_page` and `record_row` (objectstack#36495, `actionRendersAt`). */ +const places = (location: string) => (a: AnyAction): boolean => + declares(location)(a) || ((location === 'record_page' || location === 'record_row') && declares('record')(a)); +/** Folded into the record header's ⋯ (`component: 'action:menu'`, formerly `record_more`). */ +const folded = (a: AnyAction): boolean => a.component === 'action:menu'; const actionNamed = (name: string): AnyAction | undefined => taskActions.find((a) => a.name === name); describe('showcase_task record action locations have a stock host (#22030)', () => { @@ -86,7 +92,7 @@ describe('showcase_task record action locations have a stock host (#22030)', () expect(projectPage?.name).toBe('showcase_project_detail'); }); - describe('record_header / record_more — the Task Detail title bar', () => { + describe('record / record_page — the Task Detail title bar', () => { const headers = taskPage ? allComponents(taskPage).filter((c) => c.type === 'page:header') : []; const ids = (headers[0]?.properties?.actions ?? []) as unknown[]; @@ -102,15 +108,16 @@ describe('showcase_task record action locations have a stock host (#22030)', () expect(result.data?.actions).toEqual(ids); }); - it('lists the task\'s whole record_header / record_more set — what the synthesized header carries — less the actions its section bar draws', () => { + it('lists the task\'s whole record / record_page set — what the synthesized header carries — less the actions its section bar draws', () => { expect(ids.every((id) => typeof id === 'string')).toBe(true); expect(new Set(ids).size, 'no id is listed twice').toBe(ids.length); - // An action placed at record_section AND record_more is drawn on this - // page by the quick-actions bar; `record_more` is its place on the - // standard page a phone or the drawer draws (objectstack#36150), so the - // authored header leaves it out (see the record_section block below). + // An action placed at record_section AND a folded record_page is drawn + // on this page by the quick-actions bar; the folded `record_page` is its + // place on the standard page a phone or the drawer draws + // (objectstack#36150), so the authored header leaves it out (see the + // record_section block below). const headerSet = taskActions - .filter((a) => declares('record_header')(a) || declares('record_more')(a)) + .filter(places('record_page')) .filter((a) => !declares('record_section')(a)) .map((a) => a.name as string); expect([...ids].sort()).toEqual([...headerSet].sort()); @@ -119,10 +126,10 @@ describe('showcase_task record action locations have a stock host (#22030)', () it('hosts at least one action at each location, and a url and an api action under the ⋯ overflow', () => { const listed = ids.map((id) => actionNamed(id as string)).filter((a): a is AnyAction => !!a); expect(listed).toHaveLength(ids.length); - expect(listed.filter(declares('record_header')).length).toBeGreaterThan(0); - // The overflow takes every action declaring record_more WITHOUT - // record_header, whatever the inline budget. - const overflowOnly = listed.filter((a) => declares('record_more')(a) && !declares('record_header')(a)); + expect(listed.filter((a) => places('record_page')(a) && !folded(a)).length).toBeGreaterThan(0); + // The overflow takes every record_page action folded with + // `component: 'action:menu'`, whatever the inline budget. + const overflowOnly = listed.filter((a) => places('record_page')(a) && folded(a)); expect(overflowOnly.map((a) => a.type)).toEqual(expect.arrayContaining(['url', 'api'])); }); }); @@ -143,7 +150,7 @@ describe('showcase_task record action locations have a stock host (#22030)', () expect(fk?.reference).toBe('showcase_project'); }); - it('authors no `actions`, so its rows carry the host\'s list_item + record_related actions', () => { + it('authors no `actions`, so its rows carry the host\'s record_row + record_related actions', () => { expect(relatedLists).toHaveLength(1); expect(props).not.toHaveProperty('actions'); expect(taskActions.filter(declares('record_related')).length).toBeGreaterThan(0); @@ -192,7 +199,7 @@ describe('showcase_task record action locations have a stock host (#22030)', () // INLINE in a header, so neither page draws one twice in view. const inlineToo = taskActions .filter(declares('record_section')) - .filter(declares('record_header')) + .filter((a) => places('record_page')(a) && !folded(a)) .map((a) => a.name); expect(inlineToo).toEqual([]); }); @@ -200,16 +207,17 @@ describe('showcase_task record action locations have a stock host (#22030)', () it('reaches every record_section action on the standard page too, under the ⋯ overflow (objectstack#36150)', () => { // A phone and the side drawer draw the standard page, which has no // section bar: an action the bar hosts is found there through its - // `record_more` location, which the synthesized header reads. + // folded `record_page` location, which the synthesized header reads. const sectionSet = taskActions.filter(declares('record_section')); expect(sectionSet.length).toBeGreaterThan(0); - expect(sectionSet.filter((a) => !declares('record_more')(a)).map((a) => a.name)).toEqual([]); + expect(sectionSet.filter((a) => !(places('record_page')(a) && folded(a))).map((a) => a.name)).toEqual([]); }); }); it('every record location keeps a stock host for a task action', () => { - for (const location of ['record_header', 'record_more', 'record_related', 'record_section']) { - expect(taskActions.filter(declares(location)).length, location).toBeGreaterThan(0); + for (const location of ['record_page', 'record_related', 'record_section']) { + expect(taskActions.filter(places(location)).length, location).toBeGreaterThan(0); } + expect(taskActions.filter((a) => places('record_page')(a) && folded(a)).length, 'record_page folded').toBeGreaterThan(0); }); }); diff --git a/examples/app-todo/src/actions/task.actions.ts b/examples/app-todo/src/actions/task.actions.ts index fa9b1c3cf2f..f4bb9cfe615 100644 --- a/examples/app-todo/src/actions/task.actions.ts +++ b/examples/app-todo/src/actions/task.actions.ts @@ -10,7 +10,7 @@ export const CompleteTaskAction = defineAction({ icon: 'check-circle', type: 'script', target: 'completeTask', - locations: ['record_header', 'list_item'], + locations: ['record'], successMessage: 'Task marked as complete!', refreshAfter: true, ai: { @@ -27,7 +27,7 @@ export const StartTaskAction = defineAction({ icon: 'play-circle', type: 'script', target: 'startTask', - locations: ['record_header', 'list_item'], + locations: ['record'], successMessage: 'Task started!', refreshAfter: true, ai: { @@ -55,7 +55,7 @@ export const DeferTaskAction = defineAction({ icon: 'clock', type: 'script', target: 'deferTask', - locations: ['record_header'], + locations: ['record_page'], params: [ { name: 'new_due_date', @@ -82,7 +82,7 @@ export const SetReminderAction = defineAction({ icon: 'bell', type: 'script', target: 'setReminder', - locations: ['record_header', 'list_item'], + locations: ['record'], params: [ { name: 'reminder_date', @@ -103,7 +103,7 @@ export const CloneTaskAction = defineAction({ icon: 'copy', type: 'script', target: 'cloneTask', - locations: ['record_header'], + locations: ['record_page'], successMessage: 'Task cloned successfully!', refreshAfter: true, ai: { @@ -126,7 +126,7 @@ export const MassCompleteTasksAction = defineAction({ type: 'script', target: 'massCompleteTasks', execution: 'perRecord', - locations: ['list_toolbar'], + locations: ['list'], successMessage: 'Selected tasks marked as complete!', refreshAfter: true, ai: { @@ -143,7 +143,7 @@ export const DeleteCompletedAction = defineAction({ icon: 'trash', type: 'script', target: 'deleteCompletedTasks', - locations: ['list_toolbar'], + locations: ['list'], // Destructive + irreversible — flag as danger so Studio paints it red // and the AI tool runtime routes through the HITL approval queue when // `enableActionApproval` is on. @@ -168,7 +168,7 @@ export const ExportToCsvAction = defineAction({ icon: 'download', type: 'script', target: 'exportTasksToCSV', - locations: ['list_toolbar'], + locations: ['list'], successMessage: 'Export completed!', refreshAfter: false, ai: { diff --git a/packages/cli/src/commands/generate.ts b/packages/cli/src/commands/generate.ts index 7a7a6cc3d30..4fa61374e37 100644 --- a/packages/cli/src/commands/generate.ts +++ b/packages/cli/src/commands/generate.ts @@ -503,7 +503,7 @@ export default ${toCamelCase(name)}Views; * * `locations` places it (#21325): an action with none, that no view * places by name, renders on no surface, and `os validate` says so - * (`action-no-placement`). `record_header` is the button on the record it + * (`action-no-placement`). `record_page` is the button on the record it * acts on; the emitted comment names the rest of the vocabulary and the * explicit headless `[]`. * @@ -519,7 +519,7 @@ export default ${toCamelCase(name)}Views; * field the object declares, so the click opens a dialog for that value and * writes it to the record as the signed-in user. `type` is left at its * default (`'script'`, the route the write is posted to; any other type is - * refused beside the operation), and `locations` leaves out `list_toolbar`, + * refused beside the operation), and `locations` leaves out `list`, * which `ActionSchema` refuses for an update (no current record there). */ namesObject: true, @@ -556,21 +556,21 @@ export default ${toCamelCase(name)}Action; // runs it. operation: 'update', params: [{ field: ${tsString(field)} }], - // Where the button is drawn: the record's header. Others: 'record_more', - // 'record_section', 'list_item' (not 'list_toolbar': an update needs the + // Where the button is drawn: the record's header. Others: 'record' (the + // header and each list row), 'record_section', 'record_row' (not 'list': an update needs the // record it writes). An action meant only for REST / MCP / AI callers says // so with an empty list. - locations: ['record_header'], + locations: ['record_page'], ${footer}`; } return `${header} // Runs the flow named in \`target\` against the record it is invoked on. type: 'flow', target: ${tsString(bindings.flow)}, - // Where the button is drawn: the record's header. Others: 'record_more', - // 'record_section', 'list_item', 'list_toolbar'. An action meant only for + // Where the button is drawn: the record's header. Others: 'record' (the + // header and each list row), 'record_section', 'record_row', 'list'. An action meant only for // REST / MCP / AI callers says so with an empty list. - locations: ['record_header'], + locations: ['record_page'], ${footer}`; }, }, diff --git a/packages/cli/test/package-install-local-handlers.integration.test.ts b/packages/cli/test/package-install-local-handlers.integration.test.ts index 31de0eec3eb..423cd3bf749 100644 --- a/packages/cli/test/package-install-local-handlers.integration.test.ts +++ b/packages/cli/test/package-install-local-handlers.integration.test.ts @@ -88,7 +88,7 @@ const COMPLETE_TASK = { name: 'complete_task', label: 'Complete Task', objectName: OBJECT, - locations: ['record_header'], + locations: ['record_page'], type: 'script', body: { language: 'js', diff --git a/packages/cli/test/serve-boot-diagnostics-noise-budget.e2e.test.ts b/packages/cli/test/serve-boot-diagnostics-noise-budget.e2e.test.ts index b9e3809fa90..8eb3237bf65 100644 --- a/packages/cli/test/serve-boot-diagnostics-noise-budget.e2e.test.ts +++ b/packages/cli/test/serve-boot-diagnostics-noise-budget.e2e.test.ts @@ -99,7 +99,7 @@ export const ResolveTicketAction = defineAction({ icon: 'check-circle', operation: 'update', patch: { status: 'resolved' }, - locations: ['record_header', 'list_item'], + locations: ['record'], visible: 'has(record.status) && record.status != "resolved" && record.status != "closed"', successMessage: 'Ticket resolved.', refreshAfter: true, @@ -112,7 +112,7 @@ export const EscalateTicketAction = defineAction({ icon: 'arrow-up', type: 'script', target: 'escalateTicket', - locations: ['record_header'], + locations: ['record_page'], }); `; diff --git a/packages/cli/test/verify-author-time-stage.test.ts b/packages/cli/test/verify-author-time-stage.test.ts index 48b4ebe6e42..8f323ffbe33 100644 --- a/packages/cli/test/verify-author-time-stage.test.ts +++ b/packages/cli/test/verify-author-time-stage.test.ts @@ -101,7 +101,7 @@ function taskApp(planted: boolean): Record { objectName: 'vg_task', type: 'url', target: 'https://example.com/help', - locations: ['record_header'], + locations: ['record_page'], visible: planted ? 'done != true' : 'record.done != true', }, ], diff --git a/packages/cloud-connection/src/marketplace-install-local-register-refusal.test.ts b/packages/cloud-connection/src/marketplace-install-local-register-refusal.test.ts index 37b7d8af11b..d8930f24f66 100644 --- a/packages/cloud-connection/src/marketplace-install-local-register-refusal.test.ts +++ b/packages/cloud-connection/src/marketplace-install-local-register-refusal.test.ts @@ -101,7 +101,7 @@ const obj = (name: string, fields: Bag = { title: { name: 'title', type: 'text', const recordPage = (name: string, object: string) => ({ name, label: name, type: 'record', object, isDefault: true, regions: [] }); /** A top-level action bound by `objectName` to `objectName`. */ const boundAction = (objectName: string) => ({ - name: 'routing_ping', label: 'Ping', objectName, type: 'url', target: 'https://example.com/ping', locations: ['record_header'], + name: 'routing_ping', label: 'Ping', objectName, type: 'url', target: 'https://example.com/ping', locations: ['record_page'], }); /** A package version whose namespace is its id's last segment. */ diff --git a/packages/lint/src/rule-explanations.ts b/packages/lint/src/rule-explanations.ts index d877ce13c05..3203e3f7042 100644 --- a/packages/lint/src/rule-explanations.ts +++ b/packages/lint/src/rule-explanations.ts @@ -3736,7 +3736,7 @@ const RECORD_PAGE_HEADER_ACTIONS_DIFFER_EXPLANATION: RuleExplanation = { '`variant: \'primary\'`, else the first button. The incoming order is where the two pages differ: the ' + 'full page takes it from the header\'s `actions` list, the standard page (phone, drawer, preview) from ' + 'the object\'s action declaration order, and the standard page draws every action placed at ' + - '`record_header` or `record_more`, listed or not. This finding means the two give a different primary ' + + '`record` or `record_page`, listed or not. This finding means the two give a different primary ' + 'button, or the listed actions in a different order.', 'The order has one declaration point, the actions. Give each an `order` (lower first) and the main one ' + '`variant: \'primary\'`, and both pages sort alike; the header\'s list then only chooses which actions ' + @@ -5651,22 +5651,22 @@ const ACTION_NAME_UNDEFINED_EXPLANATION: RuleExplanation = { '`actions`; a `record:related_list`\'s `actions`; an `action` nav entry\'s ' + '`actionDef.actionName`; and an `object` nav entry\'s deep-link `runAction`.', 'A name resolves when any action in the stack carries it: a `stack.actions` entry or an entry ' + - 'of any object\'s `actions`. The runtime ships no built-in action names (`list_toolbar` and ' + - '`list_item` are locations, not actions), so a name that resolves nowhere is dead: most ' + + 'of any object\'s `actions`. The runtime ships no built-in action names (`list` and ' + + '`record_row` are locations, not actions), so a name that resolves nowhere is dead: most ' + 'surfaces draw a button that does nothing when clicked, the alert drops its call-to-action ' + 'without a word, and the header draws no button, with only a browser-console warning. An ' + 'error: there is no cross-package escape to soften it with, and an action another installed ' + 'package contributes is the one legitimate miss.', 'To fix a miss, define the action — a `stack.actions` entry or an entry of the object\'s `actions` — ' + 'placed where the surface looks for it, or remove the reference. A `page:header` draws only actions ' + - 'placed at `record_header` or `record_more`, so a header action needs one of the two in its ' + + 'placed at `record` or `record_page`, so a header action needs one of the two in its ' + '`locations`; the selection bar and an alert\'s call-to-action place an action by name, with no ' + '`locations` entry.', // The drawn locations are held to the rule by its test, over every location. 'A `record:related_list` is the exception, and resolves the way its renderer does: against the ' + 'RELATED object\'s own actions (written on it, or a `stack.actions` entry bound to it by ' + '`objectName`), never the page\'s object or a global action, and only an action placed at a ' + - 'location the list draws (`list_toolbar` as a header button, `list_item` and `record_related` ' + + 'location the list draws (`list` as a header button, `record`, `record_row` and `record_related` ' + 'as a row-menu item): naming it in `actions` is not a placement. An id that misses either test ' + 'draws no button, only a refusal notice above the list. So define the action on the related ' + 'object (in its `actions`, or in `stack.actions` with `objectName` naming it) with one of those ' + @@ -6282,7 +6282,7 @@ const ACTION_NO_PLACEMENT_EXPLANATION: RuleExplanation = { 'publishes and is listed in Setup, and no user can ever click it — the ADR-0078 shape of a ' + 'declaration that renders nothing.', // Held equal to `ACTION_LOCATIONS` (`@objectstack/spec/ui`) by the rule's test. - 'The locations an action can declare: `list_toolbar`, `list_item`, `record_header`, `record_more`, ' + + 'The locations an action can declare: `list`, `record`, `record_page`, `record_row`, ' + '`record_related`, `record_section`. A list view places an action by NAME instead: naming it in ' + '`bulkActions` or `bulkActionDefs` puts it on the selection bar, which the view drives, never ' + '`locations` (an action that only makes sense over a selection has no single-record location). ' + diff --git a/packages/lint/src/runtime-gate.inert-type-writes.test.ts b/packages/lint/src/runtime-gate.inert-type-writes.test.ts index c9c2bf48eaf..9c77a4a7fb6 100644 --- a/packages/lint/src/runtime-gate.inert-type-writes.test.ts +++ b/packages/lint/src/runtime-gate.inert-type-writes.test.ts @@ -244,7 +244,7 @@ describe('#19542 — the `action` door (validateStackExpressions)', () => { label: 'Convert Lead', objectName: 'crm_lead', icon: 'ArrowRightCircle', - locations: ['list_item', 'record_header', 'record_more'], + locations: ['record'], type: 'flow', target: 'crm_convert_lead_wizard', refreshAfter: false, diff --git a/packages/lint/src/runtime-lazy-deps.test.ts b/packages/lint/src/runtime-lazy-deps.test.ts index 55f2d370095..5ebb73c44a8 100644 --- a/packages/lint/src/runtime-lazy-deps.test.ts +++ b/packages/lint/src/runtime-lazy-deps.test.ts @@ -164,7 +164,7 @@ const GATED_ACTION = { label: 'Approve', objectName: 'leave_request', type: 'script', - locations: ['record_header'], + locations: ['record_page'], body: { language: 'js', source: "await ctx.api.object('leave_request').update({ id: ctx.recordId, owner: 'x' });" }, }; diff --git a/packages/lint/src/validate-action-body-capabilities.test.ts b/packages/lint/src/validate-action-body-capabilities.test.ts index da64303bf55..872fbb973f0 100644 --- a/packages/lint/src/validate-action-body-capabilities.test.ts +++ b/packages/lint/src/validate-action-body-capabilities.test.ts @@ -29,7 +29,7 @@ const action = (source: string, capabilities?: string[], extra: Record ({ name: 'crm_convert_lead', label: 'Convert', type: 'script', - locations: ['record_header'], + locations: ['record_page'], }, ], }); diff --git a/packages/lint/src/validate-action-locations.ts b/packages/lint/src/validate-action-locations.ts index 4d241e752a5..affb27189fd 100644 --- a/packages/lint/src/validate-action-locations.ts +++ b/packages/lint/src/validate-action-locations.ts @@ -156,7 +156,7 @@ export function validateActionLocations(stack: AnyRec): ActionLocationsFinding[] // vocabulary, name placement and the headless shape are // `os explain action-no-placement`. hint: - 'Declare where it renders, e.g. `locations: [\'record_header\']`, place it from a list view\'s ' + + 'Declare where it renders, e.g. `locations: [\'record_page\']`, place it from a list view\'s ' + '`bulkActions`, or write `locations: []` if it is headless (REST / MCP / AI only)', }); }; diff --git a/packages/lint/src/validate-action-name-refs.test.ts b/packages/lint/src/validate-action-name-refs.test.ts index 34827f0a558..3583f293ab2 100644 --- a/packages/lint/src/validate-action-name-refs.test.ts +++ b/packages/lint/src/validate-action-name-refs.test.ts @@ -325,24 +325,24 @@ describe('validateActionNameRefs — record:related_list actions', () => { { name: 'crm_account', fields: { name: { type: 'text' } }, - actions: [{ name: 'crm_merge_accounts', type: 'script', locations: ['record_header'] }], + actions: [{ name: 'crm_merge_accounts', type: 'script', locations: ['record_page'] }], }, { name: 'crm_contact', fields: { name: { type: 'text' } }, actions: [ { name: 'crm_log_call', type: 'script', locations: ['record_related'] }, - { name: 'crm_new_contact', type: 'script', locations: ['list_toolbar'] }, - { name: 'crm_email_contact', type: 'script', locations: ['list_item'] }, - { name: 'crm_pin_contact', type: 'script', locations: ['record_header'] }, + { name: 'crm_new_contact', type: 'script', locations: ['list'] }, + { name: 'crm_email_contact', type: 'script', locations: ['record_row'] }, + { name: 'crm_pin_contact', type: 'script', locations: ['record_page'] }, { name: 'crm_sync_contact', type: 'script', locations: [] }, { name: 'crm_score_contact', type: 'script' }, ], }, ], actions: [ - { name: 'crm_tag_contact', objectName: 'crm_contact', type: 'script', locations: ['list_item'] }, - { name: 'crm_export_all', type: 'script', locations: ['list_toolbar'] }, + { name: 'crm_tag_contact', objectName: 'crm_contact', type: 'script', locations: ['record_row'] }, + { name: 'crm_export_all', type: 'script', locations: ['list'] }, ], pages: [ { @@ -682,7 +682,7 @@ describe('[#22161] one-line verdicts — action-name-undefined', () => { fields: { name: { type: 'text' } }, actions: [ { name: 'crm_log_call', type: 'script', locations: ['record_related'] }, - { name: 'crm_pin', type: 'script', locations: ['record_header', 'record_more', 'record_section', 'list_item_x'] }, + { name: 'crm_pin', type: 'script', locations: ['record_page', 'record_section', 'list_item_x'] }, { name: 'crm_score', type: 'script' }, ], }, diff --git a/packages/lint/src/validate-action-name-refs.ts b/packages/lint/src/validate-action-name-refs.ts index b1183f51b13..19effce2dec 100644 --- a/packages/lint/src/validate-action-name-refs.ts +++ b/packages/lint/src/validate-action-name-refs.ts @@ -47,7 +47,7 @@ * carries the same severity: **error**. It is a genuine dead reference, and — * unlike an object name — there is no cross-package escape hatch to soften it * with. The runtime ships NO built-in action names (there is no - * `BUILTIN_ACTIONS` registry; `list_toolbar`/`list_item` are *locations*, not + * `BUILTIN_ACTIONS` registry; `list`/`record_row` are *locations*, not * actions), so a name resolving nowhere is dead, full stop. * * Scope note: this rule asks only "is this action defined ANYWHERE in the @@ -124,8 +124,9 @@ function collectActionNames(stack: AnyRec): Set { * What a `record:related_list` draws for an authored action placed at each * location of the spec's vocabulary (`ACTION_LOCATIONS`), or `null` where it * draws nothing. Read at objectui's `relatedListActions.ts` - * (`placeAuthoredRelatedListActions`): `list_toolbar` is a header button; - * `list_item` and `record_related` are a row-menu item. The list renders only + * (`placeAuthoredRelatedListActions`): `list` is a header button; + * `record`, `record_row` and `record_related` are a row-menu item (`record` + * covers each list row). The list renders only * inside a parent record, which is the one scope `record_related` names. * * Keyed by `ActionLocation`, so the vocabulary is read from the spec and never @@ -133,10 +134,10 @@ function collectActionNames(stack: AnyRec): Set { * classified here, instead of leaving a stale pair that silently refuses it. */ const RELATED_LIST_DRAWS: Readonly> = { - list_toolbar: 'a header button', - list_item: 'a row-menu item', - record_header: null, - record_more: null, + list: 'a header button', + record: 'a row-menu item', + record_page: null, + record_row: 'a row-menu item', record_related: 'a row-menu item', record_section: null, }; @@ -146,10 +147,23 @@ const RELATED_LIST_LOCATIONS: readonly ActionLocation[] = ACTION_LOCATIONS.filte (location) => RELATED_LIST_DRAWS[location] !== null, ); -/** `` `list_toolbar` (a header button), … `` — for a hint. */ -const RELATED_LIST_PLACEMENTS = RELATED_LIST_LOCATIONS.map( - (location) => `\`${location}\` (${RELATED_LIST_DRAWS[location]})`, -).join(', '); +/** + * `` `list` (a header button), `record`, `record_row` or `record_related` (a + * row-menu item) `` — for a hint: locations that draw the same thing share + * one parenthesis, in the spec's own order, so the one-line fix stays short. + */ +const RELATED_LIST_PLACEMENTS = (() => { + const groups = new Map(); + for (const location of RELATED_LIST_LOCATIONS) { + const draws = RELATED_LIST_DRAWS[location]!; + groups.set(draws, [...(groups.get(draws) ?? []), location]); + } + return [...groups].map(([draws, locations]) => { + const names = locations.map((l) => `\`${l}\``); + const list = names.length > 1 ? `${names.slice(0, -1).join(', ')} or ${names[names.length - 1]}` : names[0]; + return `${list} (${draws})`; + }).join(', '); +})(); /** * The actions a related list resolves an id against, for each object this @@ -491,7 +505,7 @@ export function validateActionNameRefs(stack: AnyRec): ActionNameRefFinding[] { // refused by the spec on its own, not a reference for this rule to // resolve — so only the string elements are checked, each at its // AUTHORED index. The header draws an authored action only when it is - // placed at `record_header` or `record_more`. + // placed at `record` or `record_page`. if (type === 'page:header' && Array.isArray(props.actions)) { const ids = props.actions as unknown[]; for (let hi = 0; hi < ids.length; hi++) { @@ -502,7 +516,7 @@ export function validateActionNameRefs(stack: AnyRec): ActionNameRefFinding[] { where, `${path}.properties.actions[${hi}]`, 'Page-header actions', - 'with `record_header` or `record_more` in its `locations`', + 'with `record` or `record_page` in its `locations`', 'the header draws no button for it', ); } diff --git a/packages/lint/src/validate-action-object-binding.test.ts b/packages/lint/src/validate-action-object-binding.test.ts index bbba2fbc6ec..ee3a4eb48eb 100644 --- a/packages/lint/src/validate-action-object-binding.test.ts +++ b/packages/lint/src/validate-action-object-binding.test.ts @@ -8,7 +8,7 @@ const action = (extra: Record) => ({ name: 'mark_done', label: describe('action-no-object-binding', () => { it('refuses a standalone action that declares a location and no objectName', () => { - const findings = validateActionObjectBinding({ actions: [action({ locations: ['record_header'] })] }); + const findings = validateActionObjectBinding({ actions: [action({ locations: ['record_page'] })] }); expect(findings).toHaveLength(1); expect(findings[0]).toMatchObject({ rule: ACTION_NO_OBJECT_BINDING, severity: 'error', path: 'actions[0].objectName' }); expect(findings[0].hint).toContain('locations: []'); @@ -17,16 +17,16 @@ describe('action-no-object-binding', () => { it('is silent on a bound action, a headless one, one with no `locations`, and one embedded on its object', () => { expect(validateActionObjectBinding({ actions: [ - action({ objectName: 'qa_task', locations: ['record_header'] }), + action({ objectName: 'qa_task', locations: ['record_page'] }), action({ name: 'sync_all', locations: [] }), action({ name: 'unplaced' }), ], - objects: [{ name: 'qa_task', actions: [action({ locations: ['record_header'] })] }], + objects: [{ name: 'qa_task', actions: [action({ locations: ['record_page'] })] }], })).toEqual([]); }); it('the runtime publish gate refuses the `action` write', () => { - const verdict = runRuntimeAuthoringRules({ type: 'action', item: action({ locations: ['list_toolbar'] }) }); + const verdict = runRuntimeAuthoringRules({ type: 'action', item: action({ locations: ['list'] }) }); expect(verdict.errors.map((f) => f.rule)).toContain(ACTION_NO_OBJECT_BINDING); }); }); diff --git a/packages/lint/src/validate-expressions.test.ts b/packages/lint/src/validate-expressions.test.ts index 97ff18ee0bb..9843a5a6ae1 100644 --- a/packages/lint/src/validate-expressions.test.ts +++ b/packages/lint/src/validate-expressions.test.ts @@ -1685,7 +1685,7 @@ describe('validateStackExpressions (ADR-0032 build-time)', () => { it('flags a bare-field `visible` on a stack action (the trap that hid Mark Done)', () => { const issues = validateStackExpressions({ objects: [{ name: 'showcase_task', fields: { done: { type: 'boolean' }, status: { type: 'select' } } }], - actions: [{ name: 'mark_done', objectName: 'showcase_task', type: 'script', locations: ['record_header'], visible: '!done' }], + actions: [{ name: 'mark_done', objectName: 'showcase_task', type: 'script', locations: ['record_page'], visible: '!done' }], }); const v = issues.filter(i => i.where.includes("action 'mark_done' visible")); expect(v).toHaveLength(1); diff --git a/packages/lint/src/validate-null-guards.ts b/packages/lint/src/validate-null-guards.ts index 2bc1ae6bf53..042269fe0ec 100644 --- a/packages/lint/src/validate-null-guards.ts +++ b/packages/lint/src/validate-null-guards.ts @@ -189,13 +189,13 @@ * or the object's field list — and the two hits in (2) prove it from one * file: identical `record. != null` guards on identical `locations`, * where `f_lookup`/`f_lookups` are NOT default-list columns (so the - * predicate faults on `list_item`) while `f_textarea` IS one (so it does + * predicate faults on `record_row`) while `f_textarea` IS one (so it does * not). Nothing in the action's own metadata distinguishes them. `&&` * short-circuiting makes it worse: `record.id == ctx.user.id && * record.two_factor_enabled != true` never reaches the absent key on a * row whose first conjunct is false, so whether a given predicate faults * depends on row DATA. A sound static rule would have to flag every - * `record.*` read on any action reaching `list_item` — 34 of 34, which + * `record.*` read on any action reaching `record_row` — 34 of 34, which * is a platform-contract finding, not a lint rule. * 4. **The prescription would be wrong.** `has()` guards absence, not * nullness: measured, `has(record.a) && record.a > 1` FAULTS on a diff --git a/packages/lint/src/validate-object-action-layout.test.ts b/packages/lint/src/validate-object-action-layout.test.ts index 66945fab9ab..4181f810a5a 100644 --- a/packages/lint/src/validate-object-action-layout.test.ts +++ b/packages/lint/src/validate-object-action-layout.test.ts @@ -22,16 +22,16 @@ const LEAD = { name: 'crm_lead', fields: { title: { type: 'text' } }, actions: [ - { name: 'convert_lead', label: 'Convert', locations: ['record_header'] }, - { name: 'log_call', label: 'Log call', locations: ['record_more'] }, - { name: 'mass_assign', label: 'Assign', locations: ['list_toolbar'] }, + { name: 'convert_lead', label: 'Convert', locations: ['record_page'] }, + { name: 'log_call', label: 'Log call', locations: ['record_page'], component: 'action:menu' }, + { name: 'mass_assign', label: 'Assign', locations: ['list'] }, { name: 'headless', label: 'Headless', locations: [] }, ], }; const stack = (extra: Record = {}, actionLayout?: unknown) => ({ objects: [{ ...LEAD, ...(actionLayout ? { actionLayout } : {}) }], - actions: [{ name: 'send_email', objectName: 'crm_lead', label: 'Send email', locations: ['record_header', 'list_toolbar'] }], + actions: [{ name: 'send_email', objectName: 'crm_lead', label: 'Send email', locations: ['record_page', 'list'] }], ...extra, }); diff --git a/packages/lint/src/validate-object-action-layout.ts b/packages/lint/src/validate-object-action-layout.ts index d9ffc7e36f6..29c3b660b04 100644 --- a/packages/lint/src/validate-object-action-layout.ts +++ b/packages/lint/src/validate-object-action-layout.ts @@ -18,8 +18,8 @@ import { recordsOf } from './object-graph.js'; * - `object-action-layout-unknown`: no action of that name is declared on the * object (its own `actions`, or a stack action whose `objectName` is it); * - `object-action-layout-not-placed`: the action is declared but not placed - * in that scope: `list_toolbar` for the `list` arm, `record_header` or - * `record_more` for the `record` arm (the record header draws both). A + * in that scope: `list` for the `list` arm, `record` or `record_page` + * for the `record` arm (the record header draws both). A * record action named in the `list` arm, or the reverse, is this. * * Both object positions are judged: an object's own `actionLayout`, and an @@ -59,8 +59,8 @@ type AnyRec = Record; /** The locations an arm's actions are placed at: the page's header draws an action placed at one of them. */ const ARM_LOCATIONS: Readonly> = { - list: ['list_toolbar'], - record: ['record_header', 'record_more'], + list: ['list'], + record: ['record', 'record_page'], }; function strName(v: unknown): string | undefined { diff --git a/packages/lint/src/validate-object-references.test.ts b/packages/lint/src/validate-object-references.test.ts index b962559ac51..c772de4ea31 100644 --- a/packages/lint/src/validate-object-references.test.ts +++ b/packages/lint/src/validate-object-references.test.ts @@ -582,7 +582,7 @@ describe('[#35143] validateObjectReferences — the object a seed, a flow node o const write = (objectName: string) => runRuntimeAuthoringRules({ type: 'action', - item: { name: 'go', label: 'Go', objectName, type: 'script', locations: ['record_header'], body: { language: 'js', source: 'return 1;' } }, + item: { name: 'go', label: 'Go', objectName, type: 'script', locations: ['record_page'], body: { language: 'js', source: 'return 1;' } }, context: { objects }, }); expect(objectRefErrors(write('crm_laed'))).toEqual(['actions[0].objectName']); @@ -593,7 +593,7 @@ describe('[#35143] validateObjectReferences — the object a seed, a flow node o const write = (packageScope?: { packageId: string; dependencies: string[] }) => runRuntimeAuthoringRules({ type: 'action', - item: { name: 'go', label: 'Go', objectName: 'crm_lead', type: 'script', locations: ['record_header'], body: { language: 'js', source: 'return 1;' } }, + item: { name: 'go', label: 'Go', objectName: 'crm_lead', type: 'script', locations: ['record_page'], body: { language: 'js', source: 'return 1;' } }, context: { objects: [] }, ...(packageScope ? { packageScope } : {}), }); @@ -607,7 +607,7 @@ describe('[#35143] validateObjectReferences — the object a seed, a flow node o const write = (dependencies: string[]) => runRuntimeAuthoringRules({ type: 'action', - item: { name: 'go', label: 'Go', objectName: 'crm_lead', type: 'script', locations: ['record_header'], body: { language: 'js', source: 'return 1;' } }, + item: { name: 'go', label: 'Go', objectName: 'crm_lead', type: 'script', locations: ['record_page'], body: { language: 'js', source: 'return 1;' } }, context: { objects: owned }, packageScope: { packageId: 'com.acme.ext', dependencies }, }); diff --git a/packages/lint/src/validate-record-page-header.test.ts b/packages/lint/src/validate-record-page-header.test.ts index d4e2c4c98b4..74e9cd4c644 100644 --- a/packages/lint/src/validate-record-page-header.test.ts +++ b/packages/lint/src/validate-record-page-header.test.ts @@ -36,9 +36,9 @@ const LEAD = { /** The lead's actions in source order, none declaring `order` or a variant. */ const leadActions = (): AnyRec[] => [ - { name: 'convert_lead', objectName: 'crm_lead', type: 'script', locations: ['record_header'] }, - { name: 'qualify_lead', objectName: 'crm_lead', type: 'script', locations: ['record_header'] }, - { name: 'schedule_followup', objectName: 'crm_lead', type: 'script', locations: ['record_header'] }, + { name: 'convert_lead', objectName: 'crm_lead', type: 'script', locations: ['record_page'] }, + { name: 'qualify_lead', objectName: 'crm_lead', type: 'script', locations: ['record_page'] }, + { name: 'schedule_followup', objectName: 'crm_lead', type: 'script', locations: ['record_page'] }, ]; const header = (properties: AnyRec): AnyRec => ({ type: 'page:header', properties }); @@ -153,13 +153,13 @@ describe('validateRecordPageHeader · the actions', () => { it('compares the row of buttons and the overflow menu apart, as they are drawn', () => { // `archive_lead` is overflow-only: wherever the list names it, it is drawn after every button. - const actions = [...leadActions(), { name: 'archive_lead', objectName: 'crm_lead', locations: ['record_more'] }]; + const actions = [...leadActions(), { name: 'archive_lead', objectName: 'crm_lead', locations: ['record_page'], component: 'action:menu' }]; const list = ['archive_lead', 'convert_lead', 'qualify_lead', 'schedule_followup']; expect(validateRecordPageHeader(stackOf(leadPage({ actions: list }), actions))).toEqual([]); }); it('counts an unlisted placed action that leads the standard page', () => { - const actions = [{ name: 'log_call', objectName: 'crm_lead', locations: ['record_header'], order: -5 }, ...leadActions()]; + const actions = [{ name: 'log_call', objectName: 'crm_lead', locations: ['record_page'], order: -5 }, ...leadActions()]; const list = ['convert_lead', 'qualify_lead', 'schedule_followup']; const findings = validateRecordPageHeader(stackOf(leadPage({ actions: list }), actions)); expect(findings.map((f) => f.rule)).toEqual([RECORD_PAGE_HEADER_ACTIONS_DIFFER]); @@ -167,7 +167,7 @@ describe('validateRecordPageHeader · the actions', () => { }); it('reads the object\'s own actions ahead of the stack\'s bound ones', () => { - const lead = { ...LEAD, actions: [{ name: 'qualify_lead', locations: ['record_header'] }] }; + const lead = { ...LEAD, actions: [{ name: 'qualify_lead', locations: ['record_page'] }] }; const stack = stackOf(leadPage({ actions: LISTED }), leadActions().slice(0, 1).concat(leadActions().slice(2)), [lead]); expect(validateRecordPageHeader(stack)).toEqual([]); }); @@ -175,9 +175,9 @@ describe('validateRecordPageHeader · the actions', () => { it('skips a destructive or menu-only action when picking the primary, as the renderer does', () => { // Unlisted, so only the standard page draws them, and first by order: neither is its primary. const actions = [ - { name: 'delete_lead', objectName: 'crm_lead', locations: ['record_header'], order: -9, variant: 'danger' }, - { name: 'more_menu', objectName: 'crm_lead', locations: ['record_header'], order: -8, component: 'action:menu' }, - { name: 'archive_lead', objectName: 'crm_lead', locations: ['record_more'], order: -7 }, + { name: 'delete_lead', objectName: 'crm_lead', locations: ['record_page'], order: -9, variant: 'danger' }, + { name: 'more_menu', objectName: 'crm_lead', locations: ['record_page'], order: -8, component: 'action:menu' }, + { name: 'archive_lead', objectName: 'crm_lead', locations: ['record_page'], component: 'action:menu', order: -7 }, ...leadActions(), ]; const list = ['convert_lead', 'qualify_lead', 'schedule_followup']; diff --git a/packages/lint/src/validate-record-page-header.ts b/packages/lint/src/validate-record-page-header.ts index e8397d437c2..7803ba5fd7d 100644 --- a/packages/lint/src/validate-record-page-header.ts +++ b/packages/lint/src/validate-record-page-header.ts @@ -29,7 +29,7 @@ import { walkPageComponents } from './page-walk.js'; * buttons. The incoming order is where the two differ: the full page's is * the header's `actions` list, the standard page's is the object's own * action declaration order, and the standard page draws every action the - * object places at `record_header` / `record_more`, listed or not. When that + * object places at `record` / `record_page`, listed or not. When that * gives a different primary button, or the listed actions in a different * order within the row of buttons or within the `⋯` (the two are drawn * apart), the header lists them in an order the actions do not declare: @@ -126,8 +126,11 @@ function objectActions(stack: AnyRec, object: AnyRec, objectName: string): AnyRe return out; } +/** objectui's `actionRendersAt`: `record` is drawn at `record_page` and at `record_row` (protocol 19). */ function placedIn(action: AnyRec, location: string): boolean { - return Array.isArray(action.locations) && action.locations.includes(location); + if (!Array.isArray(action.locations)) return false; + return action.locations.includes(location) + || ((location === 'record_page' || location === 'record_row') && action.locations.includes('record')); } /** The header renderer's sort: `order` ascending, `variant: 'primary'` first among equals, then incoming order. */ @@ -142,11 +145,11 @@ function headerSort(actions: readonly AnyRec[]): AnyRec[] { /** * An action the header draws as a button in its row: placed at - * `record_header`, and not pinned into the `⋯` by `component: 'action:menu'`. - * The rest (`record_more`-only, menu-pinned) are drawn in the `⋯` only. + * `record` or `record_page`, and not folded into the `⋯` by `component: + * 'action:menu'`. The rest (folded) are drawn in the `⋯` only. */ function isButton(action: AnyRec): boolean { - return placedIn(action, 'record_header') && action.component !== 'action:menu'; + return placedIn(action, 'record_page') && action.component !== 'action:menu'; } /** @@ -231,7 +234,7 @@ export function validateRecordPageHeader(stack: AnyRec): RecordPageHeaderFinding const universe = objectActions(stack, object, objectName); const byName = new Map(universe.map((a) => [a.name as string, a])); if (!listed.every((n) => byName.has(n))) continue; - const isPlaced = (a: AnyRec): boolean => placedIn(a, 'record_header') || placedIn(a, 'record_more'); + const isPlaced = (a: AnyRec): boolean => placedIn(a, 'record_page'); const fullPage = headerSort([...new Set(listed)].map((n) => byName.get(n)!).filter(isPlaced)); if (fullPage.length === 0) continue; diff --git a/packages/metadata-protocol/src/protocol-extension-arrangement.ts b/packages/metadata-protocol/src/protocol-extension-arrangement.ts index d347533ba14..23005045e63 100644 --- a/packages/metadata-protocol/src/protocol-extension-arrangement.ts +++ b/packages/metadata-protocol/src/protocol-extension-arrangement.ts @@ -77,7 +77,7 @@ const PRESCRIPTION: Readonly> = Object.free fieldGroups: "place what this package brings with `place`, e.g. `place: [{ field: 'tax_id', group: 'basic', after: 'industry' }]`", relatedLists: "place what this package brings with `place`, e.g. `place: [{ list: 'contract', after: 'opportunity' }]`", actionLayout: "place an action this package brings by the action's own `locations` and `order`, e.g. " - + "`{ name: 'send_quote', objectName: 'crm_lead', locations: ['record_more'], order: 50 }`", + + "`{ name: 'send_quote', objectName: 'crm_lead', locations: ['record_page'], component: 'action:menu', order: 50 }`", }); /** The sentence. Prescription inside the first 500 characters: a 4xx message crosses the REST boundary capped there. */ diff --git a/packages/metadata-protocol/src/protocol.object-cascade-delete-objects.test.ts b/packages/metadata-protocol/src/protocol.object-cascade-delete-objects.test.ts index 9ee8d9855d1..368f00f7760 100644 --- a/packages/metadata-protocol/src/protocol.object-cascade-delete-objects.test.ts +++ b/packages/metadata-protocol/src/protocol.object-cascade-delete-objects.test.ts @@ -57,8 +57,8 @@ const TASK = { label: 'Task', fields: { title: { name: 'title', type: 'text', label: 'Title' } }, actions: [ - { name: 'showcase_mark_done', label: 'Mark Done', type: 'script', locations: ['record_header'] }, - { name: 'showcase_snooze', label: 'Snooze', type: 'script', locations: ['record_header'] }, + { name: 'showcase_mark_done', label: 'Mark Done', type: 'script', locations: ['record_page'] }, + { name: 'showcase_snooze', label: 'Snooze', type: 'script', locations: ['record_page'] }, ], }; const PROJECT = { diff --git a/packages/metadata-protocol/src/protocol.object-disabled-actions.test.ts b/packages/metadata-protocol/src/protocol.object-disabled-actions.test.ts index 4f2cdb2bf7b..f2e228a2b5b 100644 --- a/packages/metadata-protocol/src/protocol.object-disabled-actions.test.ts +++ b/packages/metadata-protocol/src/protocol.object-disabled-actions.test.ts @@ -59,8 +59,8 @@ const TASK = { label: 'Task', fields: { title: { name: 'title', type: 'text', label: 'Title' } }, actions: [ - { name: 'showcase_mark_done', label: 'Mark Done', type: 'script', locations: ['record_header'] }, - { name: 'showcase_snooze', label: 'Snooze', type: 'script', locations: ['record_header'] }, + { name: 'showcase_mark_done', label: 'Mark Done', type: 'script', locations: ['record_page'] }, + { name: 'showcase_snooze', label: 'Snooze', type: 'script', locations: ['record_page'] }, ], }; const PROJECT = { diff --git a/packages/metadata-protocol/src/protocol.object-duplicate-action-name-refusal.test.ts b/packages/metadata-protocol/src/protocol.object-duplicate-action-name-refusal.test.ts index cf363c4c8c2..15c63820470 100644 --- a/packages/metadata-protocol/src/protocol.object-duplicate-action-name-refusal.test.ts +++ b/packages/metadata-protocol/src/protocol.object-duplicate-action-name-refusal.test.ts @@ -15,6 +15,8 @@ import { describe, expect, it } from 'vitest'; import { assertEngineDeleteDispatch, assertEngineUpdateDispatch, assertEngineFindOnePredicate, type EngineFindOneQueryInput } from '@objectstack/metadata-core'; import { ObjectStackProtocolImplementation } from './protocol.js'; +// Paid at collection, not inside a clocked case (check:test-source-alias). +import '@objectstack/lint'; /** The engine surface the repository write path touches (as the container-issue-descent harness). */ function makeProtocol() { @@ -52,7 +54,7 @@ async function rejection(promise: Promise): Promise { throw new Error('expected the save to be rejected, but it resolved'); } -const act = (name: string, label: string) => ({ name, label, type: 'script', target: 'noop', locations: ['record_header'] }); +const act = (name: string, label: string) => ({ name, label, type: 'script', target: 'noop', locations: ['record_page'] }); const itemWith = (actions: unknown[]) => ({ name: 'dup_item', diff --git a/packages/metadata-protocol/src/protocol.stored-action-gate-lowering.test.ts b/packages/metadata-protocol/src/protocol.stored-action-gate-lowering.test.ts index 7ad738fb125..c4f5ee4dfc3 100644 --- a/packages/metadata-protocol/src/protocol.stored-action-gate-lowering.test.ts +++ b/packages/metadata-protocol/src/protocol.stored-action-gate-lowering.test.ts @@ -18,6 +18,8 @@ import { ObjectSchema } from '@objectstack/spec/data'; import { ActionSchema } from '@objectstack/spec/ui'; import { assertEngineDeleteDispatch, assertEngineUpdateDispatch, assertEngineFindOnePredicate, type EngineFindOneQueryInput } from '@objectstack/metadata-core'; import { ObjectStackProtocolImplementation } from './protocol.js'; +// Paid at collection, not inside a clocked case (check:test-source-alias). +import '@objectstack/lint'; /** The engine surface the repository write path touches (as the external-binding harness). */ function makeProtocol() { @@ -56,16 +58,16 @@ function storedBody(rows: Record[], type: string, name: string) const SSO_ONLY = { name: 'sso_only', label: 'SSO only', type: 'url' as const, target: 'https://example.com/sso', - locations: ['record_header' as const], requiresFeature: 'ssoEnforced' as const, + locations: ['record_page' as const], requiresFeature: 'ssoEnforced' as const, }; const OWNER_ONLY = { name: 'owner_only', label: 'Owner only', type: 'url' as const, target: 'https://example.com/owner', - locations: ['record_header' as const], visible: "record.name != ''", + locations: ['record_page' as const], visible: "record.name != ''", requiresMembershipReach: 'delete_organization' as const, }; const PLAIN = { name: 'plain', label: 'Plain', type: 'url' as const, target: 'https://example.com/plain', - locations: ['record_header' as const], + locations: ['record_page' as const], }; const order = (actions: unknown[]) => ({ diff --git a/packages/objectql/src/bound-action-collision-report.test.ts b/packages/objectql/src/bound-action-collision-report.test.ts index add561cd63f..1bc5cbb96a4 100644 --- a/packages/objectql/src/bound-action-collision-report.test.ts +++ b/packages/objectql/src/bound-action-collision-report.test.ts @@ -36,14 +36,14 @@ const OWNER = { objects: [ObjectSchema.create({ name: 'bc_org', label: 'Org', fields: { name: { name: 'name', type: 'text', label: 'Name' } }, - actions: [{ name: 'rename', label: 'Rename', type: 'url', target: 'https://example.com/own', locations: ['record_header'] }], + actions: [{ name: 'rename', label: 'Rename', type: 'url', target: 'https://example.com/own', locations: ['record_page'] }], } as any)], }; /** Another package binding an action of the same NAME to the owner's object — a different declaration. */ const TWIN = { id: 'com.test.twin', name: 'twin', - actions: [{ name: 'rename', label: 'Rename (twin)', objectName: 'bc_org', type: 'url', target: 'https://example.com/twin', locations: ['record_header'] }], + actions: [{ name: 'rename', label: 'Rename (twin)', objectName: 'bc_org', type: 'url', target: 'https://example.com/twin', locations: ['record_page'] }], }; /** Another package carrying the owner's declaration itself, bound by `objectName` — one declaration, two packages. */ @@ -92,7 +92,7 @@ describe('the registry\'s bound-action collision audit', () => { const stack = defineStack({ manifest: { id: 'com.test.same', name: 'same', version: '1.0.0', type: 'app' }, objects: [{ name: 'bc_same', label: 'Same', fields: { name: { name: 'name', type: 'text', label: 'Name' } } }], - actions: [{ name: 'same_action', label: 'Same', objectName: 'bc_same', type: 'url', target: 'https://example.com', locations: ['record_header'] }], + actions: [{ name: 'same_action', label: 'Same', objectName: 'bc_same', type: 'url', target: 'https://example.com', locations: ['record_page'] }], } as any); // The JSON round trip is the compiled artifact's shape: two copies, not one reference. const engine = await engineWith([JSON.parse(JSON.stringify({ ...stack, ...stack.manifest }))]); diff --git a/packages/objectql/src/bound-action-foreign-object.test.ts b/packages/objectql/src/bound-action-foreign-object.test.ts index 625b259e4a5..98eada08b5b 100644 --- a/packages/objectql/src/bound-action-foreign-object.test.ts +++ b/packages/objectql/src/bound-action-foreign-object.test.ts @@ -157,14 +157,14 @@ const OWNER = { objects: [{ name: 'ba_org', label: 'Org', fields: { name: { name: 'name', type: 'text', label: 'Name' } }, - actions: [{ name: 'own_action', label: 'Own', type: 'url', target: 'https://example.com/own', locations: ['record_header'] }], + actions: [{ name: 'own_action', label: 'Own', type: 'url', target: 'https://example.com/own', locations: ['record_page'] }], }], }; /** The bound action another package declares for the owner's object. */ const BOUND = { name: 'rename_org', label: 'Rename', objectName: 'ba_org', type: 'url', - target: 'https://example.com/rename', locations: ['record_header'], + target: 'https://example.com/rename', locations: ['record_page'], requiredPermissions: ['org_admin'], }; @@ -235,7 +235,7 @@ describe('a bound top-level action reaches another package\'s object as served', const stack = defineStack({ manifest: { id: 'com.test.same', name: 'same', version: '1.0.0', type: 'app' }, objects: [{ name: 'ba_same', label: 'Same', fields: { name: { name: 'name', type: 'text', label: 'Name' } } }], - actions: [{ name: 'same_action', label: 'Same', objectName: 'ba_same', type: 'url', target: 'https://example.com', locations: ['record_header'] }], + actions: [{ name: 'same_action', label: 'Same', objectName: 'ba_same', type: 'url', target: 'https://example.com', locations: ['record_page'] }], } as any); const { protocol } = await hostWith([{ ...stack, ...stack.manifest }]); const served: any = await protocol.getMetaItem({ type: 'object', name: 'ba_same' } as any); @@ -367,7 +367,7 @@ describe('a bound action is served as its ActionSchema parse', () => { /** One declaration, carried both by the owner's object and by a binder package. */ const GATED = { label: 'Change slug', type: 'url' as const, target: 'https://example.com/slug', - locations: ['record_header' as const], visible: "record.name != ''", + locations: ['record_page' as const], visible: "record.name != ''", requiresFeature: 'multiOrgEnabled' as const, }; const LOWERED = { dialect: 'cel', source: "(record.name != '') && features.multiOrgEnabled != false" }; @@ -436,7 +436,7 @@ describe('a bound action saved at runtime through the metadata door reaches its /** The standalone action an author saves for the owner's object — no package ships it. */ const RUNTIME = { name: 'rt_action', label: 'Runtime', objectName: 'ba_org', type: 'url', - target: 'https://example.com/rt', locations: ['record_header'], + target: 'https://example.com/rt', locations: ['record_page'], }; const save = (protocol: ObjectStackProtocolImplementation, item: any, extra: Record = {}) => protocol.saveMetaItem({ type: 'action', name: item.name, item: structuredClone(item), ...extra } as any); @@ -557,28 +557,28 @@ const LAUNCHER = { fields: { name: { name: 'name', type: 'text', label: 'Name' } }, // An inline action, as the same-stack merge leaves a bound one: in the // object's own `actions`, not in the standalone collection. - actions: [{ name: 'inline_enroll', label: 'Enroll', type: 'flow', target: 'mk_enroll', locations: ['record_header'] }], + actions: [{ name: 'inline_enroll', label: 'Enroll', type: 'flow', target: 'mk_enroll', locations: ['record_page'] }], }], flows: [{ name: 'app_flow', label: 'App flow', type: 'autolaunched', nodes: [], edges: [] }], actions: [ // Withheld once the module is disabled: the flow only the module ships. - { name: 'bound_enroll', label: 'Enroll', objectName: 'mk_lead', type: 'flow', target: 'mk_enroll', locations: ['record_header'] }, + { name: 'bound_enroll', label: 'Enroll', objectName: 'mk_lead', type: 'flow', target: 'mk_enroll', locations: ['record_page'] }, // Withheld: a param backed by the module's object. { name: 'bound_override', label: 'Add to campaign', objectName: 'mk_lead', type: 'flow', target: 'app_flow', - locations: ['record_header'], + locations: ['record_page'], params: [{ name: 'campaignId', field: 'mk_campaign', objectOverride: 'mk_member', label: 'Campaign', required: true }], }, // Controls: an enabled flow, and a field param on the action's own object. - { name: 'bound_app_flow', label: 'Run', objectName: 'mk_lead', type: 'flow', target: 'app_flow', locations: ['record_header'] }, + { name: 'bound_app_flow', label: 'Run', objectName: 'mk_lead', type: 'flow', target: 'app_flow', locations: ['record_page'] }, { name: 'bound_field_param', label: 'Note', objectName: 'mk_lead', type: 'flow', target: 'app_flow', - locations: ['record_header'], params: [{ name: 'note', field: 'name', label: 'Note' }], + locations: ['record_page'], params: [{ name: 'note', field: 'name', label: 'Note' }], }, // Control: a URL action that names the module's object only in its text. - { name: 'bound_url_mention', label: 'Docs', objectName: 'mk_lead', type: 'url', target: 'https://example.com/mk_member', locations: ['record_header'] }, + { name: 'bound_url_mention', label: 'Docs', objectName: 'mk_lead', type: 'url', target: 'https://example.com/mk_member', locations: ['record_page'] }, // Withheld from GET /meta/action: bound to the module's object, whose own read is refused. - { name: 'bound_to_member', label: 'Member', objectName: 'mk_member', type: 'url', target: 'https://example.com/m', locations: ['record_header'] }, + { name: 'bound_to_member', label: 'Member', objectName: 'mk_member', type: 'url', target: 'https://example.com/m', locations: ['record_page'] }, ], }; diff --git a/packages/objectql/src/object-own-action-schema-parse.test.ts b/packages/objectql/src/object-own-action-schema-parse.test.ts index c6017f37648..f139c7297f9 100644 --- a/packages/objectql/src/object-own-action-schema-parse.test.ts +++ b/packages/objectql/src/object-own-action-schema-parse.test.ts @@ -26,7 +26,7 @@ import { ObjectQL } from './engine.js'; /** One gated declaration, authored on an object's own action. */ const GATED = { name: 'gated', label: 'Gated', type: 'url' as const, target: 'https://example.com/gated', - locations: ['record_header' as const], visible: "record.name != ''", + locations: ['record_page' as const], visible: "record.name != ''", requiresFeature: 'multiOrgEnabled' as const, }; const LOWERED = { dialect: 'cel', source: "(record.name != '') && features.multiOrgEnabled != false" }; diff --git a/packages/objectql/src/protocol-flow-custom-override.test.ts b/packages/objectql/src/protocol-flow-custom-override.test.ts index fc8152e0f52..aa0ba56c7a5 100644 --- a/packages/objectql/src/protocol-flow-custom-override.test.ts +++ b/packages/objectql/src/protocol-flow-custom-override.test.ts @@ -162,7 +162,7 @@ const actionBody = (label: string, extra: Record = {}) => ({ objectName: 'showcase_task', type: 'script', body: { language: 'js', source: `return { ran: '${label}' };` }, - locations: ['record_header', 'list_item'], + locations: ['record'], ...ACTION_GATES, ...extra, }); diff --git a/packages/objectql/src/protocol-meta-disabled-actions.test.ts b/packages/objectql/src/protocol-meta-disabled-actions.test.ts index 6d4c060ee0c..e8441789608 100644 --- a/packages/objectql/src/protocol-meta-disabled-actions.test.ts +++ b/packages/objectql/src/protocol-meta-disabled-actions.test.ts @@ -151,8 +151,8 @@ const SHOWCASE = { name: 'da_task', label: 'Task', fields: { name: { name: 'name', type: 'text', label: 'Name' } }, actions: [ - { name: 'da_mark_done', label: 'Mark Done', type: 'url', target: 'https://example.com/done', locations: ['record_header'] }, - { name: 'da_snooze', label: 'Snooze', type: 'url', target: 'https://example.com/snooze', locations: ['record_header'] }, + { name: 'da_mark_done', label: 'Mark Done', type: 'url', target: 'https://example.com/done', locations: ['record_page'] }, + { name: 'da_snooze', label: 'Snooze', type: 'url', target: 'https://example.com/snooze', locations: ['record_page'] }, ], }], }; diff --git a/packages/platform-objects/src/apps/setup-nav-per-user-stores.test.ts b/packages/platform-objects/src/apps/setup-nav-per-user-stores.test.ts index 804702b76f6..d528ad5b9b2 100644 --- a/packages/platform-objects/src/apps/setup-nav-per-user-stores.test.ts +++ b/packages/platform-objects/src/apps/setup-nav-per-user-stores.test.ts @@ -16,7 +16,7 @@ // view (the grid the menu entry opened) did not show, and authors no // `add` picker and no `actions` — so it exposes nothing new; // (4) the Linked Accounts list already served "Identity links", and the one -// row action that grid offered, `unlink_account`, is a `list_item` +// row action that grid offered, `unlink_account`, is a `record_row` // action, which a related list's host offers on its rows. // // Reach, stated so a green run is not read wider than it is: (1) reads @@ -147,6 +147,6 @@ describe('(4) Linked Accounts already serves "Identity links" (#23803)', () => { it('the grid\'s one row action, unlink_account, is offered on list rows', () => { const unlink = (SysAccount.actions ?? []).find((a) => a.name === 'unlink_account'); expect(unlink, 'sys_account lost unlink_account').toBeDefined(); - expect(unlink?.locations).toContain('list_item'); + expect(unlink?.locations).toContain('record'); }); }); diff --git a/packages/platform-objects/src/audit/sys-notification.object.ts b/packages/platform-objects/src/audit/sys-notification.object.ts index d7bdf56a51e..cb26db35184 100644 --- a/packages/platform-objects/src/audit/sys-notification.object.ts +++ b/packages/platform-objects/src/audit/sys-notification.object.ts @@ -100,7 +100,7 @@ export const SysNotification = ObjectSchema.create({ 'Send a message to everyone in your organization, or to the members you pick. It appears in each recipient’s notifications.', icon: 'send', variant: 'primary', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', target: '/api/v1/messaging/in-app-messages', requiredPermissions: ['setup.write'], diff --git a/packages/platform-objects/src/identity/invitation-delivery-copy.test.ts b/packages/platform-objects/src/identity/invitation-delivery-copy.test.ts index 13e9c3c8bff..90a5ca1121b 100644 --- a/packages/platform-objects/src/identity/invitation-delivery-copy.test.ts +++ b/packages/platform-objects/src/identity/invitation-delivery-copy.test.ts @@ -153,7 +153,7 @@ describe('sys_invitation.copy_invitation_link — the declaration', () => { it('is a script action bound to its handler by target, on the row menu and the record header', () => { expect(copy.type).toBe('script'); expect(copy.target).toBe('copy_invitation_link'); - expect(copy.locations).toEqual(['list_item', 'record_header']); + expect(copy.locations).toEqual(['record']); }); it('shows the answer in a copyable text dialog, the acceptUrl field', () => { diff --git a/packages/platform-objects/src/identity/invite-entry-toolbar.test.ts b/packages/platform-objects/src/identity/invite-entry-toolbar.test.ts index f9eae81e44b..3c0dcc1f0e7 100644 --- a/packages/platform-objects/src/identity/invite-entry-toolbar.test.ts +++ b/packages/platform-objects/src/identity/invite-entry-toolbar.test.ts @@ -71,10 +71,10 @@ function action(object: unknown, name: string): AnyAction { return found as AnyAction; } -/** Declared `list_toolbar` actions, in declaration order. */ +/** Declared `list` actions, in declaration order. */ function toolbarActions(object: unknown): AnyAction[] { return (((object as { actions?: AnyAction[] }).actions) ?? []) - .filter((a) => (a.locations ?? []).includes('list_toolbar')); + .filter((a) => (a.locations ?? []).includes('list')); } /** The three declaration sites of `invite_user`, as [label, object] rows. */ @@ -86,7 +86,7 @@ const MIRRORS: Array<[string, unknown]> = [ /** * Every declaration site: the three toolbar mirrors plus sys_organization's - * `record_header` copy (ruling 6228318638, B′ on #24034), which a + * `record_page` copy (ruling 6228318638, B′ on #24034), which a * `page:header` can name because it lives on the page's own object. Its * placement is pinned in `sys-organization-invite-action.test.ts`; what the * four must share — endpoint, gates, inputs — is pinned here. @@ -99,11 +99,11 @@ const ALL_MIRRORS: Array<[string, unknown]> = [ describe('invite_user — reachable from the default Members tab (#11544)', () => { it('is declared on sys_member, in the toolbar the Members tab renders', () => { // The regression itself: the whole defect was this action's ABSENCE from - // this one object. `list_toolbar` is what the org record page's + // this one object. `list` is what the org record page's // `record:related_list` over sys_member surfaces as header buttons // (objectui `RelatedRecordActionsBridge.deriveActions` → `RelatedList`). const invite = action(SysMember, 'invite_user'); - expect(invite.locations).toContain('list_toolbar'); + expect(invite.locations).toContain('list'); expect(invite.type).toBe('api'); expect(invite.target).toBe(INVITE_ENDPOINT); }); @@ -159,7 +159,7 @@ describe('invite_user — the mirrors agree (#11544)', () => { }); it.each(MIRRORS)('%s offers it from the list toolbar', (_name, object) => { - expect(action(object, 'invite_user').locations).toContain('list_toolbar'); + expect(action(object, 'invite_user').locations).toContain('list'); }); it.each(ALL_MIRRORS)('%s carries the same lowered `organization` capability gate', (_name, object) => { diff --git a/packages/platform-objects/src/identity/remove-pending-sso-user-visibility.test.ts b/packages/platform-objects/src/identity/remove-pending-sso-user-visibility.test.ts index 8e59b8d2d9a..2def89c2ae1 100644 --- a/packages/platform-objects/src/identity/remove-pending-sso-user-visibility.test.ts +++ b/packages/platform-objects/src/identity/remove-pending-sso-user-visibility.test.ts @@ -55,7 +55,7 @@ describe('Setup → Users offers Remove Pending User on a pending row, managed, expect(action.type).toBe('api'); expect(action.target).toBe('/api/v1/auth/admin/remove-sso-user'); expect(action.recordIdParam).toBe('userId'); - expect(action.locations).toEqual(['list_item', 'record_header']); + expect(action.locations).toEqual(['record']); // A confirmation is asked first (the parsed template, whatever its words). expect((action.confirmText as { source?: unknown } | undefined)?.source).toEqual(expect.any(String)); // The door mounts with or without the better-auth admin plugin, as Add / Import do. diff --git a/packages/platform-objects/src/identity/setup-list-empty-states.test.ts b/packages/platform-objects/src/identity/setup-list-empty-states.test.ts index 76a4b2e3320..8ccdd4b7f2f 100644 --- a/packages/platform-objects/src/identity/setup-list-empty-states.test.ts +++ b/packages/platform-objects/src/identity/setup-list-empty-states.test.ts @@ -131,7 +131,7 @@ describe('API Keys: Create Key through the existing mint route', () => { it('is declared as a primary list-toolbar action', () => { expect(create, 'sys_api_key declares no create_api_key action').toBeDefined(); - expect(create?.locations).toEqual(['list_toolbar']); + expect(create?.locations).toEqual(['list']); expect(create?.variant).toBe('primary'); expect(nonEmptyString(create?.label)).toBe(true); }); diff --git a/packages/platform-objects/src/identity/sys-account-link-social-retired.test.ts b/packages/platform-objects/src/identity/sys-account-link-social-retired.test.ts index c57f04d182a..8de42d350f4 100644 --- a/packages/platform-objects/src/identity/sys-account-link-social-retired.test.ts +++ b/packages/platform-objects/src/identity/sys-account-link-social-retired.test.ts @@ -71,7 +71,7 @@ describe('#21849 — unlink_account is unchanged by the retirement', () => { expect(unlink?.type).toBe('api'); expect(unlink?.target).toBe('/api/v1/auth/unlink-account'); expect(unlink?.mode).toBe('delete'); - expect(unlink?.locations).toEqual(['list_item', 'record_header']); + expect(unlink?.locations).toEqual(['record']); expect(unlink?.params).toEqual([ { name: 'accountId', field: 'id', defaultFromRow: true, required: true }, ]); diff --git a/packages/platform-objects/src/identity/sys-account.object.ts b/packages/platform-objects/src/identity/sys-account.object.ts index 7537ae960ab..fcd0134eb9a 100644 --- a/packages/platform-objects/src/identity/sys-account.object.ts +++ b/packages/platform-objects/src/identity/sys-account.object.ts @@ -63,7 +63,7 @@ export const SysAccount = ObjectSchema.create({ icon: 'unlink', variant: 'danger', mode: 'delete', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', target: '/api/v1/auth/unlink-account', // Confirm question on `description`, not `confirmText`: this action collects diff --git a/packages/platform-objects/src/identity/sys-api-key-action-copy.test.ts b/packages/platform-objects/src/identity/sys-api-key-action-copy.test.ts index 72150858c61..bf4d470e95f 100644 --- a/packages/platform-objects/src/identity/sys-api-key-action-copy.test.ts +++ b/packages/platform-objects/src/identity/sys-api-key-action-copy.test.ts @@ -4,7 +4,7 @@ // record-level success message names the record (the write-feedback // convention). // -// Both are `list_item` row actions. The console's runner fills a +// Both are `record_row` row actions. The console's runner fills a // `successMessage` `{{ record.* }}` hole from the row the dispatch carries // (ActionRunner `composeSuccessMessage`, pinned in objectui's // `ActionRunner.copyTemplate-13367.test.ts`, "the row a dispatch carries is diff --git a/packages/platform-objects/src/identity/sys-api-key.object.ts b/packages/platform-objects/src/identity/sys-api-key.object.ts index f2685705fed..a85487c05f5 100644 --- a/packages/platform-objects/src/identity/sys-api-key.object.ts +++ b/packages/platform-objects/src/identity/sys-api-key.object.ts @@ -103,7 +103,7 @@ export const SysApiKey = ObjectSchema.create({ icon: 'plus-circle', variant: 'primary', mode: 'create', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', method: 'POST', target: '/api/v1/keys', @@ -145,7 +145,7 @@ export const SysApiKey = ObjectSchema.create({ icon: 'shield-off', variant: 'danger', mode: 'custom', - locations: ['list_item'], + locations: ['record_row'], type: 'api', method: 'PATCH', target: '/api/v1/data/sys_api_key/{id}', @@ -175,7 +175,7 @@ export const SysApiKey = ObjectSchema.create({ icon: 'shield-check', variant: 'secondary', mode: 'custom', - locations: ['list_item'], + locations: ['record_row'], type: 'api', method: 'PATCH', target: '/api/v1/data/sys_api_key/{id}', diff --git a/packages/platform-objects/src/identity/sys-idp-group-mapping-actions.test.ts b/packages/platform-objects/src/identity/sys-idp-group-mapping-actions.test.ts index 6340afcd634..8c78afd3d26 100644 --- a/packages/platform-objects/src/identity/sys-idp-group-mapping-actions.test.ts +++ b/packages/platform-objects/src/identity/sys-idp-group-mapping-actions.test.ts @@ -62,7 +62,7 @@ function offered(source: string, user: Record): string { describe('sys_idp_group_mapping: Map and Delete reach the platform-admin mounts', () => { it('Map SSO Group POSTs the save from the list toolbar, naming the provider, with the body keys the save reads', () => { const map = action('map_sso_group'); - expect(map).toMatchObject({ type: 'api', method: 'POST', target: SET_ROUTE, locations: ['list_toolbar'] }); + expect(map).toMatchObject({ type: 'api', method: 'POST', target: SET_ROUTE, locations: ['list'] }); const params = paramsOf(map); expect(params.map((p) => p.name)).toEqual(['providerId', 'groupExternalId', 'groupDisplayName', 'permissionSet']); // The source and the set are required; the group is one of two, judged by the door. @@ -71,7 +71,7 @@ describe('sys_idp_group_mapping: Map and Delete reach the platform-admin mounts' it('Map SCIM Group POSTs the save from the list toolbar, naming the connection, with the body keys the save reads', () => { const map = action('map_scim_group'); - expect(map).toMatchObject({ type: 'api', method: 'POST', target: SET_ROUTE, locations: ['list_toolbar'] }); + expect(map).toMatchObject({ type: 'api', method: 'POST', target: SET_ROUTE, locations: ['list'] }); const params = paramsOf(map); expect(params.map((p) => p.name)).toEqual(['connectionId', 'groupExternalId', 'groupDisplayName', 'permissionSet']); expect(params.filter((p) => p.required).map((p) => p.name)).toEqual(['connectionId', 'permissionSet']); @@ -101,7 +101,7 @@ describe('sys_idp_group_mapping: Map and Delete reach the platform-admin mounts' method: 'POST', target: DELETE_ROUTE, recordIdParam: 'mappingId', - locations: ['list_item', 'record_header'], + locations: ['record'], }); // No param dialog: the row is the whole input, so the confirmation is the one dialog. expect(del.params ?? []).toEqual([]); diff --git a/packages/platform-objects/src/identity/sys-idp-group-mapping.object.ts b/packages/platform-objects/src/identity/sys-idp-group-mapping.object.ts index 4776744f986..40d27582b28 100644 --- a/packages/platform-objects/src/identity/sys-idp-group-mapping.object.ts +++ b/packages/platform-objects/src/identity/sys-idp-group-mapping.object.ts @@ -100,7 +100,7 @@ export const SysIdpGroupMapping = ObjectSchema.create({ icon: 'plus-circle', variant: 'primary', mode: 'create', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', method: 'POST', target: '/api/v1/auth/admin/scim/set-group-mapping', @@ -148,7 +148,7 @@ export const SysIdpGroupMapping = ObjectSchema.create({ icon: 'plus-circle', variant: 'secondary', mode: 'create', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', method: 'POST', target: '/api/v1/auth/admin/scim/set-group-mapping', @@ -201,7 +201,7 @@ export const SysIdpGroupMapping = ObjectSchema.create({ icon: 'trash-2', variant: 'danger', mode: 'custom', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', method: 'POST', target: '/api/v1/auth/admin/scim/delete-group-mapping', diff --git a/packages/platform-objects/src/identity/sys-invitation.object.ts b/packages/platform-objects/src/identity/sys-invitation.object.ts index 20f06da4569..5d82e9cd294 100644 --- a/packages/platform-objects/src/identity/sys-invitation.object.ts +++ b/packages/platform-objects/src/identity/sys-invitation.object.ts @@ -87,7 +87,7 @@ export const SysInvitation = ObjectSchema.create({ 'Invite someone by email address. They join this organization with the chosen role when they accept the invitation.', icon: 'user-plus', variant: 'primary', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', target: '/api/v1/auth/organization/invite-member', // Inviting/managing invitations is a multi-org-only flow (the @@ -131,7 +131,7 @@ export const SysInvitation = ObjectSchema.create({ icon: 'x-circle', variant: 'danger', mode: 'delete', - locations: ['list_item'], + locations: ['record_row'], type: 'api', target: '/api/v1/auth/organization/cancel-invitation', recordIdParam: 'invitationId', @@ -168,7 +168,7 @@ export const SysInvitation = ObjectSchema.create({ 'Resend the invitation to {{ record.email }}? The expiry date starts over, and an invitation that has already expired is replaced by a new one.', icon: 'send', variant: 'secondary', - locations: ['list_item'], + locations: ['record_row'], type: 'api', target: '/api/v1/auth/organization/invite-member', bodyExtra: { resend: true }, @@ -213,7 +213,7 @@ export const SysInvitation = ObjectSchema.create({ label: 'Copy Invite Link', icon: 'link', variant: 'secondary', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'script', target: 'copy_invitation_link', // The gates of `resend_invitation` (the organization capability and the @@ -221,7 +221,7 @@ export const SysInvitation = ObjectSchema.create({ // invite mirrors are, and offered on a pending row only, before its // `expires_at`: a row can still read `pending` after it expires, and // its link admits no one (the handler refuses it too). `has()` opens - // each operand for the sparse `list_item` face (#8990), as on the + // each operand for the sparse `record_row` face (#8990), as on the // recipient-side actions below; `expires_at` is compared by ordering, // so it also needs its `!= null` half (`materializeDeclaredFields`). visible: "features.cloudManaged != true && has(record.status) && record.status == 'pending' && has(record.expires_at) && record.expires_at != null && datetime(record.expires_at) > now()", @@ -249,7 +249,7 @@ export const SysInvitation = ObjectSchema.create({ // them out of the admin org-management view. // // Both predicates open each operand with `has()` for the SPARSE action - // face (#8990): they reach `list_item`, so the bound record is the row the + // face (#8990): they reach `record_row`, so the bound record is the row the // inbox view projected, and an unprojected `email` / `status` aborts the // whole predicate at key resolution instead of reading null — fail-closed, // so the Accept/Decline pair vanishes with no way to tell that from the @@ -262,7 +262,7 @@ export const SysInvitation = ObjectSchema.create({ label: 'Accept Invitation', icon: 'check', variant: 'primary', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', target: '/api/v1/auth/organization/accept-invitation', recordIdParam: 'invitationId', @@ -285,7 +285,7 @@ export const SysInvitation = ObjectSchema.create({ label: 'Decline Invitation', icon: 'x', variant: 'ghost', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', target: '/api/v1/auth/organization/reject-invitation', recordIdParam: 'invitationId', diff --git a/packages/platform-objects/src/identity/sys-member.object.ts b/packages/platform-objects/src/identity/sys-member.object.ts index e45915520af..6b746276f30 100644 --- a/packages/platform-objects/src/identity/sys-member.object.ts +++ b/packages/platform-objects/src/identity/sys-member.object.ts @@ -79,7 +79,7 @@ export const SysMember = ObjectSchema.create({ // move this page if it did. Looking for the tab order in // this directory finds nothing; it lives one directory over (#16270). // Declaration order is render order — the related-list toolbar bridge - // maps the child object's `list_toolbar` actions in array order + // maps the child object's `list` actions in array order // (objectui `RelatedRecordActionsBridge.deriveActions` → // `RelatedList`), so this sits left of `add_member`. // @@ -100,7 +100,7 @@ export const SysMember = ObjectSchema.create({ 'Invite someone by email address. They join this organization with the chosen role when they accept the invitation.', icon: 'user-plus', variant: 'primary', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', target: '/api/v1/auth/organization/invite-member', // Same gate as the other two mirrors — the org CAPABILITY, not @@ -176,7 +176,7 @@ export const SysMember = ObjectSchema.create({ label: 'Add Member', icon: 'link-2', variant: 'secondary', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', target: '/api/v1/auth/organization/add-member', // The door's platform-admin gate, declared where both action doors read it (#30771). @@ -225,7 +225,7 @@ export const SysMember = ObjectSchema.create({ description: "Choose the new organization role for {{ record.user_id.name | default:'this member' }}.", icon: 'shield', mode: 'edit', - locations: ['list_item'], + locations: ['record_row'], type: 'api', target: '/api/v1/auth/organization/update-member-role', recordIdParam: 'memberId', @@ -254,7 +254,7 @@ export const SysMember = ObjectSchema.create({ icon: 'user-minus', variant: 'danger', mode: 'delete', - locations: ['list_item'], + locations: ['record_row'], type: 'api', target: '/api/v1/auth/organization/remove-member', recordIdParam: 'memberIdOrEmail', @@ -293,7 +293,7 @@ export const SysMember = ObjectSchema.create({ icon: 'crown', variant: 'danger', mode: 'custom', - locations: ['list_item'], + locations: ['record_row'], type: 'api', target: '/api/v1/auth/organization/update-member-role', recordIdParam: 'memberId', @@ -302,7 +302,7 @@ export const SysMember = ObjectSchema.create({ // then the feature gate are AND-composed onto it by the lowerings. // Owner only: better-auth refuses to SET the creator role unless the // caller holds it, whatever an admin's statements say. - // `has()` guards the SPARSE action face (#8990): this is a `list_item` + // `has()` guards the SPARSE action face (#8990): this is a `record_row` // action, so a member list that does not project `role` would abort the // predicate at key resolution and drop the button silently. `has()` // alone — the operand is a bare equality against a literal (see diff --git a/packages/platform-objects/src/identity/sys-oauth-application.object.ts b/packages/platform-objects/src/identity/sys-oauth-application.object.ts index 315b4781a6d..49514c61dd3 100644 --- a/packages/platform-objects/src/identity/sys-oauth-application.object.ts +++ b/packages/platform-objects/src/identity/sys-oauth-application.object.ts @@ -63,7 +63,7 @@ export const SysOauthApplication = ObjectSchema.create({ // // The two toggle predicates are guarded for the SPARSE action face (#8990), // and this pair is where the guard actually changes what a user sees. Both - // reach `list_item`, and `disabled` is nullable upstream (better-auth writes + // reach `record_row`, and `disabled` is nullable upstream (better-auth writes // the column only when it is set), so a list row can carry it PROJECTED AND // NULL. Measured against the `@objectstack/formula` CEL engine, the old // spellings both broke on exactly that row: `!record.disabled` FAULTED @@ -96,7 +96,7 @@ export const SysOauthApplication = ObjectSchema.create({ icon: 'pause-circle', variant: 'secondary', mode: 'custom', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', method: 'POST', target: '/api/v1/auth/admin/oauth2/toggle-disabled', @@ -131,7 +131,7 @@ export const SysOauthApplication = ObjectSchema.create({ icon: 'play-circle', variant: 'primary', mode: 'custom', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', method: 'POST', target: '/api/v1/auth/admin/oauth2/toggle-disabled', @@ -160,7 +160,7 @@ export const SysOauthApplication = ObjectSchema.create({ icon: 'plus-circle', variant: 'primary', mode: 'create', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', method: 'POST', target: '/api/v1/auth/sys-oauth-application/register', @@ -216,7 +216,7 @@ export const SysOauthApplication = ObjectSchema.create({ icon: 'refresh-cw', variant: 'secondary', mode: 'custom', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', method: 'POST', target: '/api/v1/auth/oauth2/client/rotate-secret', @@ -253,7 +253,7 @@ export const SysOauthApplication = ObjectSchema.create({ icon: 'trash', variant: 'danger', mode: 'delete', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', method: 'POST', target: '/api/v1/auth/oauth2/delete-client', diff --git a/packages/platform-objects/src/identity/sys-organization-invite-action.test.ts b/packages/platform-objects/src/identity/sys-organization-invite-action.test.ts index b35d7efa765..fd93c898612 100644 --- a/packages/platform-objects/src/identity/sys-organization-invite-action.test.ts +++ b/packages/platform-objects/src/identity/sys-organization-invite-action.test.ts @@ -40,10 +40,10 @@ function action(name: string): HeaderAction { return found as HeaderAction; } -/** The object's `record_header` actions, in the order the stable `order` sort gives them. */ +/** The object's `record_page` actions, in the order the stable `order` sort gives them. */ function headerOrder(): string[] { return actions() - .filter((a) => (a.locations ?? []).includes('record_header')) + .filter((a) => ((a.locations ?? []).includes('record_page') || (a.locations ?? []).includes('record'))) .map((a, i) => ({ a, i })) .sort((x, y) => (x.a.order ?? 0) - (y.a.order ?? 0) || x.i - y.i) .map(({ a }) => a.name as string); @@ -53,9 +53,9 @@ function headerOrder(): string[] { const MAX_VISIBLE = 3; describe('sys_organization.invite_user — the record header (#24016)', () => { - it('is a record_header api action on the invite endpoint, bound to THIS organization', () => { + it('is a record_page api action on the invite endpoint, bound to THIS organization', () => { const invite = action('invite_user'); - expect(invite.locations).toContain('record_header'); + expect(invite.locations).toContain('record_page'); expect(invite.type).toBe('api'); expect(invite.target).toBe('/api/v1/auth/organization/invite-member'); // The row id rides as `organizationId`: without it better-auth falls back @@ -66,7 +66,7 @@ describe('sys_organization.invite_user — the record header (#24016)', () => { it('is the one primary action in the header', () => { const primaries = actions() - .filter((a) => (a.locations ?? []).includes('record_header')) + .filter((a) => ((a.locations ?? []).includes('record_page') || (a.locations ?? []).includes('record'))) .filter((a) => a.variant === 'primary') .map((a) => a.name); expect(primaries).toEqual(['invite_user']); diff --git a/packages/platform-objects/src/identity/sys-organization-rename-action.test.ts b/packages/platform-objects/src/identity/sys-organization-rename-action.test.ts index 257caf13e54..c996612272b 100644 --- a/packages/platform-objects/src/identity/sys-organization-rename-action.test.ts +++ b/packages/platform-objects/src/identity/sys-organization-rename-action.test.ts @@ -3,7 +3,7 @@ // sys_organization's rename door: a name/logo-only action a record page can // offer. // -// `update_organization` renames too, but it is declared at `list_item` only (a +// `update_organization` renames too, but it is declared at `record_row` only (a // record page's header never offers it) and it bundles `slug`, which the cloud // orchestrator's slug action governs where it exists — an action the // composition serving that route declares itself, never this object. So the @@ -11,12 +11,12 @@ // // What this file pins, from source: // - the new action's declaration: its params are exactly `name` and `logo`, -// it sits at `record_header` and `list_item`, it targets better-auth's +// it sits at `record_page` and `record_row`, it targets better-auth's // `organization/update` exactly as `update_organization` does, and it is // gated on the grades that reach `organization/update` (owner, admin) like // it, but on the organization capability rather than `multiOrgEnabled`, so // a `single` deployment can rename its one organization (#25347); -// - one door per field on the record header: no `record_header` action that +// - one door per field on the record header: no `record_page` action that // targets `organization/update` carries a `slug` param; // - the header order: the rename takes an inline slot and leave folds into // the overflow (the ordering model is described in @@ -69,10 +69,10 @@ function action(name: string): DeclaredAction { const paramKeys = (a: DeclaredAction): string[] => (a.params ?? []).map((p) => (p.field ?? p.name) as string); -/** The object's `record_header` actions, in the order the stable `order` sort gives them. */ +/** The object's `record_page` actions, in the order the stable `order` sort gives them. */ function headerOrder(): string[] { return actions() - .filter((a) => (a.locations ?? []).includes('record_header')) + .filter((a) => ((a.locations ?? []).includes('record_page') || (a.locations ?? []).includes('record'))) .map((a, i) => ({ a, i })) .sort((x, y) => (x.a.order ?? 0) - (y.a.order ?? 0) || x.i - y.i) .map(({ a }) => a.name as string); @@ -89,7 +89,7 @@ describe('sys_organization.rename_organization: the declaration', () => { }); it('is offered at the record header and on the list row', () => { - expect(action('rename_organization').locations).toEqual(['record_header', 'list_item']); + expect(action('rename_organization').locations).toEqual(['record']); }); it("targets better-auth's organization/update exactly as update_organization does", () => { @@ -112,9 +112,9 @@ describe('sys_organization.rename_organization: the declaration', () => { }); describe('sys_organization: one door per field on the record header', () => { - it('no record_header action that writes through organization/update collects a slug', () => { + it('no record_page action that writes through organization/update collects a slug', () => { const headerWriters = actions() - .filter((a) => (a.locations ?? []).includes('record_header')) + .filter((a) => ((a.locations ?? []).includes('record_page') || (a.locations ?? []).includes('record'))) .filter((a) => a.target === UPDATE_TARGET); expect(headerWriters.map((a) => a.name)).toEqual(['rename_organization']); for (const a of headerWriters) { @@ -147,9 +147,9 @@ describe('sys_organization: every door it declares is one an open-source composi }); describe('sys_organization: the open-source slug door is unchanged (control)', () => { - it('update_organization keeps name / slug / logo, its target and list_item alone', () => { + it('update_organization keeps name / slug / logo, its target and record_row alone', () => { const update = action('update_organization'); - expect(update.locations).toEqual(['list_item']); + expect(update.locations).toEqual(['record_row']); expect(update.target).toBe(UPDATE_TARGET); expect(paramKeys(update)).toEqual(['name', 'slug', 'logo']); }); diff --git a/packages/platform-objects/src/identity/sys-organization.object.ts b/packages/platform-objects/src/identity/sys-organization.object.ts index cc8e360b7c1..30cbd93033b 100644 --- a/packages/platform-objects/src/identity/sys-organization.object.ts +++ b/packages/platform-objects/src/identity/sys-organization.object.ts @@ -69,7 +69,7 @@ export const SysOrganization = ObjectSchema.create({ label: 'Create Organization', icon: 'plus', variant: 'primary', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', target: '/api/v1/auth/organization/create', // Hidden while cloud-managed: creating an organization makes the caller @@ -101,7 +101,7 @@ export const SysOrganization = ObjectSchema.create({ label: 'Edit Organization', icon: 'pencil', mode: 'edit', - locations: ['list_item'], + locations: ['record_row'], type: 'api', target: '/api/v1/auth/organization/update', recordIdParam: 'organizationId', @@ -133,7 +133,7 @@ export const SysOrganization = ObjectSchema.create({ icon: 'trash', variant: 'danger', mode: 'delete', - locations: ['list_item'], + locations: ['record_row'], type: 'api', target: '/api/v1/auth/organization/delete', recordIdParam: 'organizationId', @@ -157,7 +157,7 @@ export const SysOrganization = ObjectSchema.create({ icon: 'check-circle-2', variant: 'secondary', mode: 'custom', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', target: '/api/v1/auth/organization/set-active', recordIdParam: 'organizationId', @@ -178,7 +178,7 @@ export const SysOrganization = ObjectSchema.create({ // OWN actions only (spec `component.zod.ts`, page:header), so the // organization record page cannot offer an invite from a mirror on // another object. Ruling 6228318638 (B′ on #24034): declared at - // `record_header`, primary, first by `order`. + // `record_page`, primary, first by `order`. // // The record IS the organization, so its id rides as `organizationId` // instead of better-auth's active-org fallback — an admin on another @@ -193,7 +193,7 @@ export const SysOrganization = ObjectSchema.create({ // Lower than every sibling (unset = 0), so the stable `order` sort puts // it first in the record header. order: -1, - locations: ['record_header'], + locations: ['record_page'], type: 'api', target: '/api/v1/auth/organization/invite-member', recordIdParam: 'organizationId', @@ -246,7 +246,7 @@ export const SysOrganization = ObjectSchema.create({ // grade may leave. order: 1, mode: 'custom', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', target: '/api/v1/auth/organization/leave', recordIdParam: 'organizationId', @@ -275,8 +275,8 @@ export const SysOrganization = ObjectSchema.create({ // better-auth's slug-taken check and plugin-auth's // `beforeUpdateOrganization` slug guard both run only on a sent slug. // - // One door per field. A record page reaches no `list_item` action, so - // this one is declared at `record_header` too, and nothing on that page + // One door per field. A record page reaches no `record_row` action, so + // this one is declared at `record_page` too, and nothing on that page // sends a slug to better-auth. `update_organization` is the slug door of // a composition without the cloud orchestrator. Where the orchestrator // governs the slug, the composition that serves its route declares the @@ -288,7 +288,7 @@ export const SysOrganization = ObjectSchema.create({ icon: 'pencil', variant: 'secondary', mode: 'edit', - locations: ['record_header', 'list_item'], + locations: ['record'], type: 'api', target: '/api/v1/auth/organization/update', recordIdParam: 'organizationId', diff --git a/packages/platform-objects/src/identity/sys-scim-connection-credential-actions.test.ts b/packages/platform-objects/src/identity/sys-scim-connection-credential-actions.test.ts index 7dbf72bd887..9f5d03641fa 100644 --- a/packages/platform-objects/src/identity/sys-scim-connection-credential-actions.test.ts +++ b/packages/platform-objects/src/identity/sys-scim-connection-credential-actions.test.ts @@ -51,7 +51,7 @@ function offered(source: string, record: Record): string { describe('sys_scim_connection_credential: mint and revoke reach the platform-admin mounts', () => { it('mint POSTs the mint mount from the list toolbar, with the body keys the mount reads', () => { const mint = action('mint_scim_credential'); - expect(mint).toMatchObject({ type: 'api', method: 'POST', target: MINT_ROUTE, locations: ['list_toolbar'] }); + expect(mint).toMatchObject({ type: 'api', method: 'POST', target: MINT_ROUTE, locations: ['list'] }); const params = (mint.params ?? []) as Array<{ name?: string; required?: boolean; type?: string; reference?: string }>; expect(params.map((p) => p.name)).toEqual(['connectionId', 'label', 'organizationId', 'provisioningDomainId', 'expiresAt']); // The mount refuses a mint with no connection id; nothing else is required. @@ -69,7 +69,7 @@ describe('sys_scim_connection_credential: mint and revoke reach the platform-adm method: 'POST', target: REVOKE_ROUTE, recordIdParam: 'credentialId', - locations: ['list_item', 'record_header'], + locations: ['record'], }); // No param dialog: the row is the whole input, so the confirmation is the one dialog. expect(revoke.params ?? []).toEqual([]); diff --git a/packages/platform-objects/src/identity/sys-scim-connection-credential.object.ts b/packages/platform-objects/src/identity/sys-scim-connection-credential.object.ts index ae4cece9b57..6b41cf06ce6 100644 --- a/packages/platform-objects/src/identity/sys-scim-connection-credential.object.ts +++ b/packages/platform-objects/src/identity/sys-scim-connection-credential.object.ts @@ -90,7 +90,7 @@ export const SysScimConnectionCredential = ObjectSchema.create({ icon: 'plus-circle', variant: 'primary', mode: 'create', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', method: 'POST', target: '/api/v1/auth/admin/scim/mint-credential', @@ -156,7 +156,7 @@ export const SysScimConnectionCredential = ObjectSchema.create({ icon: 'shield-off', variant: 'danger', mode: 'custom', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', method: 'POST', target: '/api/v1/auth/admin/scim/revoke-credential', diff --git a/packages/platform-objects/src/identity/sys-session.object.ts b/packages/platform-objects/src/identity/sys-session.object.ts index a72912180fe..494cbac87dd 100644 --- a/packages/platform-objects/src/identity/sys-session.object.ts +++ b/packages/platform-objects/src/identity/sys-session.object.ts @@ -80,7 +80,7 @@ export const SysSession = ObjectSchema.create({ label: 'Sign out other devices', icon: 'log-out', variant: 'danger', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', target: '/api/v1/auth/revoke-other-sessions', confirmText: 'Sign out of every other device where you\'re currently logged in? Your current session will remain active.', @@ -101,7 +101,7 @@ export const SysSession = ObjectSchema.create({ icon: 'log-out', variant: 'danger', mode: 'delete', - locations: ['list_item'], + locations: ['record_row'], type: 'api', // Keyed on the row's `id` — every list row carries it — and resolved to // the session SERVER-side by plugin-auth's `sys-session/revoke` door, so diff --git a/packages/platform-objects/src/identity/sys-sso-provider.object.ts b/packages/platform-objects/src/identity/sys-sso-provider.object.ts index ce1336114a4..aef2e8d310a 100644 --- a/packages/platform-objects/src/identity/sys-sso-provider.object.ts +++ b/packages/platform-objects/src/identity/sys-sso-provider.object.ts @@ -96,7 +96,7 @@ export const SysSsoProvider = ObjectSchema.create({ icon: 'plus-circle', variant: 'primary', mode: 'create', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', method: 'POST', // Routed through the env-side bridge (plugin-auth `auth-plugin.ts`), which @@ -167,7 +167,7 @@ export const SysSsoProvider = ObjectSchema.create({ icon: 'shield', variant: 'primary', mode: 'create', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', method: 'POST', // SAML 2.0 via @better-auth/sso (samlify-backed). Routed through the @@ -213,7 +213,7 @@ export const SysSsoProvider = ObjectSchema.create({ label: 'Request Domain Verification', icon: 'globe', variant: 'secondary', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', method: 'POST', // ADR-0135 D6 (opt-in OS_SSO_DOMAIN_VERIFICATION). Asks @better-auth/sso @@ -259,7 +259,7 @@ export const SysSsoProvider = ObjectSchema.create({ label: 'Verify Domain', icon: 'shield-check', variant: 'secondary', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', method: 'POST', // ADR-0135 D6. Re-checks the DNS-TXT record and flips `domain_verified` @@ -282,7 +282,7 @@ export const SysSsoProvider = ObjectSchema.create({ icon: 'trash', variant: 'danger', mode: 'delete', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', method: 'POST', target: '/api/v1/auth/sso/delete-provider', @@ -335,7 +335,7 @@ export const SysSsoProvider = ObjectSchema.create({ label: 'Edit Sign-In Options', icon: 'settings', variant: 'secondary', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', method: 'POST', // The provider's two sign-in toggles (ruling record 6718355623 on the @@ -381,7 +381,7 @@ export const SysSsoProvider = ObjectSchema.create({ label: 'Edit SAML Settings', icon: 'pencil', variant: 'secondary', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', method: 'POST', target: '/api/v1/auth/admin/sso/update-provider', @@ -409,7 +409,7 @@ export const SysSsoProvider = ObjectSchema.create({ label: 'Edit OIDC Settings', icon: 'pencil', variant: 'secondary', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', method: 'POST', target: '/api/v1/auth/admin/sso/update-provider', @@ -444,7 +444,7 @@ export const SysSsoProvider = ObjectSchema.create({ label: 'Show Groups Claim', icon: 'users', variant: 'secondary', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', method: 'POST', target: '/api/v1/auth/admin/sso/get-groups-claim', @@ -468,7 +468,7 @@ export const SysSsoProvider = ObjectSchema.create({ label: 'Edit Groups Claim', icon: 'users', variant: 'secondary', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', method: 'POST', target: '/api/v1/auth/admin/sso/set-groups-claim', @@ -500,7 +500,7 @@ export const SysSsoProvider = ObjectSchema.create({ label: 'Show Attribute Mapping', icon: 'id-card', variant: 'secondary', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', method: 'POST', target: '/api/v1/auth/admin/sso/get-attribute-mapping', @@ -528,7 +528,7 @@ export const SysSsoProvider = ObjectSchema.create({ label: 'Edit Attribute Mapping', icon: 'id-card', variant: 'secondary', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', method: 'POST', target: '/api/v1/auth/admin/sso/set-attribute-mapping', diff --git a/packages/platform-objects/src/identity/sys-team-add-member-action.test.ts b/packages/platform-objects/src/identity/sys-team-add-member-action.test.ts index 2b265b15a9e..ae5c8e9999b 100644 --- a/packages/platform-objects/src/identity/sys-team-add-member-action.test.ts +++ b/packages/platform-objects/src/identity/sys-team-add-member-action.test.ts @@ -41,7 +41,7 @@ describe('sys_team.add_team_member — Add Member opened from a team', () => { const fromList = action(SysTeamMember, 'add_team_member'); it('is offered on the team row and the team record header', () => { - expect(fromTeam.locations).toEqual(['list_item', 'record_header']); + expect(fromTeam.locations).toEqual(['record']); }); it('binds the team from the row it is opened on, as teamId', () => { @@ -65,7 +65,7 @@ describe('sys_team.add_team_member — Add Member opened from a team', () => { }); it('leaves the membership-list copy asking for the team, where none is in hand', () => { - expect(fromList.locations).toEqual(['list_toolbar']); + expect(fromList.locations).toEqual(['list']); expect(fromList.recordIdParam).toBeUndefined(); expect((fromList.params ?? []).map((p) => p.name)).toEqual(['teamId', 'userId']); }); diff --git a/packages/platform-objects/src/identity/sys-team-derived-related-lists.test.ts b/packages/platform-objects/src/identity/sys-team-derived-related-lists.test.ts index 935210c33b3..a01a4c1a71f 100644 --- a/packages/platform-objects/src/identity/sys-team-derived-related-lists.test.ts +++ b/packages/platform-objects/src/identity/sys-team-derived-related-lists.test.ts @@ -10,7 +10,7 @@ * `deriveRelatedLists`, cited in `packages/spec/liveness/field.json`). * * `sys_session.active_team_id` used to derive one. That list carried the - * session object's only `list_toolbar` action, "Sign out other devices", + * session object's only `list` action, "Sign out other devices", * which revokes the CALLER's own other sessions — on a team record it read as * a team action and was not one. The field, its lookup and its label stay * (better-auth writes `activeTeamId` into it); only the derived list goes. @@ -134,6 +134,6 @@ describe("the user's own Sessions related list is unchanged", () => { it('"Sign out other devices" stays the session list toolbar action', () => { const action = (SysSession.actions as ActionDef[]).find((a) => a.name === 'revoke_my_other_sessions'); - expect(action?.locations).toEqual(['list_toolbar']); + expect(action?.locations).toEqual(['list']); }); }); diff --git a/packages/platform-objects/src/identity/sys-team-member.object.ts b/packages/platform-objects/src/identity/sys-team-member.object.ts index 39e32e6eb25..c374b0f4807 100644 --- a/packages/platform-objects/src/identity/sys-team-member.object.ts +++ b/packages/platform-objects/src/identity/sys-team-member.object.ts @@ -53,7 +53,7 @@ export const SysTeamMember = ObjectSchema.create({ label: 'Add Member', icon: 'user-plus', variant: 'primary', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', target: '/api/v1/auth/organization/add-team-member', // Team membership lives under organizations — multi-org-only. Gate @@ -84,7 +84,7 @@ export const SysTeamMember = ObjectSchema.create({ icon: 'user-minus', variant: 'danger', mode: 'delete', - locations: ['list_item'], + locations: ['record_row'], type: 'api', target: '/api/v1/auth/organization/remove-team-member', requiresFeature: 'organization', diff --git a/packages/platform-objects/src/identity/sys-team.object.ts b/packages/platform-objects/src/identity/sys-team.object.ts index 491f5226da6..3d1725c4e5d 100644 --- a/packages/platform-objects/src/identity/sys-team.object.ts +++ b/packages/platform-objects/src/identity/sys-team.object.ts @@ -42,7 +42,7 @@ export const SysTeam = ObjectSchema.create({ label: 'Create Team', icon: 'plus', variant: 'primary', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', target: '/api/v1/auth/organization/create-team', // Teams are nested inside organizations — a multi-org-only concept. @@ -71,7 +71,7 @@ export const SysTeam = ObjectSchema.create({ label: 'Edit Team', icon: 'pencil', mode: 'edit', - locations: ['list_item'], + locations: ['record_row'], type: 'api', target: '/api/v1/auth/organization/update-team', recordIdParam: 'teamId', @@ -100,7 +100,7 @@ export const SysTeam = ObjectSchema.create({ name: 'add_team_member', label: 'Add Member', icon: 'user-plus', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', target: '/api/v1/auth/organization/add-team-member', recordIdParam: 'teamId', @@ -129,7 +129,7 @@ export const SysTeam = ObjectSchema.create({ icon: 'trash', variant: 'danger', mode: 'delete', - locations: ['list_item'], + locations: ['record_row'], type: 'api', target: '/api/v1/auth/organization/remove-team', recordIdParam: 'teamId', diff --git a/packages/platform-objects/src/identity/sys-two-factor.object.ts b/packages/platform-objects/src/identity/sys-two-factor.object.ts index cd6c0150ea7..9c2177f8d89 100644 --- a/packages/platform-objects/src/identity/sys-two-factor.object.ts +++ b/packages/platform-objects/src/identity/sys-two-factor.object.ts @@ -74,7 +74,7 @@ export const SysTwoFactor = ObjectSchema.create({ label: 'Enable 2FA', icon: 'shield-check', variant: 'primary', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', target: '/api/v1/auth/two-factor/enable', requiresFeature: 'twoFactor', @@ -99,7 +99,7 @@ export const SysTwoFactor = ObjectSchema.create({ label: 'Disable 2FA', icon: 'shield-off', variant: 'danger', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', target: '/api/v1/auth/two-factor/disable', requiresFeature: 'twoFactor', @@ -118,7 +118,7 @@ export const SysTwoFactor = ObjectSchema.create({ label: 'Regenerate Backup Codes', icon: 'refresh-cw', variant: 'secondary', - locations: ['list_toolbar', 'list_item'], + locations: ['list', 'record_row'], type: 'api', target: '/api/v1/auth/two-factor/generate-backup-codes', requiresFeature: 'twoFactor', diff --git a/packages/platform-objects/src/identity/sys-user-platform-admin-roster-action.test.ts b/packages/platform-objects/src/identity/sys-user-platform-admin-roster-action.test.ts index 0318427f8af..19b13537d99 100644 --- a/packages/platform-objects/src/identity/sys-user-platform-admin-roster-action.test.ts +++ b/packages/platform-objects/src/identity/sys-user-platform-admin-roster-action.test.ts @@ -44,7 +44,7 @@ describe('[ADR-0095 D3] sys_user list_platform_admins', () => { expect(roster.map((a) => a.name)).toEqual(['list_platform_admins']); expect(action()).toMatchObject({ type: 'api', - locations: ['list_toolbar'], + locations: ['list'], visible: { dialect: 'cel', source: 'current_user.isPlatformAdmin == true' }, refreshAfter: false, }); diff --git a/packages/platform-objects/src/identity/sys-user-set-manager-action.test.ts b/packages/platform-objects/src/identity/sys-user-set-manager-action.test.ts index ddc4e7f4e33..d1c45b9ef5c 100644 --- a/packages/platform-objects/src/identity/sys-user-set-manager-action.test.ts +++ b/packages/platform-objects/src/identity/sys-user-set-manager-action.test.ts @@ -109,8 +109,8 @@ describe('#19249 — sys_user.set_user_manager posts the admin endpoint', () => }); it('surfaces on the row menu AND the record-detail header', () => { - expect(ACTION.locations).toContain('list_item'); - expect(ACTION.locations).toContain('record_header'); + // `record` is the row menu and the record page (objectstack#36495). + expect(ACTION.locations).toContain('record'); }); it('collects the manager on `manager_id`, seeded from the row, under the body key the endpoint reads', () => { diff --git a/packages/platform-objects/src/identity/sys-user.object.ts b/packages/platform-objects/src/identity/sys-user.object.ts index 47d931456ce..2700d953faa 100644 --- a/packages/platform-objects/src/identity/sys-user.object.ts +++ b/packages/platform-objects/src/identity/sys-user.object.ts @@ -141,7 +141,7 @@ export const SysUser = ObjectSchema.create({ 'Invite someone by email address. They join this organization with the chosen role when they accept the invitation.', icon: 'user-plus', variant: 'primary', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', target: '/api/v1/auth/organization/invite-member', // Gated on the org CAPABILITY, not multi-org (cloud ADR-0081 D1): the @@ -211,7 +211,7 @@ export const SysUser = ObjectSchema.create({ // `pending-sso-users.test.ts` (the declared targets, driven live). // // UI surfaces them under the row menu AND the - // record-detail header (`record_header`, overflowing into the ⋯ + // record-detail header (`record_page`, overflowing into the ⋯ // "More" menu) so platform admins can manage an account from either // the Users list or an open user record — without dropping to SQL or // a custom Setup wizard. @@ -245,7 +245,7 @@ export const SysUser = ObjectSchema.create({ label: 'Ban User', icon: 'ban', variant: 'danger', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', target: '/api/v1/auth/admin/ban-user', // The door's platform-admin gate, declared where both action doors read it (#30771). @@ -283,7 +283,7 @@ export const SysUser = ObjectSchema.create({ label: 'Unban User', icon: 'check-circle-2', variant: 'secondary', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', target: '/api/v1/auth/admin/unban-user', // The door's platform-admin gate, declared where both action doors read it (#30771). @@ -312,7 +312,7 @@ export const SysUser = ObjectSchema.create({ label: 'Unlock Account', icon: 'lock-open', variant: 'secondary', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', target: '/api/v1/auth/admin/unlock-user', // The door's platform-admin gate, declared where both action doors read it (#30771). @@ -352,7 +352,7 @@ export const SysUser = ObjectSchema.create({ label: 'Create User', icon: 'user-plus', variant: 'secondary', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', target: '/api/v1/auth/admin/create-user', // The door's platform-admin gate, declared where both action doors read it (#30771). @@ -479,7 +479,7 @@ export const SysUser = ObjectSchema.create({ "Add someone by email address before their first sign-in. They sign in through your organization's identity provider; no password is set here.", icon: 'user-plus', variant: 'primary', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', target: '/api/v1/auth/admin/add-sso-user', requiredPermissions: [...PLATFORM_ADMIN_USERS_GATE], @@ -541,7 +541,7 @@ export const SysUser = ObjectSchema.create({ "Add many people at once from CSV text. Each row is added on its own, so a bad row fails alone. They sign in through your organization's identity provider; no password is set here.", icon: 'upload', variant: 'secondary', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', target: '/api/v1/auth/admin/import-sso-users', requiredPermissions: [...PLATFORM_ADMIN_USERS_GATE], @@ -606,7 +606,7 @@ export const SysUser = ObjectSchema.create({ label: 'Remove Pending User', icon: 'user-minus', variant: 'danger', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', target: '/api/v1/auth/admin/remove-sso-user', requiredPermissions: [...PLATFORM_ADMIN_USERS_GATE], @@ -623,7 +623,7 @@ export const SysUser = ObjectSchema.create({ label: 'Set Password', icon: 'key-round', variant: 'secondary', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', // #2766 V1 — same path as better-auth's stock route, but served by the // plugin-auth wrapper registered ahead of the catch-all: it accepts the @@ -693,7 +693,7 @@ export const SysUser = ObjectSchema.create({ label: 'Impersonate User', icon: 'user-cog', variant: 'secondary', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', target: '/api/v1/auth/admin/impersonate-user', // The door's platform-admin gate, declared where both action doors read it (#30771). @@ -745,7 +745,7 @@ export const SysUser = ObjectSchema.create({ label: 'Set Manager', icon: 'network', variant: 'secondary', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', target: '/api/v1/auth/admin/set-user-manager', // The door's platform-admin gate, declared where both action doors read it (#30771). @@ -833,7 +833,7 @@ export const SysUser = ObjectSchema.create({ label: 'Remove Manager', icon: 'user-minus', variant: 'secondary', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', target: '/api/v1/auth/admin/set-user-manager', // The door's platform-admin gate, declared where both action doors read it (#30771). @@ -862,7 +862,7 @@ export const SysUser = ObjectSchema.create({ label: 'Platform Administrators', icon: 'shield-check', variant: 'secondary', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', target: '/api/v1/auth/admin/list-platform-admins', // The door's platform-admin gate, declared where both action doors read it (#30771). @@ -896,7 +896,7 @@ export const SysUser = ObjectSchema.create({ label: 'Register AI Service Account', icon: 'bot', variant: 'secondary', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', target: '/api/v1/auth/service-account/register', // Offered in a cloud-managed environment too: an account is no person @@ -932,7 +932,7 @@ export const SysUser = ObjectSchema.create({ label: 'Create API Key', icon: 'key-round', variant: 'secondary', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', target: '/api/v1/auth/service-account/create-key', // An AI service account's row only. Its owner is admitted by the door @@ -992,7 +992,7 @@ export const SysUser = ObjectSchema.create({ icon: 'user-pen', variant: 'primary', mode: 'edit', - locations: ['record_header'], + locations: ['record_page'], type: 'api', target: '/api/v1/auth/update-user', visible: 'has(record.id) && record.id == ctx.user.id', @@ -1014,7 +1014,7 @@ export const SysUser = ObjectSchema.create({ label: 'Change Password', icon: 'key', variant: 'secondary', - locations: ['record_header', 'record_more', 'record_section'], + locations: ['record_page', 'record_section'], type: 'api', target: '/api/v1/auth/change-password', // Managed (IdP-provisioned) users hold no local credential — hide the @@ -1035,7 +1035,7 @@ export const SysUser = ObjectSchema.create({ label: 'Change Email', icon: 'mail', variant: 'secondary', - locations: ['record_header', 'record_more', 'record_section'], + locations: ['record_page', 'record_section'], type: 'api', target: '/api/v1/auth/change-email', // A managed user's email is owned by the IdP — a local change would @@ -1052,7 +1052,7 @@ export const SysUser = ObjectSchema.create({ label: 'Resend Verification Email', icon: 'mail-check', variant: 'secondary', - locations: ['record_header', 'record_more', 'record_section'], + locations: ['record_page', 'record_section'], type: 'api', target: '/api/v1/auth/send-verification-email', // Only render for the row owner AND when their email is still @@ -1074,7 +1074,7 @@ export const SysUser = ObjectSchema.create({ icon: 'user-x', variant: 'danger', mode: 'delete', - locations: ['record_more', 'record_section'], + locations: ['record_page', 'record_section'], component: 'action:menu', type: 'api', target: '/api/v1/auth/delete-user', // Self-delete needs a local password; managed users are deprovisioned diff --git a/packages/platform-objects/src/pages/record-page-header-actions.test.ts b/packages/platform-objects/src/pages/record-page-header-actions.test.ts index 4cdb7ec915e..6027fed01cb 100644 --- a/packages/platform-objects/src/pages/record-page-header-actions.test.ts +++ b/packages/platform-objects/src/pages/record-page-header-actions.test.ts @@ -7,7 +7,7 @@ * * Both pages were `kind: 'slotted'` until the `tabs` slot retired (#27053); * the synthesized header they rendered read every object action placed at - * `record_header` or `record_more` at render time, an action another package + * `record` or `record_page` at render time, an action another package * places on the object included. Rebuilt as `kind: 'full'` pages they named * the platform's own ids instead, and an authored id list is the whole set * (#11592), so an installed package's header action on `sys_user` stopped @@ -34,7 +34,7 @@ function headerPlacedIds(object: { actions?: unknown }): string[] { for (const action of (object.actions ?? []) as Rec[]) { const locations = (action.locations ?? []) as string[]; const name = action.name as string; - if (!locations.includes('record_header') && !locations.includes('record_more')) continue; + if (!locations.includes('record_page') && !locations.includes('record')) continue; if (!ids.includes(name)) ids.push(name); } return ids; diff --git a/packages/platform-objects/src/pages/sys-organization.page.ts b/packages/platform-objects/src/pages/sys-organization.page.ts index 402f4708ed7..de94682d697 100644 --- a/packages/platform-objects/src/pages/sys-organization.page.ts +++ b/packages/platform-objects/src/pages/sys-organization.page.ts @@ -18,7 +18,7 @@ import type { Page } from '@objectstack/spec/ui'; * swapped in — node for node: * * - `page:header` with `placedActions: true` (#29951): every action placed on - * `sys_organization` at `record_header` / `record_more`, read live (Set + * `sys_organization` at `record` / `record_page`, read live (Set * Active, Invite User, Leave Organization, Rename Organization — Edit and * Delete are row actions only — and any an installed package places * there), the set the synthesized header carried. A full page renders @@ -59,7 +59,7 @@ export const SysOrganizationDetailPage: Page = { width: 'full', components: [ // The synthesized header's action set, read live: every action placed - // on `sys_organization` at `record_header` or `record_more`, in + // on `sys_organization` at `record` or `record_page`, in // declaration order, including one another package places there (a // frozen id list dropped those, #29951). The host appends its own // system actions after these. diff --git a/packages/platform-objects/src/pages/sys-user.page.ts b/packages/platform-objects/src/pages/sys-user.page.ts index e792e84970b..e2bccd68776 100644 --- a/packages/platform-objects/src/pages/sys-user.page.ts +++ b/packages/platform-objects/src/pages/sys-user.page.ts @@ -42,7 +42,7 @@ const TWO_FACTOR_OFFERED = P`has(features.twoFactor) && features.twoFactor == tr * `tabs` slot retired (#27053); the rebuild renders the same nodes in the * same order. The header the synthesizer used to supply is a `page:header` * with `placedActions: true` (#29951): it draws every `sys_user` action - * placed at `record_header` / `record_more`, read live, so the platform's + * placed at `record` / `record_page`, read live, so the platform's * own (`ban_user / impersonate_user / … / update_my_profile / * change_my_password / …`) and any an installed package places on * `sys_user` appear in the header and its overflow menu, as they did on @@ -88,7 +88,7 @@ export const SysUserDetailPage: Page = { components: [ // ── The record header ───────────────────────────────────────── // The synthesized header's action set, read live: every action placed - // on `sys_user` at `record_header` or `record_more`, in declaration + // on `sys_user` at `record` or `record_page`, in declaration // order (admin actions, then the self-service ones), then any action // another package places there. A frozen id list dropped those // (#29951). The host appends its own system actions after these. diff --git a/packages/platform-objects/src/platform-objects.test.ts b/packages/platform-objects/src/platform-objects.test.ts index 56fcad9f5bf..4106861053d 100644 --- a/packages/platform-objects/src/platform-objects.test.ts +++ b/packages/platform-objects/src/platform-objects.test.ts @@ -334,16 +334,16 @@ describe('@objectstack/platform-objects', () => { // An admin viewing an open user record must be able to run the same // account-management actions available from the Users list row menu — // otherwise they have to navigate back to the list. Each admin action is - // therefore declared on BOTH `list_item` and `record_header` (the detail - // header overflows extras into the ⋯ "More" menu). `record_header` is the - // only detail-surface location objectui consumes (it does NOT read - // `record_more`), so these must use `record_header` specifically. + // therefore declared on `record` — the row menu AND the detail header + // (objectstack#36495; the header overflows extras into the ⋯ "More" + // menu) — and NOT folded (`component: 'action:menu'`), which would send + // each straight into the ⋯. const adminActions = ['ban_user', 'unban_user', 'unlock_user', 'set_user_password', 'impersonate_user']; for (const name of adminActions) { const a = (SysUser.actions ?? []).find((x) => x.name === name); expect(a, `${name} action must exist`).toBeTruthy(); - expect(a?.locations, `${name} locations`).toContain('list_item'); - expect(a?.locations, `${name} must also surface on the detail header`).toContain('record_header'); + expect(a?.locations, `${name} must surface on the row menu and the detail header`).toContain('record'); + expect((a as { component?: string } | undefined)?.component, `${name} is not folded`).not.toBe('action:menu'); } }); @@ -436,7 +436,7 @@ describe('@objectstack/platform-objects', () => { const revoke = (SysSession.actions ?? []).find((a) => a.name === 'revoke_session'); expect(revoke).toBeDefined(); expect(revoke?.type).toBe('api'); - expect(revoke?.locations).toEqual(['list_item']); + expect(revoke?.locations).toEqual(['record_row']); expect(revoke?.target).toBe('/api/v1/auth/sys-session/revoke'); expect(revoke?.recordIdParam).toBe('sessionId'); // The row field that seeds `recordIdParam` defaults to `id` — the one diff --git a/packages/plugins/plugin-approvals/src/sys-approval-request-page.test.ts b/packages/plugins/plugin-approvals/src/sys-approval-request-page.test.ts index 484213bd647..779d2b765db 100644 --- a/packages/plugins/plugin-approvals/src/sys-approval-request-page.test.ts +++ b/packages/plugins/plugin-approvals/src/sys-approval-request-page.test.ts @@ -136,7 +136,7 @@ describe('sys_approval_request detail page — the page body', () => { // whole, and the rail of progress, attachments and activity, the activity // last (maintainer 2026-11-17). The header reads the object's placed // header actions live: a bare `page:header` drew none, so an action - // another package places on the object at `record_header` was dropped + // another package places on the object at `record_page` was dropped // (#29951). expect(COMPONENTS.map((c) => c.type)).toEqual(['page:header', 'record:highlights', 'record:approval_decision']); expect(DECISION_AT).toBe(COMPONENTS.length - 1); diff --git a/packages/plugins/plugin-approvals/src/sys-approval-request.object.ts b/packages/plugins/plugin-approvals/src/sys-approval-request.object.ts index 5abd9aedaf7..f606582d10c 100644 --- a/packages/plugins/plugin-approvals/src/sys-approval-request.object.ts +++ b/packages/plugins/plugin-approvals/src/sys-approval-request.object.ts @@ -725,7 +725,7 @@ export const SysApprovalRequest = ObjectSchema.create({ visible: 'has(record.viewer) && has(record.viewer.can_act) && record.viewer.can_act == true' + ' || has(record.viewer) && has(record.viewer.can_override_approve) && record.viewer.can_override_approve == true', - locations: ['record_section', 'list_item'], + locations: ['record_section', 'record_row'], // Names what was approved, in the inbox's inline Approve wording. The // decide route answers `ApprovalDecisionResult`, whose `request` is the // read-back row with its display enrichment, so `record_title` is the @@ -780,7 +780,7 @@ export const SysApprovalRequest = ObjectSchema.create({ visible: 'has(record.viewer) && has(record.viewer.can_act) && record.viewer.can_act == true' + ' || has(record.viewer) && has(record.viewer.can_override) && record.viewer.can_override == true', - locations: ['record_section', 'list_item'], + locations: ['record_section', 'record_row'], successMessage: 'Rejected "{{ result.request.record_title }}"', refreshAfter: true, ai: { diff --git a/packages/plugins/plugin-approvals/src/sys-approval-request.page.ts b/packages/plugins/plugin-approvals/src/sys-approval-request.page.ts index 577be3fa786..50279ac6811 100644 --- a/packages/plugins/plugin-approvals/src/sys-approval-request.page.ts +++ b/packages/plugins/plugin-approvals/src/sys-approval-request.page.ts @@ -24,7 +24,7 @@ import type { Page } from '@objectstack/spec/ui'; * (`placedActions: true`, #29951). The object places none of its own (its * decision actions are `record_section` ones, drawn by the panel below), so * the header draws only what an installed package places on - * `sys_approval_request` at `record_header` / `record_more`. + * `sys_approval_request` at `record` / `record_page`. * - Then the highlight strip: the object's `highlightFields` WITHOUT * `record_id`. `record_id` / `object_name` is a declared `referenceVia` * pointer pair, and the page reaches the record it points at through the @@ -89,7 +89,7 @@ export const SysApprovalRequestDetailPage: Page = { // request by the business record it is about, linked to it, wherever // the approvals get serves that record's title, objectstack#35415; // else by the flow's label, the object's `nameField`), and every action placed - // on the object at `record_header` / `record_more`, read live, as the + // on the object at `record` / `record_page`, read live, as the // synthesized header drew them. The object places none of its own, so // only an action another package places there shows (a bare header // dropped it, #29951); the host appends its system actions. diff --git a/packages/qa/dogfood/test/action-list-packageless-other-object.dogfood.test.ts b/packages/qa/dogfood/test/action-list-packageless-other-object.dogfood.test.ts index 51b4172f71a..39124ff663a 100644 --- a/packages/qa/dogfood/test/action-list-packageless-other-object.dogfood.test.ts +++ b/packages/qa/dogfood/test/action-list-packageless-other-object.dogfood.test.ts @@ -29,7 +29,7 @@ import { bootShowcase } from './showcase-boot.js'; const PKG = 'com.example.qalistagree'; const action = (name: string, label: string, objectName: string) => ({ - name, label, objectName, type: 'url', target: 'https://example.com', locations: ['record_more'], + name, label, objectName, type: 'url', target: 'https://example.com', locations: ['record_page'], component: 'action:menu', }); describe('[#33904] the action list agrees with the by-name read beside a package-less save on another object', () => { diff --git a/packages/qa/dogfood/test/action-save-packageless-other-object.dogfood.test.ts b/packages/qa/dogfood/test/action-save-packageless-other-object.dogfood.test.ts index b7cc445dc01..2b550e28c0f 100644 --- a/packages/qa/dogfood/test/action-save-packageless-other-object.dogfood.test.ts +++ b/packages/qa/dogfood/test/action-save-packageless-other-object.dogfood.test.ts @@ -34,7 +34,7 @@ import { bootShowcase } from './showcase-boot.js'; const PKG = 'com.example.qasaveother'; const action = (name: string, label: string, objectName: string) => ({ - name, label, objectName, type: 'url', target: `https://example.invalid/${label}`, locations: ['record_more'], + name, label, objectName, type: 'url', target: `https://example.invalid/${label}`, locations: ['record_page'], component: 'action:menu', }); describe('[ADR-0150 D4] a package-less action save on an object the package does not bind', () => { diff --git a/packages/qa/dogfood/test/api-action-door-forward.dogfood.test.ts b/packages/qa/dogfood/test/api-action-door-forward.dogfood.test.ts index 11dcff40f19..14411f2d956 100644 --- a/packages/qa/dogfood/test/api-action-door-forward.dogfood.test.ts +++ b/packages/qa/dogfood/test/api-action-door-forward.dogfood.test.ts @@ -81,7 +81,7 @@ const RemoteProbe = ObjectSchema.create({ label: 'Ping Remote', type: 'api', target: 'https://example.invalid/ping', - locations: ['record_header'], + locations: ['record_page'], }, { name: 'rename_probe', @@ -90,7 +90,7 @@ const RemoteProbe = ObjectSchema.create({ method: 'PATCH', target: '/api/v1/data/probe_remote_thing/${ctx.recordId}', bodyExtra: { name: 'renamed-through-the-door' }, - locations: ['record_header'], + locations: ['record_page'], }, ], } as any); diff --git a/packages/qa/dogfood/test/mcp-oauth-api-action-forward.dogfood.test.ts b/packages/qa/dogfood/test/mcp-oauth-api-action-forward.dogfood.test.ts index 91cc421df87..b4249e0fda1 100644 --- a/packages/qa/dogfood/test/mcp-oauth-api-action-forward.dogfood.test.ts +++ b/packages/qa/dogfood/test/mcp-oauth-api-action-forward.dogfood.test.ts @@ -61,10 +61,10 @@ const Probe = ObjectSchema.create({ sharingModel: 'public_read_write', fields: { name: Field.text({ label: 'Name' }) }, actions: [ - { name: 'probe_update_me', label: 'Update Me', type: 'api', method: 'POST', target: '/api/v1/auth/update-user', bodyExtra: { name: 'Renamed By Agent' }, locations: ['record_header'], ai: ai('Rename the signed-in user through the identity route as the caller.') }, - { name: 'probe_data_patch', label: 'Data Patch', type: 'api', method: 'PATCH', target: '/api/v1/data/probe_fwd_thing/${ctx.recordId}', bodyExtra: { name: 'patched' }, locations: ['record_header'], ai: ai('Patch the probe record through the data door as the caller.') }, - { name: 'probe_ban', label: 'Ban', type: 'api', method: 'POST', target: '/api/v1/auth/admin/ban-user', params: [{ name: 'userId', label: 'User', type: 'text', required: true }], locations: ['record_header'], ai: ai('Ban the probe target user through the better-auth admin endpoint.') }, - { name: 'probe_meta_put', label: 'Meta Put', type: 'api', method: 'PUT', target: '/api/v1/meta/object/probe_fwd_thing', locations: ['record_header'], ai: ai('Rewrite the probe object definition through the metadata door.') }, + { name: 'probe_update_me', label: 'Update Me', type: 'api', method: 'POST', target: '/api/v1/auth/update-user', bodyExtra: { name: 'Renamed By Agent' }, locations: ['record_page'], ai: ai('Rename the signed-in user through the identity route as the caller.') }, + { name: 'probe_data_patch', label: 'Data Patch', type: 'api', method: 'PATCH', target: '/api/v1/data/probe_fwd_thing/${ctx.recordId}', bodyExtra: { name: 'patched' }, locations: ['record_page'], ai: ai('Patch the probe record through the data door as the caller.') }, + { name: 'probe_ban', label: 'Ban', type: 'api', method: 'POST', target: '/api/v1/auth/admin/ban-user', params: [{ name: 'userId', label: 'User', type: 'text', required: true }], locations: ['record_page'], ai: ai('Ban the probe target user through the better-auth admin endpoint.') }, + { name: 'probe_meta_put', label: 'Meta Put', type: 'api', method: 'PUT', target: '/api/v1/meta/object/probe_fwd_thing', locations: ['record_page'], ai: ai('Rewrite the probe object definition through the metadata door.') }, ], } as any); diff --git a/packages/qa/dogfood/test/org-change-slug-bound-action.dogfood.test.ts b/packages/qa/dogfood/test/org-change-slug-bound-action.dogfood.test.ts index 1b2e0e245a3..824d658e479 100644 --- a/packages/qa/dogfood/test/org-change-slug-bound-action.dogfood.test.ts +++ b/packages/qa/dogfood/test/org-change-slug-bound-action.dogfood.test.ts @@ -21,7 +21,7 @@ * the declaration the platform object carried — is mounted beside the * showcase. Then: * - `GET /meta/object/sys_organization` serves `change_slug` once, with the - * orchestrator's target, method, `record_header` location and one `slug` + * orchestrator's target, method, `record_page` location and one `slug` * param, and the `multiOrgEnabled` gate lowered exactly as the platform's * own `requiresFeature` actions are; * - the gate admits it with multi-org on and hides it with multi-org off, @@ -57,7 +57,7 @@ const cloudShaped = defineStack({ icon: 'edit-3', variant: 'secondary', mode: 'custom', - locations: ['record_header'], + locations: ['record_page'], type: 'api', target: TARGET, method: 'POST', @@ -113,7 +113,7 @@ describe('a cloud-shaped composition binds change_slug to sys_organization, and it('serves change_slug once, with the orchestrator target, its location and its one slug param', () => { const served = actions.filter((a) => a.name === 'change_slug'); expect(served).toHaveLength(1); - expect(served[0]).toMatchObject({ type: 'api', target: TARGET, method: 'POST', locations: ['record_header'] }); + expect(served[0]).toMatchObject({ type: 'api', target: TARGET, method: 'POST', locations: ['record_page'] }); expect(served[0].params).toEqual([{ field: 'slug', required: true, defaultFromRow: true }]); }); @@ -143,7 +143,8 @@ describe('a cloud-shaped composition binds change_slug to sys_organization, and it('sorts after the rename and before leave in the record header, so it sits in the overflow', () => { const header = actions - .filter((a) => (a.locations ?? []).includes('record_header')) + // `record` covers the record page too (objectstack#36495). + .filter((a) => (a.locations ?? []).some((l: string) => l === 'record_page' || l === 'record')) .map((a, i) => ({ a, i })) .sort((x, y) => (x.a.order ?? 0) - (y.a.order ?? 0) || x.i - y.i) .map(({ a }) => a.name); diff --git a/packages/qa/downstream-contract/src/log-call.action.ts b/packages/qa/downstream-contract/src/log-call.action.ts index a34a18d2059..0c6aa0fa57e 100644 --- a/packages/qa/downstream-contract/src/log-call.action.ts +++ b/packages/qa/downstream-contract/src/log-call.action.ts @@ -12,6 +12,6 @@ export const LogCallAction: Action = { objectName: 'dc_account', type: 'script', target: 'logCall', - locations: ['record_header'], + locations: ['record_page'], successMessage: 'Call logged.', }; diff --git a/packages/qa/downstream-contract/src/modern.action.ts b/packages/qa/downstream-contract/src/modern.action.ts index 12d5b2114e2..7d91d72b505 100644 --- a/packages/qa/downstream-contract/src/modern.action.ts +++ b/packages/qa/downstream-contract/src/modern.action.ts @@ -9,5 +9,5 @@ export const ArchiveAccountAction = defineAction({ objectName: 'dc_account', type: 'script', target: 'archiveAccount', - locations: ['record_header'], + locations: ['record_page'], }); diff --git a/packages/qa/scenarios/src/runner/door-rules-corpus.ts b/packages/qa/scenarios/src/runner/door-rules-corpus.ts index 41ff01e4957..3e4f40b09b1 100644 --- a/packages/qa/scenarios/src/runner/door-rules-corpus.ts +++ b/packages/qa/scenarios/src/runner/door-rules-corpus.ts @@ -163,7 +163,7 @@ export const DOOR_RULES_CORPUS: DoorRulesCorpus = { }, { id: '13-tier', - text: "13. ACTIONS / BUTTONS are `action` metadata, NOT views — and this version offers only these action types: `flow` / `form` / `modal` / `url`. When the user asks for a \"button\", \"action\", \"动作\", \"按钮\", or an operation that DOES something to a record (\"mark as done / 标记为已完成\", \"approve\", \"submit\", \"set status to X\", \"send\"), create an `action` — a view only DISPLAYS data, an action is the clickable control that performs the operation. FIRST call get_metadata_schema('action'), then create_metadata(type:'action', …) with `type` set to one of `flow` / `form` / `modal` / `url` and `target` naming what it opens (the schema says what each type's target is). Any other action type is refused by the tool (status:'unsupported_in_this_version' — relay its `summary`), so never author one and never promise one:\n - BIND IT TO THE OBJECT: set `objectName:''`. That is what folds the action into the object's record header (so the button renders) AND wires its handler (so clicking it works). An action with no objectName is a dead global button (lint: `action_missing_object_binding`). Give it `label`, optional `icon`, and `locations` (e.g. ['record_header'] or ['list_item']).\n - A button that must CHANGE the record is `type:'flow'` with `target:''`: author that flow too, in the same build (rule 14 has its shapes), and do not say the button works: on this MCP connection that flow is a staged draft until a person publishes and tests it in Studio > Changes. This version offers no inline code body on an action, so the write lives in the flow, never in the action — an action that only RETURNS the new values changes NOTHING.\n Do NOT make a view \"for\" the button and defer the real logic — author the action itself THIS turn, bound to the object's app package (not the default workspace). After staging, verify_build lints actions — FIX every `action_*` error (e.g. action_missing_object_binding) before telling the user the button works; an action you cannot get past the lint is NOT done.", + text: "13. ACTIONS / BUTTONS are `action` metadata, NOT views — and this version offers only these action types: `flow` / `form` / `modal` / `url`. When the user asks for a \"button\", \"action\", \"动作\", \"按钮\", or an operation that DOES something to a record (\"mark as done / 标记为已完成\", \"approve\", \"submit\", \"set status to X\", \"send\"), create an `action` — a view only DISPLAYS data, an action is the clickable control that performs the operation. FIRST call get_metadata_schema('action'), then create_metadata(type:'action', …) with `type` set to one of `flow` / `form` / `modal` / `url` and `target` naming what it opens (the schema says what each type's target is). Any other action type is refused by the tool (status:'unsupported_in_this_version' — relay its `summary`), so never author one and never promise one:\n - BIND IT TO THE OBJECT: set `objectName:''`. That is what folds the action into the object's record header (so the button renders) AND wires its handler (so clicking it works). An action with no objectName is a dead global button (lint: `action_missing_object_binding`). Give it `label`, optional `icon`, and `locations` (e.g. ['record_page'] or ['record_row']).\n - A button that must CHANGE the record is `type:'flow'` with `target:''`: author that flow too, in the same build (rule 14 has its shapes), and do not say the button works: on this MCP connection that flow is a staged draft until a person publishes and tests it in Studio > Changes. This version offers no inline code body on an action, so the write lives in the flow, never in the action — an action that only RETURNS the new values changes NOTHING.\n Do NOT make a view \"for\" the button and defer the real logic — author the action itself THIS turn, bound to the object's app package (not the default workspace). After staging, verify_build lints actions — FIX every `action_*` error (e.g. action_missing_object_binding) before telling the user the button works; an action you cannot get past the lint is NOT done.", }, { id: '14', diff --git a/packages/runtime/src/action-execution.ts b/packages/runtime/src/action-execution.ts index 2aa7db94e87..d65533b56c2 100644 --- a/packages/runtime/src/action-execution.ts +++ b/packages/runtime/src/action-execution.ts @@ -3621,7 +3621,7 @@ export function summarizeAction( (Array.isArray(action?.locations) && action.locations.some( (l: string) => - l === 'list_item' || l === 'record_header' || l === 'record_more' || l === 'record_related', + l === 'record' || l === 'record_page' || l === 'record_row' || l === 'record_related', )); const description = (typeof action?.ai?.description === 'string' ? action.ai.description : undefined) ?? diff --git a/packages/runtime/src/action-flow-input-params.test.ts b/packages/runtime/src/action-flow-input-params.test.ts index 5ac0ae48b3d..85b57b31e78 100644 --- a/packages/runtime/src/action-flow-input-params.test.ts +++ b/packages/runtime/src/action-flow-input-params.test.ts @@ -37,6 +37,8 @@ import { summarizeActionParams, summarizeFlowInputParams, } from './action-execution.js'; +// Paid at collection, not inside a clocked case (check:test-source-alias). +import '@objectstack/metadata'; const NO_DEPS: any = {}; @@ -47,7 +49,7 @@ const FLOW_ACTION = { type: 'flow', target: 'schedule_followup', ai: { exposed: true }, - locations: ['record_header'], + locations: ['record_page'], }; /** @@ -145,7 +147,7 @@ describe('summarizeActionParams / summarizeAction fall back to the flow (#15705) }); it('CONTROL — a non-flow action handed a flow is unchanged (the caller resolves none)', () => { - const script = { name: 'close_case', type: 'script', target: 'closeCase', locations: ['record_header'] }; + const script = { name: 'close_case', type: 'script', target: 'closeCase', locations: ['record_page'] }; expect(summarizeActionParams(NO_DEPS, script, undefined)).toEqual([]); expect(summarizeAction(NO_DEPS, script, undefined, 'crm_case')).not.toHaveProperty('params'); }); diff --git a/packages/runtime/src/action-selection-caller-scope.pin.test.ts b/packages/runtime/src/action-selection-caller-scope.pin.test.ts index 182bb0ba372..bf298739226 100644 --- a/packages/runtime/src/action-selection-caller-scope.pin.test.ts +++ b/packages/runtime/src/action-selection-caller-scope.pin.test.ts @@ -75,7 +75,7 @@ const SELECTION_ACTION = { label: 'Close selected', type: 'script', target: ACTION, - locations: ['list_toolbar'], + locations: ['list'], execution: 'aggregate', ai: { exposed: true, description: 'Close every selected ticket in one call.' }, }; diff --git a/packages/runtime/src/http-dispatcher.test.ts b/packages/runtime/src/http-dispatcher.test.ts index 8e227a57ff9..a58253c7ae0 100644 --- a/packages/runtime/src/http-dispatcher.test.ts +++ b/packages/runtime/src/http-dispatcher.test.ts @@ -4465,7 +4465,7 @@ describe('HttpDispatcher — MCP action bridge (list_actions / run_action)', () objectName: 'todo_task', type: 'script', target: 'completeTask', // handler key differs from the declarative name - locations: ['record_header', 'list_item'], + locations: ['record'], ai: { exposed: true, description: 'Mark a todo task as complete.' }, }; const gatedAction = { @@ -4673,7 +4673,7 @@ describe('HttpDispatcher — MCP action bridge (list_actions / run_action)', () objectName: 'todo_task', type: 'flow', target: 'escalation_flow', - locations: ['record_header'], + locations: ['record_page'], ai: { exposed: true, description: 'Escalate a ticket to the on-call team.' }, }; const makeFlowBridge = (execCtx: any, automation: any) => { @@ -4763,7 +4763,7 @@ describe('HttpDispatcher — MCP action bridge (list_actions / run_action)', () objectName: 'todo_task', type: 'script', body: { language: 'js', source: 'ctx.record.archived = true;' }, - locations: ['record_header'], + locations: ['record_page'], params: [{ name: 'reason', type: 'text', required: true }], ai: { exposed: true, description: 'Archive a completed todo task.' }, }; diff --git a/packages/runtime/src/mcp-list-actions-flow-params.test.ts b/packages/runtime/src/mcp-list-actions-flow-params.test.ts index 4882bf4afec..212464a3b14 100644 --- a/packages/runtime/src/mcp-list-actions-flow-params.test.ts +++ b/packages/runtime/src/mcp-list-actions-flow-params.test.ts @@ -29,7 +29,7 @@ const FLOW_ACTION = { objectName: 'crm_lead', type: 'flow', target: 'schedule_followup', - locations: ['record_header'], + locations: ['record_page'], ai: { exposed: true, description: 'Schedule a follow-up task for this lead.' }, }; diff --git a/packages/runtime/src/mcp-resume-run.test.ts b/packages/runtime/src/mcp-resume-run.test.ts index 2ae673a4244..65e3d8c17db 100644 --- a/packages/runtime/src/mcp-resume-run.test.ts +++ b/packages/runtime/src/mcp-resume-run.test.ts @@ -62,7 +62,7 @@ const SCHEDULE = { objectName: OBJECT, type: 'flow', target: 'schedule_followup', - locations: ['record_header'], + locations: ['record_page'], ai: { exposed: true, description: 'Schedule a follow-up task for this lead.' }, }; /** Two screens in a row, so a resume can pause again. */ @@ -72,7 +72,7 @@ const WIZARD = { objectName: OBJECT, type: 'flow', target: 'followup_wizard', - locations: ['record_header'], + locations: ['record_page'], ai: { exposed: true, description: 'Walk through a two-step follow-up wizard.' }, }; /** Gated on a capability the default caller does not hold. */ diff --git a/packages/services/service-datasource/src/datasource-admin-plugin.ts b/packages/services/service-datasource/src/datasource-admin-plugin.ts index 9d5577207f3..e5335b67a0c 100644 --- a/packages/services/service-datasource/src/datasource-admin-plugin.ts +++ b/packages/services/service-datasource/src/datasource-admin-plugin.ts @@ -355,7 +355,7 @@ export class DatasourceAdminServicePlugin implements Plugin { method: 'POST', variant: 'secondary', refreshAfter: false, - locations: ['record_header', 'list_item'], + locations: ['record'], }, // The #8155 migration's operator-initiated door: one datasource, one // click, by a human who is looking at the row. Deliberately NOT a @@ -379,7 +379,7 @@ export class DatasourceAdminServicePlugin implements Plugin { method: 'POST', variant: 'secondary', refreshAfter: true, - locations: ['record_header'], + locations: ['record_page'], }, ] as any); diff --git a/packages/services/service-messaging/src/in-app-message-action.test.ts b/packages/services/service-messaging/src/in-app-message-action.test.ts index a2021163192..643aeafde83 100644 --- a/packages/services/service-messaging/src/in-app-message-action.test.ts +++ b/packages/services/service-messaging/src/in-app-message-action.test.ts @@ -32,7 +32,7 @@ describe('send_in_app_message ↔ POST /api/v1/messaging/in-app-messages', () => it('is a same-origin api action on the Notification Events list toolbar, aimed at the door', () => { expect(action).toBeDefined(); expect(action!.type).toBe('api'); - expect(action!.locations).toEqual(['list_toolbar']); + expect(action!.locations).toEqual(['list']); expect(action!.target).toBe(IN_APP_MESSAGE_ROUTE); }); diff --git a/packages/spec/liveness/action.json b/packages/spec/liveness/action.json index e022b76ad70..494f94c0ce0 100644 --- a/packages/spec/liveness/action.json +++ b/packages/spec/liveness/action.json @@ -311,7 +311,7 @@ "order": { "status": "live", "evidence": "packages/spec/src/stack.zod.ts (mergeActionsIntoObjects stable-sorts each action group by order)", - "note": "Deterministic action ordering (#2670). Framework stable-sorts every action group by `order` at defineStack/composeStacks time; objectui record_header picks the first as the primary button. Lower = higher; unset = 0." + "note": "Deterministic action ordering (#2670). Framework stable-sorts every action group by `order` at defineStack/composeStacks time; objectui's record page header picks the first as the primary button. Lower = higher; unset = 0." }, "confirmText": { "status": "live", diff --git a/packages/spec/liveness/object.json b/packages/spec/liveness/object.json index 3a3f9be2f74..192fd64a526 100644 --- a/packages/spec/liveness/object.json +++ b/packages/spec/liveness/object.json @@ -64,21 +64,21 @@ "status": "live", "verifiedAt": "2026-11-26", "evidenceScope": "in-repo", - "evidence": "ui/packages/app-shell/src/views/RecordDetailView.tsx#RecordDetailView (the synthesized record header reads the arm); ui/packages/components/src/renderers/layout/containers.tsx#PageHeaderActions (an authored `page:header` with `placedActions: true` reads it); ui/packages/types/src/ui-action.ts#arrangedHeaderActions (pinned actions placed at `record_header` in pin order, the rest at `record_more`); ui/packages/plugin-grid/src/ObjectGrid.tsx#ObjectGrid (the grid reads the arm and ranks its row actions with `rankRowActionDefs`); ui/packages/plugin-grid/src/components/RowActionMenu.tsx#planRowActionMenu (a row's ⋮ menu, its right-click menu and the list page selection bar's one-record actions list the actions the arm names first, `pinned` then `more`, then the rest as before, with `orderRowMenuActions`; the row's inline button is unchanged); ui/packages/plugin-grid/src/components/SelectionBar.tsx#planExposedEntries (the selection bar draws the first three of that order as buttons)", + "evidence": "ui/packages/app-shell/src/views/RecordDetailView.tsx#RecordDetailView (the synthesized record header reads the arm); ui/packages/components/src/renderers/layout/containers.tsx#PageHeaderActions (an authored `page:header` with `placedActions: true` reads it); ui/packages/types/src/ui-action.ts#arrangedHeaderActions (pinned actions are header buttons in pin order, lifted out of the ⋯ fold; the rest are folded with `component: 'action:menu'`); ui/packages/plugin-grid/src/ObjectGrid.tsx#ObjectGrid (the grid reads the arm and ranks its row actions with `rankRowActionDefs`); ui/packages/plugin-grid/src/components/RowActionMenu.tsx#planRowActionMenu (a row's ⋮ menu, its right-click menu and the list page selection bar's one-record actions list the actions the arm names first, `pinned` then `more`, then the rest as before, with `orderRowMenuActions`; the row's inline button is unchanged); ui/packages/plugin-grid/src/components/SelectionBar.tsx#planExposedEntries (the selection bar draws the first three of that order as buttons)", "note": "objectstack#36366: the record scope, drawn in the record header: the record page, the side preview and the phone's bottom bar. objectstack#36494: the same order leads the actions a grid row already offers: its ⋮ menu, its right-click menu and, on a list page, the selection bar's one-record actions, whose buttons are the first three of that order.", "children": { "pinned": { "status": "live", "verifiedAt": "2026-11-23", "evidenceScope": "in-repo", - "evidence": "ui/packages/types/src/ui-action.ts#arrangedHeaderActions (a pinned action is placed at `record_header` and leads the sort, in pin order); ui/packages/app-shell/src/views/RecordDetailView.tsx#RecordDetailView (the record header, side preview and phone bar draw them as buttons); ui/packages/components/src/renderers/layout/containers.tsx#PageHeaderActions (an authored `placedActions: true` header too)", + "evidence": "ui/packages/types/src/ui-action.ts#arrangedHeaderActions (a pinned action is a header button, lifted out of the ⋯ fold, and leads the sort, in pin order); ui/packages/app-shell/src/views/RecordDetailView.tsx#RecordDetailView (the record header, side preview and phone bar draw them as buttons); ui/packages/components/src/renderers/layout/containers.tsx#PageHeaderActions (an authored `placedActions: true` header too)", "note": "objectstack#36366: the record header's buttons, at most three, in order." }, "more": { "status": "live", "verifiedAt": "2026-11-23", "evidenceScope": "in-repo", - "evidence": "ui/packages/types/src/ui-action.ts#arrangedHeaderActions (an unpinned action is placed at `record_more`, the ones `more` names first in that order); ui/packages/app-shell/src/views/RecordDetailView.tsx#RecordDetailView (the record header's ⋯ draws them)", + "evidence": "ui/packages/types/src/ui-action.ts#arrangedHeaderActions (an unpinned action is folded into the ⋯ with `component: 'action:menu'`, the ones `more` names first in that order); ui/packages/app-shell/src/views/RecordDetailView.tsx#RecordDetailView (the record header's ⋯ draws them)", "note": "objectstack#36366: the order of the record header's ⋯ menu." } } diff --git a/packages/spec/liveness/page.json b/packages/spec/liveness/page.json index 71f901f49cd..3471f3ca326 100644 --- a/packages/spec/liveness/page.json +++ b/packages/spec/liveness/page.json @@ -1,6 +1,6 @@ { "type": "page", - "_note": "PageSchema (UI). Renderers live in objectui; objectui paths are cited with the `objectui:` realm marker (in `evidence` or `note` prose) and counted, not resolved against this repo (#5623). Seeded from the Studio page-design dogfood (framework#2254/#2261/#2265). Containers (variables/regions/interfaceConfig/slots/aria) classified at top level — one drill level, no divergent sub-statuses. The removed roadmap page types (record_review/blank) and their config fields (recordReview/blankLayout) were hard-removed — no longer authorable. RETIREMENT RECORD (#11027, 2026-08-24): `regions[].components[].responsive` is a retiredKey tombstone (ADR-0049 D2) — measured dead across both repos (zero callers of either objectui consumer implementation); the shared `ResponsiveConfigSchema` left with it. The walk drills one level only, so no component-level key has a row here (`page/regions` stays RECORDED in undrilled-containers.baseline.json — #4956's page-side instance, still open for the other component keys); the checkable record of THIS retirement is the authorable-surface `ui/PageComponent:responsive [RETIRED]` row, RETIRED_KEYS_BY_MAJOR[18], and the `page-component-responsive-removed` conversion. LIVE RECORD (#23016, 2026-10-12, maintainer ruling in the card body; rewritten from its PLANNED record by #24300 once the renderer shipped): `regions[].components[].dataSource` gained a second shape, the API binding `ElementApiDataSourceSchema` (`{ provider: 'api', read: { url, method? }, path? }`, `read.url` a same-origin API path refused at parse otherwise, no credential key) — LIVE: measured at the console pin `.objectui-sha` @0707b4ae3712, which carries the renderer, objectui @c4dd7078ed (objectstack-ai/objectui#12197). The console reads it on every page element (objectui: packages/react/src/SchemaRenderer.tsx calls useElementApiDataSource for each node it renders; the read is objectui: packages/react/src/element-data-source/useElementApiDataSource.ts, which parses the binding with this schema first, sends one GET to `read.url` through the host's signed-in fetch and selects `path`) and binds the selected value as `data` in the element's expression holes, in its `visibleWhen` and in its subtree, drawing a loading or error panel until the value is in; the generic stat / usage-bar / checklist blocks take it as their `dataSource` (objectui: packages/app-shell/src/console/blocks/productBlocks.tsx). No row carries it because the walk never reaches a component-level key (`page/regions` and `page/slots` are recorded undrilled containers) and `childShape()` does not descend the `z.union` the key now is; the checkable record is the authorable-surface `ui/ElementApiDataSource:*` rows and the schema's own describe, which no longer carries the `[PLANNED — not yet rendered]` marker. LIVE RECORD (#23134, 2026-10-13, ruling B on objectstack-ai/objectui#12296, ruling comment 6137226306; rewritten from its PLANNED record by #23585 once the renderer shipped): `regions[].components[].properties.parentDataSource` on `record:related_list` (`RecordRelatedListProps` in packages/spec/src/ui/component.zod.ts) is the block's PARENT-record binding, the element object binding `ElementDataSourceSchema` by reference, read by the single-record rule (the first row by `sort`; no row is a loud absence, never an empty list); the node-level `dataSource` on the block keeps its child-row meaning (#6953). LIVE: measured at the console pin `.objectui-sha` @4016370af3c9, which carries the renderer, objectui @d81e46043 (objectstack-ai/objectui#12407, the related-list leg of objectstack-ai/objectui#12294). The block hands the key to its parent read (objectui: packages/plugin-detail/src/renderers/record-related-list.tsx, whose RecordRelatedListRenderer passes `schema.parentDataSource` to ParentRecordBinding; the read is objectui: packages/plugin-detail/src/renderers/recordBinding.tsx, whose BoundRecordProvider asks the page's own adapter, so under the caller's identity, for one row (`$top: 1`) by the binding's `sort` and provides it as the record context the list body reads, `relationshipValueField` included). No row, or a read the server refuses as forbidden, draws the block's loud absence (NoParentRecord) in its place and queries no child rows; with the key absent, ParentRecordBinding leaves the list as it is and the record page's record context remains the parent. No row carries it for the reason above (component-level keys sit under the recorded undrilled `page/regions` container); the checkable record is the authorable-surface `ui/RecordRelatedListProps:parentDataSource` row and the key's own describe, which no longer carries the `[PLANNED — not yet rendered]` marker. PLANNED RECORD (#24266, 2026-10-18, objectstack-ai/cloud#2774 Q2 = B as the card quotes it): `regions[].components[].properties.emptyState` on the three bound record blocks `record:details`, `record:highlights` and `record:quick_actions` (`RecordDetailsProps`, `RecordHighlightsProps`, `RecordQuickActionsProps` in packages/spec/src/ui/component.zod.ts) is the list view's own `EmptyStateSchema` by reference, drawn only when the block's node-level `dataSource` binding answers no row. PLANNED, not live: measured at objectui @79cb8c03e, the three blocks take their binding through objectui: packages/plugin-detail/src/renderers/recordBinding.tsx, which mounts a 0-row answer as a record context with no record, so each draws its own placeholder and nothing reads the key. Carrier: objectstack-ai/objectui#12932, dispatched once a spec release carrying the key is installable. No row carries it for the reason above (component-level keys sit under the recorded undrilled `page/regions` container); the checkable record is the authorable-surface `ui/RecordDetailsProps:emptyState`, `ui/RecordHighlightsProps:emptyState` and `ui/RecordQuickActionsProps:emptyState` rows and the keys' own `[PLANNED — not yet rendered]` describe. When that card lands, the marker leaves and this sentence is rewritten. LIVE RECORD (#30018, 2026-11-04, ruling record 6624172200 on #29951, letter A; rewritten from its PLANNED record by #29951's ui half once the reader landed): `regions[].components[].properties.placedActions` on `page:header` (`PageHeaderProps` in packages/spec/src/ui/component.zod.ts) is the explicit opt-in to draw every action of the bound object whose `locations` include `record_header` or `record_more`, read live, in place of an authored `actions` id list; `true` beside an authored `actions` list is refused at the key by the props door (`@objectstack/lint` `validateComponentProps`, rule `component-props-invalid`). LIVE: the header renderer reads it (ui/packages/components/src/renderers/layout/containers.tsx, `PageHeaderActions`, which `PageHeaderRenderer` hands the key: `true` draws `placedHeaderActions` from ui/packages/types/src/ui-action.ts over the object's actions as the metadata read serves them, the one placed-header reader `RecordDetailView`'s synthesized header reads too; a pair that skipped validation draws none of the object's actions and is reported once), and the `page:header` registration publishes the input. Its producers are the platform record pages `sys_user_detail` and `sys_organization_detail` (@objectstack/platform-objects) and `sys_approval_request_detail` (@objectstack/plugin-approvals), which set it in place of the frozen id lists that dropped another package's header actions. No row carries it for the reason above (component-level keys sit under the recorded undrilled `page/regions` container); the checkable record is the authorable-surface `ui/PageHeaderProps:placedActions` row and the key's own describe, which no longer carries the `[PLANNED — not yet rendered]` marker.", + "_note": "PageSchema (UI). Renderers live in objectui; objectui paths are cited with the `objectui:` realm marker (in `evidence` or `note` prose) and counted, not resolved against this repo (#5623). Seeded from the Studio page-design dogfood (framework#2254/#2261/#2265). Containers (variables/regions/interfaceConfig/slots/aria) classified at top level — one drill level, no divergent sub-statuses. The removed roadmap page types (record_review/blank) and their config fields (recordReview/blankLayout) were hard-removed — no longer authorable. RETIREMENT RECORD (#11027, 2026-08-24): `regions[].components[].responsive` is a retiredKey tombstone (ADR-0049 D2) — measured dead across both repos (zero callers of either objectui consumer implementation); the shared `ResponsiveConfigSchema` left with it. The walk drills one level only, so no component-level key has a row here (`page/regions` stays RECORDED in undrilled-containers.baseline.json — #4956's page-side instance, still open for the other component keys); the checkable record of THIS retirement is the authorable-surface `ui/PageComponent:responsive [RETIRED]` row, RETIRED_KEYS_BY_MAJOR[18], and the `page-component-responsive-removed` conversion. LIVE RECORD (#23016, 2026-10-12, maintainer ruling in the card body; rewritten from its PLANNED record by #24300 once the renderer shipped): `regions[].components[].dataSource` gained a second shape, the API binding `ElementApiDataSourceSchema` (`{ provider: 'api', read: { url, method? }, path? }`, `read.url` a same-origin API path refused at parse otherwise, no credential key) — LIVE: measured at the console pin `.objectui-sha` @0707b4ae3712, which carries the renderer, objectui @c4dd7078ed (objectstack-ai/objectui#12197). The console reads it on every page element (objectui: packages/react/src/SchemaRenderer.tsx calls useElementApiDataSource for each node it renders; the read is objectui: packages/react/src/element-data-source/useElementApiDataSource.ts, which parses the binding with this schema first, sends one GET to `read.url` through the host's signed-in fetch and selects `path`) and binds the selected value as `data` in the element's expression holes, in its `visibleWhen` and in its subtree, drawing a loading or error panel until the value is in; the generic stat / usage-bar / checklist blocks take it as their `dataSource` (objectui: packages/app-shell/src/console/blocks/productBlocks.tsx). No row carries it because the walk never reaches a component-level key (`page/regions` and `page/slots` are recorded undrilled containers) and `childShape()` does not descend the `z.union` the key now is; the checkable record is the authorable-surface `ui/ElementApiDataSource:*` rows and the schema's own describe, which no longer carries the `[PLANNED — not yet rendered]` marker. LIVE RECORD (#23134, 2026-10-13, ruling B on objectstack-ai/objectui#12296, ruling comment 6137226306; rewritten from its PLANNED record by #23585 once the renderer shipped): `regions[].components[].properties.parentDataSource` on `record:related_list` (`RecordRelatedListProps` in packages/spec/src/ui/component.zod.ts) is the block's PARENT-record binding, the element object binding `ElementDataSourceSchema` by reference, read by the single-record rule (the first row by `sort`; no row is a loud absence, never an empty list); the node-level `dataSource` on the block keeps its child-row meaning (#6953). LIVE: measured at the console pin `.objectui-sha` @4016370af3c9, which carries the renderer, objectui @d81e46043 (objectstack-ai/objectui#12407, the related-list leg of objectstack-ai/objectui#12294). The block hands the key to its parent read (objectui: packages/plugin-detail/src/renderers/record-related-list.tsx, whose RecordRelatedListRenderer passes `schema.parentDataSource` to ParentRecordBinding; the read is objectui: packages/plugin-detail/src/renderers/recordBinding.tsx, whose BoundRecordProvider asks the page's own adapter, so under the caller's identity, for one row (`$top: 1`) by the binding's `sort` and provides it as the record context the list body reads, `relationshipValueField` included). No row, or a read the server refuses as forbidden, draws the block's loud absence (NoParentRecord) in its place and queries no child rows; with the key absent, ParentRecordBinding leaves the list as it is and the record page's record context remains the parent. No row carries it for the reason above (component-level keys sit under the recorded undrilled `page/regions` container); the checkable record is the authorable-surface `ui/RecordRelatedListProps:parentDataSource` row and the key's own describe, which no longer carries the `[PLANNED — not yet rendered]` marker. PLANNED RECORD (#24266, 2026-10-18, objectstack-ai/cloud#2774 Q2 = B as the card quotes it): `regions[].components[].properties.emptyState` on the three bound record blocks `record:details`, `record:highlights` and `record:quick_actions` (`RecordDetailsProps`, `RecordHighlightsProps`, `RecordQuickActionsProps` in packages/spec/src/ui/component.zod.ts) is the list view's own `EmptyStateSchema` by reference, drawn only when the block's node-level `dataSource` binding answers no row. PLANNED, not live: measured at objectui @79cb8c03e, the three blocks take their binding through objectui: packages/plugin-detail/src/renderers/recordBinding.tsx, which mounts a 0-row answer as a record context with no record, so each draws its own placeholder and nothing reads the key. Carrier: objectstack-ai/objectui#12932, dispatched once a spec release carrying the key is installable. No row carries it for the reason above (component-level keys sit under the recorded undrilled `page/regions` container); the checkable record is the authorable-surface `ui/RecordDetailsProps:emptyState`, `ui/RecordHighlightsProps:emptyState` and `ui/RecordQuickActionsProps:emptyState` rows and the keys' own `[PLANNED — not yet rendered]` describe. When that card lands, the marker leaves and this sentence is rewritten. LIVE RECORD (#30018, 2026-11-04, ruling record 6624172200 on #29951, letter A; rewritten from its PLANNED record by #29951's ui half once the reader landed): `regions[].components[].properties.placedActions` on `page:header` (`PageHeaderProps` in packages/spec/src/ui/component.zod.ts) is the explicit opt-in to draw every action of the bound object whose `locations` include `record` or `record_page`, read live, in place of an authored `actions` id list; `true` beside an authored `actions` list is refused at the key by the props door (`@objectstack/lint` `validateComponentProps`, rule `component-props-invalid`). LIVE: the header renderer reads it (ui/packages/components/src/renderers/layout/containers.tsx, `PageHeaderActions`, which `PageHeaderRenderer` hands the key: `true` draws `placedHeaderActions` from ui/packages/types/src/ui-action.ts over the object's actions as the metadata read serves them, the one placed-header reader `RecordDetailView`'s synthesized header reads too; a pair that skipped validation draws none of the object's actions and is reported once), and the `page:header` registration publishes the input. Its producers are the platform record pages `sys_user_detail` and `sys_organization_detail` (@objectstack/platform-objects) and `sys_approval_request_detail` (@objectstack/plugin-approvals), which set it in place of the frozen id lists that dropped another package's header actions. No row carries it for the reason above (component-level keys sit under the recorded undrilled `page/regions` container); the checkable record is the authorable-surface `ui/PageHeaderProps:placedActions` row and the key's own describe, which no longer carries the `[PLANNED — not yet rendered]` marker.", "props": { "source": { "status": "live", diff --git a/packages/spec/src/compose-stacks.test.ts b/packages/spec/src/compose-stacks.test.ts index f74c2d90564..574fe8a786c 100644 --- a/packages/spec/src/compose-stacks.test.ts +++ b/packages/spec/src/compose-stacks.test.ts @@ -530,7 +530,7 @@ describe('composeStacks + defineStack integration', () => { // ─── Action `order` sorting (mergeActionsIntoObjects) ─────────────── // Regression coverage for #2670: the record-header primary button is the first -// visible `record_header` action, so `order` must control which action lands +// visible `record_page` action, so `order` must control which action lands // first — instead of fragile cross-file registration order. describe('Action order sorting', () => { @@ -543,9 +543,9 @@ describe('Action order sorting', () => { name: 'deal', fields: { title: { type: 'text' } }, actions: [ - { name: 'close_deal', label: 'Close', locations: ['record_header'] }, - { name: 'print', label: 'Print', locations: ['record_header'], order: 5 }, - { name: 'approve', label: 'Approve', locations: ['record_header'], order: -10 }, + { name: 'close_deal', label: 'Close', locations: ['record_page'] }, + { name: 'print', label: 'Print', locations: ['record_page'], order: 5 }, + { name: 'approve', label: 'Approve', locations: ['record_page'], order: -10 }, ], }, ], @@ -627,14 +627,14 @@ describe('Action order sorting', () => { { name: 'deal', fields: { title: { type: 'text' } }, - actions: [{ name: 'app_action', label: 'App', locations: ['record_header'] }], + actions: [{ name: 'app_action', label: 'App', locations: ['record_page'] }], }, ], }); // A plugin (e.g. plugin-approvals) contributes a high-priority decision. const approvals = makeStack({ actions: [ - { name: 'approve', label: 'Approve', objectName: 'deal', locations: ['record_header'], order: -100 }, + { name: 'approve', label: 'Approve', objectName: 'deal', locations: ['record_page'], order: -100 }, ], }); const combined = composeStacks([base, approvals]); diff --git a/packages/spec/src/conversions/action-locations-acted-on.test.ts b/packages/spec/src/conversions/action-locations-acted-on.test.ts new file mode 100644 index 00000000000..406528dcd04 --- /dev/null +++ b/packages/spec/src/conversions/action-locations-acted-on.test.ts @@ -0,0 +1,82 @@ +// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license. + +import { describe, expect, it } from 'vitest'; + +import { ALL_CONVERSIONS } from './registry.js'; +import type { ConversionApplication, ConversionTodoDetail } from './types.js'; + +/** + * [#36495] `action-locations-acted-on` — the sites with no lossless rewrite. + * + * The fixture pair in `conversions.test.ts` proves before → after over the + * whole table, and a site left as stored looks the same there as a site the + * conversion never looked at. What this file pins is that each such site is + * REPORTED: a TODO at its path, and no rewrite. Without the TODO an author + * would meet the old word only as a parse refusal, or not at all for data at + * rest, and the action would be drawn nowhere on a protocol-19 runtime. + */ +describe('action-locations-acted-on (ADR-0087 D3 TODOs)', () => { + const conversion = ALL_CONVERSIONS.find((c) => c.id === 'action-locations-acted-on')!; + + function run(stack: Record) { + const notices: ConversionApplication[] = []; + const todos: ConversionTodoDetail[] = []; + const out = conversion.apply(stack, (n) => notices.push(n), { reportTodo: (t) => todos.push(t) }); + return { out: out as { actions: Record[] }, notices, todos }; + } + + it('is registered for protocol 19 and retired from the authoring load path', () => { + expect(conversion, 'the conversion is registered').toBeDefined(); + expect(conversion.toMajor).toBe(19); + expect(conversion.retiredFromLoadPath).toBe(true); + }); + + // Until 19 the record page header folded this action into its ⋯ menu (its + // component) while a `record:quick_actions` bar at `record_header` drew it as + // a button (it read the location only). At `record_page` the fold is one state + // for the whole page: no rewrite keeps the bar button. + it.each([ + [['record_header']], + [['record_header', 'record_more']], + [['list_item', 'record_header']], + ])('leaves %j with an authored action:menu as stored, with a TODO', (locations) => { + const action = { name: 'print_lead', label: 'Print', type: 'script', component: 'action:menu', locations }; + const { out, notices, todos } = run({ actions: [action] }); + expect(todos.map((t) => t.path)).toEqual(['actions[0].locations']); + expect(todos[0]!.reason).toContain('record:quick_actions'); + expect(notices).toEqual([]); + expect(out.actions[0]).toBe(action); + }); + + it('rewrites a record_header action whose component is not action:menu, with no TODO', () => { + const { out, todos } = run({ + actions: [{ name: 'print_lead', label: 'Print', type: 'script', component: 'action:icon', locations: ['record_header'] }], + }); + expect(todos).toEqual([]); + expect(out.actions[0]).toMatchObject({ component: 'action:icon', locations: ['record_page'] }); + }); + + it('leaves a ⋯-only action on the list toolbar as stored, with a TODO', () => { + const action = { name: 'export_one', label: 'Export', type: 'script', locations: ['list_toolbar', 'record_more'] }; + const { out, notices, todos } = run({ actions: [action] }); + expect(todos.map((t) => t.path)).toEqual(['actions[0].locations']); + expect(notices).toEqual([]); + expect(out.actions[0]).toBe(action); + }); + + // The list toolbar already folded an `action:menu` action, so the fold on + // both surfaces is what it drew before. + it('rewrites a ⋯-only toolbar action that already carries action:menu, with no TODO', () => { + const { out, todos } = run({ + actions: [{ + name: 'export_all', + label: 'Export all', + type: 'script', + component: 'action:menu', + locations: ['list_toolbar', 'record_more'], + }], + }); + expect(todos).toEqual([]); + expect(out.actions[0]).toMatchObject({ component: 'action:menu', locations: ['list', 'record_page'] }); + }); +}); diff --git a/packages/spec/src/conversions/entries/19/action-locations-acted-on.ts b/packages/spec/src/conversions/entries/19/action-locations-acted-on.ts new file mode 100644 index 00000000000..524afc93ac4 --- /dev/null +++ b/packages/spec/src/conversions/entries/19/action-locations-acted-on.ts @@ -0,0 +1,466 @@ +// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license. + +// The `action-locations-acted-on` conversion (`toMajor: 19`; objectstack#36495, +// maintainer rulings 7213534162 and 7213827153). A LEAF: it imports neither +// `registry.ts` nor another conversion's module. `registry.ts` imports +// `actionLocationsActedOn` and lists it in `MAJOR_19_CONVERSIONS`. + +import type { ConversionApplication, ConversionContext, MetadataConversion } from '../../types.js'; +import { mapCollection, mapPageComponents } from '../../walk.js'; +import { ACTION_CONTAINER_BLOCK_TYPES, ACTION_RUNNER_BLOCK_TYPES, type Dict, isDict } from '../shared.js'; + +/** + * Action locations name what an action acts on (protocol 19). + * + * Until 19 an action's `locations` named page parts: `list_toolbar`, + * `list_item`, `record_header`, `record_more`, `record_related`, + * `record_section`. Once the object's `actionLayout` took over which actions + * are buttons and in what order, a location only has to say what the action + * acts on: `list` (no record) and `record` (one record, on the record page and + * on each list row), with the narrow words `record_page`, `record_row`, + * `record_related` and `record_section` for an action that is on one of those + * surfaces only. + * + * ## The rewrite of one action's `locations` (the ruling, word for word) + * + * - `list_toolbar` → `list`; + * - `record_header` or `record_more` → `record_page`; + * - `list_item` → `record_row`; + * - both sides (a `list_item` beside `record_header` or `record_more`) → + * `record`; + * - `record_related`, `record_section` and every word already canonical stay; + * - a `record_more`-only action (`record_more` without `record_header`) keeps + * its fold into the record page's ⋯ menu through `component: 'action:menu'`. + * + * Order is kept: each word is rewritten where it stands, and a word the + * rewrite makes twice (`record_header` beside `record_more`) is kept once, at + * its first position. + * + * ## Lossless — every action is drawn where it is drawn today + * + * The record page header drew an action placed at `record_header` as a + * button (within its budget) and one placed at `record_more` only in its ⋯ + * menu, as it drew any action with `component: 'action:menu'`. After the + * rewrite both are `record_page`, and the fold is the component. On every + * other surface the component is not read for an object's action (the list + * row menu, a related list, a record section block), so writing it changes + * nothing there. That a `component` the author wrote is replaced for a + * `record_more`-only action is lossless for the same reason: the header put + * such an action in the ⋯ menu whatever its component said. + * + * The one surface that does read an object action's `component` is the list + * page toolbar, which folds `action:menu` into its own overflow. An action + * placed at `record_more` only and at `list_toolbar` has no lossless rewrite: + * the fold would reach the toolbar too. It is left as stored and reported as a + * structured TODO (ADR-0087 D3); the hand rewrite chooses between the fold on + * both surfaces and none. When the action already carries `component: + * 'action:menu'` the toolbar folded it before, and the rewrite is lossless. + * + * The other reader of the component is the record page itself. Until 19 an + * action at `record_header` with `component: 'action:menu'` had two states: + * the header folded it into its ⋯ menu, and a `record:quick_actions` bar at + * `record_header` drew it as a button. At `record_page` the fold is one state + * for the whole record page, so that bar leaves it out. No rewrite keeps + * both: it is left as stored and reported as a TODO. + * + * Every action left as stored keeps an old word, which a protocol-19 reader + * matches to no surface: it is drawn nowhere until it is rewritten by hand. + * + * ## Page components + * + * The same rewrite runs on the `locations` of a page's action rows + * (`action:button` / `action:icon` properties, and each member of an + * `action:group` / `action:menu` / `action:bar`), which tell the runner a + * record-scoped action from an object-level one. A row has no `component`, so + * a `record_more`-only row is `record_page` and nothing more. + * + * A component's single `location` (the location a `record:quick_actions` bar, + * an `action:group` or an `action:bar` draws) is rewritten by surface: + * `list_toolbar` → `list`, `list_item` → `record_row`, `record_header` → + * `record_page`. A bar at `record_page` draws the record page's actions that + * are not folded into its ⋯ menu, which is the set it drew at `record_header`. + * Two are TODOs, left as stored: + * - `record_more`: the ⋯ menu's actions are no location of their own now, so + * a bar that drew only them has no word. + * - an `action:group` at `record_header` with a `record_more`-only member: a + * group member has no `component` to keep its fold, so at `record_page` the + * group would draw that member too. + * + * ## Where it replays + * + * Retired from the load path, as the other protocol-19 entries are: an author + * writing an old word meets the location enum's own prescription at parse. + * Data at rest (`applyConversionsToStoredItem`), built artifacts and + * `os migrate meta --from 18` replay it. Idempotent by construction: every + * word it writes is canonical, and a canonical word is never rewritten. + */ + +const RECORD_PAGE_WORDS = new Set(['record_header', 'record_more']); + +/** A stored action's (or page row's) `locations`, rewritten; `undefined` when nothing changes. */ +function rewriteLocations(locations: readonly unknown[]): unknown[] | undefined { + const onPage = locations.some((l) => typeof l === 'string' && RECORD_PAGE_WORDS.has(l)); + const onRow = locations.includes('list_item'); + let changed = false; + const out: unknown[] = []; + for (const word of locations) { + let next: unknown = word; + if (word === 'list_toolbar') next = 'list'; + else if (typeof word === 'string' && RECORD_PAGE_WORDS.has(word)) next = onRow ? 'record' : 'record_page'; + else if (word === 'list_item') next = onPage ? 'record' : 'record_row'; + if (next !== word) changed = true; + if (typeof next === 'string' && out.includes(next)) { + changed = true; + continue; + } + out.push(next); + } + return changed ? out : undefined; +} + +/** `record_more` declared without `record_header`: the action was drawn only in the record page's ⋯ menu. */ +function isMoreOnly(locations: readonly unknown[]): boolean { + return locations.includes('record_more') && !locations.includes('record_header'); +} + +/** + * One object action (top-level `actions[]` or `objects[].actions[]`). A + * `record_more`-only action keeps its fold through `component`, unless it is + * on the list toolbar too without that component already (a TODO, left as + * stored). A `record_header` action with an authored `component: + * 'action:menu'` is a TODO too, left as stored. + */ +function convertAction( + action: Dict, + path: string, + emit: (detail: ConversionApplication) => void, + context: ConversionContext | undefined, +): Dict { + const locations = action.locations; + if (!Array.isArray(locations)) return action; + const next = rewriteLocations(locations); + if (!next) return action; + const moreOnly = isMoreOnly(locations); + if (locations.includes('record_header') && action.component === 'action:menu') { + context?.reportTodo?.({ + path: `${path}.locations`, + from: JSON.stringify(locations), + reason: + 'This action is placed at `record_header` with `component: \'action:menu\'`. Until 19 the record page ' + + 'header folded it into its ⋯ menu while a `record:quick_actions` bar at `record_header` drew it as a ' + + 'button. Protocol 19 has one state for both: at `record_page` an `action:menu` action is folded ' + + 'everywhere on the record page, so that bar would leave it out. Left as stored; rewrite it by hand to ' + + '`record_page` (`record` if it is on `list_item` too), with `component: \'action:menu\'` to keep the ' + + 'fold and lose the bar button, or without it to draw a button in the header and the bar.', + }); + return action; + } + if (moreOnly && locations.includes('list_toolbar') && action.component !== 'action:menu') { + context?.reportTodo?.({ + path: `${path}.locations`, + from: JSON.stringify(locations), + reason: + 'This action is in the record page\'s ⋯ menu only (`record_more` without `record_header`) and on the list ' + + 'page toolbar (`list_toolbar`). Protocol 19 keeps the ⋯ fold with `component: \'action:menu\'`, which ' + + 'the list toolbar reads too: it would fold the action into the toolbar\'s overflow as well. Left as ' + + 'stored; rewrite it by hand to `[\'list\', \'record_page\']`, with `component: \'action:menu\'` to keep ' + + 'the fold on both surfaces or without it to draw a button on both.', + }); + return action; + } + emit({ from: JSON.stringify(locations), to: JSON.stringify(next), path: `${path}.locations` }); + let rewritten: Dict = { ...action, locations: next }; + if (moreOnly && action.component !== 'action:menu') { + emit({ + from: action.component === undefined ? '(omitted)' : JSON.stringify(action.component), + to: 'action:menu', + path: `${path}.component`, + }); + rewritten = { ...rewritten, component: 'action:menu' }; + } + return rewritten; +} + +/** A page action row's `locations` (a row has no `component`). */ +function convertRow(row: Dict, path: string, emit: (detail: ConversionApplication) => void): Dict { + const locations = row.locations; + if (!Array.isArray(locations)) return row; + const next = rewriteLocations(locations); + if (!next) return row; + emit({ from: JSON.stringify(locations), to: JSON.stringify(next), path: `${path}.locations` }); + return { ...row, locations: next }; +} + +const SINGLE_LOCATION: Readonly> = { + list_toolbar: 'list', + list_item: 'record_row', + record_header: 'record_page', +}; + +/** The component types whose own `location` names the surface they draw. */ +const LOCATION_COMPONENT_TYPES = new Set(['record:quick_actions', 'action:group', 'action:bar']); + +/** The member lists of an action container whose rows carry `locations`. */ +function memberListsOf(type: string): readonly string[] { + if (ACTION_CONTAINER_BLOCK_TYPES.has(type)) return ['actions']; + if (type === 'action:bar') return ['actions', 'systemActions']; + return []; +} + +function convertComponent( + component: Dict, + path: string, + emit: (detail: ConversionApplication) => void, + context: ConversionContext | undefined, +): Dict { + const type = component.type; + if (typeof type !== 'string') return component; + const properties = component.properties; + if (!isDict(properties)) return component; + const memberLists = memberListsOf(type); + const runner = ACTION_RUNNER_BLOCK_TYPES.has(type); + const located = LOCATION_COMPONENT_TYPES.has(type); + if (!runner && !located && memberLists.length === 0) return component; + + const location = properties.location; + if (located && typeof location === 'string') { + const todo = (reason: string) => { + context?.reportTodo?.({ path: `${path}.properties.location`, from: JSON.stringify(location), reason }); + return component; + }; + if (location === 'record_more') { + return todo( + `The \`${type}\` block draws the actions in the record page's ⋯ menu (\`location: 'record_more'\`). Protocol 19 ` + + 'keeps that fold with each action\'s `component: \'action:menu\'` and gives the ⋯ menu no location of its ' + + 'own, so no word draws only those actions. Left as stored; choose `record_page` (every record page ' + + 'action that is not folded into the ⋯ menu) or name the actions this block should draw.', + ); + } + if (location === 'record_header' && type === 'action:group') { + const members = properties.actions; + const foldedMember = Array.isArray(members) + && members.some((m) => isDict(m) && Array.isArray(m.locations) && isMoreOnly(m.locations)); + if (foldedMember) { + return todo( + 'This `action:group` draws its members placed at `record_header`, and one of its members is placed at ' + + '`record_more` only. Protocol 19 writes both `record_page`, and a group member has no `component` to keep ' + + 'the ⋯ fold, so at `record_page` the group would draw that member too. Left as stored; remove the ' + + 'member or accept it at `record_page`.', + ); + } + } + } + + let next = properties; + if (runner) next = convertRow(next, `${path}.properties`, emit); + if (located && typeof location === 'string' && Object.prototype.hasOwnProperty.call(SINGLE_LOCATION, location)) { + const to = SINGLE_LOCATION[location]!; + emit({ from: location, to, path: `${path}.properties.location` }); + next = { ...next, location: to }; + } + for (const key of memberLists) { + const members = next[key]; + if (!Array.isArray(members)) continue; + let changed = false; + const nextMembers = members.map((member, i) => { + if (!isDict(member)) return member; + const mapped = convertRow(member, `${path}.properties.${key}[${i}]`, emit); + if (mapped !== member) changed = true; + return mapped; + }); + if (changed) next = { ...next, [key]: nextMembers }; + } + return next === properties ? component : { ...component, properties: next }; +} + +const actionLocationsActedOn: MetadataConversion = { + id: 'action-locations-acted-on', + toMajor: 19, + retiredFromLoadPath: true, + retiredAfter: '18.6.0', + surface: 'action.locations / action.component / object.actions[].locations / object.actions[].component / ' + + 'page.component.action:button.locations / page.component.action:icon.locations / ' + + 'page.component.action:group.actions[].locations / page.component.action:menu.actions[].locations / ' + + 'page.component.action:bar.actions[].locations / page.component.action:bar.systemActions[].locations / ' + + 'page.component.record:quick_actions.location / page.component.action:group.location / ' + + 'page.component.action:bar.location', + summary: + "action locations say what an action acts on: 'list_toolbar' → 'list', 'record_header' / 'record_more' → " + + "'record_page', 'list_item' → 'record_row', a 'list_item' beside either record word → 'record'; a " + + "'record_more'-only action keeps its ⋯ fold with component 'action:menu', so every action is drawn where " + + 'it was drawn before', + apply(stack, emit, context) { + const onAction = (action: Dict, path: string): Dict => convertAction(action, path, emit, context); + let next = mapCollection(stack, 'actions', onAction); + next = mapCollection(next, 'objects', (obj, path) => + mapCollection(obj, 'actions', (action, actionPath) => onAction(action, `${path}.${actionPath}`)), + ); + return mapPageComponents(next, (component, path) => convertComponent(component, path, emit, context)); + }, + fixture: { + before: { + actions: [ + // A toolbar action, a row action, a header action, a ⋯-only action. + { name: 'import_leads', label: 'Import', objectName: 'crm_lead', type: 'script', locations: ['list_toolbar'] }, + { name: 'quick_view', label: 'Quick view', objectName: 'crm_lead', type: 'script', locations: ['list_item'] }, + { name: 'convert_lead', label: 'Convert', objectName: 'crm_lead', type: 'script', locations: ['record_header'] }, + { name: 'clone_lead', label: 'Clone', objectName: 'crm_lead', type: 'script', locations: ['record_more'] }, + // Both sides, the header word twice over: one `record`. + { + name: 'assign_lead', + label: 'Assign', + objectName: 'crm_lead', + type: 'script', + locations: ['list_item', 'record_header', 'record_more'], + }, + // ⋯-only on both sides, beside an exception word: `record` and the fold; + // an authored component is replaced (the header folded it whatever it said). + { + name: 'archive_lead', + label: 'Archive', + objectName: 'crm_lead', + type: 'script', + component: 'action:icon', + locations: ['record_more', 'record_section', 'list_item'], + }, + // Already canonical, headless, and exception-only: untouched. + { name: 'score_lead', label: 'Score', objectName: 'crm_lead', type: 'script', locations: ['record'] }, + { name: 'sync_leads', label: 'Sync', type: 'script', locations: [] }, + { name: 'log_call', label: 'Log call', objectName: 'crm_lead', type: 'script', locations: ['record_related'] }, + // ⋯-only and on the toolbar: no lossless rewrite, left as stored (a TODO). + { + name: 'export_one', + label: 'Export', + objectName: 'crm_lead', + type: 'script', + locations: ['list_toolbar', 'record_more'], + }, + // ⋯-only and on the toolbar, already folded: the toolbar folded it too, so lossless. + { + name: 'export_all', + label: 'Export all', + objectName: 'crm_lead', + type: 'script', + component: 'action:menu', + locations: ['list_toolbar', 'record_more'], + }, + // A header word with an authored fold: a header ⋯ item and a quick-actions button + // until 19, one state after it. No lossless rewrite, left as stored (a TODO). + { + name: 'print_lead', + label: 'Print', + objectName: 'crm_lead', + type: 'script', + component: 'action:menu', + locations: ['record_header'], + }, + ], + objects: [{ + name: 'crm_account', + label: 'Account', + actions: [{ name: 'merge_account', label: 'Merge', type: 'script', locations: ['record_more', 'record_header'] }], + }], + pages: [{ + name: 'lead_detail', + regions: [{ + name: 'main', + components: [ + { type: 'record:quick_actions', properties: { location: 'record_header', actionNames: ['convert_lead'] } }, + { type: 'record:quick_actions', properties: { location: 'record_section', actionNames: ['assign_lead'] } }, + // The ⋯ menu's own bar has no word now: a TODO, left as stored. + { type: 'record:quick_actions', properties: { location: 'record_more' } }, + { type: 'action:button', properties: { label: 'Run', actionType: 'script', locations: ['list_item', 'record_header'] } }, + { + type: 'action:group', + properties: { + location: 'list_toolbar', + actions: [{ name: 'refresh', label: 'Refresh', type: 'script', locations: ['list_toolbar'] }], + }, + }, + ], + }], + }], + }, + after: { + actions: [ + { name: 'import_leads', label: 'Import', objectName: 'crm_lead', type: 'script', locations: ['list'] }, + { name: 'quick_view', label: 'Quick view', objectName: 'crm_lead', type: 'script', locations: ['record_row'] }, + { name: 'convert_lead', label: 'Convert', objectName: 'crm_lead', type: 'script', locations: ['record_page'] }, + { + name: 'clone_lead', + label: 'Clone', + objectName: 'crm_lead', + type: 'script', + locations: ['record_page'], + component: 'action:menu', + }, + { name: 'assign_lead', label: 'Assign', objectName: 'crm_lead', type: 'script', locations: ['record'] }, + { + name: 'archive_lead', + label: 'Archive', + objectName: 'crm_lead', + type: 'script', + component: 'action:menu', + locations: ['record', 'record_section'], + }, + { name: 'score_lead', label: 'Score', objectName: 'crm_lead', type: 'script', locations: ['record'] }, + { name: 'sync_leads', label: 'Sync', type: 'script', locations: [] }, + { name: 'log_call', label: 'Log call', objectName: 'crm_lead', type: 'script', locations: ['record_related'] }, + { + name: 'export_one', + label: 'Export', + objectName: 'crm_lead', + type: 'script', + locations: ['list_toolbar', 'record_more'], + }, + { + name: 'export_all', + label: 'Export all', + objectName: 'crm_lead', + type: 'script', + component: 'action:menu', + locations: ['list', 'record_page'], + }, + { + name: 'print_lead', + label: 'Print', + objectName: 'crm_lead', + type: 'script', + component: 'action:menu', + locations: ['record_header'], + }, + ], + objects: [{ + name: 'crm_account', + label: 'Account', + actions: [{ name: 'merge_account', label: 'Merge', type: 'script', locations: ['record_page'] }], + }], + pages: [{ + name: 'lead_detail', + regions: [{ + name: 'main', + components: [ + { type: 'record:quick_actions', properties: { location: 'record_page', actionNames: ['convert_lead'] } }, + { type: 'record:quick_actions', properties: { location: 'record_section', actionNames: ['assign_lead'] } }, + { type: 'record:quick_actions', properties: { location: 'record_more' } }, + { type: 'action:button', properties: { label: 'Run', actionType: 'script', locations: ['record'] } }, + { + type: 'action:group', + properties: { + location: 'list', + actions: [{ name: 'refresh', label: 'Refresh', type: 'script', locations: ['list'] }], + }, + }, + ], + }], + }], + }, + // Actions: import, quick view, convert, clone (+ its component), assign, + // archive (+ its component), export all (already folded), merge = 10. + // Page: the header bar's location, the button's locations, the group's + // location and its member = 4. + expectedNotices: 14, + }, +}; + +export { actionLocationsActedOn }; diff --git a/packages/spec/src/conversions/registry.ts b/packages/spec/src/conversions/registry.ts index 44d1146a3df..717f5d14f66 100644 --- a/packages/spec/src/conversions/registry.ts +++ b/packages/spec/src/conversions/registry.ts @@ -138,6 +138,7 @@ import { permissionRlsTagsRemoved } from './entries/18/permission-rls-tags-remov import { flowDecisionModeInclusiveExplicit } from './entries/18/flow-decision-mode-inclusive-explicit.js'; // Major 19: imported after every major-18 conversion, in `MAJOR_19_CONVERSIONS`'s // identifier order. +import { actionLocationsActedOn } from './entries/19/action-locations-acted-on.js'; import { agentModelProviderRemoved } from './entries/19/agent-model-provider-removed.js'; import { knowledgeSourceContentFieldsToContent } from './entries/19/knowledge-source-content-fields-to-content.js'; import { knowledgeSourceIdToName } from './entries/19/knowledge-source-id-to-name.js'; @@ -323,6 +324,7 @@ const MAJOR_18_CONVERSIONS: readonly OrderedConversion[] = [ * `order: 2` are settled by `id`. */ const MAJOR_19_CONVERSIONS: readonly OrderedConversion[] = [ + { conversion: actionLocationsActedOn, order: 3 }, { conversion: agentModelProviderRemoved, order: 2 }, { conversion: knowledgeSourceContentFieldsToContent, order: 2 }, { conversion: knowledgeSourceIdToName, order: 1 }, diff --git a/packages/spec/src/data/api-methods-batch-conformance.test.ts b/packages/spec/src/data/api-methods-batch-conformance.test.ts index 41eda68572f..59defe2f604 100644 --- a/packages/spec/src/data/api-methods-batch-conformance.test.ts +++ b/packages/spec/src/data/api-methods-batch-conformance.test.ts @@ -71,7 +71,7 @@ const SINGLE_RECORD_WRITE_ONLY: Record = { // default, `userActions` opens `edit` alone, and `delete` is not in // `apiMethods`). So there is no selection to batch. // · A multi-select revoke, if the product ever wants one, still would not - // reach `/batch`. Both actions are `locations: ['list_item']`; naming one + // reach `/batch`. Both actions are `locations: ['record_row']`; naming one // in a view's `bulkActions` promotes it to `operation: 'custom'` + // `actionDef`, which `useBulkExecutor` fans out through the action runner // as N single-record PATCHes against the route #7769 opened. The data-plane diff --git a/packages/spec/src/data/object-action-layout.ts b/packages/spec/src/data/object-action-layout.ts index 610b16e62c9..db190db10ff 100644 --- a/packages/spec/src/data/object-action-layout.ts +++ b/packages/spec/src/data/object-action-layout.ts @@ -14,10 +14,10 @@ import { strictObject } from '../shared/strict-object'; * one scope: * * - `list`: the actions that act on no record, drawn on the object's list - * page toolbar (placed at `list_toolbar`), with the list page's built-ins + * page toolbar (placed at `list`), with the list page's built-ins * `$import` and `$export`. * - `record`: the actions that act on one record, drawn in the record page's - * header (placed at `record_header` or `record_more`). The same arm orders + * header (placed at `record` or `record_page`). The same arm orders * every surface that draws that header: the record page, the side preview * and a phone's bottom action bar. It also orders the actions a grid row * already offers, adding none: the row's ⋮ menu, its right-click menu and, @@ -200,14 +200,14 @@ export const OBJECT_ACTION_LAYOUT_SCHEMA = strictObject( list: layoutArm('list') .optional() .describe( - "The list scope's arrangement: actions of the object placed at `list_toolbar`, as drawn on the list page " + + "The list scope's arrangement: actions of the object placed at `list`, as drawn on the list page " + 'toolbar, and `$import` / `$export` as pinned buttons (not pinned, they stay in the page\'s own Import / ' + 'Export menu). Omit to draw it as before.', ), record: layoutArm('record') .optional() .describe( - "The record scope's arrangement: actions of the object placed at `record_header` or `record_more`, as " + + "The record scope's arrangement: actions of the object placed at `record` or `record_page`, as " + "drawn in the record header (record page, side preview, a phone's bottom bar). The same order leads the " + "actions a grid row already offers, adding none: the row's ⋮ menu, its right-click menu and, on a list " + "page, the selection bar's actions for one selected record (`pinned` names first, then `more` names, then " + diff --git a/packages/spec/src/data/object.test.ts b/packages/spec/src/data/object.test.ts index 2557f9b3636..59704181f97 100644 --- a/packages/spec/src/data/object.test.ts +++ b/packages/spec/src/data/object.test.ts @@ -1414,7 +1414,7 @@ describe('ObjectSchema.create()', () => { name: 'clone_demo', label: 'Clone', mode: 'custom', - locations: ['list_item'], + locations: ['record_row'], type: 'api', method: 'POST', target: '/api/v1/data/demo', @@ -1442,7 +1442,7 @@ describe('ObjectSchema.create()', () => { name: 'activate_demo', label: 'Activate', mode: 'custom', - locations: ['list_item'], + locations: ['record_row'], type: 'api', method: 'PATCH', target: '/api/v1/data/demo/{id}', @@ -1451,7 +1451,7 @@ describe('ObjectSchema.create()', () => { name: 'clone_demo', label: 'Clone', mode: 'custom', - locations: ['list_item'], + locations: ['record_row'], type: 'api', method: 'POST', target: '/api/v1/data/demo', diff --git a/packages/spec/src/kernel/public-auth-features.ts b/packages/spec/src/kernel/public-auth-features.ts index 5ad782c51cd..7cf16c203cd 100644 --- a/packages/spec/src/kernel/public-auth-features.ts +++ b/packages/spec/src/kernel/public-auth-features.ts @@ -155,7 +155,7 @@ export const PUBLIC_AUTH_FEATURES = { 'sys_team_member.actions.add_team_member', 'sys_team_member.actions.remove_team_member', // Fourth mirror of the email-invite entry, at the organization record - // page's `record_header` — a `page:header` resolves ids against its own + // page's header (`record_page`) — a `page:header` resolves ids against its own // object's actions only (ruling 6228318638, B′ on #24034). 'sys_organization.actions.invite_user', // The name/logo-only rename door, at the record header and the row: diff --git a/packages/spec/src/migrations/entries/semantic/19.action-locations-page-parts-retired.ts b/packages/spec/src/migrations/entries/semantic/19.action-locations-page-parts-retired.ts new file mode 100644 index 00000000000..4b248b629de --- /dev/null +++ b/packages/spec/src/migrations/entries/semantic/19.action-locations-page-parts-retired.ts @@ -0,0 +1,41 @@ +// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license. + +import type { SemanticMigration } from '../../types.js'; + +// #36495 — maintainer rulings 7213534162 and 7213827153 — the D3 entry of the +// action-location vocabulary move. The data half is mechanical (the D2 +// conversion `action-locations-acted-on` rewrites every location it can +// rewrite losslessly); what it cannot do is the four sites it leaves as stored, +// and code: a plugin or a hand-written page that compares a location to an old +// word. +export const entry: SemanticMigration = { + id: 'action-locations-page-parts-retired', + surface: 'action.locations / page component location — `list_toolbar`, `list_item`, `record_header` and ' + + '`record_more` left the enum; `list`, `record`, `record_page` and `record_row` joined ' + + '`record_related` and `record_section`', + replacement: + 'name what the action acts on: `list` for no record (the list page toolbar), `record` for one record on the ' + + 'record page and on each list row, `record_page` or `record_row` for one of the two only. A ' + + '`record_more`-only action keeps its fold into the record page\'s ⋯ menu with `component: \'action:menu\'`; ' + + 'the order and the buttons of an object\'s actions are its `actionLayout`', + reason: + 'With the object\'s `actionLayout` deciding which actions are buttons and in what order, a location only ' + + 'says what the action acts on. The D2 conversion `action-locations-acted-on` maps every old word to its new ' + + 'one, in a source the migration edits and in a stored row it reads, and every action is drawn where it ' + + 'was drawn before. It leaves four sites as stored, each with a TODO: an action in the ⋯ menu only that ' + + 'is on the list toolbar too without `component: \'action:menu\'` (the fold would reach the toolbar), an ' + + 'action at `record_header` with an authored `component: \'action:menu\'` (the header folded it while a ' + + '`record:quick_actions` bar drew it as a button, and `record_page` has one state for both), a block whose ' + + 'own `location` is `record_more`, and an `action:group` at `record_header` with a ⋯-only member (the ⋯ ' + + 'menu has no location of its own now). A site left as stored keeps its old word, which a protocol-19 ' + + 'runtime matches to no surface: that action or block draws nothing until it is rewritten by hand. Code ' + + 'is the other part no conversion reaches: a ' + + 'plugin or a hand-written component that compares a location to an old word no longer matches anything, ' + + 'silently', + acceptanceCriteria: + 'No action, page row or page block names `list_toolbar`, `list_item`, `record_header` or `record_more`; ' + + 'each is refused at parse with the word that replaced it. Every TODO the migration reports is rewritten ' + + 'by hand, and no plugin code compares a location to an old word.', + conversionIds: ['action-locations-acted-on'], + relevantWhen: { kind: 'stack-declares', keys: ['actions', 'objects', 'pages'] }, +}; diff --git a/packages/spec/src/migrations/registry.ts.template b/packages/spec/src/migrations/registry.ts.template index 7f95819e9f5..8b7425d0fc8 100644 --- a/packages/spec/src/migrations/registry.ts.template +++ b/packages/spec/src/migrations/registry.ts.template @@ -3733,6 +3733,10 @@ const step19: MigrationStep = { + 'View All and Modify All stop casting a field vote: `viewAllFields: true` is written beside them ' + 'in every permission set entry of a source that predates the switch, so the migrated source keeps ' + 'the field reads those bits cast; the semantic entry names what it does not keep. ' + + 'Action locations say what an action acts on: `list_toolbar` becomes `list`, `record_header` and ' + + '`record_more` become `record_page`, `list_item` becomes `record_row`, and an action on both a row and ' + + 'the record page becomes `record`; an action that sat in the record page\'s ⋯ menu only keeps that fold ' + + 'with `component: \'action:menu\'`, so every action is drawn where it was. ' + 'It also admits the knowledge source as a metadata type (`knowledge_source`, ADR-0161 K4) and ' + 'settles its keys on the way in: `id` becomes `name` and `source.contentFields` becomes ' + '`source.content`, a list of field names in which `\'*\'` is refused, because each listed field ' diff --git a/packages/spec/src/migrations/semantic-relevance.test.ts b/packages/spec/src/migrations/semantic-relevance.test.ts index 4ab4fa2c87e..f62f6153054 100644 --- a/packages/spec/src/migrations/semantic-relevance.test.ts +++ b/packages/spec/src/migrations/semantic-relevance.test.ts @@ -62,6 +62,7 @@ const EXPECTED_RELEVANCE: Readonly> = { '18:job-timeout-unit-in-key': ['jobs'], '18:mapping-lookup-params-retired': ['mappings'], '18:permission-restore-purge-bits-retired': ['permissions'], + '19:action-locations-page-parts-retired': ['actions', 'objects', 'pages'], '19:agent-model-provider-retired': ['agents'], }; @@ -85,12 +86,12 @@ describe('which entries carry a relevance question (ENUMERATION)', () => { expect(actual).toEqual(EXPECTED_RELEVANCE); }); - it('is 28 entries: 5 of protocol 17, 22 of protocol 18 and 1 of protocol 19', () => { + it('is 29 entries: 5 of protocol 17, 22 of protocol 18 and 2 of protocol 19', () => { const keys = Object.keys(EXPECTED_RELEVANCE); - expect(keys).toHaveLength(28); + expect(keys).toHaveLength(29); expect(keys.filter((k) => k.startsWith('17:'))).toHaveLength(5); expect(keys.filter((k) => k.startsWith('18:'))).toHaveLength(22); - expect(keys.filter((k) => k.startsWith('19:'))).toHaveLength(1); + expect(keys.filter((k) => k.startsWith('19:'))).toHaveLength(2); }); it('the table names only registered entries (anti-vacuity for the comparison above)', () => { @@ -246,7 +247,7 @@ describe('the answer is three-valued, and only a positive proof is `absent` (EVA describe('todos reports every entry; absentTodos names the proven-absent subset (CHAIN)', () => { const TO = Math.max(...MIGRATION_MAJORS); - /** A stack that declares objects only — none of the first batch's keys. */ + /** A stack that declares objects only — none of the first batch's keys (one protocol-19 entry asks about `objects`). */ const OBJECTS_ONLY = { manifest: { id: 'com.example.relevance', name: 'relevance', version: '1.0.0', type: 'app' }, objects: [{ name: 'rel_thing', label: 'Thing', fields: { title: { type: 'text', label: 'Title' } } }], @@ -269,7 +270,11 @@ describe('todos reports every entry; absentTodos names the proven-absent subset it('on a stack declaring none of the batch\'s keys, absentTodos names exactly the questioned entries', () => { const result = applyMetaMigrations(structuredClone(OBJECTS_ONLY), MIGRATION_SUPPORT_FLOOR, TO); - const expectedAbsent = crossed(MIGRATION_SUPPORT_FLOOR, TO).filter((k) => k in EXPECTED_RELEVANCE); + // An entry that asks about `objects` (an object carries its own actions, + // objectstack#36495) is relevant to this stack, so it is not absent. + const expectedAbsent = crossed(MIGRATION_SUPPORT_FLOOR, TO).filter( + (k) => k in EXPECTED_RELEVANCE && !EXPECTED_RELEVANCE[k]!.includes('objects'), + ); expect(expectedAbsent.length).toBeGreaterThan(0); expect(ids(result.absentTodos)).toEqual(expectedAbsent); expect(result.hops.flatMap((h) => ids(h.absentTodos))).toEqual(ids(result.absentTodos)); diff --git a/packages/spec/src/shared/retired-key-removal-version.pin.test.ts b/packages/spec/src/shared/retired-key-removal-version.pin.test.ts index 6897b0042b9..03ef6ce6048 100644 --- a/packages/spec/src/shared/retired-key-removal-version.pin.test.ts +++ b/packages/spec/src/shared/retired-key-removal-version.pin.test.ts @@ -101,6 +101,7 @@ import { FlowSchema } from '../automation/flow.zod'; import { JobSchema } from '../system/job.zod'; import { TranslationBundleSchema, TranslationItemSchema } from '../system/translation.zod'; import { PROTOCOL_MAJOR } from '../kernel/protocol-version'; +import { ActionLocationSchema } from '../ui/action.zod'; import { EmailTemplateDefinitionSchema } from '../system/email-template.zod'; import { KnowledgeRefreshPolicySchema, KnowledgeSourceSchema, ObjectKnowledgeSourceSchema } from '../ai/knowledge-source.zod'; import { @@ -340,6 +341,11 @@ const JOIN: Readonly> = { // #35926: a relationship field's boolean `inlineEdit`, refused by the enum's own error map. // #37712: an agent's `model.provider`, tombstoned on the model block. 'agent-model-provider-removed': [tombstone(AIModelConfigSchema, 'agent.model', 'provider')], + // objectstack#36495: a retired page-part location word is an enum VALUE, so + // what an author meets is the enum's refusal of it, which names the release. + 'action-locations-acted-on': (['list_toolbar', 'list_item', 'record_header', 'record_more'] as const).map((word) => + refusal(`action.locations ${word}`, () => ActionLocationSchema.safeParse(word)), + ), 'field-inline-edit-boolean-removed': [ refusal( 'field.inlineEdit: true', diff --git a/packages/spec/src/stack-bound-action-foreign-object.test.ts b/packages/spec/src/stack-bound-action-foreign-object.test.ts index af59baa3c10..1ca7240f5af 100644 --- a/packages/spec/src/stack-bound-action-foreign-object.test.ts +++ b/packages/spec/src/stack-bound-action-foreign-object.test.ts @@ -23,7 +23,7 @@ const manifest = { id: 'com.test.binder', name: 'binder', version: '1.0.0', type const OWN = { name: 'binder_note', label: 'Note', fields: { title: { type: 'text' as const, label: 'Title' } } }; const bound = (objectName: string) => ({ name: 'probe_bound', label: 'Probe', objectName, type: 'url' as const, target: 'https://example.com', - locations: ['record_header' as const], + locations: ['record_page' as const], }); const refusalOf = (config: unknown): any => { diff --git a/packages/spec/src/stack.zod.ts b/packages/spec/src/stack.zod.ts index 2c315d36fc8..ec837cffcd8 100644 --- a/packages/spec/src/stack.zod.ts +++ b/packages/spec/src/stack.zod.ts @@ -6838,7 +6838,7 @@ function validateCrossReferences( * - The sort is STABLE (`Array.prototype.sort` is stable since ES2019), so * actions that tie on `order` — including the overwhelmingly common case where * NOBODY sets `order` — keep their original registration order. This is what - * lets `order` promote a `record_header` action into the primary-button slot + * lets `order` promote a record page action into the primary-button slot * without disturbing everything else. * - Returns the SAME array reference untouched when no action opts in, so callers * pay zero allocation on the common path and can cheaply detect "unchanged". @@ -6884,7 +6884,7 @@ function sortActionsByOrder(actions: T[]): T[] { * `actions`) is stable-sorted by `order` via {@link sortActionsByOrder}. Because * that sort is a no-op unless an author sets `order`, this is fully backward * compatible — arrays with no `order` keep their exact registration order and - * reference. Renderers that pick a single primary action from `record_header` + * reference. Renderers that pick a single primary action from the record page header * (objectui) therefore see approve/reject-style actions in their declared * priority rather than in fragile cross-file registration order. * diff --git a/packages/spec/src/studio/action-location-retirement.test.ts b/packages/spec/src/studio/action-location-retirement.test.ts index f83e7ce06fa..ec698e75942 100644 --- a/packages/spec/src/studio/action-location-retirement.test.ts +++ b/packages/spec/src/studio/action-location-retirement.test.ts @@ -17,7 +17,7 @@ import { // `commandPalette`), consumed only by `ActionContributionSchema.location` // inside a Studio plugin manifest; // ./ui — the platform-canonical vocabulary for where an action renders -// in a RUNNING APP's UI (`list_toolbar`, …, `record_section`; 7 values at +// in a RUNNING APP's UI (`list`, …, `record_section`; 7 values at // the time of this rename, 6 since #6888 retired `global_nav`), whose // docblock declares it "single source of truth for the whole platform". // @@ -76,7 +76,7 @@ describe('studio ActionLocation dual-source retirement', () => { // declared in ui/action.zod.ts. Not just "same declaration everywhere" // — NO other entry may export the bare name at all. A re-export from // ./studio would share the declaration (green to the dual-source gate) - // while telling Studio plugin authors that `list_toolbar` & co. are + // while telling Studio plugin authors that `list` & co. are // valid manifest contribution locations — the C14/C15 lesson: a // re-export can lie about the domain even when the symbol is honest. for (const name of ['ActionLocationSchema', 'ActionLocation']) { @@ -109,14 +109,14 @@ describe('studio ActionLocation dual-source retirement', () => { } // The two vocabularies were disjoint precisely here — the app-UI values // must NOT leak into the Studio contribution enum: - expect(() => studio.ActionContributionLocationSchema.parse('list_toolbar')).toThrow(); + expect(() => studio.ActionContributionLocationSchema.parse('list')).toThrow(); expect(() => studio.ActionContributionLocationSchema.parse('record_section')).toThrow(); // ui side — untouched by THIS rename, and still the app-UI vocabulary // (`global_nav` left it later and separately, #6888). expect('ActionLocationSchema' in ui).toBe(true); expect('ACTION_LOCATIONS' in ui).toBe(true); - for (const loc of ['list_toolbar', 'record_header', 'record_section']) { + for (const loc of ['list', 'record_page', 'record_section']) { expect(() => ui.ActionLocationSchema.parse(loc)).not.toThrow(); } expect(() => ui.ActionLocationSchema.parse('toolbar')).toThrow(); @@ -137,6 +137,6 @@ describe('studio ActionLocation dual-source retirement', () => { // The authored VALUE domain did not move an inch with the TS rename; the // SAME document differing only in this one value stays illegal (so this // negative cannot pass for an unrelated reason): - expect(() => StudioPluginManifestSchema.parse(manifestWith('list_toolbar'))).toThrow(); + expect(() => StudioPluginManifestSchema.parse(manifestWith('list'))).toThrow(); }); }); diff --git a/packages/spec/src/studio/plugin.zod.ts b/packages/spec/src/studio/plugin.zod.ts index 80fe4b0affc..510fb611c49 100644 --- a/packages/spec/src/studio/plugin.zod.ts +++ b/packages/spec/src/studio/plugin.zod.ts @@ -147,8 +147,9 @@ export type SidebarGroupContributionParsed = z.infer i.path.join('.')); diff --git a/packages/spec/src/ui/action-declarative-update.ts b/packages/spec/src/ui/action-declarative-update.ts index 5c613c715ea..11caa8aaca4 100644 --- a/packages/spec/src/ui/action-declarative-update.ts +++ b/packages/spec/src/ui/action-declarative-update.ts @@ -39,7 +39,7 @@ import { onSuccessBesideUpdateOperationRefusal } from './action-on-success-execu * is no `patch` and no non-empty `params`, refused at `patch`. On a page * action row it is no `name`, refused at `name`: the row runs the declared * action its `name` names, and the route writes THAT action's `patch`. - * 5. A `list_toolbar` location is refused: no current record there. + * 5. A `list` location is refused: no current record there. * * Deliberately NOT judged here: `objectName`. `ActionSchema` parses an action * embedded on an object (object implicit) and a standalone one in @@ -248,13 +248,13 @@ export function refuseDeclarativeUpdateContradictions(surface: DeclarativeUpdate if (Array.isArray(data.locations)) { data.locations.forEach((location, index) => { - if (location !== 'list_toolbar') return; + if (location !== 'list') return; ctx.addIssue({ code: 'custom', path: ['locations', index], message: - "`list_toolbar` has no current record — an `operation: 'update'` action writes ONE record, the one it " - + 'runs on. Use a record location (`list_item`, `record_header`, `record_more`, `record_section`) or, ' + "`list` has no current record — an `operation: 'update'` action writes ONE record, the one it " + + 'runs on. Use a record location (`record`, `record_page`, `record_row`, `record_section`) or, ' + "for the selection bar, a `bulkActionDefs` entry on the list view (`{ operation: 'update', patch }`).", }); }); diff --git a/packages/spec/src/ui/action-pressed.test.ts b/packages/spec/src/ui/action-pressed.test.ts index 5084b4f30bb..fbfb71019bc 100644 --- a/packages/spec/src/ui/action-pressed.test.ts +++ b/packages/spec/src/ui/action-pressed.test.ts @@ -24,7 +24,7 @@ const base = { objectName: 'kb_article', type: 'script', target: 'markHelpful', - locations: ['record_header'], + locations: ['record_page'], } as const; const PRESSED = "has(record.viewer) && record.viewer.vote == 'helpful'"; diff --git a/packages/spec/src/ui/action-row-update.test.ts b/packages/spec/src/ui/action-row-update.test.ts index af94e480cc7..44d49bc3a45 100644 --- a/packages/spec/src/ui/action-row-update.test.ts +++ b/packages/spec/src/ui/action-row-update.test.ts @@ -24,7 +24,7 @@ * - MIXING RULE: every executor-binding key beside `operation: 'update'` is * refused at ITS path with code `custom` and a message whose first sentence * names the executor the key belongs to; `patch` without the operation and - * `operation: 'update'` with nothing to write are refused; `list_toolbar` + * `operation: 'update'` with nothing to write are refused; `list` * is refused; the bulk-only operations are refused with the reason. * - BOUNDARIES: an inline page-element action cannot carry the keys; a * standalone action without `objectName` is refused by `defineStack`; the @@ -272,13 +272,13 @@ describe('mixing rule: one refusal per contradiction, at the contradicting key', } }); - it('refuses a `list_toolbar` location — no current record there; the selection bar is the bulk def\'s home', () => { - const result = ActionSchema.safeParse({ ...duly, locations: ['record_header', 'list_toolbar'] }); + it('refuses a `list` location — no current record there; the selection bar is the bulk def\'s home', () => { + const result = ActionSchema.safeParse({ ...duly, locations: ['record_page', 'list'] }); const issue = issueAt(result, 'locations.1'); expect(issue?.code).toBe('custom'); - expect(issue?.message).toMatch(/^`list_toolbar` has no current record — an `operation: 'update'` action writes ONE record, the one it runs on\./); + expect(issue?.message).toMatch(/^`list` has no current record — an `operation: 'update'` action writes ONE record, the one it runs on\./); expect(issueAt(result, 'locations.0')).toBeUndefined(); - expect(ActionSchema.safeParse({ ...duly, locations: ['list_item', 'record_header', 'record_more', 'record_section'] }).success).toBe(true); + expect(ActionSchema.safeParse({ ...duly, locations: ['record', 'record_section'] }).success).toBe(true); }); it('refuses the bulk-only operations with the reason, not a bare enum list', () => { diff --git a/packages/spec/src/ui/action-undoable-fulfillment.test.ts b/packages/spec/src/ui/action-undoable-fulfillment.test.ts index b80ff740aec..8b0fbeec7d6 100644 --- a/packages/spec/src/ui/action-undoable-fulfillment.test.ts +++ b/packages/spec/src/ui/action-undoable-fulfillment.test.ts @@ -76,7 +76,7 @@ describe('ActionSchema — `undoable: true` is refused where no runtime fulfils ...base, type: 'api', target: 'lead', - locations: ['record_header', 'list_item'], + locations: ['record'], params: [{ field: 'assigned_to', required: true }], undoable: true, successMessage: 'Lead reassigned.', diff --git a/packages/spec/src/ui/action.test.ts b/packages/spec/src/ui/action.test.ts index 52550d68737..b5650b9808b 100644 --- a/packages/spec/src/ui/action.test.ts +++ b/packages/spec/src/ui/action.test.ts @@ -506,10 +506,10 @@ describe('ActionSchema', () => { describe('Action Locations', () => { it('should accept valid locations', () => { const locations = [ - 'list_toolbar', - 'list_item', - 'record_header', - 'record_more', + 'list', + 'record', + 'record_page', + 'record_row', 'record_related', 'record_section', ] as const; @@ -529,7 +529,7 @@ describe('ActionSchema', () => { name: 'toolbar_action', label: 'Toolbar Action', target: 'noop', - locations: ['list_toolbar'], + locations: ['list'], }; expect(() => ActionSchema.parse(action)).not.toThrow(); @@ -729,7 +729,7 @@ describe('ActionSchema', () => { label: 'Approve', icon: 'check-circle', type: 'script', - locations: ['record_header', 'record_more'], + locations: ['record_page'], target: 'approveOpportunity', confirmText: 'Are you sure you want to approve this opportunity?', successMessage: 'Opportunity approved successfully!', @@ -747,7 +747,7 @@ describe('ActionSchema', () => { icon: 'arrow-right', type: 'modal', target: 'transfer_case_modal', - locations: ['record_more'], + locations: ['record_page'], component: 'action:menu', params: [ { name: 'new_owner', @@ -783,7 +783,7 @@ describe('ActionSchema', () => { icon: 'mail', type: 'flow', target: 'send_quote_flow', - locations: ['record_header', 'list_item'], + locations: ['record'], params: [ { name: 'recipient', @@ -815,7 +815,7 @@ describe('ActionSchema', () => { icon: 'file-spreadsheet', type: 'api', target: '/api/export/excel', - locations: ['list_toolbar'], + locations: ['list'], successMessage: 'Export started. You will receive an email when ready.', }; @@ -828,7 +828,7 @@ describe('ActionSchema', () => { label: 'Delete', icon: 'trash', type: 'script', - locations: ['record_more'], + locations: ['record_page'], component: 'action:menu', target: 'deleteRecord', confirmText: 'Are you sure you want to delete this record? This action cannot be undone.', successMessage: 'Record deleted successfully!', @@ -845,7 +845,7 @@ describe('ActionSchema', () => { label: 'Clone', icon: 'copy', type: 'script', - locations: ['record_more', 'list_item'], + locations: ['record'], component: 'action:menu', target: 'cloneRecord', params: [ { @@ -1116,7 +1116,7 @@ describe('ActionSchema - ai block (ADR-0011)', () => { label: 'Hint', target: 'noop', objectName: 'task', - locations: ['record_header'], + locations: ['record_page'], ai: { exposed: true, description: longDescription, paramHints: { recordId: { description: 'The task id.' } } }, }), ).not.toThrow(); @@ -1244,18 +1244,18 @@ describe('ActionSchema - order', () => { })).toThrow(); }); - it('should combine order with variant and locations (record_header primary hint)', () => { + it('should combine order with variant and locations (record_page primary hint)', () => { const result = ActionSchema.parse({ name: 'approve', label: 'Approve', target: 'approve_handler', - locations: ['record_header', 'record_more'], + locations: ['record_page'], variant: 'primary', order: -10, }); expect(result.order).toBe(-10); expect(result.variant).toBe('primary'); - expect(result.locations).toContain('record_header'); + expect(result.locations).toContain('record_page'); }); }); @@ -1503,15 +1503,33 @@ describe('ACTION_LOCATIONS — canonical source of truth', () => { // of producing a silent runtime mismatch. it('exposes the full set of supported locations', () => { expect([...ACTION_LOCATIONS]).toEqual([ - 'list_toolbar', - 'list_item', - 'record_header', - 'record_more', + 'list', + 'record', + 'record_page', + 'record_row', 'record_related', 'record_section', ]); }); + // ─── objectstack#36495 — the page-part words are retired ──────────────── + // + // Locations say what an action acts on. The four words that named a part of + // a page are refused with the word to write instead, and the ADR-0087 + // conversion `action-locations-acted-on` rewrites stored and pre-19 sources. + it.each([ + ['list_toolbar', '`list`'], + ['list_item', '`record_row`'], + ['record_header', '`record_page`'], + ['record_more', "component: 'action:menu'"], + ])('refuses the retired page-part word %s with its prescription', (word, prescription) => { + const result = ActionLocationSchema.safeParse(word); + expect(result.success).toBe(false); + const message = result.success ? '' : result.error.issues.map((i) => i.message).join('\n'); + expect(message).toContain(`\`${word}\``); + expect(message).toContain(prescription); + }); + it('ActionLocationSchema accepts every value in ACTION_LOCATIONS', () => { for (const loc of ACTION_LOCATIONS) { expect(() => ActionLocationSchema.parse(loc)).not.toThrow(); diff --git a/packages/spec/src/ui/action.zod.ts b/packages/spec/src/ui/action.zod.ts index 25cc2698a9a..3fcb11392da 100644 --- a/packages/spec/src/ui/action.zod.ts +++ b/packages/spec/src/ui/action.zod.ts @@ -521,7 +521,7 @@ export const ActionParamSchema = lazySchema(() => strictObject( reference: SnakeCaseIdentifierSchema.optional().describe('Reference target object for inline lookup/master_detail params; mirrors FieldSchema.reference.').meta({ title: 'Reference Object' }), /** * When true, the param's default value is pulled from the current row record - * (key = the resolved field name) when the action runs from a list_item + * (key = the resolved field name) when the action runs from a list row (`record_row` / `record`) * context. Useful for edit dialogs that pre-fill from the selected row. */ defaultFromRow: z.boolean().optional().meta({ title: 'Default From Row' }), @@ -797,7 +797,7 @@ function refuseAskAiContradictions( * Note: The action name is the configuration ID. JavaScript function names can use camelCase, * but the metadata ID must be lowercase snake_case. */ -// Retired-VALUE prescription. Declared with `//` (never `/** */`) and ABOVE the +// Retired-VALUE prescriptions. Declared with `//` (never `/** */`) and ABOVE the // enum's JSDoc deliberately: `build-docs.ts` takes a doc comment adjacent to the // declaration as the reference entry's blurb, so a `/** */` here would displace // the location table below. (House style set by the `crypto.hash` / @@ -811,68 +811,111 @@ const GLOBAL_NAV_RETIRED = + 'never reached a user. The only thing that DID draw it was the Studio designer, which ' + 'previewed a command-palette frame for a surface the product does not have — an authoring ' + 'tool teaching authors to write dead metadata (ADR-0078). Place the action on a location a ' - + 'renderer serves (`list_toolbar`, `list_item`, `record_header`, `record_more`, ' - + '`record_related`, `record_section`), or — for an action that deliberately has no UI home, ' + + 'renderer serves (`list`, `record`, `record_page`, `record_row`, `record_related`, ' + + '`record_section`), or — for an action that deliberately has no UI home, ' + 'such as an object-less one invoked over REST/MCP/AI — declare it headless with ' + '`locations: []`, which keeps its capability gate, param contract and audit trail. ' + 'This edit left `os migrate meta` with the protocol-16.x conversions: apply it by hand, or run the tool on a release that still carries the conversion — https://objectstack.ai/docs/protocol-upgrade.'; +// The four page-part words protocol 19 replaced (objectstack#36495): a location +// now says what the action acts on. Each keeps a prescription keyed on the +// received value, so only a spelling that used to be legal is told it moved. +const PAGE_PART_LOCATIONS_RETIRED_TAIL = + ' Protocol 19 names what an action acts on, not the part of the page it sits in: `list` (acts on ' + + 'no record), `record` (acts on one record: the record page and each list row), and the narrow ' + + 'words `record_page`, `record_row`, `record_related` and `record_section`. Which actions are ' + + 'buttons and in what order is the object\'s `actionLayout`. ' + + 'Run `os migrate meta --from 18` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand.'; +const PAGE_PART_LOCATIONS_RETIRED: Readonly> = { + list_toolbar: '`list_toolbar` became `list` in @objectstack/spec 19: write `list`.' + + PAGE_PART_LOCATIONS_RETIRED_TAIL, + list_item: '`list_item` became `record_row` in @objectstack/spec 19 — or `record`, when the action is also ' + + 'on the record page (`record_header` / `record_more` beside it).' + PAGE_PART_LOCATIONS_RETIRED_TAIL, + record_header: '`record_header` became `record_page` in @objectstack/spec 19 — or `record`, when the action ' + + 'is also on each list row (`list_item` beside it).' + PAGE_PART_LOCATIONS_RETIRED_TAIL, + record_more: '`record_more` became `record_page` in @objectstack/spec 19 — or `record`, when the action is ' + + 'also on each list row (`list_item` beside it). An action that was only in the record page\'s ⋯ menu ' + + '(`record_more` without `record_header`) keeps that fold with `component: \'action:menu\'`. A block ' + + 'whose own `location` is `record_more` (a bar of the ⋯ menu\'s actions) has no replacement word: the ⋯ ' + + 'menu is no location of its own now, and a bar at `record_page` leaves its actions out.' + + PAGE_PART_LOCATIONS_RETIRED_TAIL, +}; + /** - * Action Location — where an action is allowed to surface in the UI. + * Action Location — what an action acts on, and so where it can surface. * * Canonical list (single source of truth for the whole platform). Renderers, * the ActionEngine, the Studio designer dropdowns, and `objectui` consumers * MUST import from this constant rather than re-declaring their own enum — * adding a new location should require touching this one file only. * - * Semantics: - * - `list_toolbar` — header/toolbar of a list view (bulk actions, "New", export). - * - `list_item` — per-row action on a list/grid row (Salesforce row-level menu). - * - `record_header` — primary actions in the record-detail title bar. - * - `record_more` — overflow menu under the "More" / ⋯ button on a record. + * Semantics (protocol 19, objectstack#36495; maintainer rulings 7213534162 + * and 7213827153): + * - `list` — acts on no record: drawn on the object's list page + * toolbar ("New", import, export, an object-level run). + * - `record` — acts on one record: drawn on the record page (its + * header, the side preview, a phone's bottom bar) AND + * on each list row (the row's ⋮ menu). The word an + * action that acts on a record writes by default. + * - `record_page` — acts on one record, on the record page only (not on + * list rows). + * - `record_row` — acts on one record, on each list row only (every row + * wherever the object is listed; not on the record page). * - `record_related` — per-row action on each row of a related list shown inside * a parent record, in that parent's context only. Unlike - * `list_item` (every row wherever the object is listed), it + * `record_row` (every row wherever the object is listed), it * never surfaces on the object's own list views. * - `record_section` — actions surfaced inside a body section/tab of a record * (e.g. a Security tab grouping change-password, 2FA, etc.). * Drawn only by an authored record page block that renders * it; the standard record page (a phone, the side preview, * and an object with no authored page) does not draw it, so - * an action that must reach every surface adds `record_more`. + * an action that must reach every surface adds `record_page` + * (with `component: 'action:menu'` to sit in the ⋯ menu). + * + * Which of an object's record-page actions are buttons and which sit in the + * page's ⋯ menu, and in what order, is the object's `actionLayout`; without + * it, an action with `component: 'action:menu'` is drawn in the ⋯ menu only. + * + * Until protocol 19 the words named page parts: `list_toolbar` (now `list`), + * `list_item` (now `record_row`), `record_header` and `record_more` (now + * `record_page`, the `record_more`-only fold kept by `component: + * 'action:menu'`), and an action on both a row and the record page now writes + * `record`. The conversion `action-locations-acted-on` rewrites stored and + * source metadata losslessly; the enum's error map tells an author who writes + * an old word which word replaced it. * * `global_nav` was REMOVED in 17 (#6888, maintainer ruling 2026-08-09). It had * been declared here since the vocabulary was written and no product surface * ever served it: the console's ⌘K palette composes its groups from nav items, * objects, dashboards, pages, reports, recent items and record search, and - * references no action metadata. Four of the five references to the value in - * the whole UI repo were the Studio designer — which drew the author a mock - * "⌘K · Command palette" frame, promising a rendering the product cannot do - * (the ADR-0078 declares-renders-does-nothing shape, arriving through the - * location vocabulary rather than through a missing key). Retired rather than - * implemented: no user has asked for command-palette actions and the only two - * declarers were our own showcase corpus, so wiring the palette would have been - * capability expansion with no pull. This is an enum VALUE, not a key, so there - * is no `retiredKey()` tombstone — the prescription lives on the enum's own - * error map above, keyed on `issue.input` so that only the spelling which used - * to be legal is told it "was removed". An object-less action's honest - * declaration is `locations: []` (headless), not a location nothing renders. + * references no action metadata. Retired rather than implemented. This is an + * enum VALUE, not a key, so there is no `retiredKey()` tombstone — the + * prescription lives on the enum's own error map above, keyed on + * `issue.input` so that only the spelling which used to be legal is told it + * "was removed". An object-less action's honest declaration is + * `locations: []` (headless), not a location nothing renders. */ export const ACTION_LOCATIONS = [ - 'list_toolbar', - 'list_item', - 'record_header', - 'record_more', + 'list', + 'record', + 'record_page', + 'record_row', 'record_related', 'record_section', ] as const; export const ActionLocationSchema = z.enum(ACTION_LOCATIONS, { - // Only the spelling that USED to be legal gets the retirement message. + // Only a spelling that USED to be legal gets a retirement message. // Telling the author of `globalnav` that their value "was removed" would // misinform, so everything else keeps zod's own enum error, which already // lists the legal locations. (`array_agg` / `crypto.hash` precedent.) - error: (issue) => (issue.input === 'global_nav' ? GLOBAL_NAV_RETIRED : undefined), + error: (issue) => { + if (issue.input === 'global_nav') return GLOBAL_NAV_RETIRED; + return typeof issue.input === 'string' && Object.prototype.hasOwnProperty.call(PAGE_PART_LOCATIONS_RETIRED, issue.input) + ? PAGE_PART_LOCATIONS_RETIRED[issue.input] + : undefined; + }, }); export type ActionLocation = z.input; @@ -1422,7 +1465,7 @@ const actionObject = () => strictObject({ icon: z.string().optional().describe('Icon name'), /** Where does this action appear? */ - locations: z.array(ActionLocationSchema).optional().describe('Locations where this action is visible. `record_section` is drawn only by an authored record page block that renders it; the standard record page (on a phone, in the side preview, and for an object with no authored page) does not draw it, so an action that must reach every surface adds `record_more` as well.'), + locations: z.array(ActionLocationSchema).optional().describe('Locations where this action is visible. `record_section` is drawn only by an authored record page block that renders it; the standard record page (on a phone, in the side preview, and for an object with no authored page) does not draw it, so an action that must reach every surface adds `record_page` as well, with `component: \'action:menu\'` to sit in the record page\'s ⋯ menu rather than be a header button. `list` acts on no record (the list page toolbar); `record` acts on one record, on the record page and on each list row; `record_page` and `record_row` are one of those two only.'), /** * Visual Component Type @@ -1678,7 +1721,7 @@ const actionObject = () => strictObject({ * `bodyExtra`, `bodyShape`, `recordIdParam`/`recordIdField`, `onSuccess`, * `opensInNewTab`/`newTabUrl` and any other explicit `type` are each refused * with their own message ({@link refuseDeclarativeUpdateContradictions}). - * A `list_toolbar` location is refused too: there is no current record + * A `list` location is refused too: there is no current record * there — the selection bar is the bulk def's home. * * EXECUTOR CONTRACT (the halves that perform the write are downstream cards @@ -1858,7 +1901,7 @@ const actionObject = () => strictObject({ * instead of relying on cross-file `defineStack({ actions })` registration * order — which is fragile and couples unrelated features. * - * In `record_header` the first visible action becomes the primary button, so + * On the record page the first visible action becomes the primary button, so * a low (or negative) `order` promotes an action into the primary slot and a * high `order` demotes it toward the `⋯` overflow menu. This is the * declarative lever a plugin (e.g. plugin-approvals) or app author uses to @@ -1871,7 +1914,7 @@ const actionObject = () => strictObject({ * backward compatible. Renderers MAY additionally prefer a `variant:'primary'` * action when two actions tie on `order` (see objectui record-header renderer). */ - order: z.number().optional().describe('Sort order within a location group (lower = higher). Promotes/demotes an action toward the record_header primary button; stable, so actions without `order` keep their registration order.'), + order: z.number().optional().describe('Sort order within a location group (lower = higher). Promotes/demotes an action toward the record page header\'s primary button; stable, so actions without `order` keep their registration order.'), /** UX Behavior */ // NB this describe() renders into the InlineAction reference table too (both @@ -2284,11 +2327,11 @@ const actionObject = () => strictObject({ ai: ActionAiSchema.optional().describe('AI exposure (opt-in). Set ai.exposed=true + ai.description to make this callable by agents.'), /** - * Row-context: when the action runs from a list_item location, this body key + * Row-context: when the action runs from a list row (`record_row` / `record`), this body key * receives the row's id (or the field named by `recordIdField`). Defaults to * `id` when omitted but `recordIdField` is set; otherwise no injection. */ - recordIdParam: z.string().optional().describe('Body key to inject the row id into when running from a list_item context.'), + recordIdParam: z.string().optional().describe('Body key to inject the row id into when running from a list row (`record_row` / `record`).'), /** * Row field whose value seeds `recordIdParam`. Defaults to `'id'` when * `recordIdParam` is set. Use this when the body key expects a non-id value @@ -2593,7 +2636,7 @@ const actionObject = () => strictObject({ * `patch` only beside `operation: 'update'`; beside it, `type` stays at its * default `'script'` (the platform action route), every key that binds or * shapes a dispatch the update does not make is refused at its own path, there - * is a `patch` or a non-empty `params` to write, and no `list_toolbar` + * is a `patch` or a non-empty `params` to write, and no `list` * location. `objectName` is judged by `defineStack`'s walk instead * (`stack.zod.ts`, `collectGlobalUpdateActionErrors`). */ diff --git a/packages/spec/src/ui/component-action-row-declarative-update.test.ts b/packages/spec/src/ui/component-action-row-declarative-update.test.ts index d84a81bd53f..879c8929059 100644 --- a/packages/spec/src/ui/component-action-row-declarative-update.test.ts +++ b/packages/spec/src/ui/component-action-row-declarative-update.test.ts @@ -144,10 +144,10 @@ const MEMBERS: readonly Member[] = [ control: (k) => ({ ...UPDATE, [k]: 'script' }), }, { - title: "5. `operation: 'update'` + a `list_toolbar` location", - keys: () => ({ ...UPDATE, locations: ['record_header', 'list_toolbar'] }), + title: "5. `operation: 'update'` + a `list` location", + keys: () => ({ ...UPDATE, locations: ['record_page', 'list'] }), at: () => ['locations', 1], - control: () => ({ ...UPDATE, locations: ['record_header'] }), + control: () => ({ ...UPDATE, locations: ['record_page'] }), }, ]; diff --git a/packages/spec/src/ui/component-record-blocks.test.ts b/packages/spec/src/ui/component-record-blocks.test.ts index 729c240d33a..e25942afde2 100644 --- a/packages/spec/src/ui/component-record-blocks.test.ts +++ b/packages/spec/src/ui/component-record-blocks.test.ts @@ -218,7 +218,7 @@ describe('ComponentPropsMap["record:quick_actions"]', () => { }); it('vets `location` against the spec\'s own ActionLocationSchema — one vocabulary, not a restatement', () => { - expect(RecordQuickActionsProps.parse({ location: 'record_more' }).location).toBe('record_more'); + expect(RecordQuickActionsProps.parse({ location: 'record_related' }).location).toBe('record_related'); expect(RecordQuickActionsProps.safeParse({ location: 'toolbar' }).success).toBe(false); // The retired location keeps its retirement prescription — proof the row // rides the shared enum rather than a copy of its values. @@ -236,7 +236,7 @@ describe('ComponentPropsMap["record:quick_actions"]', () => { }); it('materializes nothing for the silent author — no schema defaults', () => { - // `record_header` / `end` / `default` / `sm` are the renderer's fallbacks. + // `record_page` / `end` / `default` / `sm` are the renderer's fallbacks. // NOTE the measured empty-bar truth: with no `actionNames` (and no host // actions) the renderer resolves NOTHING and renders its placeholder — it // does NOT fall back to "every action at this location", whatever the diff --git a/packages/spec/src/ui/component-report-items-action-members-typed.pin.test.ts b/packages/spec/src/ui/component-report-items-action-members-typed.pin.test.ts index 34af888c4a7..669b7b440a5 100644 --- a/packages/spec/src/ui/component-report-items-action-members-typed.pin.test.ts +++ b/packages/spec/src/ui/component-report-items-action-members-typed.pin.test.ts @@ -178,8 +178,8 @@ describe('§1 each member accepts every shape a measured writer authors', () => // objectui `components/src/__tests__/action-group.test.tsx:33`, `action-bodyShape-forward.test.tsx:120`. ['members placed by location', 'action:group', { actions: [ - { name: 'here', label: 'Here', type: 'script', locations: ['list_toolbar'] }, - { name: 'elsewhere', label: 'Elsewhere', type: 'script', locations: ['record_header'] }, + { name: 'here', label: 'Here', type: 'script', locations: ['list'] }, + { name: 'elsewhere', label: 'Elsewhere', type: 'script', locations: ['record_page'] }, ], }], ['an api member with a body shape', 'action:group', { @@ -220,7 +220,7 @@ describe('§1 each member accepts every shape a measured writer authors', () => confirmText: { dialect: 'template', source: 'Close it?' }, successMessage: { dialect: 'template', source: 'Closed' }, errorMessage: { dialect: 'template', source: 'Could not close' }, - refreshAfter: true, locations: ['record_header'], objectName: 'case', + refreshAfter: true, locations: ['record_page'], objectName: 'case', }], }], // #30017: an array `params` beside `confirmText` is refused (two dialogs for diff --git a/packages/spec/src/ui/component.test.ts b/packages/spec/src/ui/component.test.ts index b55c5496c81..c29cde2fd99 100644 --- a/packages/spec/src/ui/component.test.ts +++ b/packages/spec/src/ui/component.test.ts @@ -144,8 +144,8 @@ describe('PageHeaderProps icon is retired — no renderer reads it', () => { }); // #30018 (ruling record 6624172200 on #29951, letter A): `placedActions` is the -// explicit opt-in to every action of the bound object placed at `record_header` -// / `record_more`, read live, beside the authored `actions` list, which keeps +// explicit opt-in to every action of the bound object placed at `record_page` +// (or `record`), inline or folded, read live, beside the authored `actions` list, which keeps // its #11592 meaning (an authored list is the whole set). The two are refused // together. Each refusal is asserted by code AND path, so a refusal for another // reason (a closed-shape `unrecognized_keys`, a type miss) cannot pass it; and diff --git a/packages/spec/src/ui/component.zod.ts b/packages/spec/src/ui/component.zod.ts index c95e9ed541b..5ececaf9328 100644 --- a/packages/spec/src/ui/component.zod.ts +++ b/packages/spec/src/ui/component.zod.ts @@ -606,8 +606,8 @@ export type PageContainerProps = z.input; * `placedActions: true` beside an authored `actions` list: two answers to the * one question of which of the bound object's actions a `page:header` draws. * The list is the whole set (#11592's meaning, kept by ruling record - * 6624172200, letter A); the switch is every action placed at `record_header` / - * `record_more`, read live. Neither can be read as narrowing the other without + * 6624172200, letter A); the switch is every action placed on the record page + * (`record` / `record_page`), read live. Neither can be read as narrowing the other without * inventing a rule nobody authored, so the pair is refused at authoring and the * author keeps one. `placedActions: false` beside a list says nothing new and * is not the pair. @@ -624,7 +624,7 @@ export type PageContainerProps = z.input; const PAGE_HEADER_PLACED_ACTIONS_BESIDE_LIST = { message: 'A `page:header` that sets `placedActions: true` draws every action of the bound object placed at ' - + '`record_header` or `record_more`, read live, so an `actions` list beside it is a second, different ' + + '`record` or `record_page`, read live, so an `actions` list beside it is a second, different ' + 'answer to which actions the header draws. Keep one: `actions` for a curated list that is the whole ' + 'set the header draws, or `placedActions: true` for every placed action, and delete the other key.', path: ['placedActions'], @@ -713,17 +713,17 @@ export const PageHeaderProps = strictObject({ * declare a header placement. objectui's `PageHeaderRenderer` * (`resolvedHeaderActions` then `headerActionPlan`; read points recorded in * `liveness/page.json`, row `regions`) resolves each id against the actions declared on the bound object, keeps - * those whose `locations` include `record_header` or `record_more`, and draws + * those whose `locations` include `record` or `record_page`, and draws * no other action of the object: * - * - an action that declares `record_header` and is NOT named here is not + * - an action that declares `record_page` and is NOT named here is not * drawn in this header. Declaring the placement does not add it, so the * list is the author's curation of the header, and a new header action is * added to the list as well as to the object; * - with the key omitted, an authored `page:header` draws none of the * object's own actions (the list resolves to empty), unless it sets * `placedActions: true` below: the other, explicit way to say which - * actions, namely every `record_header` / `record_more` action of the + * actions, namely every `record` / `record_page` action of the * object, read live. That is the set the platform's synthesized default * record page, used when no page is assigned, builds its header from; * - a named id whose action declares neither location renders nowhere; @@ -737,11 +737,11 @@ export const PageHeaderProps = strictObject({ * here and added the switch beside it. */ actions: z.array(z.string()).optional().describe( - 'Action IDs the header draws, resolved against the actions declared on the page\'s object. An authored list is the whole set: an action that declares `record_header` (or `record_more`) in its `locations` but is not named here is not drawn, and a header with neither this key nor `placedActions: true` draws none of the object\'s actions. `placedActions: true` is the other way to say which actions the header draws (every one placed at `record_header` / `record_more`, read live), and the two are refused together. A named action that declares neither location renders nowhere. The host\'s own Edit / Share / Delete chrome is separate from this list.', + 'Action IDs the header draws, resolved against the actions declared on the page\'s object. An authored list is the whole set: an action that declares `record` or `record_page` in its `locations` but is not named here is not drawn, and a header with neither this key nor `placedActions: true` draws none of the object\'s actions. `placedActions: true` is the other way to say which actions the header draws (every one placed at `record` / `record_page`, read live), and the two are refused together. A named action that declares neither location renders nowhere. The host\'s own Edit / Share / Delete chrome is separate from this list.', ), /** * The explicit opt-in to draw EVERY action of the bound object whose - * `locations` include `record_header` or `record_more`, read live from the + * `locations` include `record` or `record_page`, read live from the * object's metadata, in place of an authored `actions` id list (ruling * record 6624172200, letter A). An action another package places on the * object is drawn without editing this page, which is what a platform record @@ -772,7 +772,7 @@ export const PageHeaderProps = strictObject({ * container). */ placedActions: z.boolean().optional().describe( - 'Draw every action of the page\'s object whose `locations` include `record_header` or `record_more`, read live from the object\'s metadata, in place of an authored `actions` list: an action added to the object later, by any package, is drawn without editing the page. Omit it, or set false, to keep the `actions` list as the whole set. Refused as `true` beside an authored `actions` list: keep one.', + 'Draw every action of the page\'s object whose `locations` include `record` or `record_page`, read live from the object\'s metadata, in place of an authored `actions` list: an action added to the object later, by any package, is drawn without editing the page. Omit it, or set false, to keep the `actions` list as the whole set. Refused as `true` beside an authored `actions` list: keep one.', ), /** * Which of the two page-header layouts the renderer builds (#6776). @@ -2498,7 +2498,7 @@ export const RecordQuickActionsProps = strictObject({ }, { actionNames: z.array(z.string()).optional().describe('Names of actions declared on this object (`actions[]`), in display order. The engine still location-filters named actions. Measured: when omitted (and the host supplies nothing) the bar resolves NO actions and renders its empty placeholder — it does not fall back to "every action at this location", whatever the registration\'s input list claims.'), requiredPermissions: z.array(z.string()).optional().describe(RECORD_BLOCK_REQUIRED_PERMISSIONS_DESCRIPTION), - location: ActionLocationSchema.optional().describe('Which declared action location this bar renders (renderer default: `record_header`).'), + location: ActionLocationSchema.optional().describe('Which declared action location this bar renders (renderer default: `record_page`). At `record_page` it draws the record page\'s actions that are not folded into its ⋯ menu (`component: \'action:menu\'`); an action placed at `record` is drawn at `record_page` and at `record_row`.'), align: z.enum(['start', 'center', 'end']).optional().describe('Horizontal alignment of the button row (renderer default: `end`).'), inline: z.boolean().optional().describe('Render in the flow instead of pulling up into the record-header band. The page header sets this itself when it hosts the bar in its own action slot.'), variant: z.enum(['default', 'destructive', 'outline', 'secondary', 'ghost', 'link']).optional().describe('Button variant for every action — the Button primitive\'s own vocabulary; a per-action `variant` on the resolved def wins (renderer default: `default`).'), @@ -3994,7 +3994,7 @@ function refuseRowOnSuccessBesideExecutor(executorKey: 'actionType' | 'type', ow * {@link actionContainerMemberParamsFitType}. Whether the named action * exists, is an `operation: 'update'` action and declares those params is a * cross-reference this row cannot see; - * - beside it, a `list_toolbar` location — refused at `locations.N`. + * - beside it, a `list` location — refused at `locations.N`. * * Applied first on each row, as the runner reads `operation` first: the row's * url-target, executor-alias and `onSuccess`-executor judgments stand down @@ -4122,7 +4122,7 @@ export const ActionButtonPropsSchema = lazySchema(() => strictObject({ method: z.string().optional().describe('HTTP method for an `api` action, forwarded to the runner'), bodyExtra: z.unknown().optional().describe('Static request-body fields for an `api` action, forwarded to the runner'), bodyShape: z.unknown().optional().describe('How an `api` action shapes its request body, forwarded to the runner'), - operation: actionOperation().optional().describe('Declarative single-record write: `ActionSchema`\'s own `operation`, whose one member is `update`. The row runs the declared action its `name` names. The runner reads `operation` before any executor and posts the row\'s values to the platform action route under that `name`; the route resolves that action by name and writes ITS `patch`, so the row has no `patch` of its own and needs a `name`. What the row\'s `params` supply rides the request as params, written only where that action declares them and otherwise refused by the route. Judged as `ActionSchema` judges it: beside it the executor key is absent or `script`, `target`, `method`, `bodyExtra`, `bodyShape`, `recordIdField` and `onSuccess` are refused, and `list_toolbar` is not a location'), + operation: actionOperation().optional().describe('Declarative single-record write: `ActionSchema`\'s own `operation`, whose one member is `update`. The row runs the declared action its `name` names. The runner reads `operation` before any executor and posts the row\'s values to the platform action route under that `name`; the route resolves that action by name and writes ITS `patch`, so the row has no `patch` of its own and needs a `name`. What the row\'s `params` supply rides the request as params, written only where that action declares them and otherwise refused by the route. Judged as `ActionSchema` judges it: beside it the executor key is absent or `script`, `target`, `method`, `bodyExtra`, `bodyShape`, `recordIdField` and `onSuccess` are refused, and `list` is not a location'), patch: rowPatchRetired("An `action:button`'s"), confirmText: actionRowCopy('confirmText').optional() .describe(`${ACTION_ROW_COPY_DESCRIBE.confirmText} Beside a non-empty array \`params\` it is refused — the runner would show the confirm and then the param dialog, two dialogs for one decision; put the question on \`description\` instead. Correct with no \`params\`, beside \`params: []\`, and beside an object \`params\` (static values, no param dialog)`), @@ -4231,7 +4231,7 @@ export const ActionIconPropsSchema = lazySchema(() => strictObject({ method: z.string().optional().describe('HTTP method for an `api` action, forwarded to the runner'), bodyExtra: z.unknown().optional().describe('Static request-body fields for an `api` action, forwarded to the runner'), bodyShape: z.unknown().optional().describe('How an `api` action shapes its request body, forwarded to the runner'), - operation: actionOperation().optional().describe('Declarative single-record write: `ActionSchema`\'s own `operation`, whose one member is `update`. The row runs the declared action its `name` names. The runner reads `operation` before any executor and posts the row\'s values to the platform action route under that `name`; the route resolves that action by name and writes ITS `patch`, so the row has no `patch` of its own and needs a `name`. What the row\'s `params` supply rides the request as params, written only where that action declares them and otherwise refused by the route. Judged as `ActionSchema` judges it: beside it the executor key is absent or `script`, `target`, `method`, `bodyExtra`, `bodyShape` and `onSuccess` are refused, and `list_toolbar` is not a location'), + operation: actionOperation().optional().describe('Declarative single-record write: `ActionSchema`\'s own `operation`, whose one member is `update`. The row runs the declared action its `name` names. The runner reads `operation` before any executor and posts the row\'s values to the platform action route under that `name`; the route resolves that action by name and writes ITS `patch`, so the row has no `patch` of its own and needs a `name`. What the row\'s `params` supply rides the request as params, written only where that action declares them and otherwise refused by the route. Judged as `ActionSchema` judges it: beside it the executor key is absent or `script`, `target`, `method`, `bodyExtra`, `bodyShape` and `onSuccess` are refused, and `list` is not a location'), patch: rowPatchRetired("An `action:icon`'s"), confirmText: actionRowCopy('confirmText').optional() .describe(`${ACTION_ROW_COPY_DESCRIBE.confirmText} Beside a non-empty array \`params\` it is refused — the runner would show the confirm and then the param dialog, two dialogs for one decision; put the question on \`description\` instead. Correct with no \`params\`, beside \`params: []\`, and beside an object \`params\` (static values, no param dialog)`), @@ -4389,7 +4389,7 @@ function actionContainerMemberShape() { method: z.string().optional().describe('HTTP method for an `api` action, forwarded to the runner'), bodyExtra: z.unknown().optional().describe('Static request-body fields for an `api` action, forwarded to the runner'), bodyShape: z.unknown().optional().describe('How an `api` action shapes its request body, forwarded to the runner'), - operation: actionOperation().optional().describe('Declarative single-record write: `ActionSchema`\'s own `operation`, whose one member is `update`. The row runs the declared action its `name` names. The runner reads `operation` before any executor and posts the row\'s values to the platform action route under that `name`; the route resolves that action by name and writes ITS `patch`, so the row has no `patch` of its own and needs a `name`. What the row\'s `params` supply rides the request as params, written only where that action declares them and otherwise refused by the route. Judged as `ActionSchema` judges it: beside it the executor key is absent or `script`, `target`, `method`, `bodyExtra`, `bodyShape` and `onSuccess` are refused, and `list_toolbar` is not a location'), + operation: actionOperation().optional().describe('Declarative single-record write: `ActionSchema`\'s own `operation`, whose one member is `update`. The row runs the declared action its `name` names. The runner reads `operation` before any executor and posts the row\'s values to the platform action route under that `name`; the route resolves that action by name and writes ITS `patch`, so the row has no `patch` of its own and needs a `name`. What the row\'s `params` supply rides the request as params, written only where that action declares them and otherwise refused by the route. Judged as `ActionSchema` judges it: beside it the executor key is absent or `script`, `target`, `method`, `bodyExtra`, `bodyShape` and `onSuccess` are refused, and `list` is not a location'), patch: rowPatchRetired('An `action:group` or `action:menu` member\'s'), confirmText: actionRowCopy('confirmText').optional() .describe(`${ACTION_ROW_COPY_DESCRIBE.confirmText} Beside a non-empty array \`params\` it is refused — the runner would show the confirm and then the param dialog, two dialogs for one decision; put the question on \`description\` instead. Correct with no \`params\`, beside \`params: []\`, and beside a \`type: 'api'\` member's object \`params\` (its request payload, no param dialog)`), diff --git a/packages/spec/src/ui/dashboard-header-ask-ai-37142.test.ts b/packages/spec/src/ui/dashboard-header-ask-ai-37142.test.ts index a922457842a..690a9ee6f4f 100644 --- a/packages/spec/src/ui/dashboard-header-ask-ai-37142.test.ts +++ b/packages/spec/src/ui/dashboard-header-ask-ai-37142.test.ts @@ -15,7 +15,7 @@ describe('DashboardHeaderActionSchema — `actionType: ask_ai`', () => { const issues = r.error!.issues; expect(issues.map((i) => i.path.join('.'))).toEqual(['actionType']); expect(issues[0].code).toBe('custom'); - expect(issues[0].message).toContain("locations: ['record_header']"); + expect(issues[0].message).toContain("locations: ['record_page']"); }); it('keeps the vocabulary derived: ask_ai is still a member, refused by the header alone', () => { diff --git a/packages/spec/src/ui/dashboard.zod.ts b/packages/spec/src/ui/dashboard.zod.ts index fcb1f7adf49..df73376260d 100644 --- a/packages/spec/src/ui/dashboard.zod.ts +++ b/packages/spec/src/ui/dashboard.zod.ts @@ -131,7 +131,7 @@ function refuseRecordlessAskAi( message: "A dashboard header action cannot be `actionType: 'ask_ai'`: that type focuses the in-app assistant on " + 'the one record an action runs on, and a dashboard header runs on none. Put an `ask_ai` action on the ' - + "object (`locations: ['record_header']` or `['record_more']`), where it runs on the record shown.", + + "object (`locations: ['record_page']` or `['record']`), where it runs on the record shown.", }); } diff --git a/packages/spec/src/ui/page.zod.ts b/packages/spec/src/ui/page.zod.ts index d3a9089cec7..f3959538b2f 100644 --- a/packages/spec/src/ui/page.zod.ts +++ b/packages/spec/src/ui/page.zod.ts @@ -2162,7 +2162,7 @@ export const PageSchema = lazySchema(() => strictObject({ "Do not author Tailwind classes in page source in either tier: `source` is " + "runtime metadata the build-time Tailwind never scans, so utility classNames " + "silently produce no CSS (ADR-0065; ADR-0080). " + - "Where it is drawn: an object's assigned record page of kind 'full', 'html' or 'react' (its `isDefault` page, or an app's page named by `apps`) is drawn on the desktop full record page only. On a phone and in the side preview (the drawer a list opens, a split pane, an interface page's preview) the record opens on the standard record page, built from the object's own metadata, so the page's layout and what lives only on it (its own blocks, tabs and sections, and `record_section` actions, which the standard page does not draw; give such an action `record_more` as well) do not appear there. A page named in the URL (a print page and other named page routes) is drawn wherever that route opens, the platform's own approval request and user pages keep their page on every surface, and a `kind: 'slotted'` page is the standard page with its slots filled, on every surface.", + "Where it is drawn: an object's assigned record page of kind 'full', 'html' or 'react' (its `isDefault` page, or an app's page named by `apps`) is drawn on the desktop full record page only. On a phone and in the side preview (the drawer a list opens, a split pane, an interface page's preview) the record opens on the standard record page, built from the object's own metadata, so the page's layout and what lives only on it (its own blocks, tabs and sections, and `record_section` actions, which the standard page does not draw; give such an action `record_page` as well, with `component: 'action:menu'` to keep it in the ⋯ menu) do not appear there. A page named in the URL (a print page and other named page routes) is drawn wherever that route opens, the platform's own approval request and user pages keep their page on every surface, and a `kind: 'slotted'` page is the standard page with its slots filled, on every surface.", ), /** diff --git a/packages/verify/src/action-flow-dropped-fields.test.ts b/packages/verify/src/action-flow-dropped-fields.test.ts index 8557c9525d0..c9a7b5800c5 100644 --- a/packages/verify/src/action-flow-dropped-fields.test.ts +++ b/packages/verify/src/action-flow-dropped-fields.test.ts @@ -100,8 +100,8 @@ const fixtureStack = defineStack({ objects: [Report], flows: [writer(SUBMIT, { status: 'submitted', note: 'submitted by the button' }), writer(ADD_NOTE, { note: 'noted by the button' })], actions: [ - { name: 'submit_for_approval', label: 'Submit for approval', objectName: REPORT, type: 'flow', target: SUBMIT, locations: ['record_header'] }, - { name: 'add_note', label: 'Add note', objectName: REPORT, type: 'flow', target: ADD_NOTE, locations: ['record_header'] }, + { name: 'submit_for_approval', label: 'Submit for approval', objectName: REPORT, type: 'flow', target: SUBMIT, locations: ['record_page'] }, + { name: 'add_note', label: 'Add note', objectName: REPORT, type: 'flow', target: ADD_NOTE, locations: ['record_page'] }, ], } as never); diff --git a/scripts/sdui-manifest.record.json b/scripts/sdui-manifest.record.json index fe8d56e3e3a..2219b1d8872 100644 --- a/scripts/sdui-manifest.record.json +++ b/scripts/sdui-manifest.record.json @@ -13,11 +13,11 @@ ], "source": "built-tree", "generator": "scripts/gen-sdui-manifest-node.mjs", - "generatedAt": "2026-11-24", - "sha256": "36170a5f0406f280028d3a3825d2f3abda571b1afc58c32321f6de51c511bec2", + "generatedAt": "2026-11-27", + "sha256": "35af7307b195e14956e951fd116d04bf9546aab7ffca1bb40ee7b1ed7a8571ee", "components": 106, "inTree": { "modulesRoot": "ui/apps/console", - "objectuiWorkspaceVersion": "18.6.0" + "objectuiWorkspaceVersion": "19.0.0-next.0" } } diff --git a/sdui.manifest.json b/sdui.manifest.json index 3774bc0f0ef..ad3fa38746c 100644 --- a/sdui.manifest.json +++ b/sdui.manifest.json @@ -2047,10 +2047,10 @@ "name": "location", "type": "enum", "enum": [ - "list_toolbar", - "list_item", - "record_header", - "record_more", + "list", + "record", + "record_page", + "record_row", "record_related", "record_section" ], @@ -2644,7 +2644,7 @@ "name": "locations", "type": "array", "of": "string", - "description": "The placements the action declares (`list_toolbar`, `list_item`, `record_header`, …). A `script` or `flow` action declared record-scoped (`list_item`, `record_header`, `record_more` or `record_section`) refuses to run when no record or single selection is in scope, instead of running without one" + "description": "The placements the action declares (`list`, `record_row`, `record_page`, …). A `script` or `flow` action declared record-scoped (`record_row`, `record`, `record_page` or `record_section`) refuses to run when no record or single selection is in scope, instead of running without one" }, { "name": "toast", @@ -2708,10 +2708,10 @@ "name": "location", "type": "enum", "enum": [ - "list_toolbar", - "list_item", - "record_header", - "record_more", + "list", + "record", + "record_page", + "record_row", "record_related", "record_section" ], @@ -2943,7 +2943,7 @@ "name": "locations", "type": "array", "of": "string", - "description": "The placements the action declares (`list_toolbar`, `list_item`, `record_header`, …). A `script` or `flow` action declared record-scoped (`list_item`, `record_header`, `record_more` or `record_section`) refuses to run when no record or single selection is in scope, instead of running without one" + "description": "The placements the action declares (`list`, `record_row`, `record_page`, …). A `script` or `flow` action declared record-scoped (`record_row`, `record`, `record_page` or `record_section`) refuses to run when no record or single selection is in scope, instead of running without one" }, { "name": "toast", @@ -3515,12 +3515,12 @@ "name": "actions", "type": "array", "of": "string", - "description": "Action IDS — the names of actions declared on the object's own metadata — rendered in the header before any host-injected system actions. An id whose action declares neither record_header nor record_more in its locations renders nowhere." + "description": "Action IDS — the names of actions declared on the object's own metadata — rendered in the header before any host-injected system actions. An id whose action declares neither record nor record_page in its locations renders nowhere." }, { "name": "placedActions", "type": "boolean", - "description": "Set true to draw every action of the object placed at record_header or record_more, read live from the object's metadata, in place of an Actions list: an action another package adds to the object is drawn without editing the page. Refused beside an authored Actions list: keep one." + "description": "Set true to draw every action of the object placed at record or record_page, read live from the object's metadata, in place of an Actions list: an action another package adds to the object is drawn without editing the page. Refused beside an authored Actions list: keep one." }, { "name": "recordChrome", @@ -3534,7 +3534,7 @@ { "name": "maxVisible", "type": "number", - "description": "How many header actions render as inline buttons on desktop before the rest fold into the overflow menu. A positive integer, defaulting to 3 — the contract rejects 0 and fractional values. In a record page's header bar, actions that do not fit its width fold too, so a narrow drawer shows fewer. Two kinds of action are routed to the overflow menu regardless of this budget and never occupy an inline slot: an action whose locations declare record_more without record_header, and any action with component action:menu. The host's own buttons (the record page's Edit) take no slot and never fold. The first inline action, or the one declaring variant primary, is the one filled primary button; the others are outline buttons. The host's Edit is always an outline button: on a record with no header action of its own the row has no filled button. An action declaring variant danger is never the primary: inline it is a destructive button, and in the overflow menu it is a red row below a separator." + "description": "How many header actions render as inline buttons on desktop before the rest fold into the overflow menu. A positive integer, defaulting to 3 — the contract rejects 0 and fractional values. In a record page's header bar, actions that do not fit its width fold too, so a narrow drawer shows fewer. An action with component action:menu (the record page's fold) is routed to the overflow menu regardless of this budget and never occupies an inline slot. The host's own buttons (the record page's Edit) take no slot and never fold. The first inline action, or the one declaring variant primary, is the one filled primary button; the others are outline buttons. The host's Edit is always an outline button: on a record with no header action of its own the row has no filled button. An action declaring variant danger is never the primary: inline it is a destructive button, and in the overflow menu it is a red row below a separator." }, { "name": "mobileMaxVisible", diff --git a/ui/apps/console/src/__tests__/record-block-record-reach.test.tsx b/ui/apps/console/src/__tests__/record-block-record-reach.test.tsx index 2382b805240..f0330a5e16c 100644 --- a/ui/apps/console/src/__tests__/record-block-record-reach.test.tsx +++ b/ui/apps/console/src/__tests__/record-block-record-reach.test.tsx @@ -167,7 +167,7 @@ const PROBE_OBJECT_SCHEMA = { name: PROBE_ACTION, label: 'Probe Action', type: 'url', - locations: ['record_header'], + locations: ['record_page'], visible: "record.stage == 'qualified'", }, ], @@ -279,14 +279,14 @@ const SAMPLE_BY_INPUT: Readonly> = { // the same record renders differently twice and the stability control // (rightly) refuses to grade the probe. The header is not what this probe // asks about. - // - `record:quick_actions` reads `location || 'record_header'`, + // - `record:quick_actions` reads `location || 'record_page'`, // `align || 'end'`, `variant || 'default'`, `size || 'sm'`; the // probe action is declared at the header location, and the generic // samples (`'x'` for the two strings, the enum's first arm for the // other two) point the bar at a location with no actions. relationshipValueField: 'id', showHeader: false, - location: 'record_header', + location: 'record_page', align: 'end', variant: 'default', size: 'sm', diff --git a/ui/apps/console/src/__tests__/registry-inputs-spec-parity.test.ts b/ui/apps/console/src/__tests__/registry-inputs-spec-parity.test.ts index c73aca5cab1..452d2dd0a86 100644 --- a/ui/apps/console/src/__tests__/registry-inputs-spec-parity.test.ts +++ b/ui/apps/console/src/__tests__/registry-inputs-spec-parity.test.ts @@ -2813,7 +2813,7 @@ const ACTION_LEAF_MEMBER_CLAIMS: Record = { bodyShape: 'The `object` arm\'s one member is `wrap`: `{ wrap: \'data\' }` nests the static values under `data` with `bodyExtra` riding flat beside it, while `flat` and an absent key send the same flat body — asserted on the body the runner\'s built-in `api` executor sends (objectui#11168 slice 1).', locations: - 'Members are placement names, read at dispatch by `@object-ui/core`\'s `createServerActionHandler` (the console\'s `script` handler is built on it): a list carrying a record-scoped member (`record_header`) refuses to run with no record or selection in scope — an error toast and no request — while an object-level list (`list_toolbar`) runs (objectui#11168 slice 1).', + 'Members are placement names, read at dispatch by `@object-ui/core`\'s `createServerActionHandler` (the console\'s `script` handler is built on it): a list carrying a record-scoped member (`record_page`) refuses to run with no record or selection in scope — an error toast and no request — while an object-level list (`list`) runs (objectui#11168 slice 1).', toast: 'Members `showOnSuccess` / `showOnError` / `duration`, each asserted on the toast handler the runner calls: `showOnSuccess: false` silences a success, `showOnError: false` silences a failure, and `duration` is handed to the toast; with no `toast` both outcomes are toasted (objectui#11168 slice 1).', resultDialog: @@ -3644,7 +3644,7 @@ const MEMBER_PINS: Record = { }, 'record:related_list.actions': { file: 'packages/plugin-detail/src/__tests__/RecordRelatedListRenderer.authoredActions-11163.test.tsx', - pins: 'Members are action-id STRINGS resolved against the RELATED object\'s own `actions` — the `useMetadataItem` + `resolveDeclaredActionIds` lookup `record:quick_actions.actionNames` resolves through — and placed by each action\'s own `locations`, read through the real `SchemaRenderer`, this block\'s registration, the real `RelatedList` and the real data table. An authored list renders IN AUTHORED ORDER (`list_toolbar` members as header buttons, `list_item` members in each row\'s menu, one list feeding both) and REPLACES the host bridge\'s default rather than adding to it; an ABSENT key leaves the bridge\'s actions exactly as they were and makes no lookup at all (the control); `[]` draws none while the built-in New stays, because New is not an action id; and an authored action runs through the host\'s executor with its resolved definition. The refusals are member facts too: an id the registry cannot resolve and an id whose action declares neither list location are each named in a `role="status"` notice while the resolvable members still render, an array of inline action objects is refused whole, nothing is refused while the lookup is in flight, and with no host the list stays read-only while a bad id is still refused, so the refusal is the registry\'s and not the host\'s. New file (objectui#11163, the ENFORCE ruling on objectstack#20665), replacing the `NO_READ_SITE_TO_PIN` exemption this key carried since objectui#8071 slice 2.', + pins: 'Members are action-id STRINGS resolved against the RELATED object\'s own `actions` — the `useMetadataItem` + `resolveDeclaredActionIds` lookup `record:quick_actions.actionNames` resolves through — and placed by each action\'s own `locations`, read through the real `SchemaRenderer`, this block\'s registration, the real `RelatedList` and the real data table. An authored list renders IN AUTHORED ORDER (`list` members as header buttons, `record_row` members in each row\'s menu, one list feeding both) and REPLACES the host bridge\'s default rather than adding to it; an ABSENT key leaves the bridge\'s actions exactly as they were and makes no lookup at all (the control); `[]` draws none while the built-in New stays, because New is not an action id; and an authored action runs through the host\'s executor with its resolved definition. The refusals are member facts too: an id the registry cannot resolve and an id whose action declares neither list location are each named in a `role="status"` notice while the resolvable members still render, an array of inline action objects is refused whole, nothing is refused while the lookup is in flight, and with no host the list stays read-only while a bad id is still refused, so the refusal is the registry\'s and not the host\'s. New file (objectui#11163, the ENFORCE ruling on objectstack#20665), replacing the `NO_READ_SITE_TO_PIN` exemption this key carried since objectui#8071 slice 2.', }, 'record:related_list.add': { file: 'packages/plugin-detail/src/__tests__/recordRelatedListInputs.spec-parity.test.ts', diff --git a/ui/apps/console/src/dev/DevRecordHeaderActions.tsx b/ui/apps/console/src/dev/DevRecordHeaderActions.tsx index a78d0afe4a2..6033621ed13 100644 --- a/ui/apps/console/src/dev/DevRecordHeaderActions.tsx +++ b/ui/apps/console/src/dev/DevRecordHeaderActions.tsx @@ -2,7 +2,7 @@ * Dev-only harness for record-header `type:'api'` actions (objectui#3391). * * Reproduces the issue's exact declaration: an object action on - * `locations:['record_header']` whose target is + * `locations:['record_page']` whose target is * `/api/v1/data/os_tianshun_ehr_production_plan/{id}`, with a required * field-backed param, `bodyExtra` and a confirm dialog. Before the fix the * header executor never stashed the record under `params._rowRecord`, so the @@ -40,7 +40,7 @@ const OBJECT_DEF = { { name: 'copy_plan_row', label: '复制', - locations: ['record_header'], + locations: ['record_page'], type: 'api', method: 'PATCH', target: `/api/v1/data/${OBJECT_NAME}/{id}`, diff --git a/ui/apps/console/src/preview-samples.ts b/ui/apps/console/src/preview-samples.ts index eeb24dec282..2422db5c2de 100644 --- a/ui/apps/console/src/preview-samples.ts +++ b/ui/apps/console/src/preview-samples.ts @@ -194,7 +194,7 @@ export const SAMPLES: Record> = { // Spec-17 placement vocabulary; the pre-17 `record`/`list` shorthands are // not in the enum (and the ActionPreview placement mock renders nothing // for them, so the "Where it appears" section was empty). - locations: ['record_header', 'list_toolbar'], + locations: ['record_page', 'list'], confirmText: 'Close this order? This cannot be undone.', successMessage: 'Order closed.', // No `bulkEnabled`: RETIRED in spec 17 (objectstack#3896). The multi-select diff --git a/ui/apps/console/src/record-header-preview.tsx b/ui/apps/console/src/record-header-preview.tsx index 62fa3f1cd10..ad9c0ab423a 100644 --- a/ui/apps/console/src/record-header-preview.tsx +++ b/ui/apps/console/src/record-header-preview.tsx @@ -2,7 +2,7 @@ * DEV-ONLY record-header api-action preview (objectui#3391). * * Mounts the REAL RecordDetailView with a stub dataSource and no backend so - * the `record_header` `type:'api'` `{field}`-interpolation fix can be + * the `record_page` `type:'api'` `{field}`-interpolation fix can be * browser-verified: clicking the header action must PATCH * `/api/v1/data/os_tianshun_ehr_production_plan/plan-42` — not the literal * `{id}` (`%7Bid%7D`) the bug sent. diff --git a/ui/apps/console/src/services/approvalRequestsDataSource.decisionPage.test.tsx b/ui/apps/console/src/services/approvalRequestsDataSource.decisionPage.test.tsx index a90beab9cc8..306631d345c 100644 --- a/ui/apps/console/src/services/approvalRequestsDataSource.decisionPage.test.tsx +++ b/ui/apps/console/src/services/approvalRequestsDataSource.decisionPage.test.tsx @@ -124,12 +124,12 @@ const REQUEST_DEF = { { name: 'approval_approve', label: 'Approve', type: 'api', method: 'POST', target: '/api/v1/approvals/requests/{id}/approve', params: DECISION_PARAMS, - visible: DECIDE, locations: ['record_section', 'list_item'], refreshAfter: true, + visible: DECIDE, locations: ['record_section', 'record_row'], refreshAfter: true, }, { name: 'approval_reject', label: 'Reject', type: 'api', method: 'POST', target: '/api/v1/approvals/requests/{id}/reject', params: DECISION_PARAMS, - visible: DECIDE, locations: ['record_section', 'list_item'], refreshAfter: true, + visible: DECIDE, locations: ['record_section', 'record_row'], refreshAfter: true, }, { // The submitter's own control on a pending request: drawn by the same bar, diff --git a/ui/apps/console/src/services/approvalRequestsDataSource.recordPagePayload-28546.test.tsx b/ui/apps/console/src/services/approvalRequestsDataSource.recordPagePayload-28546.test.tsx index 2714bd696a8..7a59fa3df8f 100644 --- a/ui/apps/console/src/services/approvalRequestsDataSource.recordPagePayload-28546.test.tsx +++ b/ui/apps/console/src/services/approvalRequestsDataSource.recordPagePayload-28546.test.tsx @@ -149,12 +149,12 @@ const REQUEST_DEF = { { name: 'approval_approve', label: 'Approve', type: 'api', method: 'POST', target: '/api/v1/approvals/requests/{id}/approve', params: DECISION_PARAMS, - visible: CAN_ACT, locations: ['record_section', 'list_item'], refreshAfter: true, + visible: CAN_ACT, locations: ['record_section', 'record_row'], refreshAfter: true, }, { name: 'approval_reject', label: 'Reject', type: 'api', method: 'POST', target: '/api/v1/approvals/requests/{id}/reject', params: DECISION_PARAMS, - visible: CAN_ACT, locations: ['record_section', 'list_item'], refreshAfter: true, + visible: CAN_ACT, locations: ['record_section', 'record_row'], refreshAfter: true, }, ], enable: { apiMethods: ['get', 'list'] }, diff --git a/ui/apps/console/src/services/approvalRequestsDataSource.servedPage.test.tsx b/ui/apps/console/src/services/approvalRequestsDataSource.servedPage.test.tsx index eed2d286611..2b897661278 100644 --- a/ui/apps/console/src/services/approvalRequestsDataSource.servedPage.test.tsx +++ b/ui/apps/console/src/services/approvalRequestsDataSource.servedPage.test.tsx @@ -109,12 +109,12 @@ const REQUEST_DEF = { { name: 'approval_approve', label: 'Approve', type: 'api', method: 'POST', target: '/api/v1/approvals/requests/{id}/approve', params: DECISION_PARAMS, - visible: CAN_ACT, locations: ['record_section', 'list_item'], refreshAfter: true, + visible: CAN_ACT, locations: ['record_section', 'record_row'], refreshAfter: true, }, { name: 'approval_reject', label: 'Reject', type: 'api', method: 'POST', target: '/api/v1/approvals/requests/{id}/reject', params: DECISION_PARAMS, - visible: CAN_ACT, locations: ['record_section', 'list_item'], refreshAfter: true, + visible: CAN_ACT, locations: ['record_section', 'record_row'], refreshAfter: true, }, ], enable: { apiMethods: ['get', 'list'] }, diff --git a/ui/apps/console/src/services/approvalRequestsDataSource.servedPageApprovers-12482.test.tsx b/ui/apps/console/src/services/approvalRequestsDataSource.servedPageApprovers-12482.test.tsx index 2fe3328d60a..4195e760fad 100644 --- a/ui/apps/console/src/services/approvalRequestsDataSource.servedPageApprovers-12482.test.tsx +++ b/ui/apps/console/src/services/approvalRequestsDataSource.servedPageApprovers-12482.test.tsx @@ -137,12 +137,12 @@ const REQUEST_DEF = { { name: 'approval_approve', label: 'Approve', type: 'api', method: 'POST', target: '/api/v1/approvals/requests/{id}/approve', params: DECISION_PARAMS, - visible: CAN_ACT, locations: ['record_section', 'list_item'], refreshAfter: true, + visible: CAN_ACT, locations: ['record_section', 'record_row'], refreshAfter: true, }, { name: 'approval_reject', label: 'Reject', type: 'api', method: 'POST', target: '/api/v1/approvals/requests/{id}/reject', params: DECISION_PARAMS, - visible: CAN_ACT, locations: ['record_section', 'list_item'], refreshAfter: true, + visible: CAN_ACT, locations: ['record_section', 'record_row'], refreshAfter: true, }, ], enable: { apiMethods: ['get', 'list'] }, diff --git a/ui/apps/console/src/services/approvalRequestsDataSource.servedPageMemberPermissions-13324.test.tsx b/ui/apps/console/src/services/approvalRequestsDataSource.servedPageMemberPermissions-13324.test.tsx index 90cb2a73314..5cc0c44beb1 100644 --- a/ui/apps/console/src/services/approvalRequestsDataSource.servedPageMemberPermissions-13324.test.tsx +++ b/ui/apps/console/src/services/approvalRequestsDataSource.servedPageMemberPermissions-13324.test.tsx @@ -103,12 +103,12 @@ const REQUEST_DEF = { { name: 'approval_approve', label: 'Approve', type: 'api', method: 'POST', target: '/api/v1/approvals/requests/{id}/approve', params: DECISION_PARAMS, - visible: CAN_ACT, locations: ['record_section', 'list_item'], refreshAfter: true, + visible: CAN_ACT, locations: ['record_section', 'record_row'], refreshAfter: true, }, { name: 'approval_reject', label: 'Reject', type: 'api', method: 'POST', target: '/api/v1/approvals/requests/{id}/reject', params: DECISION_PARAMS, - visible: CAN_ACT, locations: ['record_section', 'list_item'], refreshAfter: true, + visible: CAN_ACT, locations: ['record_section', 'record_row'], refreshAfter: true, }, ], enable: { apiMethods: ['get', 'list'] }, diff --git a/ui/apps/console/src/services/approvalRequestsDataSource.servedPageStepLine-12491.test.tsx b/ui/apps/console/src/services/approvalRequestsDataSource.servedPageStepLine-12491.test.tsx index 2f3dbd965cb..efee5e77618 100644 --- a/ui/apps/console/src/services/approvalRequestsDataSource.servedPageStepLine-12491.test.tsx +++ b/ui/apps/console/src/services/approvalRequestsDataSource.servedPageStepLine-12491.test.tsx @@ -153,7 +153,7 @@ const REQUEST_DEF = { { name: 'approval_approve', label: 'Approve', type: 'api', method: 'POST', target: '/api/v1/approvals/requests/{id}/approve', params: DECISION_PARAMS, - visible: CAN_ACT, locations: ['record_section', 'list_item'], refreshAfter: true, + visible: CAN_ACT, locations: ['record_section', 'record_row'], refreshAfter: true, }, ], enable: { apiMethods: ['get', 'list'] }, diff --git a/ui/apps/console/src/services/approvalRequestsDataSource.servedPageSummary-12483.test.tsx b/ui/apps/console/src/services/approvalRequestsDataSource.servedPageSummary-12483.test.tsx index 37e76b2aedd..c106557edf3 100644 --- a/ui/apps/console/src/services/approvalRequestsDataSource.servedPageSummary-12483.test.tsx +++ b/ui/apps/console/src/services/approvalRequestsDataSource.servedPageSummary-12483.test.tsx @@ -156,12 +156,12 @@ const REQUEST_DEF = { { name: 'approval_approve', label: 'Approve', type: 'api', method: 'POST', target: '/api/v1/approvals/requests/{id}/approve', params: DECISION_PARAMS, - visible: CAN_ACT, locations: ['record_section', 'list_item'], refreshAfter: true, + visible: CAN_ACT, locations: ['record_section', 'record_row'], refreshAfter: true, }, { name: 'approval_reject', label: 'Reject', type: 'api', method: 'POST', target: '/api/v1/approvals/requests/{id}/reject', params: DECISION_PARAMS, - visible: CAN_ACT, locations: ['record_section', 'list_item'], refreshAfter: true, + visible: CAN_ACT, locations: ['record_section', 'record_row'], refreshAfter: true, }, ], enable: { apiMethods: ['get', 'list'] }, diff --git a/ui/apps/console/src/services/approvalRequestsDataSource.servedPageSummaryAmount-12534.test.tsx b/ui/apps/console/src/services/approvalRequestsDataSource.servedPageSummaryAmount-12534.test.tsx index 0ea80933c08..5fd4fe639ff 100644 --- a/ui/apps/console/src/services/approvalRequestsDataSource.servedPageSummaryAmount-12534.test.tsx +++ b/ui/apps/console/src/services/approvalRequestsDataSource.servedPageSummaryAmount-12534.test.tsx @@ -200,7 +200,7 @@ const REQUEST_DEF = { { name: 'approval_approve', label: 'Approve', type: 'api', method: 'POST', target: '/api/v1/approvals/requests/{id}/approve', - visible: CAN_ACT, locations: ['record_section', 'list_item'], refreshAfter: true, + visible: CAN_ACT, locations: ['record_section', 'record_row'], refreshAfter: true, }, ], enable: { apiMethods: ['get', 'list'] }, diff --git a/ui/e2e/list-header-narrow-35446.spec.ts b/ui/e2e/list-header-narrow-35446.spec.ts index 2628e2d27c7..4a77fb9f23a 100644 --- a/ui/e2e/list-header-narrow-35446.spec.ts +++ b/ui/e2e/list-header-narrow-35446.spec.ts @@ -128,7 +128,7 @@ const TEXT = { }; const t = (key, opts) => TEXT[key] ?? (opts && opts.defaultValue) ?? key; const objectDef = { name: 'opportunity', label: 'Opportunity', pluralLabel: 'Opportunities', icon: 'briefcase', description: ${JSON.stringify(DESCRIPTION)} }; -const toolbarBar = { type: 'action:bar', location: 'list_toolbar', actions: [], maxVisible: 3, mobileMaxVisible: 0 }; +const toolbarBar = { type: 'action:bar', location: 'list', actions: [], maxVisible: 3, mobileMaxVisible: 0 }; const listFavorite = { isFavorite: false, toggle: () => {} }; const VIEW_LABEL = ${JSON.stringify(VIEW_LABEL)}; diff --git a/ui/e2e/list-no-actions-column-35554.spec.ts b/ui/e2e/list-no-actions-column-35554.spec.ts index 494f0f16c13..2075aed0871 100644 --- a/ui/e2e/list-no-actions-column-35554.spec.ts +++ b/ui/e2e/list-no-actions-column-35554.spec.ts @@ -180,9 +180,9 @@ const dataSource = { }; const record = (name) => async () => { window.__dispatched.push(name); return { success: true }; }; const rowActionDefs = [ - { name: 'submit_approval', label: '提交审批', locations: ['list_item'] }, - { name: 'make_quote', label: '生成报价单', locations: ['list_item'] }, - { name: 'clone_opportunity', label: '复制', locations: ['list_item'] }, + { name: 'submit_approval', label: '提交审批', locations: ['record_row'] }, + { name: 'make_quote', label: '生成报价单', locations: ['record_row'] }, + { name: 'clone_opportunity', label: '复制', locations: ['record_row'] }, ]; const bulkActionDefs = [ { name: 'mass_update', label: '批量更新' }, @@ -233,7 +233,7 @@ function Header() { actions: { create: () => {} }, t, listActions: [], toolbarActionsWithDeepLink: [], identityImportEnabled: false, objectCanImport: false, importVisible: false, importDisabled: false, setShowImport: () => {}, listFavorite: null, isEnvironmentList: false, - toolbarBar: { type: 'action:bar', location: 'list_toolbar', actions: [], maxVisible: 3, mobileMaxVisible: 0 }, + toolbarBar: { type: 'action:bar', location: 'list', actions: [], maxVisible: 3, mobileMaxVisible: 0 }, viewAccess: { refusal: null }, createLabel: '新建商机', }); return h(ObjectViewPageHeader, { @@ -249,7 +249,7 @@ function Header() { isEnvironmentList: false, headerToolbarActions: [], environmentEntitlements: undefined, - toolbarBar: { type: 'action:bar', location: 'list_toolbar', actions: [], maxVisible: 3, mobileMaxVisible: 0 }, + toolbarBar: { type: 'action:bar', location: 'list', actions: [], maxVisible: 3, mobileMaxVisible: 0 }, listFavorite: null, foldedHeaderActions: chrome.foldedHeaderActions, }); diff --git a/ui/e2e/live/record-topbar-35853.spec.ts b/ui/e2e/live/record-topbar-35853.spec.ts index 1352790bac1..096cd50ba2b 100644 --- a/ui/e2e/live/record-topbar-35853.spec.ts +++ b/ui/e2e/live/record-topbar-35853.spec.ts @@ -13,7 +13,7 @@ import { test, expect, type Locator, type Page } from '@playwright/test'; * 12 px). On a phone the bar is the one-row phone bar. * * Drives the real Console against the real showcase backend. The task record - * page (`showcase_task_detail`) authors three `record_header` actions; the + * page (`showcase_task_detail`) authors three `record_page` actions; the * account page is synthesized, with a tab row. */ @@ -107,7 +107,7 @@ test.describe('record header at 1280 px', () => { }); test('the header shows three authored actions by default, on one line', async ({ page }) => { - // The task page authors Mark Done, Log Time and Archive as record_header + // The task page authors Mark Done, Log Time and Archive as record_page // actions (Mark Done hides on a finished task), plus the host's Edit. await openFromList(page, 'showcase_task', 2); const record = page.locator(BAR).locator(RECORD); @@ -116,7 +116,7 @@ test.describe('record header at 1280 px', () => { await expect(actions.getByRole('button', { name: 'Log Time' })).toBeVisible(); await expect(actions.getByRole('button', { name: 'Archive' })).toBeVisible(); await expect(actions.getByRole('button', { name: 'Edit' })).toBeVisible(); - // The authored actions beyond three, and record_more, are under ⋯. + // The authored actions beyond three, and the folded ones (component: 'action:menu'), are under ⋯. await expect(actions.getByRole('button', { name: /more/i })).toBeVisible(); expect(await actionsOnOneLine(record)).toBe(true); }); diff --git a/ui/e2e/record-header-title-width.spec.ts b/ui/e2e/record-header-title-width.spec.ts index f729467fea7..2c9db08355a 100644 --- a/ui/e2e/record-header-title-width.spec.ts +++ b/ui/e2e/record-header-title-width.spec.ts @@ -35,7 +35,7 @@ import { uiRoot } from '../scripts/ui-root.mjs'; * * ## Calibration against the running app (Chromium, console dev server, * `type: 'detail'` and ``, three labelled - * `record_header` actions, viewport 799px, objectui#7281): + * `record_page` actions, viewport 799px, objectui#7281): * * DetailView before: h1 6.17px of a 218px scrollWidth, tail 724.83px * after: h1 218.39px, tail wrapped to its own line @@ -151,7 +151,7 @@ const ICON_BUTTON = 'h-10 w-10 shrink-0'; * arbitrate at all. * * So these two match what the running app actually produced with three - * labelled `record_header` actions at 799px (DetailView 724.83px, + * labelled `record_page` actions at 799px (DetailView 724.83px, * PageHeader 564.41px), not a width chosen to make a floor look needed: * DetailView 4 x 176px + 3 x 6px (`gap-1.5`) = 722px * PageHeader 3 x 192px + 2 x 8px (`gap-2`) = 592px diff --git a/ui/e2e/toast-under-modal.spec.ts b/ui/e2e/toast-under-modal.spec.ts index 39e50c79862..190850e575a 100644 --- a/ui/e2e/toast-under-modal.spec.ts +++ b/ui/e2e/toast-under-modal.spec.ts @@ -60,7 +60,7 @@ import { uiRoot } from '../scripts/ui-root.mjs'; * nothing. The components' `lib/utils` imports it for its slot helpers, * which the drawer does not call. * - The overlay's content is a stand-in for `RecordDetailView`: the record - * title and two `record_header` actions in its first row, then filler. + * title and two `record_page` actions in its first row, then filler. * Every control in it logs its clicks, so a click that falls through a toast * onto the record is caught. * - Toasts are raised by calling sonner's `toast.success` with an `Undo` @@ -139,7 +139,7 @@ let openOverlay = () => {}; const button = (label, what) => h('button', { type: 'button', className: 'h-9 px-4 rounded-md border', onClick: record(what) }, label); -/** RecordDetailView's first row (title, record_header actions), then filler. */ +/** RecordDetailView's first row (title, record_page actions), then filler. */ function RecordContent() { return h('div', { onClick: record('record') }, h('div', { className: 'flex items-center justify-between gap-4 px-6 py-4 border-b' }, diff --git a/ui/packages/app-shell/src/__tests__/ListView.gridRowColorSelect-12393.test.tsx b/ui/packages/app-shell/src/__tests__/ListView.gridRowColorSelect-12393.test.tsx index a2729d5d302..454f5b8715b 100644 --- a/ui/packages/app-shell/src/__tests__/ListView.gridRowColorSelect-12393.test.tsx +++ b/ui/packages/app-shell/src/__tests__/ListView.gridRowColorSelect-12393.test.tsx @@ -113,7 +113,7 @@ const objectDef = { stage: { name: 'stage', type: 'text', label: 'Stage' }, due_date: { name: 'due_date', type: 'date', label: 'Due' }, }, - actions: [{ name: 'approve', label: 'Approve', locations: ['list_item'], visible: "record.approver == 'u1'" }], + actions: [{ name: 'approve', label: 'Approve', locations: ['record_row'], visible: "record.approver == 'u1'" }], userActions: { edit: { visibleWhen: 'record.locked != true' } }, }; diff --git a/ui/packages/app-shell/src/environment/EnvironmentListToolbar.tsx b/ui/packages/app-shell/src/environment/EnvironmentListToolbar.tsx index 59344815865..ec5e557ba39 100644 --- a/ui/packages/app-shell/src/environment/EnvironmentListToolbar.tsx +++ b/ui/packages/app-shell/src/environment/EnvironmentListToolbar.tsx @@ -1,6 +1,6 @@ /** * EnvironmentListToolbar — the state-aware replacement for the generic - * `list_toolbar` action bar on the `sys_environment` list. + * `list` action bar on the `sys_environment` list. * * The cloud serves ONE `create_environment` action; born-with-env makes its * meaning depend on org state (which the action metadata can't express). This @@ -118,7 +118,7 @@ function OtherActionsBar({ actions }: { actions: any[] }) { // Typed as the `action:bar` node it is (objectui#11355), not as the // `BaseSchema` the `schema` prop accepts: a key `ActionBarSchema` does not // declare is refused here. - const bar: ActionBarSchema = { type: 'action:bar', location: 'list_toolbar', actions, size: 'sm', variant: 'outline' }; + const bar: ActionBarSchema = { type: 'action:bar', location: 'list', actions, size: 'sm', variant: 'outline' }; return ; } @@ -150,7 +150,7 @@ export function EnvironmentListToolbar({ actions, entitlements }: Props) { // so a create action the caller may not invoke was counted here and dropped // there. const toolbarActions = (actions || []).filter( - (a: any) => actionRendersAt(a, 'list_toolbar') && mayInvoke(a?.requiredPermissions), + (a: any) => actionRendersAt(a, 'list') && mayInvoke(a?.requiredPermissions), ); const hasCreateAction = toolbarActions.some((a: any) => a?.name === CREATE_ACTION); const ctaKind = entitlements?.ready ? decideEnvironmentCta(entitlements) : null; @@ -213,7 +213,7 @@ export function EnvironmentListToolbar({ actions, entitlements }: Props) { // Typed as the `action:bar` node it is (objectui#11355); see `OtherActionsBar`. const bar: ActionBarSchema = { type: 'action:bar', - location: 'list_toolbar', + location: 'list', actions: renderedActions, size: 'sm', variant: 'outline', diff --git a/ui/packages/app-shell/src/environment/__tests__/EnvironmentListToolbar.deepLinkArming.test.tsx b/ui/packages/app-shell/src/environment/__tests__/EnvironmentListToolbar.deepLinkArming.test.tsx index 822dc21667a..0456764c8df 100644 --- a/ui/packages/app-shell/src/environment/__tests__/EnvironmentListToolbar.deepLinkArming.test.tsx +++ b/ui/packages/app-shell/src/environment/__tests__/EnvironmentListToolbar.deepLinkArming.test.tsx @@ -43,14 +43,14 @@ const CREATE = { label: 'Create Environment', type: 'api', variant: 'primary', - locations: ['list_toolbar'], + locations: ['list'], }; /** A perfectly ordinary second toolbar action — the one the old predicate counted. */ const REFRESH = { name: 'refresh_environments', label: 'Refresh', type: 'api', - locations: ['list_toolbar'], + locations: ['list'], }; const st = (o: Partial): EnvironmentEntitlementsState => diff --git a/ui/packages/app-shell/src/environment/__tests__/EnvironmentListToolbar.deepLinkOverflow.test.tsx b/ui/packages/app-shell/src/environment/__tests__/EnvironmentListToolbar.deepLinkOverflow.test.tsx index 345d0f498ed..e30f8796e12 100644 --- a/ui/packages/app-shell/src/environment/__tests__/EnvironmentListToolbar.deepLinkOverflow.test.tsx +++ b/ui/packages/app-shell/src/environment/__tests__/EnvironmentListToolbar.deepLinkOverflow.test.tsx @@ -61,12 +61,12 @@ const CREATE = { name: 'create_environment', label: 'Create Environment', type: 'api', - locations: ['list_toolbar'], + locations: ['list'], }; const FILLERS = [ - { name: 'a1', label: 'a1', type: 'api', order: -1, locations: ['list_toolbar'] }, - { name: 'a2', label: 'a2', type: 'api', order: -1, locations: ['list_toolbar'] }, - { name: 'a3', label: 'a3', type: 'api', order: -1, locations: ['list_toolbar'] }, + { name: 'a1', label: 'a1', type: 'api', order: -1, locations: ['list'] }, + { name: 'a2', label: 'a2', type: 'api', order: -1, locations: ['list'] }, + { name: 'a3', label: 'a3', type: 'api', order: -1, locations: ['list'] }, ]; /** ready + no production env yet → `setup_production`. */ diff --git a/ui/packages/app-shell/src/environment/__tests__/EnvironmentListToolbar.test.tsx b/ui/packages/app-shell/src/environment/__tests__/EnvironmentListToolbar.test.tsx index 1034157cac6..6973e097a06 100644 --- a/ui/packages/app-shell/src/environment/__tests__/EnvironmentListToolbar.test.tsx +++ b/ui/packages/app-shell/src/environment/__tests__/EnvironmentListToolbar.test.tsx @@ -43,7 +43,7 @@ const renderToolbar = (ui: React.ReactElement) => const CREATE = { name: 'create_environment', label: 'Create Environment', - type: 'api', variant: 'primary', locations: ['list_toolbar'], + type: 'api', variant: 'primary', locations: ['list'], }; const st = (o: Partial): EnvironmentEntitlementsState => ({ ready: true, hasProductionEnv: true, upgradeUrl: '/settings/billing', source: 'summary', ...o }); @@ -57,7 +57,7 @@ const UNRESOLVED: EnvironmentEntitlementsState = { ready: false, hasProductionEnv: false, source: 'unknown', }; -const REFRESH = { name: 'refresh_all', label: 'Refresh', type: 'api', locations: ['list_toolbar'] }; +const REFRESH = { name: 'refresh_all', label: 'Refresh', type: 'api', locations: ['list'] }; describe('EnvironmentListToolbar', () => { it('no production env → "Set up your production environment" (primary)', () => { @@ -166,7 +166,7 @@ describe('EnvironmentListToolbar — loading state (objectui#3482)', () => { }); it('non-create toolbar actions still render while resolving (they never re-label)', () => { - const REFRESH = { name: 'refresh_all', label: 'Refresh', type: 'api', locations: ['list_toolbar'] }; + const REFRESH = { name: 'refresh_all', label: 'Refresh', type: 'api', locations: ['list'] }; renderToolbar( , ); @@ -176,7 +176,7 @@ describe('EnvironmentListToolbar — loading state (objectui#3482)', () => { }); it('no create action in the toolbar → nothing can jump, so no skeleton', () => { - const REFRESH = { name: 'refresh_all', label: 'Refresh', type: 'api', locations: ['list_toolbar'] }; + const REFRESH = { name: 'refresh_all', label: 'Refresh', type: 'api', locations: ['list'] }; renderToolbar(); expect(screen.getByText('Refresh')).toBeTruthy(); expect(screen.queryByTestId(CREATE_LOADING)).toBeNull(); diff --git a/ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.apiNewTabUrl-26747.test.tsx b/ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.apiNewTabUrl-26747.test.tsx index 5b6e628ae0e..6420404abe3 100644 --- a/ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.apiNewTabUrl-26747.test.tsx +++ b/ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.apiNewTabUrl-26747.test.tsx @@ -79,7 +79,7 @@ const NEW_TAB_ACTION = { target: TARGET, opensInNewTab: true, newTabUrl: '/export/{recordId}', - locations: ['list_toolbar'], + locations: ['list'], }; function stubWindowOpen() { diff --git a/ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.flowActionDoor-12037.test.tsx b/ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.flowActionDoor-12037.test.tsx index 49d90305603..f82353bab43 100644 --- a/ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.flowActionDoor-12037.test.tsx +++ b/ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.flowActionDoor-12037.test.tsx @@ -58,7 +58,7 @@ const DECLARED = { label: 'Reassign…', type: 'flow', target: FLOW, - locations: ['list_item', 'list_toolbar'], + locations: ['record_row', 'list'], requiredPermissions: ['showcase.reassign'], }; const OBJECTS = [{ name: OBJECT, label: 'Task', fields: {}, actions: [DECLARED] }]; diff --git a/ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.flowRowGuard-13397.test.tsx b/ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.flowRowGuard-13397.test.tsx index 75b53fd1700..73c8d40aaaf 100644 --- a/ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.flowRowGuard-13397.test.tsx +++ b/ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.flowRowGuard-13397.test.tsx @@ -95,7 +95,7 @@ const REASSIGN = { type: 'flow', name: 'reassign', target: 'reassign_wizard', - locations: ['list_item', 'list_toolbar'], + locations: ['record_row', 'list'], params: [{ name: 'owner', label: 'Owner', type: 'text', required: true }], }; const launch = (extra: Record = {}): ActionDef => ({ ...JSON.parse(JSON.stringify(REASSIGN)), ...extra }); @@ -128,7 +128,7 @@ describe('flowHandler.refuseBeforeInput — the resolver its dispatch runs (obje it('control: an object-level toolbar flow with 0 rows is not refused', () => { expect(runtime().flowHandler.refuseBeforeInput?.( - launch({ locations: ['list_toolbar'] }), + launch({ locations: ['list'] }), rowsContext([]), )).toBeUndefined(); }); @@ -184,7 +184,7 @@ describe('a toolbar flow launch through the console runtime (objectui#13397)', ( }); it('control: an object-level toolbar flow with 0 rows still opens its dialog', async () => { - mount([], launch({ locations: ['list_toolbar'] })); + mount([], launch({ locations: ['list'] })); await screen.findByTestId('param-dialog'); expect(toastError).not.toHaveBeenCalled(); diff --git a/ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.test.tsx b/ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.test.tsx index f0894f94ec1..612014c175d 100644 --- a/ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.test.tsx +++ b/ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.test.tsx @@ -627,8 +627,8 @@ describe('modalActionHandler — a modal action is CLIENT-SIDE ONLY (objectstack }); }); -describe('flowHandler — list_toolbar selection fallback', () => { - // Toolbar-invoked flow actions carry no `_rowRecord` (that's a list_item / +describe('flowHandler — list selection fallback', () => { + // Toolbar-invoked flow actions carry no `_rowRecord` (that's a record_row / // row-menu concept). The grid publishes its checkbox selection into the // shared ActionRunner context as `selectedRecords`; with exactly one row // selected the flow must receive that row's id as recordId, otherwise a @@ -673,7 +673,7 @@ describe('flowHandler — list_toolbar selection fallback', () => { expect(authFetchSpy).not.toHaveBeenCalled(); }); - it('blocks a record-scoped flow (locations include list_item) launched with zero rows selected (#2210)', async () => { + it('blocks a record-scoped flow (locations include record_row) launched with zero rows selected (#2210)', async () => { // BulkReassignAction shape: mounts on rows AND the toolbar. From the // toolbar with nothing selected there is no record to run on — pre-fix // the wizard opened anyway and died at the first record-bound node @@ -687,7 +687,7 @@ describe('flowHandler — list_toolbar selection fallback', () => { res = await result.current.flowHandler( { type: 'flow', name: 'showcase_bulk_reassign', target: 'showcase_reassign_wizard', - locations: ['list_item', 'list_toolbar'], + locations: ['record_row', 'list'], } as any, { selectedRecords: [] } as any, ); @@ -707,7 +707,7 @@ describe('flowHandler — list_toolbar selection fallback', () => { let res: any; await act(async () => { res = await result.current.flowHandler( - { type: 'flow', name: 'monthly_close', target: 'monthly_close', locations: ['list_toolbar'] } as any, + { type: 'flow', name: 'monthly_close', target: 'monthly_close', locations: ['list'] } as any, { selectedRecords: [] } as any, ); }); @@ -717,7 +717,7 @@ describe('flowHandler — list_toolbar selection fallback', () => { expect(body.recordId ?? null).toBeNull(); }); - it('an explicit _rowRecord (list_item invocation) still wins over the selection', async () => { + it('an explicit _rowRecord (record_row invocation) still wins over the selection', async () => { authFetchSpy.mockResolvedValue({ ok: true, json: async () => ({ success: true, data: {} }) }); const { result } = renderHook(() => useConsoleActionRuntime({ dataSource: {}, objects: [] }), @@ -739,8 +739,8 @@ describe('flowHandler — list_toolbar selection fallback', () => { // The same action shape and selection reach both handlers here, and each // answer must be the rule's own. it.each([ - ['several rows', { locations: ['list_toolbar'] }, [{ id: 'a' }, { id: 'b' }]], - ['zero rows on a record-scoped action', { locations: ['list_item', 'list_toolbar'] }, []], + ['several rows', { locations: ['list'] }, [{ id: 'a' }, { id: 'b' }]], + ['zero rows on a record-scoped action', { locations: ['record_row', 'list'] }, []], ])('refuses %s with the same answer as the script launcher (objectui#12331)', async (_label, shape, rows) => { const { result } = renderHook(() => useConsoleActionRuntime({ dataSource: {}, objects: [], objectName: 'inv' }), @@ -778,7 +778,7 @@ describe('flowHandler — list_toolbar selection fallback', () => { res = await result.current.flowHandler( { type: 'flow', name: 'bulk_close', target: 'bulk_close_flow', - locations: ['list_item', 'list_toolbar'], + locations: ['record_row', 'list'], params: { _selectedIds: ['a', 'b'] }, } as any, { selectedRecords: [{ id: 'a' }, { id: 'b' }] } as any, @@ -1077,7 +1077,7 @@ describe('apiHandler — recordIdParam seeding refuses instead of under-specifyi }); }); -describe('serverActionHandler — list_toolbar selection fallback', () => { +describe('serverActionHandler — list selection fallback', () => { it('uses the single selected row from the runner context as recordId', async () => { authFetchSpy.mockResolvedValue({ ok: true, json: async () => ({ success: true, data: {} }) }); const { result } = renderHook(() => @@ -1140,7 +1140,7 @@ describe('serverActionHandler — list_toolbar selection fallback', () => { let res: any; await act(async () => { res = await result.current.serverActionHandler( - { type: 'script', name: 'archive', locations: ['list_item', 'list_toolbar'] } as any, + { type: 'script', name: 'archive', locations: ['record_row', 'list'] } as any, { selectedRecords: [] } as any, ); }); @@ -1159,7 +1159,7 @@ describe('serverActionHandler — list_toolbar selection fallback', () => { let res: any; await act(async () => { res = await result.current.serverActionHandler( - { type: 'script', name: 'export_all', locations: ['list_toolbar'] } as any, + { type: 'script', name: 'export_all', locations: ['list'] } as any, { selectedRecords: [] } as any, ); }); @@ -1180,7 +1180,7 @@ describe('serverActionHandler — list_toolbar selection fallback', () => { { type: 'script', name: 'generate_qr_zip', - locations: ['list_item', 'list_toolbar'], + locations: ['record_row', 'list'], params: { _selectedIds: ['a', 'b'], format: 'png' }, } as any, // Multi-select would block a single-record dispatch — the injected diff --git a/ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.undoLookupId-11122.test.tsx b/ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.undoLookupId-11122.test.tsx index d94d4ffa135..0f699015902 100644 --- a/ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.undoLookupId-11122.test.tsx +++ b/ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.undoLookupId-11122.test.tsx @@ -19,7 +19,7 @@ * `DeclaredActionsBar` mount): * * - a `type: 'api'` row action (the shape of objectstack's published - * `ReassignLeadAction`: undoable, on `list_item`, writing a lookup), run by + * `ReassignLeadAction`: undoable, on `record_row`, writing a lookup), run by * the runtime's own `api` handler, which looks the object's field * definitions up itself; * - an `operation: 'update'` row action, run by `ActionRunner`, which reads @@ -144,7 +144,7 @@ async function runOnGridRow(action: Record) { type: 'object-grid', objectName: OBJECT, columns: ['name', 'account'], - rowActionDefs: [{ locations: ['list_item'], successMessage: MESSAGE, ...action }], + rowActionDefs: [{ locations: ['record_row'], successMessage: MESSAGE, ...action }], } as never} dataSource={dataSource as never} /> diff --git a/ui/packages/app-shell/src/hooks/__tests__/useOfferedNavRunAction.test.tsx b/ui/packages/app-shell/src/hooks/__tests__/useOfferedNavRunAction.test.tsx index 661fdfe89d7..083fa5b5cb7 100644 --- a/ui/packages/app-shell/src/hooks/__tests__/useOfferedNavRunAction.test.tsx +++ b/ui/packages/app-shell/src/hooks/__tests__/useOfferedNavRunAction.test.tsx @@ -47,7 +47,7 @@ const CREATE = { name: 'create_account', label: 'Create Account', type: 'api', - locations: ['list_toolbar'], + locations: ['list'], }; function land(name: string | null): void { @@ -59,10 +59,10 @@ const paramNow = () => new URL(window.location.href).searchParams.get(NAV_RUN_AC /** What `ObjectView` does with the hook's answer, verbatim in shape. */ function Toolbar({ actions, enabled = true }: { actions: any[]; enabled?: boolean }) { - const armed = useOfferedNavRunAction(actions, (a: any) => actionRendersAt(a, 'list_toolbar'), enabled); + const armed = useOfferedNavRunAction(actions, (a: any) => actionRendersAt(a, 'list'), enabled); const composed = armed === null ? actions : actions.map((a) => (a?.name === armed ? { ...a, autoTrigger: true } : a)); // Typed as the `action:bar` node it is (objectui#11355), as `ObjectView` types its own. - const bar: ActionBarSchema = { type: 'action:bar', location: 'list_toolbar', actions: composed }; + const bar: ActionBarSchema = { type: 'action:bar', location: 'list', actions: composed }; return ; } @@ -144,7 +144,7 @@ describe('the deep-link preparation step honours the declared visible gate (obje it('a name this surface does not render is the old quiet case — no notice, URL untouched', async () => { land(CREATE.name); - const { run } = mount([{ ...CREATE, locations: ['record_header'], visible: false }]); + const { run } = mount([{ ...CREATE, locations: ['record_page'], visible: false }]); await flush(); expect(notice).not.toHaveBeenCalled(); expect(run).not.toHaveBeenCalled(); diff --git a/ui/packages/app-shell/src/hooks/useConsoleActionRuntime.tsx b/ui/packages/app-shell/src/hooks/useConsoleActionRuntime.tsx index 6e1a02cf701..6c4a2dc6042 100644 --- a/ui/packages/app-shell/src/hooks/useConsoleActionRuntime.tsx +++ b/ui/packages/app-shell/src/hooks/useConsoleActionRuntime.tsx @@ -634,7 +634,7 @@ export function useConsoleActionRuntime(opts: ConsoleActionRuntimeOptions): Cons // meaningful when an object context exists (ObjectView); pages without an // object resolve their actions through the absolute path above. const obj = action.objectName || objApiName; - // The row record is stashed under `_rowRecord` for list_item actions — + // The row record is stashed under `_rowRecord` for record_row actions — // separate it from the field values, and resolve the record id from it // (the action's static params carry the field changes, not the id). const rowRecord = (params as any)._rowRecord as Record | undefined; @@ -759,7 +759,7 @@ export function useConsoleActionRuntime(opts: ConsoleActionRuntimeOptions): Cons // The record a launch runs on, by the ONE selection rule the `script` // launcher uses (objectui#12331): `@object-ui/core`'s // `resolveServerActionRecordId`. An explicit `params.recordId`, then the - // list_item row (`_rowRecord`), then — for a list_toolbar launch, which + // record_row row (`_rowRecord`), then — for a list launch, which // carries no row — the grid's checkbox selection (`selectedRecords`, // published into the runner context by ObjectGrid). One row supplies the // record. Several rows are refused: a flow takes a single `recordId` diff --git a/ui/packages/app-shell/src/layout/InboxApprovalItem.tsx b/ui/packages/app-shell/src/layout/InboxApprovalItem.tsx index 5f786a23221..4de38fdbea8 100644 --- a/ui/packages/app-shell/src/layout/InboxApprovalItem.tsx +++ b/ui/packages/app-shell/src/layout/InboxApprovalItem.tsx @@ -11,7 +11,7 @@ * (objectstack#34589). * * The decision levers are NOT drawn here: they are the request's own declared - * actions at `list_item` (`approval_approve`, `approval_reject` on + * actions at `record_row` (`approval_approve`, `approval_reject` on * `sys_approval_request`), run through `DeclaredActionsBar` — the governed * path the record page and the decision panel already run them through. So * whether a viewer sees a lever is the action's own `visible` predicate over @@ -34,7 +34,7 @@ import { timeAgo } from '../utils/relativeTime.js'; const APPROVAL_REQUEST_OBJECT = 'sys_approval_request'; /** The declared location of the inline levers (approve / reject). */ -const INLINE_DECISION_LOCATION = 'list_item'; +const INLINE_DECISION_LOCATION = 'record_row'; /** The phone tap floor, as the rest of the panel spells it. */ const PHONE_TAP = 'max-md:min-h-11'; diff --git a/ui/packages/app-shell/src/layout/__tests__/DesignModeHeaderPins-36366.test.tsx b/ui/packages/app-shell/src/layout/__tests__/DesignModeHeaderPins-36366.test.tsx index dd2b878ee3b..26819682c4b 100644 --- a/ui/packages/app-shell/src/layout/__tests__/DesignModeHeaderPins-36366.test.tsx +++ b/ui/packages/app-shell/src/layout/__tests__/DesignModeHeaderPins-36366.test.tsx @@ -68,10 +68,10 @@ import { DesignModeBar } from '../DesignModeBar'; import { DesignModeHeaderPins, useObjectPins } from '../DesignModeHeaderPins'; const ACTIONS = [ - { name: 'convert', label: 'Convert', locations: ['record_header'], order: 1 }, - { name: 'mark_won', label: 'Mark won', locations: ['record_header'], order: 2 }, - { name: 'clone', label: 'Clone', locations: ['record_header'], order: 3 }, - { name: 'log_call', label: 'Log call', locations: ['record_more'], order: 4 }, + { name: 'convert', label: 'Convert', locations: ['record_page'], order: 1 }, + { name: 'mark_won', label: 'Mark won', locations: ['record_page'], order: 2 }, + { name: 'clone', label: 'Clone', locations: ['record_page'], order: 3 }, + { name: 'log_call', label: 'Log call', locations: ['record_page'], component: 'action:menu', order: 4 }, ]; function Harness({ objectDef }: { objectDef: Record }) { diff --git a/ui/packages/app-shell/src/layout/__tests__/InboxPopover.rightPanel-34589.test.tsx b/ui/packages/app-shell/src/layout/__tests__/InboxPopover.rightPanel-34589.test.tsx index da78bd23ddb..06622c39b49 100644 --- a/ui/packages/app-shell/src/layout/__tests__/InboxPopover.rightPanel-34589.test.tsx +++ b/ui/packages/app-shell/src/layout/__tests__/InboxPopover.rightPanel-34589.test.tsx @@ -9,7 +9,7 @@ * in the page beside it neither closes it nor is swallowed by it; * - "Needs your action" heads the Notifications tab, one item per pending * request, and each item's levers are the request's OWN declared actions - * (`DeclaredActionsBar` over `sys_approval_request` at `list_item`, with + * (`DeclaredActionsBar` over `sys_approval_request` at `record_row`, with * the served row as the dispatch record), not a third approvals client; * - a decision taken there drops the row and the badge at once and asks the * feed to re-read; @@ -183,12 +183,12 @@ describe('InboxPopover — pending approvals pinned on top, decided in place (ob expect(within(section).getByText('Purchase approval · PO-001')).toBeTruthy(); }); - it("runs each request's own declared actions at list_item, with the served row as the dispatch record", () => { + it("runs each request's own declared actions at record_row, with the served row as the dispatch record", () => { render(bell()); openInbox(); expect(barProps).toHaveLength(2); expect(barProps.map((p) => p.objectName)).toEqual(['sys_approval_request', 'sys_approval_request']); - expect(barProps.map((p) => p.location)).toEqual(['list_item', 'list_item']); + expect(barProps.map((p) => p.location)).toEqual(['record_row', 'record_row']); // the row carrying the server-computed `viewer` block the actions gate on expect(barProps[0].record).toBe(approvals[0].row); expect(barProps[1].record).toBe(approvals[1].row); diff --git a/ui/packages/app-shell/src/layout/__tests__/designModeHeaderPinsModel-36366.test.ts b/ui/packages/app-shell/src/layout/__tests__/designModeHeaderPinsModel-36366.test.ts index c1f804cf6cf..e969b4c98c6 100644 --- a/ui/packages/app-shell/src/layout/__tests__/designModeHeaderPinsModel-36366.test.ts +++ b/ui/packages/app-shell/src/layout/__tests__/designModeHeaderPinsModel-36366.test.ts @@ -24,14 +24,14 @@ import { } from '../designModeHeaderPinsModel'; const ACTIONS = [ - { name: 'log_call', label: 'Log call', locations: ['record_more'] }, - { name: 'mark_won', label: 'Mark won', locations: ['record_header'], order: 2 }, - { name: 'convert', label: 'Convert', locations: ['record_header'], order: 1 }, - { name: 'clone', label: 'Clone', locations: ['record_header'], order: 3 }, - { name: 'share', label: 'Share', locations: ['record_header'], order: 4 }, - { name: 'archive', label: 'Archive', locations: ['record_header'], component: 'action:menu' }, - { name: 'mass_assign', label: 'Assign', locations: ['list_toolbar'] }, - { name: 'new_task', label: 'New task', locations: ['list_toolbar'], variant: 'primary' }, + { name: 'log_call', label: 'Log call', locations: ['record_page'], component: 'action:menu' }, + { name: 'mark_won', label: 'Mark won', locations: ['record_page'], order: 2 }, + { name: 'convert', label: 'Convert', locations: ['record_page'], order: 1 }, + { name: 'clone', label: 'Clone', locations: ['record_page'], order: 3 }, + { name: 'share', label: 'Share', locations: ['record_page'], order: 4 }, + { name: 'archive', label: 'Archive', locations: ['record_page'], component: 'action:menu' }, + { name: 'mass_assign', label: 'Assign', locations: ['list'] }, + { name: 'new_task', label: 'New task', locations: ['list'], variant: 'primary' }, ]; const TEXTS = { unknown: (n: string) => `unknown ${n}`, notPlaced: (n: string) => `not placed ${n}` }; @@ -54,7 +54,7 @@ describe('the header pins under the design mode (objectstack#36366)', () => { expect(servedPins({ actionLayout: { record: ['convert'], list: { more: ['x'] } } })).toEqual({}); }); - it("with no arm set the panel shows the header's own first three: by order, record_header only, never an action:menu", () => { + it("with no arm set the panel shows the header's own first three: by order, record_page only, never an action:menu", () => { expect(defaultPins(ACTIONS, 'record')).toEqual(['convert', 'mark_won', 'clone']); expect(defaultPins(ACTIONS, 'list')).toEqual(['new_task', 'mass_assign']); const candidates = pinCandidates(ACTIONS, 'record', []); diff --git a/ui/packages/app-shell/src/layout/__tests__/designModeHeaderPinsSave-36366.test.ts b/ui/packages/app-shell/src/layout/__tests__/designModeHeaderPinsSave-36366.test.ts index 55ea50bf5c6..af49833ea44 100644 --- a/ui/packages/app-shell/src/layout/__tests__/designModeHeaderPinsSave-36366.test.ts +++ b/ui/packages/app-shell/src/layout/__tests__/designModeHeaderPinsSave-36366.test.ts @@ -34,9 +34,9 @@ const SERVED = { label: 'Lead', _packageId: 'com.acme.crm', actions: [ - { name: 'convert', locations: ['record_header'] }, - { name: 'log_call', locations: ['record_more'] }, - { name: 'mass_assign', locations: ['list_toolbar'] }, + { name: 'convert', locations: ['record_page'] }, + { name: 'log_call', locations: ['record_page'], component: 'action:menu' }, + { name: 'mass_assign', locations: ['list'] }, ], }; @@ -89,7 +89,7 @@ beforeEach(() => emitMetadataRefresh.mockReset()); describe('saving the header pins (objectstack#36366)', () => { it('a writable package: the object as its author wrote it, with the new pins, saved as a draft and published', async () => { - const authored = { name: 'crm_lead', label: 'Lead', actions: [{ name: 'convert', locations: ['record_header'] }] }; + const authored = { name: 'crm_lead', label: 'Lead', actions: [{ name: 'convert', locations: ['record_page'] }] }; const { d, calls } = doors({ writable: true, layers: { code: authored } }); await saveObjectPins(input({ record: { pinned: ['log_call', 'convert'] } }), TEXTS, d); expect(calls).toEqual([ @@ -237,7 +237,7 @@ describe('saving the header pins (objectstack#36366)', () => { }); describe('the header pins Save publishes only the draft it wrote (objectstack#37440)', () => { - const authored = { name: 'crm_lead', label: 'Lead', actions: [{ name: 'convert', locations: ['record_header'] }] }; + const authored = { name: 'crm_lead', label: 'Lead', actions: [{ name: 'convert', locations: ['record_page'] }] }; function doorDoors() { const door = draftPublishDoor(); door.seedLive('object', 'crm_lead', 'com.acme.crm', authored); diff --git a/ui/packages/app-shell/src/layout/designModeHeaderPinsModel.ts b/ui/packages/app-shell/src/layout/designModeHeaderPinsModel.ts index 5b16ed6579d..90b201665f0 100644 --- a/ui/packages/app-shell/src/layout/designModeHeaderPinsModel.ts +++ b/ui/packages/app-shell/src/layout/designModeHeaderPinsModel.ts @@ -65,9 +65,10 @@ type PinnableAction = { }; /** The locations whose actions a scope's header places. */ -const PAGE_LOCATIONS: Readonly> = { - list: ['list_toolbar'], - record: ['record_header', 'record_more'], +const PAGE_LOCATIONS: Readonly> = { + list: ['list'], + // `actionRendersAt` draws a `record` action at `record_page` too. + record: ['record_page'], }; /** Whether `action` is placed in `page`'s scope. */ @@ -97,16 +98,15 @@ function headerSort(actions: readonly T[]): T[] { /** * What the header draws as buttons while the object sets no arm for `page`: * the first three of its row's actions by the header's own sort. On the record - * page the row's actions are those placed at `record_header` (one placed at - * `record_more` only is in ⋯ already); an action authored into ⋯ - * (`component: 'action:menu'`) is never a button. + * page the row's actions are those placed on it (`record` / `record_page`); + * an action folded into ⋯ (`component: 'action:menu'`) is never a button. */ export function defaultPins(actions: readonly PinnableAction[], page: PinPage): string[] { const row = actions.filter( (a) => typeof a.name === 'string' && a.component !== 'action:menu' && - (page === 'list' ? actionRendersAt(a as never, 'list_toolbar') : actionRendersAt(a as never, 'record_header')), + (page === 'list' ? actionRendersAt(a as never, 'list') : actionRendersAt(a as never, 'record_page')), ); return headerSort(row) .slice(0, PIN_LIMIT) diff --git a/ui/packages/app-shell/src/providers/__tests__/currentUserCan-4421.render.test.tsx b/ui/packages/app-shell/src/providers/__tests__/currentUserCan-4421.render.test.tsx index d5bf6f05a64..759b8a524ca 100644 --- a/ui/packages/app-shell/src/providers/__tests__/currentUserCan-4421.render.test.tsx +++ b/ui/packages/app-shell/src/providers/__tests__/currentUserCan-4421.render.test.tsx @@ -172,8 +172,8 @@ const SURFACES: Record = { h(RecordQuickActionsRenderer, { schema: { actions: [ - { name, label: LABEL, type: 'script', locations: ['record_header'], visible: gate }, - { name: 'print', label: COMPANION_LABEL, type: 'script', locations: ['record_header'] }, + { name, label: LABEL, type: 'script', locations: ['record_page'], visible: gate }, + { name: 'print', label: COMPANION_LABEL, type: 'script', locations: ['record_page'] }, ], } as never, }), @@ -317,8 +317,8 @@ function header(name: string, gate: unknown) { title: 'Northwind', maxVisible: 10, actions: [ - { name, label: LABEL, type: 'api', locations: ['record_header'], disabled: gate }, - { name: 'print', label: COMPANION_LABEL, type: 'api', locations: ['record_header'] }, + { name, label: LABEL, type: 'api', locations: ['record_page'], disabled: gate }, + { name: 'print', label: COMPANION_LABEL, type: 'api', locations: ['record_page'] }, ], }, }), diff --git a/ui/packages/app-shell/src/utils/__tests__/consoleServerAction.test.tsx b/ui/packages/app-shell/src/utils/__tests__/consoleServerAction.test.tsx index e42a26b3f1b..12bed9a370f 100644 --- a/ui/packages/app-shell/src/utils/__tests__/consoleServerAction.test.tsx +++ b/ui/packages/app-shell/src/utils/__tests__/consoleServerAction.test.tsx @@ -427,7 +427,7 @@ describe('the early record-id refusal is forwarded to the runner (objectui#13384 type: 'script', name: 'add_to_campaign', objectName: 'crm_lead', - locations: ['list_toolbar', 'list_item'], + locations: ['list', 'record_row'], actionParams: [{ name: 'campaign', label: 'Campaign', type: 'text', required: true }], }; const launch = () => JSON.parse(JSON.stringify(ADD_TO_CAMPAIGN)); diff --git a/ui/packages/app-shell/src/utils/__tests__/managedByEmptyState.test.ts b/ui/packages/app-shell/src/utils/__tests__/managedByEmptyState.test.ts index 243753e957c..ae01cb01290 100644 --- a/ui/packages/app-shell/src/utils/__tests__/managedByEmptyState.test.ts +++ b/ui/packages/app-shell/src/utils/__tests__/managedByEmptyState.test.ts @@ -131,14 +131,14 @@ describe('resolveManagedByEmptyState', () => { /** * The toolbar half of "the page offers a create action": the same three - * questions `action:bar` and `action:button` ask of a `list_toolbar` action. + * questions `action:bar` and `action:button` ask of a `list` action. */ describe('listToolbarDrawsAction (objectui#11687)', () => { const allowAll = () => true; const invite = { name: 'invite_user', label: 'Invite User', - locations: ['list_toolbar'], + locations: ['list'], // `requiresFeature: 'organization'` as the spec lowers it (default-on flag). visible: { dialect: 'cel', source: 'features.organization != false' }, }; @@ -152,19 +152,19 @@ describe('resolveManagedByEmptyState', () => { }); it('does not count an action placed only on rows or the record header', () => { - const rowOnly = { name: 'cancel_invitation', locations: ['list_item', 'record_header'] }; + const rowOnly = { name: 'cancel_invitation', locations: ['record'] }; const unplaced = { name: 'orphan' }; expect(listToolbarDrawsAction([rowOnly, unplaced], allowAll, {})).toBe(false); }); it('does not count an action the caller may not invoke', () => { - const gated = { name: 'create_x', locations: ['list_toolbar'], requiredPermissions: ['manage_x'] }; + const gated = { name: 'create_x', locations: ['list'], requiredPermissions: ['manage_x'] }; expect(listToolbarDrawsAction([gated], () => false, {})).toBe(false); expect(listToolbarDrawsAction([gated], allowAll, {})).toBe(true); }); it('fails closed on a `visible` that throws, as the button does', () => { - const broken = { name: 'x', locations: ['list_toolbar'], visible: { dialect: 'cel', source: 'nope.missing ==' } }; + const broken = { name: 'x', locations: ['list'], visible: { dialect: 'cel', source: 'nope.missing ==' } }; expect(listToolbarDrawsAction([broken], allowAll, {})).toBe(false); }); diff --git a/ui/packages/app-shell/src/utils/managedByEmptyState.ts b/ui/packages/app-shell/src/utils/managedByEmptyState.ts index f72e59cb7fa..4fe111b997c 100644 --- a/ui/packages/app-shell/src/utils/managedByEmptyState.ts +++ b/ui/packages/app-shell/src/utils/managedByEmptyState.ts @@ -46,7 +46,7 @@ export interface ManagedByEmptyState { * actions? (objectui#11687) * * The answer is the toolbar's own verdict, asked with the same predicates the - * `action:bar` → `action:button` pair applies to `list_toolbar`: placement + * `action:bar` → `action:button` pair applies to `list`: placement * through `actionRendersAt`, the capability gate the caller passes in (the * `useCapabilityGate` closure), and the action's `visible` gate, asked through * `hasDeclaredPredicate` and evaluated fail-closed with no row bound — a list @@ -58,7 +58,7 @@ export interface ManagedByEmptyState { * Why "the toolbar draws an action" may stand for "the page offers a way to * add a row" in the `better-auth` arm, without asking an action what it does: * read off objectstack's platform objects when objectui#11687 landed, every - * `list_toolbar` action on a `better-auth` object either adds a row (Invite + * `list` action on a `better-auth` object either adds a row (Invite * User, Register OAuth Application, Create Team, Enable 2FA, …) or sits on a * list whose every view is filtered ("Sign out other devices" on sessions), so * an empty one gets the list's view-filter copy rather than first-run copy. @@ -78,7 +78,7 @@ export function listToolbarDrawsAction( requiredPermissions?: unknown; visible?: unknown; }; - if (!actionRendersAt(action, 'list_toolbar')) return false; + if (!actionRendersAt(action, 'list')) return false; if (!mayInvoke(action.requiredPermissions)) return false; if (isActionSwitchedOff(action)) return false; if (!hasDeclaredPredicate(action.visible)) return true; @@ -96,7 +96,7 @@ export function listToolbarDrawsAction( /** * @param pageOffersCreate The list page offers a way to add a row: its generic - * New button, or a `list_toolbar` action it draws + * New button, or a `list` action it draws * ({@link listToolbarDrawsAction}). The `better-auth` arm's copy says rows * are "not added by hand here", which that page contradicts (objectui#11687). */ diff --git a/ui/packages/app-shell/src/utils/recordReadServed.ts b/ui/packages/app-shell/src/utils/recordReadServed.ts index 04bd1e1748b..aa1e940b7a3 100644 --- a/ui/packages/app-shell/src/utils/recordReadServed.ts +++ b/ui/packages/app-shell/src/utils/recordReadServed.ts @@ -14,7 +14,7 @@ * ['list']`, a list-only object — has no record surface: its record page and * drawer could only answer `OBJECT_API_METHOD_NOT_ALLOWED`. So nothing opens * one for it: not its list rows, not a related list, not a link to one of its - * records. Its row menu (`list_item` actions) is not a record surface and + * records. Its row menu (`record_row` actions) is not a record surface and * stays. * * The verdict reads the effective operation set the server hands down diff --git a/ui/packages/app-shell/src/views/DeclaredActionsBar.tsx b/ui/packages/app-shell/src/views/DeclaredActionsBar.tsx index d583204e8dc..142f12cef38 100644 --- a/ui/packages/app-shell/src/views/DeclaredActionsBar.tsx +++ b/ui/packages/app-shell/src/views/DeclaredActionsBar.tsx @@ -13,7 +13,7 @@ * A bespoke page (e.g. the approvals inbox) that already has a record in hand * can drop this bar in to surface the actions the backend declares on that * object (`objectDef.actions[]`) — filtered to a `location` - * (`record_section`, `record_header`, …) and each action's `visible` CEL — + * (`record_section`, `record_page`, …) and each action's `visible` CEL — * and have them execute through the *same* console action runtime ObjectView / * RecordDetailView use: confirm dialogs, param-collection dialogs, result * dialogs, the authenticated api/flow/server handlers, and refresh-after. @@ -60,6 +60,7 @@ import { useActionTextLocalizer, } from '@object-ui/react'; import { isActionSwitchedOff, type ActionDef } from '@object-ui/core'; +import { actionRendersAt, type ActionLocation } from '@object-ui/types'; import type { ConsoleActionDispatch } from '../consoleActionDispatch.js'; import { useObjectTranslation } from '@object-ui/i18n'; import { ChevronDown, Loader2, MoreHorizontal, ShieldAlert } from 'lucide-react'; @@ -1430,8 +1431,9 @@ export function DeclaredActionsBar({ const drop = exclude && exclude.length ? new Set(exclude) : null; return allActions.filter( (a: any) => - Array.isArray(a?.locations) && - a.locations.includes(location) && + // Placement is `actionRendersAt`'s: `record` is drawn at `record_row` + // and `record_page` too (objectstack#36495). + actionRendersAt(a, location as ActionLocation) && !(drop && drop.has(a?.name)), ); }, diff --git a/ui/packages/app-shell/src/views/InterfaceListPage.tsx b/ui/packages/app-shell/src/views/InterfaceListPage.tsx index dd07a81ac75..f8c673e2f22 100644 --- a/ui/packages/app-shell/src/views/InterfaceListPage.tsx +++ b/ui/packages/app-shell/src/views/InterfaceListPage.tsx @@ -670,12 +670,12 @@ export function InterfaceListPage({ page, className, onConfigChange, reserveEdit // The author explicitly chose these as page buttons, so surface them in // the toolbar regardless of the action's own `locations` (the action:bar // filters by location). - .map((a: any) => ({ ...a, locations: ['list_toolbar'] })) + .map((a: any) => ({ ...a, locations: ['list'] })) : []; // Typed as the `action:bar` node it is (objectui#11355), not as the // `BaseSchema` the `schema` prop accepts: a key `ActionBarSchema` does not // declare is refused here. - const buttonBar: ActionBarSchema = { type: 'action:bar', location: 'list_toolbar', actions: buttonActions, size: 'sm', variant: 'outline' }; + const buttonBar: ActionBarSchema = { type: 'action:bar', location: 'list', actions: buttonActions, size: 'sm', variant: 'outline' }; // The page's `label` and `description` are `I18nLabel`s — a string or an // inline locale map — resolved in the viewer's language (#25901). Only a page diff --git a/ui/packages/app-shell/src/views/ObjectView.bulkWiredHeaderDuplicate-12462.test.tsx b/ui/packages/app-shell/src/views/ObjectView.bulkWiredHeaderDuplicate-12462.test.tsx index fb9125ba8d5..7fac058dd6b 100644 --- a/ui/packages/app-shell/src/views/ObjectView.bulkWiredHeaderDuplicate-12462.test.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.bulkWiredHeaderDuplicate-12462.test.tsx @@ -8,11 +8,11 @@ /** * objectui#12462 (ruling A-narrow) — the list page's header does not draw a - * duplicate of a `list_toolbar` action that the ACTIVE view wires to its + * duplicate of a `list` action that the ACTIVE view wires to its * selection bar AND that is record-scoped. * * Measured on HotCRM's Leads list: `create_campaign` ("Add to Campaign", - * `locations: ['list_toolbar', 'list_item']`) is wired by the `all_leads` + * `locations: ['list', 'record_row']`) is wired by the `all_leads` * view's `bulkActions`, so the selection bar already carried it with rows * ticked while the header also drew it at every selection. The selection bar is * the list toolbar in its selection mode, so the action stays at its declared @@ -93,17 +93,17 @@ const CREATE_CAMPAIGN = { label: 'Add to Campaign', objectName: 'crm_lead', type: 'script', - locations: ['list_toolbar', 'list_item'], + locations: ['list', 'record_row'], params: [{ name: 'campaign', type: 'text', label: 'Campaign', required: true }], }; -/** A plain `list_toolbar` action: object-level, it runs with nothing selected. */ +/** A plain `list` action: object-level, it runs with nothing selected. */ const REFRESH_SCORES = { name: 'refresh_scores', label: 'Refresh Scores', objectName: 'crm_lead', type: 'script', - locations: ['list_toolbar'], + locations: ['list'], }; const LIST_VIEWS = { @@ -222,7 +222,7 @@ async function tickRows(n: number): Promise { const addToCampaignIn = (el: HTMLElement) => within(el).queryByRole('button', { name: /Add to Campaign/ }); -describe('objectui#12462 — a bulk-wired, record-scoped list_toolbar action leaves the header for the selection bar', () => { +describe('objectui#12462 — a bulk-wired, record-scoped list action leaves the header for the selection bar', () => { it('the view wires it in `bulkActions`: the plain action stays in the header, Add to Campaign is only in the bar', async () => { mountLeads('all_leads'); const header = await headerWithToolbar(); diff --git a/ui/packages/app-shell/src/views/ObjectView.cardFacesOpenNothing-33548.test.tsx b/ui/packages/app-shell/src/views/ObjectView.cardFacesOpenNothing-33548.test.tsx index 9fe8c459fd2..781c92c62ab 100644 --- a/ui/packages/app-shell/src/views/ObjectView.cardFacesOpenNothing-33548.test.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.cardFacesOpenNothing-33548.test.tsx @@ -122,7 +122,7 @@ function objectsWith(view: ViewShape) { objectName: OBJECT_NAME, type: 'script', target: 'revoke_credential', - locations: ['list_item', 'record_header'], + locations: ['record'], }, ], listViews: { diff --git a/ui/packages/app-shell/src/views/ObjectView.emptyStateMatchesPage-11687.test.tsx b/ui/packages/app-shell/src/views/ObjectView.emptyStateMatchesPage-11687.test.tsx index d4e58f7c736..37113be8e2e 100644 --- a/ui/packages/app-shell/src/views/ObjectView.emptyStateMatchesPage-11687.test.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.emptyStateMatchesPage-11687.test.tsx @@ -27,7 +27,7 @@ * spec's `lowerRequiresFeature` / `lowerRequiresMembershipReach` order. * * API Keys is the page that offers NO create action — `sys_api_key` declares - * no `list_toolbar` action and leaves `create` at the bucket default (off); + * no `list` action and leaves `create` at the bucket default (off); * keys are minted elsewhere. So it keeps the identity copy, and it is the * negative control for the first defect. The single-org Invitations case is * the other control: the same object, its Invite User hidden by its own gate, @@ -92,6 +92,8 @@ vi.mock('./metadata-admin/useMetadata', async (importOriginal) => ({ import { ObjectView } from './ObjectView'; import { ExpressionProvider } from '../providers/ExpressionProvider'; +// Paid at collection, not inside a clocked case (check:test-source-alias). +import '@objectstack/lint'; // ── The served objects (abridged to the keys this page reads) ────────────── @@ -115,7 +117,7 @@ const SYS_INVITATION = { name: 'invite_user', label: 'Invite User', variant: 'primary', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', target: '/api/v1/auth/organization/invite-member', visible: { dialect: 'cel', source: INVITE_MEMBER_GATE }, @@ -124,7 +126,7 @@ const SYS_INVITATION = { name: 'cancel_invitation', label: 'Cancel Invitation', mode: 'delete', - locations: ['list_item'], + locations: ['record_row'], type: 'api', target: '/api/v1/auth/organization/cancel-invitation', }, @@ -156,7 +158,7 @@ const SYS_API_KEY = { name: 'revoke_api_key', label: 'Revoke API Key', mode: 'custom', - locations: ['list_item'], + locations: ['record_row'], type: 'api', method: 'PATCH', target: '/api/v1/data/sys_api_key/{id}', @@ -182,7 +184,7 @@ const SYS_OAUTH_APPLICATION = { name: 'create_oauth_application', label: 'Register OAuth Application', mode: 'create', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', target: '/api/v1/auth/oauth2/create-client', // `requiresFeature: 'oidcProvider'`, lowered (a default-on flag). diff --git a/ui/packages/app-shell/src/views/ObjectView.headerFold-12705.test.tsx b/ui/packages/app-shell/src/views/ObjectView.headerFold-12705.test.tsx index edc0fc1d050..d630eb47fa4 100644 --- a/ui/packages/app-shell/src/views/ObjectView.headerFold-12705.test.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.headerFold-12705.test.tsx @@ -124,9 +124,9 @@ import { ExpressionProvider } from '../providers/ExpressionProvider'; const USER = { id: 'u1', name: 'Ada', profile: 'admin' }; -const UPDATE_STAGE = { name: 'update_stage', label: 'Update Stage', type: 'script', locations: ['list_toolbar'] }; -const INVITE = { name: 'invite_user', label: 'Invite User', type: 'script', variant: 'primary', locations: ['list_toolbar'] }; -const CREATE_USER = { name: 'create_user', label: 'Create User', type: 'script', locations: ['list_toolbar'] }; +const UPDATE_STAGE = { name: 'update_stage', label: 'Update Stage', type: 'script', locations: ['list'] }; +const INVITE = { name: 'invite_user', label: 'Invite User', type: 'script', variant: 'primary', locations: ['list'] }; +const CREATE_USER = { name: 'create_user', label: 'Create User', type: 'script', locations: ['list'] }; /** An opportunity-like list: New, Import, one toolbar action. */ const OPPORTUNITY = { @@ -300,7 +300,7 @@ describe('the object list’s header folds its actions (objectui#12705)', () => type: 'url', target: 'https://example.test/report', openIn: 'new-tab', - locations: ['list_toolbar'], + locations: ['list'], }; headerWidth = 400; const { cluster } = renderList({ ...OPPORTUNITY, actions: [UPDATE_STAGE, OPEN_REPORT] }, '?runAction=open_report'); @@ -319,7 +319,7 @@ describe('the object list’s header folds its actions (objectui#12705)', () => * header keeps `actions` at every width and the description truncates instead. */ describe('a list with no declared primary keeps its actions labelled (objectstack#33988)', () => { - const LAUNCH = { name: 'launch_contract', label: 'Launch Contract', type: 'script', locations: ['list_toolbar'] }; + const LAUNCH = { name: 'launch_contract', label: 'Launch Contract', type: 'script', locations: ['list'] }; /** The card's object: no New for the reader, one undeclared toolbar action, its English description. */ const CONTRACTS = { name: 'demo_contract', @@ -359,6 +359,6 @@ describe('declaredPrimaryToolbarAction (objectui#12705)', () => { expect(declaredPrimaryToolbarAction([CREATE_USER, INVITE] as any)?.name).toBe('invite_user'); expect(declaredPrimaryToolbarAction([CREATE_USER, late, early] as any)?.name).toBe('early'); expect(declaredPrimaryToolbarAction([CREATE_USER, UPDATE_STAGE] as any)).toBeUndefined(); - expect(declaredPrimaryToolbarAction([{ ...INVITE, locations: ['record_header'] }] as any)).toBeUndefined(); + expect(declaredPrimaryToolbarAction([{ ...INVITE, locations: ['record_page'] }] as any)).toBeUndefined(); }); }); diff --git a/ui/packages/app-shell/src/views/ObjectView.headerSelectionGate-27831.test.tsx b/ui/packages/app-shell/src/views/ObjectView.headerSelectionGate-27831.test.tsx index 15d274e1bef..3ed9736c056 100644 --- a/ui/packages/app-shell/src/views/ObjectView.headerSelectionGate-27831.test.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.headerSelectionGate-27831.test.tsx @@ -10,8 +10,8 @@ * objectstack#27831 — a single-record action in a list's header is drawn the * way a launch of it would end. * - * The showcase's Tasks → "Reassign…" (`type: 'flow'`, placed at `list_item` and - * `list_toolbar`) was drawn enabled with nothing selected, and said "select a + * The showcase's Tasks → "Reassign…" (`type: 'flow'`, placed at `record_row` and + * `list`) was drawn enabled with nothing selected, and said "select a * row first" only after a click; on a list whose rows draw no checkbox it could * never work at all. * @@ -98,17 +98,17 @@ const REASSIGN = { objectName: 'showcase_task', type: 'flow', target: 'showcase_reassign_wizard', - locations: ['list_item', 'list_toolbar'], + locations: ['record_row', 'list'], refreshAfter: true, }; -/** CONTROL: an object-level header action — declared at `list_toolbar` alone. */ +/** CONTROL: an object-level header action — declared at `list` alone. */ const EXPORT_TASKS = { name: 'showcase_export_tasks', label: 'Export Tasks', objectName: 'showcase_task', type: 'script', - locations: ['list_toolbar'], + locations: ['list'], }; const REASSIGN_URL = '/api/v1/actions/showcase_task/showcase_bulk_reassign'; diff --git a/ui/packages/app-shell/src/views/ObjectView.inviteFeedback-11817.test.tsx b/ui/packages/app-shell/src/views/ObjectView.inviteFeedback-11817.test.tsx index 49350510782..1375ae4eab2 100644 --- a/ui/packages/app-shell/src/views/ObjectView.inviteFeedback-11817.test.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.inviteFeedback-11817.test.tsx @@ -95,6 +95,8 @@ vi.mock('./metadata-admin/useMetadata', async (importOriginal) => ({ import { ObjectView } from './ObjectView'; import { ExpressionProvider } from '../providers/ExpressionProvider'; import { ConsoleToaster } from '../chrome/ConsoleToaster'; +// Paid at collection, not inside a clocked case (check:test-source-alias). +import '@objectstack/lint'; // ── The served objects (abridged to the keys these pages read) ───────────── @@ -119,7 +121,7 @@ function inviteUser(successMessage: string) { name: 'invite_user', label: 'Invite User', variant: 'primary', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', target: '/api/v1/auth/organization/invite-member', visible: { dialect: 'cel', source: INVITE_MEMBER_GATE }, @@ -149,7 +151,7 @@ function sysUser(inviteCopy = 'Invitation sent') { { name: 'ban_user', label: 'Ban User', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', target: '/api/v1/auth/admin/ban-user', description: 'Ban this user? They will be signed out and unable to sign in until unbanned.', diff --git a/ui/packages/app-shell/src/views/ObjectView.inviteOutcome-27797.test.tsx b/ui/packages/app-shell/src/views/ObjectView.inviteOutcome-27797.test.tsx index 042c14a69f1..6c241efab55 100644 --- a/ui/packages/app-shell/src/views/ObjectView.inviteOutcome-27797.test.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.inviteOutcome-27797.test.tsx @@ -131,7 +131,7 @@ const SYS_INVITATION = { { name: 'invite_user', label: 'Invite User', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', target: '/api/v1/auth/organization/invite-member', params: [ @@ -153,7 +153,7 @@ const SYS_INVITATION = { { name: 'resend_invitation', label: 'Resend Invitation', - locations: ['list_item'], + locations: ['record_row'], type: 'api', target: '/api/v1/auth/organization/invite-member', params: [ @@ -173,7 +173,7 @@ const SYS_INVITATION = { { name: 'copy_invitation_link', label: 'Copy Invite Link', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'script', target: 'copy_invitation_link', variant: 'secondary', diff --git a/ui/packages/app-shell/src/views/ObjectView.listActionsReadGate-12109.test.tsx b/ui/packages/app-shell/src/views/ObjectView.listActionsReadGate-12109.test.tsx index 0dda4bcc3e7..a1e08cabcc8 100644 --- a/ui/packages/app-shell/src/views/ObjectView.listActionsReadGate-12109.test.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.listActionsReadGate-12109.test.tsx @@ -14,7 +14,7 @@ * no read on `crm_opportunity` was shown "Update Stage" over the opportunity * list's "You don't have access". That entry is not a navigation item: it is * HotCRM's `MassUpdateStageAction` (`objectName: 'crm_opportunity'`, - * `locations: ['list_toolbar']`), drawn by THIS page's schema-driven toolbar. + * `locations: ['list']`), drawn by THIS page's schema-driven toolbar. * The fixture carries the keys of that declaration this toolbar reads. * * The verdict is the REAL `MePermissionsProvider`'s, holding the caller's @@ -100,7 +100,7 @@ const UPDATE_STAGE = { label: 'Update Stage', objectName: OBJECT_NAME, type: 'script', - locations: ['list_toolbar'], + locations: ['list'], }; const OBJECTS = [ diff --git a/ui/packages/app-shell/src/views/ObjectView.listOnlyRecordPage-33219.test.tsx b/ui/packages/app-shell/src/views/ObjectView.listOnlyRecordPage-33219.test.tsx index 4ae28a59b2b..7b002bb606f 100644 --- a/ui/packages/app-shell/src/views/ObjectView.listOnlyRecordPage-33219.test.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.listOnlyRecordPage-33219.test.tsx @@ -22,7 +22,7 @@ * - a ⌘-click opens no tab, and the name is no anchor a new tab follows; * - the name cell draws no 「Open as full page」 ↗; * - a `?recordId=` link opens no drawer and reads no record; - * - the row menu still offers the object's `list_item` action (Revoke); + * - the row menu still offers the object's `record_row` action (Revoke); * - CONTROL: the same object served with no restriction — the row click * opens the drawer, as every object's does. * @@ -107,7 +107,7 @@ const OBJECTS = [ objectName: OBJECT_NAME, type: 'script', target: 'revoke_credential', - locations: ['list_item', 'record_header'], + locations: ['record'], }, ], listViews: { @@ -267,7 +267,7 @@ describe('objectstack#33219 — a list-only object\'s rows open no record page', expect(findOne).not.toHaveBeenCalled(); }); - it('the row menu still offers the object\'s `list_item` action', async () => { + it('the row menu still offers the object\'s `record_row` action', async () => { await mountList(LIST_ONLY_OPERATIONS); expect(await rowMenuItems('okta-staging')).toContain('Revoke'); }); diff --git a/ui/packages/app-shell/src/views/ObjectView.objectBoundActions-7234.test.tsx b/ui/packages/app-shell/src/views/ObjectView.objectBoundActions-7234.test.tsx index 3628bc4bf3d..335e5796bdf 100644 --- a/ui/packages/app-shell/src/views/ObjectView.objectBoundActions-7234.test.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.objectBoundActions-7234.test.tsx @@ -32,8 +32,8 @@ * * `action:bar` filters its own set through `useCapabilityGate` before * `actionRendersAt` ever runs, and so do the other two surfaces this card names - * (`page:header` for `record_header` / `record_more`, the grid's row menu for - * `list_item`) — one shared hook exactly so the three cannot drift apart. An + * (`page:header` for `record` / `record_page`, the grid's row menu for + * `record_row`) — one shared hook exactly so the three cannot drift apart. An * action declaring a capability the viewer does not hold is filtered out, at * every location at once, with no error and no 4xx. That is the reported * symptom, and it is this gate rather than a dropped key. @@ -67,7 +67,7 @@ * ## Reverse verification — direction predicted before running * * Predicted, then observed (measurements recorded on the PR): - * • Deleting the `list_toolbar` gate's `objectDef.actions` read in + * • Deleting the `list` gate's `objectDef.actions` read in * `ObjectView.tsx` turns every presence case RED (A, D, E, G, I) and * leaves every absence case GREEN (B, C, F, H) — an absence case asserts * absence, which a deleted renderer supplies for the wrong reason. That @@ -184,7 +184,7 @@ const APPLY_TO_PEOPLE = { objectName: OBJECT_NAME, type: 'script', label: 'Apply to people', - locations: ['list_toolbar'], + locations: ['list'], }; /** The same declaration as the app that found this ships it: capability-gated. */ @@ -275,8 +275,8 @@ describe('objectui#7234 — object-declared actions reach the list toolbar', () expect(toolbarButton()).toBeNull(); }); - it('C (control): the same action at record_header only is not on this toolbar', async () => { - renderList(objectsWithActions([{ ...APPLY_TO_PEOPLE, locations: ['record_header'] }])); + it('C (control): the same action at record_page only is not on this toolbar', async () => { + renderList(objectsWithActions([{ ...APPLY_TO_PEOPLE, locations: ['record_page'] }])); await settle(); expect(toolbarButton()).toBeNull(); }); diff --git a/ui/packages/app-shell/src/views/ObjectView.recordRelatedNotOnOwnList-11270.test.tsx b/ui/packages/app-shell/src/views/ObjectView.recordRelatedNotOnOwnList-11270.test.tsx index 9b81f862ffb..c4797e93a71 100644 --- a/ui/packages/app-shell/src/views/ObjectView.recordRelatedNotOnOwnList-11270.test.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.recordRelatedNotOnOwnList-11270.test.tsx @@ -6,10 +6,10 @@ * * `record_related` places an action on the rows of a related list inside a * parent record, and nowhere else (objectstack-ai/objectstack#20937, triage - * `5919625056`). `list_item` is the location that places an action on the + * `5919625056`). `record_row` is the location that places an action on the * object's rows everywhere it is listed. So the object list page's row menu - * reads `list_item` and must keep ignoring `record_related`, while a - * `list_item` action still reaches it — the control, over the SAME render, so + * reads `record_row` and must keep ignoring `record_related`, while a + * `record_row` action still reaches it — the control, over the SAME render, so * the absence cannot be a dead relay's. * * The positive half (the related-list rows inside a record show it) is @@ -89,14 +89,16 @@ vi.mock('./RecordDetailView', () => ({ RecordDetailView: () => null })); import { ObjectView } from './ObjectView'; import { ExpressionProvider } from '../providers/ExpressionProvider'; +// Paid at collection, not inside a clocked case (check:test-source-alias). +import '@objectstack/lint'; const OBJECT_NAME = 'task'; /** The same child actions the positive half places on related-list rows. */ const ACTIONS = [ - { name: 'send_reminder', label: 'Send Reminder', type: 'api', target: '/api/remind', locations: ['list_item'] }, + { name: 'send_reminder', label: 'Send Reminder', type: 'api', target: '/api/remind', locations: ['record_row'] }, { name: 'log_time', label: 'Log Time', type: 'form', target: 'task.edit', locations: ['record_related'] }, - { name: 'archive', label: 'Archive', type: 'api', target: '/api/archive', locations: ['list_item', 'record_related'] }, + { name: 'archive', label: 'Archive', type: 'api', target: '/api/archive', locations: ['record_row', 'record_related'] }, ]; const OBJECTS = [ @@ -128,7 +130,7 @@ afterEach(() => { }); describe('objectui#11270 — the child object’s own list view does not place `record_related`', () => { - it('its row actions carry the `list_item` actions and not the `record_related`-only one', async () => { + it('its row actions carry the `record_row` actions and not the `record_related`-only one', async () => { render( @@ -144,7 +146,7 @@ describe('objectui#11270 — the child object’s own list view does not place ` await waitFor(() => expect(listSchema).not.toBeNull()); const names = (listSchema!.rowActionDefs ?? []).map((a) => a.name); // Control: the relay is alive, and `archive` (both locations) reaches the - // list through its `list_item` half. + // list through its `record_row` half. expect(names).toEqual(['send_reminder', 'archive']); expect(names).not.toContain('log_time'); }); diff --git a/ui/packages/app-shell/src/views/ObjectView.rowOpensNothing-33317.test.tsx b/ui/packages/app-shell/src/views/ObjectView.rowOpensNothing-33317.test.tsx index 3464b487619..9372d32c625 100644 --- a/ui/packages/app-shell/src/views/ObjectView.rowOpensNothing-33317.test.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.rowOpensNothing-33317.test.tsx @@ -15,7 +15,7 @@ * objectstack#33219). Either way a click on the row opens nothing, so the grid * draws its record-link column as plain text — no anchor, no `role="link"` — * and the row's right-click menu offers no Open / Open in new tab; the row's - * own `list_item` action (Revoke) stays. + * own `record_row` action (Revoke) stays. * * Driven through the real `ObjectView`, the real `ListView` grid and the real * `MePermissionsProvider`, one differential per case: the same object and @@ -110,7 +110,7 @@ function objectsWith(navigation?: AuthoredNavigation) { objectName: OBJECT_NAME, type: 'script', target: 'revoke_credential', - locations: ['list_item', 'record_header'], + locations: ['record'], }, ], listViews: { diff --git a/ui/packages/app-shell/src/views/ObjectView.toolbarScriptSelection-12331.test.tsx b/ui/packages/app-shell/src/views/ObjectView.toolbarScriptSelection-12331.test.tsx index d34a56581da..47ea8920a84 100644 --- a/ui/packages/app-shell/src/views/ObjectView.toolbarScriptSelection-12331.test.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.toolbarScriptSelection-12331.test.tsx @@ -8,7 +8,7 @@ /** * objectui#12331 — a single-record script action placed in a list's - * `list_toolbar` never drops a click. + * `list` never drops a click. * * Filed from a browser pass of HotCRM's Leads list: "Add to Campaign", a * `type: 'script'` action with one param (a campaign picker), launched from the @@ -29,7 +29,7 @@ * success toast — the action's own copy, filled from the answer's * `{{ result.* }}`, or the runner's generic line when it declares none. * - * The last block replays HotCRM's own declaration: a `list_item` placement and + * The last block replays HotCRM's own declaration: a `record_row` placement and * a FIELD-BACKED param, so the dialog draws a record picker and the toast * comes after a picker was used. It refuses and reports exactly as the plain * fixture does. @@ -48,7 +48,7 @@ * * "Record-scoped" is a declaration, not a guess: an action is single-record * when its `locations` include a record placement (`isRecordScopedAction`). An - * action declared at `list_toolbar` alone is object-level, so zero rows + * action declared at `list` alone is object-level, so zero rows * dispatches it with no record — pinned below as the control. */ @@ -111,13 +111,15 @@ vi.mock('./metadata-admin/useMetadata', async (importOriginal) => ({ import { ObjectView } from './ObjectView'; import { ExpressionProvider } from '../providers/ExpressionProvider'; import { ConsoleToaster } from '../chrome/ConsoleToaster'; +// Paid at collection, not inside a clocked case (check:test-source-alias). +import '@objectstack/lint'; const ACTION_URL = '/api/v1/actions/crm_lead/create_campaign'; /** A record-scoped placement: the toolbar plus a record placement. */ -const RECORD_SCOPED = ['list_toolbar', 'record_header']; +const RECORD_SCOPED = ['list', 'record_page']; /** The declaration the card measured: the toolbar alone, i.e. object-level. */ -const TOOLBAR_ONLY = ['list_toolbar']; +const TOOLBAR_ONLY = ['list']; function crmLead(locations: string[], successMessage?: string) { return { @@ -245,7 +247,7 @@ async function launchRefusedFromHeader(refusal: string): Promise { expect(screen.queryByRole('dialog')).toBeNull(); } -describe('objectui#12331 — a record-scoped script action at list_toolbar, with a param', () => { +describe('objectui#12331 — a record-scoped script action at list, with a param', () => { it('0 rows: the refusal shows before any dialog, and no request is sent', async () => { mountLeads(RECORD_SCOPED); await tickRows(0); @@ -284,7 +286,7 @@ describe('objectui#12331 — a record-scoped script action at list_toolbar, with }); describe('objectui#12331 — the refusal follows the `locations` declaration', () => { - it('declared at list_toolbar alone, 2 rows: one dispatch cannot name two records, so it refuses before any dialog', async () => { + it('declared at list alone, 2 rows: one dispatch cannot name two records, so it refuses before any dialog', async () => { mountLeads(TOOLBAR_ONLY); await tickRows(2); await launchRefusedFromHeader(MULTI_ROW_REFUSAL); @@ -292,7 +294,7 @@ describe('objectui#12331 — the refusal follows the `locations` declaration', ( expect(actionCalls()).toHaveLength(0); }); - it('control — declared at list_toolbar alone, 0 rows: object-level, so it dispatches with no record', async () => { + it('control — declared at list alone, 0 rows: object-level, so it dispatches with no record', async () => { mountLeads(TOOLBAR_ONLY); await tickRows(0); await launchFromHeader(); @@ -312,7 +314,7 @@ describe('objectui#12331 — the refusal follows the `locations` declaration', ( * HotCRM's `CreateCampaignAction` (objectstack-ai/hotcrm, `src/sales/actions/ * lead.actions.ts`), with the keys this chain reads. It differs from the * fixture above in the two ways the card's reading could hinge on: the record - * placement is `list_item`, and its one param is FIELD-BACKED, so the dialog + * placement is `record_row`, and its one param is FIELD-BACKED, so the dialog * draws a record picker (a lookup to `crm_campaign`) instead of a text box. */ const HOTCRM_CREATE_CAMPAIGN = { @@ -320,7 +322,7 @@ const HOTCRM_CREATE_CAMPAIGN = { label: 'Add to Campaign', objectName: 'crm_lead', type: 'script', - locations: ['list_toolbar', 'list_item'], + locations: ['list', 'record_row'], successMessage: 'Leads added to campaign!', refreshAfter: true, params: [{ field: 'crm_campaign', objectOverride: 'crm_campaign_member', label: 'Campaign', required: true }], @@ -402,7 +404,7 @@ function mountHotcrmLeads() { /** * Click the HEADER toolbar's "Add to Campaign", pick "Cloud Migration Webinar" - * in the record picker, Confirm — the card's steps. `list_item` also draws the + * in the record picker, Confirm — the card's steps. `record_row` also draws the * action on every row, so the header's toolbar is the first one on the page. */ async function launchHotcrmFromHeader(): Promise { @@ -416,11 +418,11 @@ async function launchHotcrmFromHeader(): Promise { await act(async () => { fireEvent.click(within(dialog).getByRole('button', { name: 'Confirm' })); }); } -describe('objectui#12331 — HotCRM\'s declaration: list_item placement, a field-backed record-picker param', () => { +describe('objectui#12331 — HotCRM\'s declaration: record_row placement, a field-backed record-picker param', () => { it('0 rows: the refusal shows before any dialog, and no request is sent', async () => { mountHotcrmLeads(); await tickRows(0); - // `list_item` also draws the action on every row; the header's toolbar is the first. + // `record_row` also draws the action on every row; the header's toolbar is the first. await launchRefusedFromHeader(ZERO_ROW_REFUSAL); expect(actionCalls()).toHaveLength(0); diff --git a/ui/packages/app-shell/src/views/RecordDetailView.accessEndedAfterDecision-26589.test.tsx b/ui/packages/app-shell/src/views/RecordDetailView.accessEndedAfterDecision-26589.test.tsx index a79727ef10d..d747c2e85ca 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.accessEndedAfterDecision-26589.test.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.accessEndedAfterDecision-26589.test.tsx @@ -142,7 +142,7 @@ const SYS_APPROVAL_REQUEST_DEF = { target: '/api/v1/approvals/requests/{id}/approve', params: [{ name: 'comment', label: 'Comment', type: 'textarea', required: false }], visible: 'record.viewer.can_act || record.viewer.can_override', - locations: ['record_section', 'list_item'], + locations: ['record_section', 'record_row'], successMessage: 'Approved.', refreshAfter: true, }, { @@ -151,7 +151,7 @@ const SYS_APPROVAL_REQUEST_DEF = { params: [{ name: 'comment', label: 'Comment', type: 'textarea', required: false }], visible: 'record.viewer.can_act || record.viewer.can_override', confirmText: 'Reject this request?', - locations: ['record_section', 'list_item'], + locations: ['record_section', 'record_row'], successMessage: 'Rejected.', refreshAfter: true, }, ], diff --git a/ui/packages/app-shell/src/views/RecordDetailView.accessibleNames-12625.test.tsx b/ui/packages/app-shell/src/views/RecordDetailView.accessibleNames-12625.test.tsx index cf9233b445b..d28b90dea8a 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.accessibleNames-12625.test.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.accessibleNames-12625.test.tsx @@ -14,7 +14,7 @@ * - The page's regions are named by their labels: the right column, the 动态 * panel (Activity) and a related panel (Task). They were the Details and * Related tabs until objectstack#27524 laid every width out as columns. - * - A declared `record_header` action is named by its label (Log a Call). + * - A declared `record_page` action is named by its label (Log a Call). * - A collapsible field group's header is a button named by its label * (Lead Information) that toggles `aria-expanded` — the half the card found * really broken (`DetailSection`'s header was a div with no role). @@ -73,7 +73,7 @@ const headerAction = (name: string, label: string) => ({ label, type: 'api', target: '/api/v1/noop', - locations: ['record_header'], + locations: ['record_page'], }); const LEAD = { diff --git a/ui/packages/app-shell/src/views/RecordDetailView.actionLayout-36366.test.tsx b/ui/packages/app-shell/src/views/RecordDetailView.actionLayout-36366.test.tsx index adc3e869fcc..d4df545fd46 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.actionLayout-36366.test.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.actionLayout-36366.test.tsx @@ -52,10 +52,10 @@ import { DesignModeProvider } from '../layout/designMode'; const RECORD_ID = 'rec-1'; -const CONVERT = { name: 'convert', label: 'Convert', type: 'url', target: 'https://example.com/c', locations: ['record_header'], order: 1 }; -const MARK_WON = { name: 'mark_won', label: 'Mark Won', type: 'url', target: 'https://example.com/w', locations: ['record_header'], order: 2 }; -const SHARE = { name: 'share', label: 'Share', type: 'url', target: 'https://example.com/s', locations: ['record_header'], order: 3 }; -const LOG_CALL = { name: 'log_call', label: 'Log Call', type: 'url', target: 'https://example.com/l', locations: ['record_more'], order: 4 }; +const CONVERT = { name: 'convert', label: 'Convert', type: 'url', target: 'https://example.com/c', locations: ['record_page'], order: 1 }; +const MARK_WON = { name: 'mark_won', label: 'Mark Won', type: 'url', target: 'https://example.com/w', locations: ['record_page'], order: 2 }; +const SHARE = { name: 'share', label: 'Share', type: 'url', target: 'https://example.com/s', locations: ['record_page'], order: 3 }; +const LOG_CALL = { name: 'log_call', label: 'Log Call', type: 'url', target: 'https://example.com/l', locations: ['record_page'], component: 'action:menu', order: 4 }; const ACTIONS = [CONVERT, MARK_WON, SHARE, LOG_CALL]; const LABELS = ACTIONS.map((a) => a.label); @@ -184,14 +184,14 @@ describe.each([ ['the synthesized default page, in the side preview', false], ['an authored page:header with placedActions: true', true], ] as const)('#36366 record header pins: %s', (_face, authored) => { - it('CONTROL — no pins: the header draws as before (record_header inline by order, record_more in ⋯)', async () => { + it('CONTROL — no pins: the header draws as before (record_page inline by order, folded in ⋯)', async () => { mount(undefined, authored); const { inline, menu } = await headerFaces(); expect(inline).toEqual(['Convert', 'Mark Won', 'Share']); expect(menu).toEqual(['Log Call']); }); - it('the pinned actions are the buttons, in pin order (a record_more one too); the rest are in ⋯', async () => { + it('the pinned actions are the buttons, in pin order (a folded one too); the rest are in ⋯', async () => { mount({ record: { pinned: ['log_call', 'share'] } }, authored); const { inline, menu } = await headerFaces(); expect(inline).toEqual(['Log Call', 'Share']); diff --git a/ui/packages/app-shell/src/views/RecordDetailView.actionUser.test.tsx b/ui/packages/app-shell/src/views/RecordDetailView.actionUser.test.tsx index a23644942be..e0c87591c64 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.actionUser.test.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.actionUser.test.tsx @@ -14,7 +14,7 @@ * the capability gate the engine reads (`user.systemPermissions`) is whatever * this object carries. It used to carry identity only — `{id, name, avatar}` — * and since `ActionEngine.getActionsForLocation` fails OPEN on `undefined`, every - * `record_header` / `record_more` action's `requiredPermissions` was silently + * `record` / `record_page` action's `requiredPermissions` was silently * unenforced on the one surface those locations exist on. * * Three properties are pinned here, and they pull in different directions: @@ -69,7 +69,7 @@ describe('resolveActionUser — ADR-0066 D4 capability gate seeding (#3923)', () // backend never reported systemPermissions", and `resolveActionUser` must // forward it unchanged so `ActionEngine`'s own `Array.isArray(held)` check // reads it as unknown and fails OPEN — collapsing it here would silently - // flip that to fail-CLOSED for every record_header/record_more action. + // flip that to fail-CLOSED for every record / record_page action. const resolved = resolveActionUser(user, true, undefined); expect(resolved.systemPermissions).toBeUndefined(); expect(Array.isArray(resolved.systemPermissions)).toBe(false); diff --git a/ui/packages/app-shell/src/views/RecordDetailView.apiNewTabUrl-26747.test.tsx b/ui/packages/app-shell/src/views/RecordDetailView.apiNewTabUrl-26747.test.tsx index eaed37fd078..e0a4b54771d 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.apiNewTabUrl-26747.test.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.apiNewTabUrl-26747.test.tsx @@ -81,7 +81,7 @@ const newTabAction = (name: string, label: string) => ({ target: TARGET, opensInNewTab: true, newTabUrl: '/export/{recordId}', - locations: ['record_header'], + locations: ['record_page'], }); const urlAction = (name: string, label: string) => ({ @@ -89,7 +89,7 @@ const urlAction = (name: string, label: string) => ({ label, type: 'url', target: `https://example.com/${name}`, - locations: ['record_header'], + locations: ['record_page'], }); async function mountRecordPage(actions: unknown[]) { diff --git a/ui/packages/app-shell/src/views/RecordDetailView.approvalDeclaredActions.test.tsx b/ui/packages/app-shell/src/views/RecordDetailView.approvalDeclaredActions.test.tsx index b86e9afbd20..b114bfb082b 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.approvalDeclaredActions.test.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.approvalDeclaredActions.test.tsx @@ -185,7 +185,7 @@ const SYS_APPROVAL_REQUEST_DEF = { { name: 'attachments', label: 'Attachments', type: 'file', multiple: true, required: false }, ], visible: 'record.viewer.can_act || record.viewer.can_override', - locations: ['record_section', 'list_item'], + locations: ['record_section', 'record_row'], successMessage: 'Approved.', refreshAfter: true, }, { @@ -197,7 +197,7 @@ const SYS_APPROVAL_REQUEST_DEF = { ], visible: 'record.viewer.can_act || record.viewer.can_override', confirmText: 'Reject this request? A rejection is final for every approver.', - locations: ['record_section', 'list_item'], + locations: ['record_section', 'record_row'], successMessage: 'Rejected.', refreshAfter: true, }, { diff --git a/ui/packages/app-shell/src/views/RecordDetailView.authoredPageDesktopOnly-36150.test.tsx b/ui/packages/app-shell/src/views/RecordDetailView.authoredPageDesktopOnly-36150.test.tsx index 3a7477d2a1b..089abae37c9 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.authoredPageDesktopOnly-36150.test.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.authoredPageDesktopOnly-36150.test.tsx @@ -11,7 +11,7 @@ * * - The card's pin: an authored `kind: 'full'` page draws on the desktop full * page; on a phone and in the drawer its page-only block is gone, the - * standard page's tab strip is drawn, and the object's `record_more` + * standard page's tab strip is drawn, and the object's folded (`component: 'action:menu'`) * action is still in the header's ⋯ menu. Red before the change (the * authored page drew on all three). * - CONTROL: an object with no authored page draws the standard page on all @@ -68,7 +68,7 @@ const RECORD_ID = 'rec-1'; const AUTHORED_MARK = 'Authored page block'; const SLOT_MARK = 'Slotted alert'; -const MORE_ACTION = { name: 'qa_recalc', label: 'Recalculate', type: 'api', target: '/api/v1/x', locations: ['record_section', 'record_more'] }; +const MORE_ACTION = { name: 'qa_recalc', label: 'Recalculate', type: 'api', target: '/api/v1/x', locations: ['record_section', 'record_page'], component: 'action:menu' }; function objectDef(name: string) { return { @@ -267,7 +267,7 @@ describe('#36150 an authored full page', () => { expect(screen.queryByText(AUTHORED_MARK)).toBeNull(); }); - it('on the drawer the object\'s record_more action is in the standard header\'s ⋯ menu', async () => { + it('on the drawer the object\'s folded action is in the standard header\'s ⋯ menu', async () => { mount('qa_project', [fullPage('qa_project')], 'drawer'); await recordDrawn(); const trigger = await screen.findByRole('button', { name: 'More actions' }); diff --git a/ui/packages/app-shell/src/views/RecordDetailView.builtinActionSessionUserPredicate.test.tsx b/ui/packages/app-shell/src/views/RecordDetailView.builtinActionSessionUserPredicate.test.tsx index 55d00426682..313d7d45e5c 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.builtinActionSessionUserPredicate.test.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.builtinActionSessionUserPredicate.test.tsx @@ -32,7 +32,7 @@ * evaluated on this path. * • `RecordDetailView.headerActionLookupPredicate.test.tsx` (#4641 / * objectstack#8500) drives `os.user.id` against a relation field, but only - * through DECLARED `record_header` actions — a different consumption seam + * through DECLARED `record_page` actions — a different consumption seam * (`visible` on an authored action), deliberately not the built-in one. * * The card sits exactly on the intersection, which is why it could be reported diff --git a/ui/packages/app-shell/src/views/RecordDetailView.childWriteRefreshesParent-12244.test.tsx b/ui/packages/app-shell/src/views/RecordDetailView.childWriteRefreshesParent-12244.test.tsx index 463e22ba496..34effa74f58 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.childWriteRefreshesParent-12244.test.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.childWriteRefreshesParent-12244.test.tsx @@ -415,7 +415,7 @@ describe('RecordDetailView — a header action with `refreshAfter` refreshes the type: 'api', target: '/api/v1/quotes/add-line', recordIdParam: 'quoteId', - locations: ['record_header'], + locations: ['record_page'], refreshAfter: true, }, ], diff --git a/ui/packages/app-shell/src/views/RecordDetailView.designModeTabs-36737.test.tsx b/ui/packages/app-shell/src/views/RecordDetailView.designModeTabs-36737.test.tsx index 5c5f1705d62..d01417fb6d0 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.designModeTabs-36737.test.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.designModeTabs-36737.test.tsx @@ -75,7 +75,7 @@ import { DesignModeProvider, useDesignModeController } from '../layout/designMod import { DesignModeBar } from '../layout/DesignModeBar'; const RECORD_ID = 'rec-1'; -const SHARE = { name: 'share', label: 'Share', type: 'url', target: 'https://example.com/s', locations: ['record_more'], order: 3 }; +const SHARE = { name: 'share', label: 'Share', type: 'url', target: 'https://example.com/s', locations: ['record_page'], component: 'action:menu', order: 3 }; const OBJECTS = [ { diff --git a/ui/packages/app-shell/src/views/RecordDetailView.flowActionDoor-12037.test.tsx b/ui/packages/app-shell/src/views/RecordDetailView.flowActionDoor-12037.test.tsx index 6df1ab35b46..68253878d81 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.flowActionDoor-12037.test.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.flowActionDoor-12037.test.tsx @@ -88,7 +88,7 @@ const CHILD_ACTION = { label: 'Escalate', type: 'flow', target: 'escalate_task_flow', - locations: ['list_item'], + locations: ['record_row'], requiredPermissions: ['lead_task.escalate'], }; /** Declared on this page's object, offered in the header. */ @@ -97,7 +97,7 @@ const HEADER_ACTION = { label: 'Qualify', type: 'flow', target: 'qualify_lead_wizard', - locations: ['record_header'], + locations: ['record_page'], }; const OBJECTS = [ { @@ -223,7 +223,7 @@ describe('objectui#12037 — record-page flow clicks on a declared action use th const runner = await mountRunner(); authFetchSpy.mockResolvedValue(answered({ success: true, status: 'completed' })); - const { url, body } = await run(runner, { ...CHILD_ACTION, locations: ['list_toolbar'], objectName: CHILD }); + const { url, body } = await run(runner, { ...CHILD_ACTION, locations: ['list'], objectName: CHILD }); expect(url).toBe(`/api/v1/actions/${CHILD}/escalate_task`); expect(body).toEqual({ params: {} }); diff --git a/ui/packages/app-shell/src/views/RecordDetailView.headerActionLookupPredicate.test.tsx b/ui/packages/app-shell/src/views/RecordDetailView.headerActionLookupPredicate.test.tsx index 268b4fac31f..54dc29eff1e 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.headerActionLookupPredicate.test.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.headerActionLookupPredicate.test.tsx @@ -13,7 +13,7 @@ * ## What this file pins, and why here * * "Only the record's manager sees this button" is the most common thing an - * author asks a `record_header` action's `visible` to express, and it is + * author asks a `record_page` action's `visible` to express, and it is * written against a lookup field: * * ```yaml @@ -146,13 +146,13 @@ function makeMetadata(objects: any[]) { } as any; } -/** A declared `record_header` action, gated on `visible`. */ +/** A declared `record_page` action, gated on `visible`. */ const headerAction = (name: string, visible: unknown) => ({ name, label: name, type: 'api', target: '/api/v1/noop', - locations: ['record_header'], + locations: ['record_page'], visible, }); diff --git a/ui/packages/app-shell/src/views/RecordDetailView.headerApiInterpolation.test.tsx b/ui/packages/app-shell/src/views/RecordDetailView.headerApiInterpolation.test.tsx index d043b41deca..78a7f4e49db 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.headerApiInterpolation.test.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.headerApiInterpolation.test.tsx @@ -12,9 +12,9 @@ * * The record page's api handler used to gate `{field}` interpolation on * `params._rowRecord` alone — a stash only related-list row dispatches - * carried. A `record_header` action targeting `/api/v1/data/:object/{id}` + * carried. A `record_page` action targeting `/api/v1/data/:object/{id}` * therefore went out with the literal `{id}` (`%7Bid%7D` on the wire → 400), - * while the SAME declaration on `list_item` interpolated fine. + * while the SAME declaration on `record_row` interpolated fine. * * These tests exercise the handler set the view REALLY hands to its * ActionProvider (captured via a pass-through wrapper, same harness as diff --git a/ui/packages/app-shell/src/views/RecordDetailView.headerMenuIcons-12529.test.tsx b/ui/packages/app-shell/src/views/RecordDetailView.headerMenuIcons-12529.test.tsx index b76e583c90f..00c217dbfb7 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.headerMenuIcons-12529.test.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.headerMenuIcons-12529.test.tsx @@ -76,7 +76,7 @@ const appAction = (name: string, label: string) => ({ label, type: 'url', target: `https://example.com/${name}`, - locations: ['record_header'], + locations: ['record_page'], }); function objectsWith(actions: unknown[]) { diff --git a/ui/packages/app-shell/src/views/RecordDetailView.headerRecordIdLoadWindow.test.tsx b/ui/packages/app-shell/src/views/RecordDetailView.headerRecordIdLoadWindow.test.tsx index b4f8cbb9292..ef8330d81c4 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.headerRecordIdLoadWindow.test.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.headerRecordIdLoadWindow.test.tsx @@ -7,14 +7,14 @@ */ /** - * `record_header` actions must carry the record id even while the page record + * `record_page` actions must carry the record id even while the page record * is still being fetched (objectui#5176). * * The header is NOT gated on the record load. `isLoading` — the only state the * `` early return reads — is flipped false in a `queueMicrotask` * keyed on the route, while `pageRecord` arrives one `dataSource.findOne` * round-trip later. So for the whole duration of that fetch the page renders its - * real header, with every `record_header` action live and clickable, and + * real header, with every `record_page` action live and clickable, and * `pageRecord` still `null`. * * In that window the `type:'api'` handler's `recordIdParam` seeding used to have @@ -215,7 +215,7 @@ afterEach(() => { vi.unstubAllGlobals(); }); -describe('RecordDetailView record_header actions during the page-record load window (objectui#5176)', () => { +describe('RecordDetailView record_page actions during the page-record load window (objectui#5176)', () => { it('the header renders live actions while the record is still loading', async () => { // The premise the whole card rests on. If the header were gated on the // record load there would be no window to dispatch in, and the reported @@ -235,7 +235,7 @@ describe('RecordDetailView record_header actions during the page-record load win let r: any; await act(async () => { - // A record_header action exactly as authored: no `_rowRecord` stash, no + // A record_page action exactly as authored: no `_rowRecord` stash, no // literal `recordId` override, `recordIdField` defaulting to `id`. r = await handlers.api({ name: 'archive_plan', diff --git a/ui/packages/app-shell/src/views/RecordDetailView.phoneFace-27058.test.tsx b/ui/packages/app-shell/src/views/RecordDetailView.phoneFace-27058.test.tsx index c055be3ea8a..e7ae0ee27d8 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.phoneFace-27058.test.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.phoneFace-27058.test.tsx @@ -88,7 +88,7 @@ const action = (name: string, label: string) => ({ label, type: 'api', target: '/api/v1/noop', - locations: ['record_header'], + locations: ['record_page'], }); function objectsWith(actions: unknown[]) { diff --git a/ui/packages/app-shell/src/views/RecordDetailView.placedHeaderActions-29951.test.tsx b/ui/packages/app-shell/src/views/RecordDetailView.placedHeaderActions-29951.test.tsx index f379bdf58dd..5413a129286 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.placedHeaderActions-29951.test.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.placedHeaderActions-29951.test.tsx @@ -7,10 +7,10 @@ * #27219 rebuilt the platform record pages as `kind: 'full'` pages whose * `page:header` named the platform's own action ids, and an authored id list * is the whole set (#11592), so a `type: 'url'` action an installed package - * places on `sys_user` at `record_header` stopped drawing in the 18.3 Console. + * places on `sys_user` at `record_page` stopped drawing in the 18.3 Console. * Ruling A (record 6624172200) gave the header an opt-in instead, * `placedActions: true` (objectstack#30018): every action of the page's object - * placed at `record_header` / `record_more`, read live. The three platform + * placed at `record` / `record_page`, read live. The three platform * pages now ship exactly `{ type: 'page:header', properties: { placedActions: * true } }` (pinned in platform-objects' `record-page-header-actions.test.ts` * and plugin-approvals' `sys-approval-request-page.test.ts`; that package is @@ -22,7 +22,7 @@ * object and record handed in). * * - The card's pin: on the shipped header node, the packaged url action - * draws inline and the packaged `record_more` one in the ⋯ menu, beside + * draws inline and the packaged folded (`component: 'action:menu'`) one in the ⋯ menu, beside * the platform's own; actions placed elsewhere do not draw. On the frozen * #27219 header (an id list, no opt-in) the same object draws neither * packaged action, which is the regression this pin is red on. @@ -71,14 +71,14 @@ import { FavoritesProvider } from '../context/FavoritesProvider'; const RECORD_ID = 'rec-1'; // The platform's own header actions, as `sys_user` places them. -const BAN_USER = { name: 'ban_user', label: 'Ban User', type: 'api', target: '/api/v1/x', locations: ['list_item', 'record_header'] }; -const IMPERSONATE = { name: 'impersonate_user', label: 'Impersonate User', type: 'api', target: '/api/v1/y', locations: ['record_more'] }; +const BAN_USER = { name: 'ban_user', label: 'Ban User', type: 'api', target: '/api/v1/x', locations: ['record'] }; +const IMPERSONATE = { name: 'impersonate_user', label: 'Impersonate User', type: 'api', target: '/api/v1/y', locations: ['record_page'], component: 'action:menu' }; // Placed elsewhere: never a header action. -const LIST_ONLY = { name: 'export_users', label: 'Export Users', type: 'api', target: '/api/v1/z', locations: ['list_toolbar'] }; +const LIST_ONLY = { name: 'export_users', label: 'Export Users', type: 'api', target: '/api/v1/z', locations: ['list'] }; const SECTION_ONLY = { name: 'reset_mfa', label: 'Reset MFA', type: 'api', target: '/api/v1/w', locations: ['record_section'] }; // What another package adds to `sys_user` (the folded registry appends it). -const PACKAGED_URL = { name: 'qa_open_profile', label: 'Open Profile', type: 'url', target: 'https://example.com/u', locations: ['record_header'], _packageId: 'com.qa.hdr' }; -const PACKAGED_MORE = { name: 'qa_profile_link', label: 'Copy Profile Link', type: 'url', target: 'https://example.com/l', locations: ['record_more'], _packageId: 'com.qa.hdr' }; +const PACKAGED_URL = { name: 'qa_open_profile', label: 'Open Profile', type: 'url', target: 'https://example.com/u', locations: ['record_page'], _packageId: 'com.qa.hdr' }; +const PACKAGED_MORE = { name: 'qa_profile_link', label: 'Copy Profile Link', type: 'url', target: 'https://example.com/l', locations: ['record_page'], component: 'action:menu', _packageId: 'com.qa.hdr' }; const ACTIONS = [BAN_USER, IMPERSONATE, LIST_ONLY, SECTION_ONLY, PACKAGED_URL, PACKAGED_MORE]; diff --git a/ui/packages/app-shell/src/views/RecordDetailView.printPageHeaderActions-12906.test.tsx b/ui/packages/app-shell/src/views/RecordDetailView.printPageHeaderActions-12906.test.tsx index 9c1dcad1105..b9ec7d7a057 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.printPageHeaderActions-12906.test.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.printPageHeaderActions-12906.test.tsx @@ -11,8 +11,8 @@ * header actions in the print page's screen-only chrome, beside Print. * * A page that declares `print` may hold only the printable component types, - * and `page:header` (the one block that draws a record's `record_header` / - * `record_more` actions and the system Edit / Share / Delete) is not one of + * and `page:header` (the one block that draws a record's `record_page` / + * folded (`component: 'action:menu'`) actions and the system Edit / Share / Delete) is not one of * them. So the record view draws the same row, through `PageHeaderActions` * (the resolver `page:header` itself draws with), in the chrome row that holds * the Print button, outside the print page's root, where the print stylesheet @@ -105,7 +105,7 @@ const OBJECTS = [ type: 'api', method: 'POST', target: SUBMIT_TARGET, - locations: ['record_header'], + locations: ['record_page'], }, ], }, @@ -224,7 +224,7 @@ afterEach(() => { }); describe('RecordDetailView — a print page draws the record’s header actions in its screen-only chrome beside Print (objectui#12906)', () => { - it('(a) the declared record_header action and Edit / Share / Delete are drawn in the chrome beside Print', async () => { + it('(a) the declared record_page action and Edit / Share / Delete are drawn in the chrome beside Print', async () => { const { onEdit } = await mountRecordPage([PRINT_PAGE]); const chrome = document.querySelector('[data-record-print-chrome]') as HTMLElement; expect(chrome).not.toBeNull(); diff --git a/ui/packages/app-shell/src/views/RecordDetailView.recordIdParamSeed.test.tsx b/ui/packages/app-shell/src/views/RecordDetailView.recordIdParamSeed.test.tsx index 638b74783fe..6962b2f677d 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.recordIdParamSeed.test.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.recordIdParamSeed.test.tsx @@ -18,7 +18,7 @@ * * This call site has two sources `resolveRecordIdParamSeed` alone does not * know about, on top of the row: a literal `recordId` override, and the - * `pageRecord` fallback `record_header` actions rely on when no row is + * `pageRecord` fallback `record_page` actions rely on when no row is * stashed (same fallback `interpolationRecord` above uses for `{field}` URL * tokens). Both are preserved — the tests below pin that, alongside the two * refusal wordings and the happy path — so adopting the helper here did not @@ -273,12 +273,12 @@ describe('RecordDetailView api handler — recordIdParam seeding refuses instead expect(JSON.parse(String(init.body))).toMatchObject({ targetCode: 'INV-1' }); }); - it('falls back to the page record when no row is stashed (record_header actions)', async () => { + it('falls back to the page record when no row is stashed (record_page actions)', async () => { const handlers = await mountAndCaptureHandlers(); let r: any; await act(async () => { - // A record_header-style action: no `_rowRecord` stash, so the only + // A record_page-style action: no `_rowRecord` stash, so the only // source is the page's own loaded record — the fallback // `interpolationRecord` above also relies on. `recordIdField` // defaults to `id`. diff --git a/ui/packages/app-shell/src/views/RecordDetailView.tsx b/ui/packages/app-shell/src/views/RecordDetailView.tsx index 2528c3e2e0d..20c697a96eb 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.tsx @@ -183,7 +183,7 @@ const RECORD_PAGE_APPEND_INSET = 'px-3 md:px-4 lg:px-6'; * action on the record surface, and `ActionEngine.getActionsForLocation` reads the * capability gate off `runner.getContext().user.systemPermissions`. The engine * fails OPEN on `undefined` (unknown ≠ denied), so shipping identity alone - * silently un-gated every `record_header` / `record_more` action that declared + * silently un-gated every `record` / `record_page` action that declared * `requiredPermissions` — the button rendered, and only the server's 403 stopped * it (and only for platform action routes at that). * @@ -200,7 +200,7 @@ const RECORD_PAGE_APPEND_INSET = 'px-3 md:px-4 lg:px-6'; * predating ADR-0066), which is exactly the "unknown" case the engine's own * `Array.isArray(held)` check fails OPEN on — not "holds nothing". Defaulting * it to `[]` here would silently re-introduce the same collapse at this one - * call site and gate every `record_header` / `record_more` action closed on + * call site and gate every `record` / `record_page` action closed on * such a deployment. A REPORTED empty array still forwards as `[]` and gates * strictly, unchanged. */ @@ -2058,7 +2058,7 @@ export function RecordDetailView({ dataSource, objects, onEdit, objectNameOverri // action doesn't retarget another object (a child action interpolated // from the parent's fields would hit the wrong record; same guard as // the recordIdParam fallback below). Without the page-record fallback, - // a `record_header` action reaching here through any dispatch path + // a `record_page` action reaching here through any dispatch path // that doesn't stash `_rowRecord` sent the literal `{id}` on the wire. const interpolationRecord = rowRecord ?? (!action.objectName || action.objectName === objectName @@ -2084,7 +2084,7 @@ export function RecordDetailView({ dataSource, objects, onEdit, objectNameOverri // about — a literal `recordId` override (not a declared ActionDef // field; nothing in this repo's metadata sets it today, hence the // cast) and the same page-record fallback `interpolationRecord` - // above uses for `record_header` actions dispatched with no + // above uses for `record_page` actions dispatched with no // `rowRecord`. Preserve that priority (row -> override -> // page record) and let the helper decide — and word — the // refusal only once every source has been tried, instead of the @@ -2096,7 +2096,7 @@ export function RecordDetailView({ dataSource, objects, onEdit, objectNameOverri // (the only state the early return reads) is flipped // false in a route-keyed microtask, while `pageRecord` lands one // `findOne` round-trip later; for that whole window the real header - // renders with every `record_header` action live. Clicking inside it + // renders with every `record_page` action live. Clicking inside it // seeded from `null`, which `resolveRecordIdParamSeed` deliberately // abstains on (no value AND no error — "no row context" is not that // guard's business), so the request went out naming no record and the @@ -2269,7 +2269,7 @@ export function RecordDetailView({ dataSource, objects, onEdit, objectNameOverri /** * Flow action handler — triggered when an Action with `type: 'flow'` is - * invoked from a record-level location (record_header, record_more, …) or + * invoked from a record-level location (record, record_page, …) or * from a related list on this page. It starts the flow through one of two * doors (objectui#12037, triage ruling B; the rule and its reasons live in * `utils/flowLaunch`): @@ -4737,10 +4737,11 @@ export function RecordDetailView({ dataSource, objects, onEdit, objectNameOverri // `@object-ui/plugin-detail/RecordDetailDrawer`. // Filter actions for the record page header and deduplicate by name. - // Both header locations are included: `record_header` renders inline, - // `record_more` renders inside the header's ⋯ overflow menu (the spec's - // "overflow menu under the More/⋯ button" location — PageHeaderRenderer - // routes record_more-only actions into the overflow; #2358 trap 2). + // Both record page words are included: `record_page` and `record` (which + // `actionRendersAt` draws on the record page too). An action folded into + // the header's ⋯ overflow menu says so with `component: 'action:menu'`, + // which PageHeaderRenderer routes into the overflow (#2358 trap 2; + // until protocol 19 the `record_more` location said it, objectstack#36495). // The set is `placedHeaderActions` (`@object-ui/types`): the ONE reader an // authored `page:header` with `placedActions: true` reads too // (objectstack#29951), so the synthesized header and such a page draw the @@ -5336,7 +5337,7 @@ export function RecordDetailView({ dataSource, objects, onEdit, objectNameOverri const hasAttachments = hasExplicitAttachments(effectivePage as any); // System actions (Edit / Share / Delete) — synthesized for every record - // page so objects without authored record_header actions still surface + // page so objects without authored record_page actions still surface // the basic affordances. // // Placement metadata (objectui#2361): the page header now renders up to @@ -5370,7 +5371,7 @@ export function RecordDetailView({ dataSource, objects, onEdit, objectNameOverri label: t('detail.claim', { defaultValue: 'Claim' }), icon: 'hand', type: 'script', - locations: ['record_header'], + locations: ['record_page'], order: 95, disabled: claiming, onClick: handleClaim, @@ -5387,7 +5388,7 @@ export function RecordDetailView({ dataSource, objects, onEdit, objectNameOverri label: t('detail.cancel', { defaultValue: 'Cancel' }), icon: 'x', type: 'script', - locations: ['record_header'], + locations: ['record_page'], variant: 'outline', order: 99, disabled: recordEditSaving, @@ -5400,7 +5401,7 @@ export function RecordDetailView({ dataSource, objects, onEdit, objectNameOverri : t('detail.save', { defaultValue: 'Save' }), icon: 'check', type: 'script', - locations: ['record_header'], + locations: ['record_page'], // objectstack#35816 — Save is the edit state's one filled button, and // keeps its place after Cancel, as a form's footer orders them. variant: 'primary', @@ -5437,7 +5438,7 @@ export function RecordDetailView({ dataSource, objects, onEdit, objectNameOverri // to read. icon: 'pencil', type: 'script', - locations: ['record_header'], + locations: ['record_page'], order: 100, // objectui#2572 item 4 — while a shared inline-edit draft is live, // the page:header renderer greys this CTA out so the classic form @@ -5508,7 +5509,7 @@ export function RecordDetailView({ dataSource, objects, onEdit, objectNameOverri : t('common.addToFavorites', { defaultValue: 'Add to favorites' }), icon: 'star', type: 'script', - locations: ['record_header'], + locations: ['record_page'], variant: 'outline', order: 105, component: 'action:menu', @@ -5520,7 +5521,7 @@ export function RecordDetailView({ dataSource, objects, onEdit, objectNameOverri label: t('detail.share', { defaultValue: 'Share' }), icon: 'share', type: 'script', - locations: ['record_header'], + locations: ['record_page'], variant: 'outline', order: 110, component: 'action:menu', @@ -5572,7 +5573,7 @@ export function RecordDetailView({ dataSource, objects, onEdit, objectNameOverri label: t('console.changeOwner.title', { defaultValue: 'Change Owner' }), icon: 'user-cog', type: 'script', - locations: ['record_header'], + locations: ['record_page'], variant: 'outline', order: 112, component: 'action:menu', @@ -5589,7 +5590,7 @@ export function RecordDetailView({ dataSource, objects, onEdit, objectNameOverri label: t('detail.openAsFullPage', { defaultValue: 'Open as full page' }), icon: 'arrow-up-right', type: 'script', - locations: ['record_header'], + locations: ['record_page'], variant: 'outline', order: 115, component: 'action:menu', @@ -5604,7 +5605,7 @@ export function RecordDetailView({ dataSource, objects, onEdit, objectNameOverri label: t('detail.copyRecordId', { defaultValue: 'Copy record ID' }), icon: 'copy', type: 'script', - locations: ['record_header'], + locations: ['record_page'], variant: 'outline', order: 113, component: 'action:menu', @@ -5628,7 +5629,7 @@ export function RecordDetailView({ dataSource, objects, onEdit, objectNameOverri // destructive entry apart at the bottom of the menu (objectui#12529). icon: 'trash', type: 'script', - locations: ['record_header'], + locations: ['record_page'], variant: 'danger', order: 120, component: 'action:menu', @@ -5726,7 +5727,7 @@ export function RecordDetailView({ dataSource, objects, onEdit, objectNameOverri : (synthSystemActions.find((action) => action.name === 'sys_edit') as RecordHeaderEditEntry | undefined); // The synth path hands ONLY business actions (authored on objectDef and - // routed to the record_header location, e.g. Lead.convert) to the page + // routed to the record_page location, e.g. Lead.convert) to the page // schema. System actions (Edit / Share / Delete) ride through // `RecordContext.headerSystemActions` instead, so they reach both // synth/slotted pages AND authored full-Lightning pages without @@ -6443,8 +6444,7 @@ export function RecordDetailView({ dataSource, objects, onEdit, objectNameOverri that declares `print` holds only the printable component types, and `page:header` is not one of them, so the record's header actions have no block to draw them on such a page. - This row draws them: the object's declared `record_header` / - `record_more` actions and the system set the + This row draws them: the object's declared `record` / `record_page` actions and the system set the `RecordContextProvider` above hands over (Edit / Share / Delete), through `PageHeaderActions`, the ONE resolver `page:header` draws them with, so each is gated, ordered, diff --git a/ui/packages/app-shell/src/views/RecordDetailView.updateActionRefresh-29935.test.tsx b/ui/packages/app-shell/src/views/RecordDetailView.updateActionRefresh-29935.test.tsx index 5737ba0d22b..758201da2be 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.updateActionRefresh-29935.test.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.updateActionRefresh-29935.test.tsx @@ -109,7 +109,7 @@ const resolveTicket = { type: 'script', operation: 'update', patch: { status: 'resolved' }, - locations: ['record_header'], + locations: ['record_page'], visible: 'record.status != "resolved" && record.status != "closed"', successMessage: 'Ticket resolved.', refreshAfter: false, @@ -121,7 +121,7 @@ const notifyOwner = { label: 'Notify owner', objectName: OBJECT_NAME, type: 'script', - locations: ['record_header'], + locations: ['record_page'], successMessage: 'Owner notified.', refreshAfter: false, }; diff --git a/ui/packages/app-shell/src/views/RelatedRecordActionsBridge.tsx b/ui/packages/app-shell/src/views/RelatedRecordActionsBridge.tsx index 059f4df33c5..a2a1bf6da71 100644 --- a/ui/packages/app-shell/src/views/RelatedRecordActionsBridge.tsx +++ b/ui/packages/app-shell/src/views/RelatedRecordActionsBridge.tsx @@ -41,7 +41,7 @@ * - 查看全部 → the child object's list page scoped to this parent * (`onViewAll`, the related list's "View all" link, * objectui#12741) - * - 子对象 action → the child object's `list_item` actions, and its + * - 子对象 action → the child object's `record_row` actions, and its * `record_related` ones when a parent record is in scope, * executed against the clicked row through the page's shared * ActionRunner @@ -270,17 +270,17 @@ export interface RelatedRecordActionsBridgeProps { * The locations a related list places on each ROW, by whether a parent record * is in scope (objectui#11270). * - * `list_item` places an action on the child's rows wherever the child is + * `record_row` places an action on the child's rows wherever the child is * listed. `record_related` places it on them only inside a parent record's * related-list section: objectstack-ai/objectstack#20937's enforce answer * (triage `5919625056`) read the spec's "actions on a related list section * inside a record" as row placement, and the runtime counts the location among * those that require a record. The child object's own list view reads - * `list_item` alone, in `ObjectView`. + * `record_row` alone, in `ObjectView`. */ -const ROW_LOCATIONS_IN_RECORD = ['list_item', 'record_related'] as const; -const ROW_LOCATIONS = ['list_item'] as const; -const TOOLBAR_LOCATIONS = ['list_toolbar'] as const; +const ROW_LOCATIONS_IN_RECORD = ['record_row', 'record_related'] as const; +const ROW_LOCATIONS = ['record_row'] as const; +const TOOLBAR_LOCATIONS = ['list'] as const; /** * Derive the child object's actions for a related-list surface (the row menu @@ -726,7 +726,7 @@ export function RelatedRecordActionsBridge({ // [objectui#11270] `record_related` joins the row menu only when this // bridge is mounted under a parent record — the record page mounts it // with one; a mount without (the "standalone list" these props allow) - // places `list_item` alone. + // places `record_row` alone. // // [objectui#12870] With `parentFromList` (a custom page) the parent is // each list's own: a list that bound its parent through diff --git a/ui/packages/app-shell/src/views/__tests__/DeclaredActionsBar.test.tsx b/ui/packages/app-shell/src/views/__tests__/DeclaredActionsBar.test.tsx index cd07334d71a..4dc37f18a8a 100644 --- a/ui/packages/app-shell/src/views/__tests__/DeclaredActionsBar.test.tsx +++ b/ui/packages/app-shell/src/views/__tests__/DeclaredActionsBar.test.tsx @@ -118,7 +118,7 @@ const ACTIONS = [ { name: 'approval_bulk', type: 'api', label: 'Bulk', target: '/api/v1/approvals/bulk', - locations: ['list_toolbar'], + locations: ['list'], }, ]; @@ -136,7 +136,7 @@ describe('DeclaredActionsBar', () => { ); expect(screen.getByTestId('declared-action-approval_approve')).toBeInTheDocument(); expect(screen.getByTestId('declared-action-approval_reassign')).toBeInTheDocument(); - // `list_toolbar`-only action must not surface at `record_section`. + // `list`-only action must not surface at `record_section`. expect(screen.queryByTestId('declared-action-approval_bulk')).toBeNull(); }); @@ -175,7 +175,7 @@ describe('DeclaredActionsBar', () => { , ); @@ -261,7 +261,7 @@ describe('DeclaredActionsBar', () => { , diff --git a/ui/packages/app-shell/src/views/__tests__/PageView.listViewAddRecord-13089.test.tsx b/ui/packages/app-shell/src/views/__tests__/PageView.listViewAddRecord-13089.test.tsx index b09c5938e82..a522440288c 100644 --- a/ui/packages/app-shell/src/views/__tests__/PageView.listViewAddRecord-13089.test.tsx +++ b/ui/packages/app-shell/src/views/__tests__/PageView.listViewAddRecord-13089.test.tsx @@ -89,8 +89,8 @@ const OBJECTS = [ fields: FIELDS, // One of each placement, so a served executor would show up as a key. actions: [ - { name: 'invite_user', label: 'Invite user', type: 'api', target: '/api/v1/org/invite', locations: ['list_toolbar'] }, - { name: 'remove', label: 'Remove', type: 'api', target: '/api/v1/members/{id}/remove', locations: ['list_item'] }, + { name: 'invite_user', label: 'Invite user', type: 'api', target: '/api/v1/org/invite', locations: ['list'] }, + { name: 'remove', label: 'Remove', type: 'api', target: '/api/v1/members/{id}/remove', locations: ['record_row'] }, ], }, { name: PAGE_MODE, label: 'Contract', editMode: 'page', fields: { name: FIELDS.name } }, diff --git a/ui/packages/app-shell/src/views/__tests__/PageView.relatedListActions-12870.test.tsx b/ui/packages/app-shell/src/views/__tests__/PageView.relatedListActions-12870.test.tsx index c53d625ec72..45612d2c341 100644 --- a/ui/packages/app-shell/src/views/__tests__/PageView.relatedListActions-12870.test.tsx +++ b/ui/packages/app-shell/src/views/__tests__/PageView.relatedListActions-12870.test.tsx @@ -70,12 +70,12 @@ const CHILD = 'sys_member'; * The child object's registered actions. `invite_user` is the list's header * action; `change_role` a `record_related` row action — placed only inside a * parent record, which the page list is only by its bound parent; `remove` a - * `list_item` row action. + * `record_row` row action. */ const CHILD_ACTIONS = [ - { name: 'invite_user', label: 'Invite user', type: 'api', target: '/api/v1/org/invite', locations: ['list_toolbar'] }, + { name: 'invite_user', label: 'Invite user', type: 'api', target: '/api/v1/org/invite', locations: ['list'] }, { name: 'change_role', label: 'Change role', type: 'api', target: '/api/v1/members/{id}/role', locations: ['record_related'] }, - { name: 'remove', label: 'Remove', type: 'api', target: '/api/v1/members/{id}/remove', locations: ['list_item'] }, + { name: 'remove', label: 'Remove', type: 'api', target: '/api/v1/members/{id}/remove', locations: ['record_row'] }, ]; const OBJECTS = [ diff --git a/ui/packages/app-shell/src/views/__tests__/RelatedRecordActionsBridge.blankVisible-11294.test.tsx b/ui/packages/app-shell/src/views/__tests__/RelatedRecordActionsBridge.blankVisible-11294.test.tsx index c059bc0b509..257977e7b9a 100644 --- a/ui/packages/app-shell/src/views/__tests__/RelatedRecordActionsBridge.blankVisible-11294.test.tsx +++ b/ui/packages/app-shell/src/views/__tests__/RelatedRecordActionsBridge.blankVisible-11294.test.tsx @@ -11,7 +11,7 @@ * `pred == null || pred === ''`, so a whitespace-only `visible` counted as * declared there, was evaluated, and failed closed: the action showed in the * related list's header and was missing from its rows. That held for an - * action placed on the rows by `record_related` and by `list_item` alike. + * action placed on the rows by `record_related` and by `record_row` alike. * * Every case mounts what a record page mounts, as the objectui#11270 suite * beside this file does: the real `RelatedRecordActionsBridge` around the @@ -54,8 +54,8 @@ afterEach(() => { const CHILD_NAME = 'task'; -/** Each action is on the header (`list_toolbar`) and on the rows by one row location. */ -const both = (row: 'record_related' | 'list_item') => ['list_toolbar', row]; +/** Each action is on the header (`list`) and on the rows by one row location. */ +const both = (row: 'record_related' | 'record_row') => ['list', row]; /** * The card's measured table, plus the controls that keep the verdict honest. @@ -71,12 +71,12 @@ const both = (row: 'record_related' | 'list_item') => ['list_toolbar', row]; */ const ROW_ONLY_BLANK = ' '; const CHILD_ACTIONS = [ - { name: 'send_reminder', label: 'Send Reminder', type: 'api', target: '/api/remind', locations: ['list_item'] }, + { name: 'send_reminder', label: 'Send Reminder', type: 'api', target: '/api/remind', locations: ['record_row'] }, { name: 'blank_rr', label: 'Blank RR', type: 'api', target: '/api/b1', locations: both('record_related'), visible: ' ' }, - { name: 'blank_li', label: 'Blank LI', type: 'api', target: '/api/b2', locations: both('list_item'), visible: ' ' }, + { name: 'blank_li', label: 'Blank LI', type: 'api', target: '/api/b2', locations: both('record_row'), visible: ' ' }, { name: 'empty_rr', label: 'Empty RR', type: 'api', target: '/api/e1', locations: both('record_related'), visible: '' }, - { name: 'empty_li', label: 'Empty LI', type: 'api', target: '/api/e2', locations: both('list_item'), visible: '' }, - { name: 'never_li', label: 'Never LI', type: 'api', target: '/api/n', locations: both('list_item'), visible: false }, + { name: 'empty_li', label: 'Empty LI', type: 'api', target: '/api/e2', locations: both('record_row'), visible: '' }, + { name: 'never_li', label: 'Never LI', type: 'api', target: '/api/n', locations: both('record_row'), visible: false }, { name: 'cel_yes_rr', label: 'CEL Yes', type: 'api', target: '/api/c1', locations: ['record_related'], visible: "record.name == 'Write spec'" }, { name: 'cel_no_rr', label: 'CEL No', type: 'api', target: '/api/c2', locations: ['record_related'], visible: "record.name == 'Other'" }, { name: 'blank_row_only', label: 'Blank Row Only', type: 'api', target: '/api/r', locations: ['record_related'], visible: ROW_ONLY_BLANK }, @@ -176,13 +176,13 @@ async function firstRowMenuNames(): Promise { } describe('objectui#11294 — one blank `visible` gives one answer on a related list’s toolbar and rows', () => { - it('a whitespace-only `visible` shows on the toolbar AND the rows, by `record_related` and by `list_item`; `\'\'` is the control', async () => { + it('a whitespace-only `visible` shows on the toolbar AND the rows, by `record_related` and by `record_row`; `\'\'` is the control', async () => { const warn = vi.spyOn(console, 'warn').mockImplementation(() => {}); try { mount(); await screen.findByText('Write spec'); - // The toolbar: every `list_toolbar` action whose gate is blank or empty + // The toolbar: every `list` action whose gate is blank or empty // shows, and the declared `false` does not. await waitFor(() => expect(toolbarNames()).toContain('blank_rr')); expect(toolbarNames()).toEqual(['blank_rr', 'blank_li', 'empty_rr', 'empty_li']); diff --git a/ui/packages/app-shell/src/views/__tests__/RelatedRecordActionsBridge.recordRelated-11270.test.tsx b/ui/packages/app-shell/src/views/__tests__/RelatedRecordActionsBridge.recordRelated-11270.test.tsx index c027d4e430b..85cac4c34c6 100644 --- a/ui/packages/app-shell/src/views/__tests__/RelatedRecordActionsBridge.recordRelated-11270.test.tsx +++ b/ui/packages/app-shell/src/views/__tests__/RelatedRecordActionsBridge.recordRelated-11270.test.tsx @@ -8,8 +8,8 @@ * * The spec declares the location as "actions on a related list section inside * a record". Triage read it as ROW placement (the runtime counts it among the - * locations that require a record, beside `list_item`), scoped to a parent - * record: `list_item` shows on the child's rows wherever the child is listed, + * locations that require a record, beside `record_row`), scoped to a parent + * record: `record_row` shows on the child's rows wherever the child is listed, * `record_related` only on the related-list rows inside a parent record. * * Every case mounts what a record page mounts: the real @@ -59,14 +59,14 @@ const CHILD_NAME = 'task'; /** * The child object's actions. `log_time` is the showcase's `record_related` * specimen reduced to this card's case (a `form` over the child's edit view, - * placed ONLY by `record_related`); `send_reminder` is the `list_item` control. + * placed ONLY by `record_related`); `send_reminder` is the `record_row` control. * `archive` declares both, so it must render once. */ const CHILD_ACTIONS = [ - { name: 'send_reminder', label: 'Send Reminder', type: 'api', target: '/api/remind', locations: ['list_item'] }, + { name: 'send_reminder', label: 'Send Reminder', type: 'api', target: '/api/remind', locations: ['record_row'] }, { name: 'log_time', label: 'Log Time', type: 'form', target: 'task.edit', locations: ['record_related'] }, - { name: 'archive', label: 'Archive', type: 'api', target: '/api/archive', locations: ['list_item', 'record_related'] }, - { name: 'header_only', label: 'Header Only', type: 'api', target: '/api/h', locations: ['record_header'] }, + { name: 'archive', label: 'Archive', type: 'api', target: '/api/archive', locations: ['record_row', 'record_related'] }, + { name: 'header_only', label: 'Header Only', type: 'api', target: '/api/h', locations: ['record_page'] }, ]; const CHILD = { @@ -181,7 +181,7 @@ const waitForRow = () => screen.findByText('Write spec'); const refusal = () => screen.queryByTestId('record-related-list-actions-refused'); describe('objectui#11270 — the host bridge places `record_related` on each related-list row inside a record', () => { - it('a `record_related`-only child action shows in the row menu, beside the `list_item` control, in declared order', async () => { + it('a `record_related`-only child action shows in the row menu, beside the `record_row` control, in declared order', async () => { mount(); await waitForRow(); // `archive` declares both locations and renders ONCE; `header_only` is a @@ -189,10 +189,10 @@ describe('objectui#11270 — the host bridge places `record_related` on each rel expect(await rowMenuNames()).toEqual(['send_reminder', 'log_time', 'archive']); }); - it('with no parent record in scope the bridge places only `list_item` — `record_related` is a record-page placement', async () => { + it('with no parent record in scope the bridge places only `record_row` — `record_related` is a record-page placement', async () => { mount(undefined, { parentRecord: false }); await waitForRow(); - // Control first: the row menu is alive and draws the `list_item` actions, + // Control first: the row menu is alive and draws the `record_row` actions, // so the absence below is the scope rule's, not a dead menu's. expect(await rowMenuNames()).toEqual(['send_reminder', 'archive']); }); @@ -236,8 +236,8 @@ describe('objectui#11270 — the authored `actions` channel accepts a `record_re await waitFor(() => expect(refusal()).not.toBeNull()); const notice = refusal()!; expect(notice).toHaveTextContent('header_only'); - expect(notice).toHaveTextContent(/list_toolbar/); - expect(notice).toHaveTextContent(/list_item/); + expect(notice).toHaveTextContent(/list/); + expect(notice).toHaveTextContent(/record_row/); expect(notice).toHaveTextContent(/record_related/); // The placeable entry beside it still renders. expect(await rowMenuNames()).toEqual(['log_time']); diff --git a/ui/packages/app-shell/src/views/metadata-admin/MetadataTypeActions.confirmDialog-13333.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/MetadataTypeActions.confirmDialog-13333.test.tsx index f82b0cd4307..3527d478130 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/MetadataTypeActions.confirmDialog-13333.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/MetadataTypeActions.confirmDialog-13333.test.tsx @@ -41,7 +41,7 @@ const PURGE = { type: 'api' as const, target: '/api/v1/datasources/${ctx.recordId}/purge', confirmText: 'Every cached row of this datasource is dropped.', - locations: ['record_header', 'list_toolbar'], + locations: ['record_page', 'list'], }; const nativeConfirm = vi.fn(() => true); @@ -64,7 +64,7 @@ afterEach(() => { describe('MetadataTypeActions — confirmText is asked in-app and names the item (objectui#13333)', () => { it('(a) record header: the title names the action and the item; accepting runs it once', async () => { - render(); + render(); fireEvent.click(screen.getByRole('button', { name: 'Purge cache' })); const dialog = await screen.findByRole('alertdialog'); expect(within(dialog).getByRole('heading').textContent).toBe('Purge cache on "warehouse"?'); @@ -76,7 +76,7 @@ describe('MetadataTypeActions — confirmText is asked in-app and names the item }); it('(b) CONTROL: Cancel runs nothing', async () => { - render(); + render(); fireEvent.click(screen.getByRole('button', { name: 'Purge cache' })); const dialog = await screen.findByRole('alertdialog'); fireEvent.click(within(dialog).getByTestId('type-action-confirm-cancel')); @@ -86,7 +86,7 @@ describe('MetadataTypeActions — confirmText is asked in-app and names the item }); it('(c) list toolbar: no item, so the title names the action alone', async () => { - render(); + render(); fireEvent.click(screen.getByRole('button', { name: 'Purge cache' })); const dialog = await screen.findByRole('alertdialog'); expect(within(dialog).getByRole('heading').textContent).toBe('Purge cache?'); diff --git a/ui/packages/app-shell/src/views/metadata-admin/MetadataTypeActions.paramDialogClose-6473.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/MetadataTypeActions.paramDialogClose-6473.test.tsx index 5a9b8289e6a..e64f33ef26f 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/MetadataTypeActions.paramDialogClose-6473.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/MetadataTypeActions.paramDialogClose-6473.test.tsx @@ -129,14 +129,14 @@ const ACTION = { label: 'Sync datasource', type: 'api', target: '/api/v1/datasources/${ctx.recordId}/sync', - locations: ['record_header'], + locations: ['record_page'], params: PARAMS, }; function renderActions(params: unknown[] = PARAMS) { return render( , diff --git a/ui/packages/app-shell/src/views/metadata-admin/MetadataTypeActions.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/MetadataTypeActions.test.tsx index 85e5890b224..a02e624d2c5 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/MetadataTypeActions.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/MetadataTypeActions.test.tsx @@ -59,12 +59,12 @@ describe('MetadataTypeActions', () => { it('renders only actions that declare the requested location', () => { const { container } = render( { it('renders nothing when no action declares the requested location', () => { const { container } = render( , ); @@ -89,9 +89,9 @@ describe('MetadataTypeActions', () => { it('runs an api action without params directly (no dialog)', async () => { render( , ); fireEvent.click(screen.getByTitle('Test')); @@ -104,9 +104,9 @@ describe('MetadataTypeActions', () => { it('collects array params via the dialog and sends them as the body', async () => { render( , ); fireEvent.click(screen.getByTitle('Sync')); @@ -122,9 +122,9 @@ describe('MetadataTypeActions', () => { it('shows the result dialog when the action declares resultDialog', async () => { render( , ); fireEvent.click(screen.getByTitle('Probe')); @@ -147,9 +147,9 @@ describe('MetadataTypeActions', () => { } as never); render( , ); fireEvent.click(screen.getByTitle('Probe')); @@ -169,9 +169,9 @@ describe('MetadataTypeActions', () => { } as never); render( , ); fireEvent.click(screen.getByTitle('Probe')); @@ -190,9 +190,9 @@ describe('MetadataTypeActions', () => { } as never); render( , ); fireEvent.click(screen.getByTitle('Probe')); diff --git a/ui/packages/app-shell/src/views/metadata-admin/MetadataTypeActions.tsx b/ui/packages/app-shell/src/views/metadata-admin/MetadataTypeActions.tsx index cc33e19c553..530b68b853e 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/MetadataTypeActions.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/MetadataTypeActions.tsx @@ -12,8 +12,8 @@ * /api/v1/datasources/${ctx.recordId}/test`). Rendering happens in two * chrome slots: * - * • ResourceEditPage → `location='record_header'`, `recordId` = item name. - * • ResourceListPage → `location='list_toolbar'` (no recordId). + * • ResourceEditPage → `location='record_page'`, `recordId` = item name. + * • ResourceListPage → `location='list'` (no recordId). * * Execution path mirrors ObjectView's auth-aware `apiHandler` rather than the * core ActionRunner's bare `fetch`: the metadata API endpoints require the diff --git a/ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.actionServedRows-35650.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.actionServedRows-35650.test.tsx index 103553085d4..f7338f38acc 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.actionServedRows-35650.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.actionServedRows-35650.test.tsx @@ -49,7 +49,7 @@ const STORED = { label: 'Sign contract', objectName: 'contract', type: 'script', - locations: ['record_header'], + locations: ['record_page'], body: { language: 'js', source: "throw { code: 'SIGN_IN_REQUIRED' };" }, refusals: { SIGN_IN_REQUIRED: { message: 'Sign in first.', status: 401 } }, texts: { email_subject: { message: 'Contract signed' } }, diff --git a/ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.tsx b/ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.tsx index 6ec0447caef..d3cfb801c2e 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.tsx @@ -3034,13 +3034,13 @@ function MetadataResourceEditPageImpl({ const actionsNode = ( <> {/* Declarative type-level actions (GAP-1) — e.g. datasource - "Test connection". Only on a saved item: record_header actions + "Test connection". Only on a saved item: record_page actions template `${ctx.recordId}` from the item name, which `(new)` drafts don't have yet. */} {!createMode && ( setReloadKey((k) => k + 1)} /> diff --git a/ui/packages/app-shell/src/views/metadata-admin/ResourceListPage.tsx b/ui/packages/app-shell/src/views/metadata-admin/ResourceListPage.tsx index d9a0ed8fbc3..9ffd1de5c66 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/ResourceListPage.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/ResourceListPage.tsx @@ -895,11 +895,11 @@ function DefaultMetadataList({ type, appName }: { type: string; appName?: string )); // Declarative type-level actions (GAP-1) scoped to the list toolbar. - // Per-row (`list_item`) actions are not surfaced here yet — they need the + // Per-row (`record_row`) actions are not surfaced here yet — they need the // row's recordId from the grid. const typeActions = ( <> - + {authoredObject && (