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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .changeset/38045-quick-actions-no-record.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
'@objectstack/spec': minor
'@object-ui/plugin-detail': minor
'@object-ui/app-shell': minor
'@object-ui/i18n': minor
---

**BREAKING** (unreleased protocol 19 only): a `record:quick_actions` bar's own `location` no longer accepts `record`.

Clause-②: yes (narrowing)
Metadata-protocol: narrowed

On an action, `record` says what the action acts on: one record, drawn on the record page and on each list row. A bar sits in one place and draws that place's actions, so a two-place word is no answer to "which place is this bar". A bar at `location: 'record'` matched only the actions that declare `record` literally, left out every `record_page` action and skipped the ⋯ fold a bar at `record_page` applies: an empty or wrong bar, with no message.

- `@objectstack/spec`: `RecordQuickActionsProps.location` is `RecordQuickActionsLocationSchema`, every action location except `record`. `location: 'record'` on the bar is refused at parse with a prescription that names `record_page`. A retired word on the bar (`record_header`, `list_item`, `list_toolbar`, `record_more`, `global_nav`) gets a prescription written for a bar, naming the one place to write and never offering `record`. The protocol-19 upgrade step `action-locations-page-parts-retired` now says that a bar's own `location` takes one place only. New exports: `RecordQuickActionsLocationSchema` and its type `RecordQuickActionsLocation`. `record` on an action's own `locations` is unchanged, and so are `action:group` and `action:bar`.
- `@object-ui/plugin-detail`: the bar's registration publishes the same set as its `location` enum, so `sdui.manifest.json` and JSX page validation no longer offer `record` on the bar.
- Studio (`@object-ui/app-shell`): the bar's location dropdown is typed against `RecordQuickActionsLocation`, so it offers exactly the set the spec accepts. The `record` option is gone.
- `@object-ui/i18n`: the option's labels (`Record · page and rows`, 「记录 · 页面与行」) are removed from both catalogues.

Migration — only a bar written against a 19.0.0 prerelease can carry the word; no protocol-18 source can, and the `action-locations-acted-on` conversion never writes it on a bar (it maps a bar's `record_header` to `record_page`, and leaves a bar at `record_more` as stored with a TODO):

| Wrote | Write instead |
|---|---|
| `{ type: 'record:quick_actions', properties: { location: 'record' } }` on a record page | `location: 'record_page'`, or leave the key out (it is the bar's default). The bar draws the record page's actions, the ones placed at `record` included. |
| the same bar meant for the list rows | `location: 'record_row'` |

<!-- adr-0087: not-required (already-registered action-locations-acted-on, action-locations-page-parts-retired) The word became legal on the bar only inside unreleased protocol 19, by the change these two entries register, and this change extends the semantic entry's surface: action-locations-page-parts-retired now says a record:quick_actions bar's own location takes one place only and that record there is refused at parse, naming record_page. The conversion never writes record on a bar: it maps a bar's record_header to record_page, list_item to record_row and list_toolbar to list, and leaves a bar at record_more as stored with a TODO, so no 18-to-19 upgrade ends on the refused value. -->
10 changes: 5 additions & 5 deletions content/docs/references/index.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Protocol reference — every schema by module
navTitle: Protocol Reference
description: Every schema published by @objectstack/spec — 1742 schemas across 14 protocol modules
description: Every schema published by @objectstack/spec — 1743 schemas across 14 protocol modules
---

{/* ⚠️ AUTO-GENERATED — DO NOT EDIT. Run build-docs.ts to regenerate. Hand-written docs live in the module folders under content/docs/. */}
Expand Down Expand Up @@ -35,8 +35,8 @@ counts are sums of the rows they head. Regenerate with
| [Shared Protocol](https://github.com/objectstack-ai/objectstack/tree/main/packages/spec/docs/references/shared) | 10 | 31 | Primitives used across every protocol — identifiers, HTTP, expressions, error maps, enums. |
| [Studio Protocol](https://github.com/objectstack-ai/objectstack/tree/main/packages/spec/docs/references/studio) | 3 | 35 | Studio designer metadata — the authoring surfaces for the protocols above. |
| [System Protocol](https://github.com/objectstack-ai/objectstack/tree/main/packages/spec/docs/references/system) | 40 | 298 | The runtime environment — logging, jobs, cache, metrics, notifications, i18n and compliance. |
| [UI Protocol](/docs/references/ui) | 17 | 186 | Apps, pages, views, dashboards, reports, actions and themes — the ObjectUI layer. |
| **Total** | **223** | **1742** | 14 protocol modules |
| [UI Protocol](/docs/references/ui) | 17 | 187 | Apps, pages, views, dashboards, reports, actions and themes — the ObjectUI layer. |
| **Total** | **223** | **1743** | 14 protocol modules |

---

Expand Down Expand Up @@ -391,13 +391,13 @@ The runtime environment — logging, jobs, cache, metrics, notifications, i18n a

## UI Protocol

**Source:** `packages/spec/src/ui/` · **Import:** `@objectstack/spec/ui` · **17 pages, 186 schemas**
**Source:** `packages/spec/src/ui/` · **Import:** `@objectstack/spec/ui` · **17 pages, 187 schemas**

Apps, pages, views, dashboards, reports, actions and themes — the ObjectUI layer.

| File | Schemas |
| :--- | :--- |
| [`action.zod.ts`](/docs/references/ui/action) | `Action`, `ActionAi`, `ActionLocation`, `ActionParam`, `ActionRefusal`, `ActionText`, `ActionType`, `InlineAction` |
| [`action.zod.ts`](/docs/references/ui/action) | `Action`, `ActionAi`, `ActionLocation`, `ActionParam`, `ActionRefusal`, `ActionText`, `ActionType`, `InlineAction`, `RecordQuickActionsLocation` |
| [`action-params.zod.ts`](/docs/references/ui/action-params) | `ActionSession` |
| [`ai-chat-nav-params.zod.ts`](/docs/references/ui/ai-chat-nav-params) | `AiChatNavParams` |
| [`app.zod.ts`](/docs/references/ui/app) | `ActionNavItem`, `App`, `AppBranding`, `AppContextSelector`, `AppLandingEntry`, `ComponentNavItem`, `DashboardNavItem`, `DocNavItem`, `GroupNavItem`, `NavigationArea`, `NavigationContribution`, `NavigationItem`, `ObjectNavItem`, `PageNavItem`, `ReportNavItem`, `UrlNavItem` |
Expand Down
17 changes: 15 additions & 2 deletions content/docs/references/ui/action.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ declared inline on a page element instead of registered by name).
## TypeScript Usage

```typescript
import { ActionSchema, ActionAiSchema, ActionLocationSchema, ActionParamSchema, ActionRefusalSchema, ActionTextSchema, ActionType, InlineActionSchema } from '@objectstack/spec/ui';
import type { Action, ActionAi, ActionLocation, ActionParam, ActionRefusal, ActionText, ActionType, InlineAction } from '@objectstack/spec/ui';
import { ActionSchema, ActionAiSchema, ActionLocationSchema, ActionParamSchema, ActionRefusalSchema, ActionTextSchema, ActionType, InlineActionSchema, RecordQuickActionsLocationSchema } from '@objectstack/spec/ui';
import type { Action, ActionAi, ActionLocation, ActionParam, ActionRefusal, ActionText, ActionType, InlineAction, RecordQuickActionsLocation } from '@objectstack/spec/ui';

// Validate data
const result = ActionSchema.parse(data);
Expand Down Expand Up @@ -471,3 +471,16 @@ L2 sandboxed JS body — runs inside an isolated VM with declared capabilities

---

## RecordQuickActionsLocation

### Allowed Values

* `list`
* `record_page`
* `record_row`
* `record_related`
* `record_section`


---

2 changes: 1 addition & 1 deletion content/docs/references/ui/component.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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' \| '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`. |
| **location** | `Enum<'list' \| 'record_page' \| 'record_row' \| 'record_related' \| 'record_section'>` | optional | Which single place this bar draws actions for (renderer default: `record_page`) — any action location but `record`: on an action that word says what the action acts on (the record page and each list row), and a bar sits in one place. 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 by a bar 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`). |
Expand Down
2 changes: 1 addition & 1 deletion content/docs/ui/components/record.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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`, `record`, `record_page`, `record_row`, `record_related`, `record_section` | | Which declared action location this bar renders |
| `location` | `enum`: `list`, `record_page`, `record_row`, `record_related`, `record_section` | | Which single place this bar draws actions for — any action location but `record` |
| `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 |
Expand Down
2 changes: 2 additions & 0 deletions packages/spec/api-surface/ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,8 @@
"RecordLineItemsPropsParsed (type)",
"RecordPathProps (const)",
"RecordPathProps (type)",
"RecordQuickActionsLocation (type)",
"RecordQuickActionsLocationSchema (const)",
"RecordQuickActionsProps (const)",
"RecordQuickActionsProps (type)",
"RecordReferenceRailProps (const)",
Expand Down
2 changes: 2 additions & 0 deletions packages/spec/declaration-map/ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,8 @@
"RecordHistoryProps": "ui/RecordHistoryProps",
"RecordLineItemsProps": "ui/RecordLineItemsProps",
"RecordPathProps": "ui/RecordPathProps",
"RecordQuickActionsLocation": "ui/RecordQuickActionsLocation",
"RecordQuickActionsLocationSchema": "ui/RecordQuickActionsLocation",
"RecordQuickActionsProps": "ui/RecordQuickActionsProps",
"RecordReferenceRailProps": "ui/RecordReferenceRailProps",
"RecordRelatedListProps": "ui/RecordRelatedListProps",
Expand Down
2 changes: 2 additions & 0 deletions packages/spec/export-origins/ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,8 @@
"RecordLineItemsProps": "src/ui/component.zod.ts#RecordLineItemsProps (type)",
"RecordLineItemsPropsParsed": "src/ui/component.zod.ts#RecordLineItemsPropsParsed (type)",
"RecordPathProps": "src/ui/component.zod.ts#RecordPathProps (type)",
"RecordQuickActionsLocation": "src/ui/action.zod.ts#RecordQuickActionsLocation (type)",
"RecordQuickActionsLocationSchema": "src/ui/action.zod.ts#RecordQuickActionsLocationSchema (const)",
"RecordQuickActionsProps": "src/ui/component.zod.ts#RecordQuickActionsProps (type)",
"RecordReferenceRailProps": "src/ui/component.zod.ts#RecordReferenceRailProps (type)",
"RecordRelatedListProps": "src/ui/component.zod.ts#RecordRelatedListProps (const)",
Expand Down
1 change: 1 addition & 0 deletions packages/spec/json-schema.manifest/ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@
"ui/RecordHistoryProps",
"ui/RecordLineItemsProps",
"ui/RecordPathProps",
"ui/RecordQuickActionsLocation",
"ui/RecordQuickActionsProps",
"ui/RecordReferenceRailProps",
"ui/RecordRelatedListProps",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@ 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`',
+ '`record_related` and `record_section`. A `record:quick_actions` bar\'s own `location` takes one place '
+ 'only — `record_page` (its default), `record_row`, `record_related`, `record_section` or `list` — and '
+ '`record` there is refused at parse with the prescription naming `record_page`',
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`',
+ 'the order and the buttons of an object\'s actions are its `actionLayout`. A `record:quick_actions` bar '
+ 'names the one place it draws: `record_page` (its default, which draws the actions placed at `record` '
+ 'too), `record_row`, `record_related`, `record_section` or `list` — never `record`',
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 '
Expand All @@ -35,7 +39,8 @@ export const entry: SemanticMigration = {
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.',
+ 'by hand, and no plugin code compares a location to an old word. No `record:quick_actions` bar sets its '
+ 'own `location` to `record`; it is refused at parse with the prescription naming `record_page`.',
conversionIds: ['action-locations-acted-on'],
relevantWhen: { kind: 'stack-declares', keys: ['actions', 'objects', 'pages'] },
};
11 changes: 8 additions & 3 deletions packages/spec/src/type-alias-convention.pin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ import type * as M205 from './ai/object-query-source.zod.js';
import type * as M207 from './api/ai-answer.zod.js';

// ---------------------------------------------------------------------------
// 879 isomorphic aliases: `z.input` === `z.infer`, so no `XParsed` is declared.
// 880 isomorphic aliases: `z.input` === `z.infer`, so no `XParsed` is declared.
//
// That number is machine-checked, not hand-kept. The runtime companion at the
// bottom of this file recomputes the pin count from the source and asserts that
Expand Down Expand Up @@ -1588,6 +1588,7 @@ export type Iso_ui_action__ActionLocationSchema = Assert<Eq< z.input< typeof M15
export type Iso_ui_action__ActionRefusalSchema = Assert<Eq< z.input< typeof M155.ActionRefusalSchema >, z.infer< typeof M155.ActionRefusalSchema > >>;
export type Iso_ui_action__ActionTextSchema = Assert<Eq< z.input< typeof M155.ActionTextSchema >, z.infer< typeof M155.ActionTextSchema > >>;
export type Iso_ui_action__ActionType = Assert<Eq< z.input< typeof M155.ActionType >, z.infer< typeof M155.ActionType > >>;
export type Iso_ui_action__RecordQuickActionsLocationSchema = Assert<Eq< z.input< typeof M155.RecordQuickActionsLocationSchema >, z.infer< typeof M155.RecordQuickActionsLocationSchema > >>;

// ui/app.zod.ts
export type Iso_ui_app__AppBrandingSchema = Assert<Eq< z.input< typeof M156.AppBrandingSchema >, z.infer< typeof M156.AppBrandingSchema > >>;
Expand Down Expand Up @@ -1846,7 +1847,7 @@ describe('ADR-0122 type-alias convention', () => {
// this title and the section header above the pin list — are now asserted
// against the recomputed count below, so neither can go stale without a red
// test naming it.
it('still declares all 879 isomorphic pins', () => {
it('still declares all 880 isomorphic pins', () => {
// The truth of each pin is proved by tsc, not here — an `Assert<Eq<...>>`
// that stops holding is a compile error with the alias named. What tsc
// cannot notice is a pin that was DELETED: removing the assertion removes
Expand Down Expand Up @@ -2982,7 +2983,11 @@ describe('ADR-0122 type-alias convention', () => {
// reader (the build panel in plugin-chatbot) and its producer having been
// deleted by the build retirement (Iso_ai_buildProgress__BuildProgressFrameSchema,
// __BuildProgressPhaseSchema; RETIRED_DEFS_BY_MAJOR[19]). -2.
expect(pins).toHaveLength(879);
// 879 -> 880 is #38045: a `record:quick_actions` bar's own location,
// `RecordQuickActionsLocationSchema` (`ui/action.zod.ts`), the shared
// location enum less `record`, with no default or transform
// (Iso_ui_action__RecordQuickActionsLocationSchema). +1 added.
expect(pins).toHaveLength(880);

// The count is stated in PROSE twice as well — this case's title and the
// section header above the pin list — and until commit c6b05c76a nothing read either
Expand Down
Loading
Loading