From 9dbe6e2c426af67304c623bfc5c416759e1de1a3 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 29 Nov 2026 06:11:46 +0000 Subject: [PATCH 1/9] fix(spec,studio): record:quick_actions location refuses `record`; Studio stops offering it (#38045) WIP: spec narrowing, Studio dropdown, registration enum, pins. Claude-Session: https://claude.ai/code/session_01FEkQ5pH8MaBBP5T2dVcTHL Co-Authored-By: Claude --- packages/spec/src/ui/action.zod.ts | 56 +++++++++++++++---- .../src/ui/component-record-blocks.test.ts | 47 +++++++++++++++- packages/spec/src/ui/component.zod.ts | 4 +- .../__tests__/block-config-i18n.test.ts | 2 +- .../previews/__tests__/block-config.test.ts | 41 +++++++++++++- .../metadata-admin/previews/block-config.ts | 42 ++++++++++---- ui/packages/i18n/src/namespaces/studio/en.ts | 2 +- ui/packages/i18n/src/namespaces/studio/zh.ts | 1 - ui/packages/plugin-detail/src/index.tsx | 9 ++- 9 files changed, 171 insertions(+), 33 deletions(-) diff --git a/packages/spec/src/ui/action.zod.ts b/packages/spec/src/ui/action.zod.ts index caa7f27e1f2..e1c35b96b79 100644 --- a/packages/spec/src/ui/action.zod.ts +++ b/packages/spec/src/ui/action.zod.ts @@ -860,20 +860,56 @@ export const ACTION_LOCATIONS = [ 'record_section', ] as const; +// 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.) +// Named so that a narrowed copy of the enum keeps the same prescriptions. +function retiredActionLocationMessage(input: unknown): string | undefined { + if (input === 'global_nav') return GLOBAL_NAV_RETIRED; + return typeof input === 'string' && Object.prototype.hasOwnProperty.call(PAGE_PART_LOCATIONS_RETIRED, input) + ? PAGE_PART_LOCATIONS_RETIRED[input] + : undefined; +} + export const ActionLocationSchema = z.enum(ACTION_LOCATIONS, { - // 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) => { - 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; - }, + error: (issue) => retiredActionLocationMessage(issue.input), }); export type ActionLocation = z.input; +const RECORD_IS_NO_QUICK_ACTIONS_LOCATION = + '`record` is not a place a `record:quick_actions` bar can be set to. 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. On a record page write `location: \'record_page\'` (the bar\'s default, so ' + + 'the key can be left out): it draws the record page\'s actions, the ones placed at `record` included. A ' + + 'bar for another single place names it: `record_row`, `record_related`, `record_section` or `list`.'; + +/** + * The places a `record:quick_actions` bar's own `location` can be set to: + * every {@link ACTION_LOCATIONS} word except `record` (maintainer ruling A, + * record 7251596106 on objectstack#38045). + * + * `record` answers "what does this action act on" — one record, on the record + * page AND on each list row (`RECORD_SURFACES` in `@object-ui/types`). A bar + * is in one place, so its question is "which place am I", and a two-place word + * is no answer to it: a bar at `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. The bar at `record_page` already draws + * the actions placed at `record`, so nothing is lost by refusing the word. + * + * Derived from the shared enum with `.exclude()`, never a copy of its values: + * a location the vocabulary adds reaches the bar too, and the retired words + * keep their own prescriptions here. Studio's location dropdown for the bar is + * typed against {@link RecordQuickActionsLocation}, so it offers exactly this + * set. `record` on an action's own `locations` is untouched. + */ +export const RecordQuickActionsLocationSchema = ActionLocationSchema.exclude(['record'], { + error: (issue) => (issue.input === 'record' + ? RECORD_IS_NO_QUICK_ACTIONS_LOCATION + : retiredActionLocationMessage(issue.input)), +}); +export type RecordQuickActionsLocation = z.input; + /** * Tool category values for {@link ActionAiSchema.category}. * diff --git a/packages/spec/src/ui/component-record-blocks.test.ts b/packages/spec/src/ui/component-record-blocks.test.ts index e25942afde2..f89b9f8d68d 100644 --- a/packages/spec/src/ui/component-record-blocks.test.ts +++ b/packages/spec/src/ui/component-record-blocks.test.ts @@ -23,6 +23,7 @@ import { RecordHistoryProps, RecordQuickActionsProps, } from './component.zod'; +import { ACTION_LOCATIONS, RecordQuickActionsLocationSchema } from './action.zod'; import { PageComponentType } from './page.zod'; import { RECORD_CONTEXT_BLOCK_TAGS, reactBlockTagFor } from './react-blocks'; @@ -217,7 +218,7 @@ describe('ComponentPropsMap["record:quick_actions"]', () => { expect(message).toContain('actionNames'); }); - it('vets `location` against the spec\'s own ActionLocationSchema — one vocabulary, not a restatement', () => { + it('vets `location` against the shared action-location vocabulary — one vocabulary, not a restatement', () => { 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 @@ -246,6 +247,50 @@ describe('ComponentPropsMap["record:quick_actions"]', () => { }); }); +// #38045 — maintainer ruling A (record 7251596106): `record` is not a place a +// `record:quick_actions` bar can be set to. On an action the word says what it +// acts on (the record page AND each list row); a bar sits in one place, and a +// bar at `record` drew only the actions that declare `record` literally, with +// no ⋯ fold. The bar at `record_page` already draws the `record` actions. +describe('record:quick_actions `location` — single places only, never `record` (#38045)', () => { + // POSITIVE half: without it the refusal below passes just as well on a + // schema that refuses every location, or on an empty accepted set. + it('accepts every action location except `record`, and nothing else', () => { + const expected = ACTION_LOCATIONS.filter((l) => l !== 'record'); + expect(expected.length, 'the accepted set is empty — the pin would be vacuous').toBeGreaterThan(0); + expect([...RecordQuickActionsLocationSchema.options].sort()).toEqual([...expected].sort()); + for (const location of expected) { + expect(RecordQuickActionsProps.parse({ location }), location).toEqual({ location }); + } + }); + + // NEGATIVE half: a hand- or agent-written `location: 'record'` is refused at + // parse, on the `location` path, with the prescription naming `record_page`. + it('refuses `location: \'record\'` with a prescription that names `record_page`', () => { + const result = RecordQuickActionsProps.safeParse({ location: 'record', actionNames: ['approve'] }); + expect(result.success).toBe(false); + const issues = result.error!.issues; + expect(issues).toHaveLength(1); + expect(issues[0]).toMatchObject({ code: 'invalid_value', path: ['location'] }); + expect(issues[0]!.message).toMatch(/^`record` is not a place a `record:quick_actions` bar can be set to\./); + expect(issues[0]!.message).toContain("location: 'record_page'"); + }); + + // The word stays legal where it means what it says: on an action's own + // `locations`. The narrowing is the bar's alone. + it('leaves `record` on the shared action-location enum untouched', () => { + expect(ACTION_LOCATIONS as readonly string[]).toContain('record'); + }); + + // The narrowed copy rides the shared enum: the retired page-part words keep + // their own prescriptions, not the `record` one. + it('keeps the retired words\' own prescriptions on the bar', () => { + const message = messagesOf(RecordQuickActionsProps.safeParse({ location: 'record_header' })); + expect(message).toContain('`record_header` became `record_page`'); + expect(message).not.toContain('is not a place a `record:quick_actions` bar'); + }); +}); + describe('ComponentPropsMap["record:history"]', () => { it('accepts the registration\'s three presentation keys byte-identically', () => { const authored = { limit: 20, emptyText: 'No changes yet', unknownUserText: 'System' }; diff --git a/packages/spec/src/ui/component.zod.ts b/packages/spec/src/ui/component.zod.ts index 9691cdfc75b..e4f5051acf0 100644 --- a/packages/spec/src/ui/component.zod.ts +++ b/packages/spec/src/ui/component.zod.ts @@ -68,7 +68,7 @@ import { AggregationFunction } from '../data/query.zod'; // `{ formats }` while the grid reads `.formats` and lifts nothing. Declared // outside the `ui` barrel so the two carriers share it without publishing it. import { ListViewExportOptionsSchema } from './list-view-export-options'; -import { ActionSchema, ActionType, InlineActionSchema, ActionLocationSchema } from './action.zod'; +import { ActionSchema, ActionType, InlineActionSchema, ActionLocationSchema, RecordQuickActionsLocationSchema } from './action.zod'; import { ASK_AI_RETIRED } from './action-ask-ai-retired'; import { CONFIRM_BESIDE_PARAMS_REFUSAL, declaresConfirmBesideParams } from './action-confirm-beside-params'; import { ACTION_TARGET_ALIASES } from './action-target-aliases'; @@ -2499,7 +2499,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_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: RecordQuickActionsLocationSchema.optional().describe('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: 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`).'), diff --git a/ui/packages/app-shell/src/views/metadata-admin/previews/__tests__/block-config-i18n.test.ts b/ui/packages/app-shell/src/views/metadata-admin/previews/__tests__/block-config-i18n.test.ts index db367773882..0151e9d080f 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/previews/__tests__/block-config-i18n.test.ts +++ b/ui/packages/app-shell/src/views/metadata-admin/previews/__tests__/block-config-i18n.test.ts @@ -316,7 +316,7 @@ describe('en-US labels are unchanged by the key migration (#3913)', () => { // options, incl. the shared `format` list and the shared ALIGN_OPTS 'engine.inspector.pageBlock.option.format.currency': 'Currency', 'engine.inspector.pageBlock.option.align.center': 'Center', - 'engine.inspector.pageBlock.option.location.record': 'Record · page and rows', + 'engine.inspector.pageBlock.option.location.record_page': 'Record page', 'engine.inspector.pageBlock.option.severity.warning': 'Warning', // ── the placeholder family (#3979) ─────────────────────────────────────── // ALL SIX, not a sample: this column was migrated by hand rather than diff --git a/ui/packages/app-shell/src/views/metadata-admin/previews/__tests__/block-config.test.ts b/ui/packages/app-shell/src/views/metadata-admin/previews/__tests__/block-config.test.ts index fbafc9ac335..0558e47c3ad 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/previews/__tests__/block-config.test.ts +++ b/ui/packages/app-shell/src/views/metadata-admin/previews/__tests__/block-config.test.ts @@ -4,6 +4,7 @@ import path from 'node:path'; import { fileURLToPath } from 'node:url'; import { ACTION_LOCATIONS, + RecordQuickActionsLocationSchema, PageAccordionProps, PageComponentType, PageHeaderProps, @@ -360,9 +361,32 @@ describe('page palette ↔ spec PageComponentType coverage', () => { // POSITIVE half. Without it the negative pin below passes on an empty // option list, which is how a deleted dropdown reads as a passing test. - it('offers exactly the locations the spec declares', () => { + // + // The set is the BAR's, not the whole action-location vocabulary: the spec + // narrows `RecordQuickActionsProps.location` to every location but + // `record` (objectstack#38045, maintainer ruling A), and this dropdown + // offers what that schema accepts — read from the schema at run time, so + // the pin cannot agree with a stale copy of the list. + it('offers exactly the locations the spec accepts for the bar', () => { + const offered = (locationField()?.options ?? []).map((o) => o.value); + expect(offered.length, 'option list is empty — the pin would be vacuous').toBeGreaterThan(0); + expect([...offered].sort()).toEqual([...RecordQuickActionsLocationSchema.options].sort()); + }); + + // NEGATIVE pin for objectstack#38045. `record` says what an ACTION acts on + // — the record page and each list row — and a bar sits in one place: a bar + // at `record` drew only the actions that declare `record` literally and + // skipped the ⋯ fold, an empty or wrong bar with no message. The spec now + // refuses the word on the bar with a prescription naming `record_page`, so + // offering it would teach authors — and every AI copying this corpus — to + // write metadata that fails to parse. + it('does NOT offer `record`, which the spec refuses on the bar', () => { const offered = (locationField()?.options ?? []).map((o) => o.value); - expect([...offered].sort()).toEqual([...ACTION_LOCATIONS].sort()); + expect(offered.length, 'option list is empty — the pin would be vacuous').toBeGreaterThan(0); + expect(offered).not.toContain('record'); + expect(RecordQuickActionsLocationSchema.safeParse('record').success).toBe(false); + // …while the word itself stays on the action-location vocabulary. + expect(ACTION_LOCATIONS as readonly string[]).toContain('record'); }); // NEGATIVE pin, converted from the coverage the removed option used to @@ -389,6 +413,19 @@ describe('page palette ↔ spec PageComponentType coverage', () => { expect(t(key, 'en-US')).toBe(key); expect(t(key, 'zh-CN')).toBe(key); }); + + // The same for `record` (objectstack#38045): both locale tables lost + // `…option.location.record` with the option. The control row is a key the + // dropdown still offers, so a `t()` that returned every key unchanged + // could not pass this case. + it('has no leftover translation for the removed `record` option in either locale', () => { + const key = 'engine.inspector.pageBlock.option.location.record'; + expect(t(key, 'en-US')).toBe(key); + expect(t(key, 'zh-CN')).toBe(key); + const control = 'engine.inspector.pageBlock.option.location.record_page'; + expect(t(control, 'en-US')).toBe('Record page'); + expect(t(control, 'zh-CN')).toBe('记录页'); + }); }); }); diff --git a/ui/packages/app-shell/src/views/metadata-admin/previews/block-config.ts b/ui/packages/app-shell/src/views/metadata-admin/previews/block-config.ts index aae9aca0118..54a5b3f40ea 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/previews/block-config.ts +++ b/ui/packages/app-shell/src/views/metadata-admin/previews/block-config.ts @@ -75,6 +75,30 @@ * (`designer.canvas.addSection`). One key per meaning is why that is expressible. */ +import type { RecordQuickActionsLocation } from '@objectstack/spec/ui'; + +/** + * The `record:quick_actions` location dropdown, one label key per place the + * spec lets the bar be set to (objectstack#38045, maintainer ruling A). + * + * Typed as a TOTAL `Record`, the + * `ActionDefaultInspector` `LOCATION_LABELS` mechanism: the compiler holds the + * options equal to the set the spec accepts. A location the bar gains is a + * missing-key error here, and one it refuses is an excess-property error — + * which is what removed `record`: the word says what an ACTION acts on (the + * record page and each list row), a bar sits in one place, and a bar at + * `record` drew only the actions that declare `record` literally. The bar's + * default, `record_page`, already draws those. Insertion order is the display + * order (the renderer default first), not the spec's declaration order. + */ +const QUICK_ACTIONS_LOCATION_LABELS: Record = { + record_page: 'engine.inspector.pageBlock.option.location.record_page', + record_row: 'engine.inspector.pageBlock.option.location.record_row', + record_section: 'engine.inspector.pageBlock.option.location.record_section', + record_related: 'engine.inspector.pageBlock.option.location.record_related', + list: 'engine.inspector.pageBlock.option.location.list', +}; + /** Where a field/field-list picker resolves its object from: * - 'page' — the record page's bound object (draft.object) * - 'self' — a sibling property on the same block (objectProp) @@ -628,18 +652,12 @@ export const BLOCK_CONFIG: Record = { name: 'location', label: 'engine.inspector.pageBlock.field.record:quick_actions.location', kind: 'select', - options: [ - { value: 'record_page', label: 'engine.inspector.pageBlock.option.location.record_page' }, - { value: 'record', label: 'engine.inspector.pageBlock.option.location.record' }, - { value: 'record_row', label: 'engine.inspector.pageBlock.option.location.record_row' }, - { value: 'record_section', label: 'engine.inspector.pageBlock.option.location.record_section' }, - { value: 'record_related', label: 'engine.inspector.pageBlock.option.location.record_related' }, - { value: 'list', label: 'engine.inspector.pageBlock.option.location.list' }, - // No `global_nav` option: the location was retired from the spec's - // `ACTION_LOCATIONS` in @objectstack/spec 17.0.0-rc.6 (objectstack#6888). - // Offering it here would let the designer author a value the schema now - // rejects by name. Pinned negatively in `__tests__/block-config.test.ts`. - ], + // Exactly the places the spec accepts for this bar: no `record` + // (objectstack#38045) and no retired `global_nav` (objectstack#6888) — + // offering either would let the designer author a value the schema + // refuses by name. Pinned both ways in `__tests__/block-config.test.ts`. + options: (Object.keys(QUICK_ACTIONS_LOCATION_LABELS) as RecordQuickActionsLocation[]) + .map((value) => ({ value, label: QUICK_ACTIONS_LOCATION_LABELS[value] })), }, ], diff --git a/ui/packages/i18n/src/namespaces/studio/en.ts b/ui/packages/i18n/src/namespaces/studio/en.ts index fdd127b22c9..363f150d9e1 100644 --- a/ui/packages/i18n/src/namespaces/studio/en.ts +++ b/ui/packages/i18n/src/namespaces/studio/en.ts @@ -1051,13 +1051,13 @@ const STUDIO_EN: Record = { 'engine.inspector.pageBlock.field.record:quick_actions.actionNames': 'Action names', 'engine.inspector.pageBlock.placeholder.record:quick_actions.actionNames': 'action name', 'engine.inspector.pageBlock.field.record:quick_actions.location': 'Location', - 'engine.inspector.pageBlock.option.location.record': 'Record · page and rows', 'engine.inspector.pageBlock.option.location.record_page': 'Record page', 'engine.inspector.pageBlock.option.location.record_section': 'Record section', 'engine.inspector.pageBlock.option.location.record_related': 'Record related', 'engine.inspector.pageBlock.option.location.list': 'List toolbar', 'engine.inspector.pageBlock.option.location.record_row': 'List row', // `…option.location.global_nav` retired with the location itself + // `…option.location.record` went with its option: a quick-actions bar takes one place, never `record` (objectstack#38045) // (objectstack#6888, @objectstack/spec 17.0.0-rc.6). Its only reader was the // dropdown option removed from `previews/block-config.ts`; a key kept past its // option is dead vocabulary that the next author reads as a live surface. diff --git a/ui/packages/i18n/src/namespaces/studio/zh.ts b/ui/packages/i18n/src/namespaces/studio/zh.ts index 797a94b4075..b4762100090 100644 --- a/ui/packages/i18n/src/namespaces/studio/zh.ts +++ b/ui/packages/i18n/src/namespaces/studio/zh.ts @@ -908,7 +908,6 @@ const STUDIO_ZH: Record = { 'engine.inspector.pageBlock.field.record:quick_actions.actionNames': '动作名称', 'engine.inspector.pageBlock.placeholder.record:quick_actions.actionNames': '动作名称', 'engine.inspector.pageBlock.field.record:quick_actions.location': '位置', - 'engine.inspector.pageBlock.option.location.record': '记录 · 页面与行', 'engine.inspector.pageBlock.option.location.record_page': '记录页', 'engine.inspector.pageBlock.option.location.record_section': '记录分区', 'engine.inspector.pageBlock.option.location.record_related': '记录关联列表', diff --git a/ui/packages/plugin-detail/src/index.tsx b/ui/packages/plugin-detail/src/index.tsx index f5869396353..c15cf80aa99 100644 --- a/ui/packages/plugin-detail/src/index.tsx +++ b/ui/packages/plugin-detail/src/index.tsx @@ -31,7 +31,7 @@ import { RecordHistoryRenderer } from './renderers/record-history'; import { RecordReferenceRailRenderer } from './renderers/record-reference-rail'; import { RecordAlertRenderer } from './renderers/record-alert'; import type { DataSource, DetailViewSchema } from '@object-ui/types'; -import { ACTION_LOCATIONS } from '@object-ui/types'; +import { RecordQuickActionsLocationSchema } from '@objectstack/spec/ui'; export { DetailView, DetailSection, DetailTabs, RelatedList }; export { @@ -1105,8 +1105,11 @@ ComponentRegistry.register('quick_actions', RecordQuickActionsRenderer, { // also re-reads the installed describe every run, so a spec that rewords it // turns that file red rather than leaving this text to drift. { name: 'requiredPermissions', type: 'array', of: 'string', description: '[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.' }, - // Derived from the spec's own vocabulary rather than restated — #3019. - { name: 'location', type: 'enum', enum: [...ACTION_LOCATIONS], description: 'Which declared action location this bar renders' }, + // Derived from the spec's own vocabulary rather than restated — #3019 — + // and from the BAR's set, not every action location: the spec refuses + // `record` on this bar (objectstack#38045, maintainer ruling A), so the + // published manifest must not offer it to JSX authors either. + { name: 'location', type: 'enum', enum: [...RecordQuickActionsLocationSchema.options], description: 'Which single place this bar draws actions for — any action location but `record`' }, { name: 'align', type: 'enum', enum: ['start', 'center', 'end'] }, { name: 'inline', type: 'boolean', description: 'Render in the flow instead of folding into the record header' }, { name: 'variant', type: 'string', description: 'Passed to the Button primitive; a per-action variant overrides it' }, From edfe2521930cd0722c59b614d78a832f8d00b307 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 29 Nov 2026 06:15:45 +0000 Subject: [PATCH 2/9] chore(spec): regenerate artifacts for RecordQuickActionsLocationSchema (#38045) Claude-Session: https://claude.ai/code/session_01FEkQ5pH8MaBBP5T2dVcTHL Co-Authored-By: Claude --- content/docs/references/index.mdx | 10 +++++----- content/docs/references/ui/action.mdx | 17 +++++++++++++++-- content/docs/references/ui/component.mdx | 2 +- packages/spec/api-surface/ui.json | 2 ++ packages/spec/declaration-map/ui.json | 2 ++ packages/spec/export-origins/ui.json | 2 ++ packages/spec/json-schema.manifest/ui.json | 1 + 7 files changed, 28 insertions(+), 8 deletions(-) diff --git a/content/docs/references/index.mdx b/content/docs/references/index.mdx index 42379619350..af3d18c41ba 100644 --- a/content/docs/references/index.mdx +++ b/content/docs/references/index.mdx @@ -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/. */} @@ -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 | --- @@ -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` | diff --git a/content/docs/references/ui/action.mdx b/content/docs/references/ui/action.mdx index 7213e69513f..f9de30d9b5a 100644 --- a/content/docs/references/ui/action.mdx +++ b/content/docs/references/ui/action.mdx @@ -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); @@ -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` + + +--- + diff --git a/content/docs/references/ui/component.mdx b/content/docs/references/ui/component.mdx index b8801c7f38b..0ff5c74ce1e 100644 --- a/content/docs/references/ui/component.mdx +++ b/content/docs/references/ui/component.mdx @@ -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`). | diff --git a/packages/spec/api-surface/ui.json b/packages/spec/api-surface/ui.json index 9b884f84ce5..836a682444b 100644 --- a/packages/spec/api-surface/ui.json +++ b/packages/spec/api-surface/ui.json @@ -438,6 +438,8 @@ "RecordLineItemsPropsParsed (type)", "RecordPathProps (const)", "RecordPathProps (type)", + "RecordQuickActionsLocation (type)", + "RecordQuickActionsLocationSchema (const)", "RecordQuickActionsProps (const)", "RecordQuickActionsProps (type)", "RecordReferenceRailProps (const)", diff --git a/packages/spec/declaration-map/ui.json b/packages/spec/declaration-map/ui.json index 556dfc4f846..21653ce8cb8 100644 --- a/packages/spec/declaration-map/ui.json +++ b/packages/spec/declaration-map/ui.json @@ -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", diff --git a/packages/spec/export-origins/ui.json b/packages/spec/export-origins/ui.json index d1c24a34bd6..61691ea18aa 100644 --- a/packages/spec/export-origins/ui.json +++ b/packages/spec/export-origins/ui.json @@ -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)", diff --git a/packages/spec/json-schema.manifest/ui.json b/packages/spec/json-schema.manifest/ui.json index 77b2b243653..610b35e070c 100644 --- a/packages/spec/json-schema.manifest/ui.json +++ b/packages/spec/json-schema.manifest/ui.json @@ -151,6 +151,7 @@ "ui/RecordHistoryProps", "ui/RecordLineItemsProps", "ui/RecordPathProps", + "ui/RecordQuickActionsLocation", "ui/RecordQuickActionsProps", "ui/RecordReferenceRailProps", "ui/RecordRelatedListProps", From 8ad69b222702283ed91090d85e45cb43c9a7828a Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 29 Nov 2026 06:28:01 +0000 Subject: [PATCH 3/9] chore: regenerate sdui manifest and component reference for the bar's location set (#38045) Claude-Session: https://claude.ai/code/session_01FEkQ5pH8MaBBP5T2dVcTHL Co-Authored-By: Claude --- content/docs/ui/components/record.mdx | 2 +- scripts/sdui-manifest.record.json | 6 +++--- sdui.manifest.json | 3 +-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/content/docs/ui/components/record.mdx b/content/docs/ui/components/record.mdx index cb3e240a1d9..d43d9fdd664 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`, `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 | diff --git a/scripts/sdui-manifest.record.json b/scripts/sdui-manifest.record.json index 2219b1d8872..e7b3143b9a3 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-27", - "sha256": "35af7307b195e14956e951fd116d04bf9546aab7ffca1bb40ee7b1ed7a8571ee", + "generatedAt": "2026-11-29", + "sha256": "9c29305ec8db2f727a393065f00e8c528a772db19f5bdf533759d2b09c8b9876", "components": 106, "inTree": { "modulesRoot": "ui/apps/console", - "objectuiWorkspaceVersion": "19.0.0-next.0" + "objectuiWorkspaceVersion": "19.0.0-next.2" } } diff --git a/sdui.manifest.json b/sdui.manifest.json index ad3fa38746c..c2d7a096687 100644 --- a/sdui.manifest.json +++ b/sdui.manifest.json @@ -2048,13 +2048,12 @@ "type": "enum", "enum": [ "list", - "record", "record_page", "record_row", "record_related", "record_section" ], - "description": "Which declared action location this bar renders" + "description": "Which single place this bar draws actions for — any action location but `record`" }, { "name": "align", From 8a55fce7807e229fbdaf94e2a15c3fd8cbb452ca Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 29 Nov 2026 06:44:42 +0000 Subject: [PATCH 4/9] chore: changeset for the record:quick_actions location narrowing (#38045) Claude-Session: https://claude.ai/code/session_01FEkQ5pH8MaBBP5T2dVcTHL Co-Authored-By: Claude --- .changeset/38045-quick-actions-no-record.md | 27 +++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .changeset/38045-quick-actions-no-record.md diff --git a/.changeset/38045-quick-actions-no-record.md b/.changeset/38045-quick-actions-no-record.md new file mode 100644 index 00000000000..d197192e6ce --- /dev/null +++ b/.changeset/38045-quick-actions-no-record.md @@ -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-②: no (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`. The retired page-part words keep their own prescriptions. 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`): + +| 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'` | + + From 407f0cc43ebbc82ee09db125ac0147b4b1f4bea1 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 29 Nov 2026 07:22:33 +0000 Subject: [PATCH 5/9] test(spec): pin RecordQuickActionsLocationSchema as isomorphic under ADR-0122 (#38045) Claude-Session: https://claude.ai/code/session_01FEkQ5pH8MaBBP5T2dVcTHL Co-Authored-By: Claude --- packages/spec/src/type-alias-convention.pin.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/spec/src/type-alias-convention.pin.test.ts b/packages/spec/src/type-alias-convention.pin.test.ts index 2d56e6314f8..4e0215077ad 100644 --- a/packages/spec/src/type-alias-convention.pin.test.ts +++ b/packages/spec/src/type-alias-convention.pin.test.ts @@ -1588,6 +1588,7 @@ export type Iso_ui_action__ActionLocationSchema = Assert, z.infer< typeof M155.ActionRefusalSchema > >>; export type Iso_ui_action__ActionTextSchema = Assert, z.infer< typeof M155.ActionTextSchema > >>; export type Iso_ui_action__ActionType = Assert, z.infer< typeof M155.ActionType > >>; +export type Iso_ui_action__RecordQuickActionsLocationSchema = Assert, z.infer< typeof M155.RecordQuickActionsLocationSchema > >>; // ui/app.zod.ts export type Iso_ui_app__AppBrandingSchema = Assert, z.infer< typeof M156.AppBrandingSchema > >>; From aeb79b981c8896ccd6deacd6673d98bbed3cd387 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 29 Nov 2026 07:40:23 +0000 Subject: [PATCH 6/9] test(spec): count the new isomorphic pin (#38045) Claude-Session: https://claude.ai/code/session_01FEkQ5pH8MaBBP5T2dVcTHL Co-Authored-By: Claude --- packages/spec/src/type-alias-convention.pin.test.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/spec/src/type-alias-convention.pin.test.ts b/packages/spec/src/type-alias-convention.pin.test.ts index 4e0215077ad..79d059e5ed7 100644 --- a/packages/spec/src/type-alias-convention.pin.test.ts +++ b/packages/spec/src/type-alias-convention.pin.test.ts @@ -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 @@ -1847,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>` // 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 @@ -2983,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 From c68dfcc79a5b1746bfab4e92ec6d010120c3e003 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 29 Nov 2026 09:40:31 +0000 Subject: [PATCH 7/9] =?UTF-8?q?fix(spec):=20the=20protocol-19=20location?= =?UTF-8?q?=20step=20names=20the=20bar's=20single=20places;=20bar-worded?= =?UTF-8?q?=20retired-word=20prescriptions;=20Clause-=E2=91=A1=20yes=20(#3?= =?UTF-8?q?8045)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Claude-Session: https://claude.ai/code/session_01FEkQ5pH8MaBBP5T2dVcTHL Co-Authored-By: Claude --- .changeset/38045-quick-actions-no-record.md | 8 ++-- .../19.action-locations-page-parts-retired.ts | 11 ++++-- packages/spec/src/ui/action.zod.ts | 38 ++++++++++++++++--- .../src/ui/component-record-blocks.test.ts | 34 +++++++++++++---- 4 files changed, 71 insertions(+), 20 deletions(-) diff --git a/.changeset/38045-quick-actions-no-record.md b/.changeset/38045-quick-actions-no-record.md index d197192e6ce..c3cdf579701 100644 --- a/.changeset/38045-quick-actions-no-record.md +++ b/.changeset/38045-quick-actions-no-record.md @@ -7,21 +7,21 @@ **BREAKING** (unreleased protocol 19 only): a `record:quick_actions` bar's own `location` no longer accepts `record`. -Clause-②: no (narrowing) +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`. The retired page-part words keep their own prescriptions. New exports: `RecordQuickActionsLocationSchema` and its type `RecordQuickActionsLocation`. `record` on an action's own `locations` is unchanged, and so are `action:group` and `action:bar`. +- `@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`): +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'` | - + 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 index 4b248b629de..90dcb6fa2e1 100644 --- 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 @@ -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 ' @@ -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'] }, }; diff --git a/packages/spec/src/ui/action.zod.ts b/packages/spec/src/ui/action.zod.ts index e1c35b96b79..cdca673184b 100644 --- a/packages/spec/src/ui/action.zod.ts +++ b/packages/spec/src/ui/action.zod.ts @@ -864,7 +864,6 @@ export const ACTION_LOCATIONS = [ // 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.) -// Named so that a narrowed copy of the enum keeps the same prescriptions. function retiredActionLocationMessage(input: unknown): string | undefined { if (input === 'global_nav') return GLOBAL_NAV_RETIRED; return typeof input === 'string' && Object.prototype.hasOwnProperty.call(PAGE_PART_LOCATIONS_RETIRED, input) @@ -884,6 +883,28 @@ const RECORD_IS_NO_QUICK_ACTIONS_LOCATION = + 'the key can be left out): it draws the record page\'s actions, the ones placed at `record` included. A ' + 'bar for another single place names it: `record_row`, `record_related`, `record_section` or `list`.'; +// The retired words, answered for a BAR. The shared prescriptions above are +// written for an action and offer `record` (an action on the record page AND +// each list row), which a bar refuses; a bar is told the one place to write. +const QUICK_ACTIONS_BAR_PLACES_TAIL = + ' A `record:quick_actions` bar names the one place it draws: `record_page` (its default), `record_row`, ' + + '`record_related`, `record_section` or `list`. ' + + '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 QUICK_ACTIONS_BAR_RETIRED: Readonly> = { + global_nav: '`global_nav` was removed from the action locations in @objectstack/spec 17: no surface ever drew it.' + + QUICK_ACTIONS_BAR_PLACES_TAIL, + list_toolbar: '`list_toolbar` became `list` in @objectstack/spec 19: a bar on the list page toolbar writes ' + + '`location: \'list\'`.' + QUICK_ACTIONS_BAR_PLACES_TAIL, + list_item: '`list_item` became `record_row` in @objectstack/spec 19: a bar on each list row writes ' + + '`location: \'record_row\'`.' + QUICK_ACTIONS_BAR_PLACES_TAIL, + record_header: '`record_header` became `record_page` in @objectstack/spec 19: a bar on the record page writes ' + + '`location: \'record_page\'`, or leaves the key out.' + QUICK_ACTIONS_BAR_PLACES_TAIL, + record_more: '`record_more` left the action locations in @objectstack/spec 19, and a bar of the ⋯ menu\'s ' + + 'actions has no replacement word: the ⋯ menu is no location of its own now. A bar at `record_page` draws ' + + 'the record page\'s actions and leaves out the ones folded into the ⋯ menu (`component: \'action:menu\'`).' + + QUICK_ACTIONS_BAR_PLACES_TAIL, +}; + /** * The places a `record:quick_actions` bar's own `location` can be set to: * every {@link ACTION_LOCATIONS} word except `record` (maintainer ruling A, @@ -898,15 +919,20 @@ const RECORD_IS_NO_QUICK_ACTIONS_LOCATION = * the actions placed at `record`, so nothing is lost by refusing the word. * * Derived from the shared enum with `.exclude()`, never a copy of its values: - * a location the vocabulary adds reaches the bar too, and the retired words - * keep their own prescriptions here. Studio's location dropdown for the bar is + * a location the vocabulary adds reaches the bar too. The retired words get a + * prescription written for a bar, which names one place and never offers + * `record` (the shared ones are written for an action and do). Every other + * value keeps zod's own enum error. Studio's location dropdown for the bar is * typed against {@link RecordQuickActionsLocation}, so it offers exactly this * set. `record` on an action's own `locations` is untouched. */ export const RecordQuickActionsLocationSchema = ActionLocationSchema.exclude(['record'], { - error: (issue) => (issue.input === 'record' - ? RECORD_IS_NO_QUICK_ACTIONS_LOCATION - : retiredActionLocationMessage(issue.input)), + error: (issue) => { + if (issue.input === 'record') return RECORD_IS_NO_QUICK_ACTIONS_LOCATION; + return typeof issue.input === 'string' && Object.prototype.hasOwnProperty.call(QUICK_ACTIONS_BAR_RETIRED, issue.input) + ? QUICK_ACTIONS_BAR_RETIRED[issue.input] + : undefined; + }, }); export type RecordQuickActionsLocation = z.input; diff --git a/packages/spec/src/ui/component-record-blocks.test.ts b/packages/spec/src/ui/component-record-blocks.test.ts index f89b9f8d68d..86528564071 100644 --- a/packages/spec/src/ui/component-record-blocks.test.ts +++ b/packages/spec/src/ui/component-record-blocks.test.ts @@ -23,7 +23,7 @@ import { RecordHistoryProps, RecordQuickActionsProps, } from './component.zod'; -import { ACTION_LOCATIONS, RecordQuickActionsLocationSchema } from './action.zod'; +import { ACTION_LOCATIONS, ActionLocationSchema, RecordQuickActionsLocationSchema } from './action.zod'; import { PageComponentType } from './page.zod'; import { RECORD_CONTEXT_BLOCK_TAGS, reactBlockTagFor } from './react-blocks'; @@ -282,12 +282,32 @@ describe('record:quick_actions `location` — single places only, never `record` expect(ACTION_LOCATIONS as readonly string[]).toContain('record'); }); - // The narrowed copy rides the shared enum: the retired page-part words keep - // their own prescriptions, not the `record` one. - it('keeps the retired words\' own prescriptions on the bar', () => { - const message = messagesOf(RecordQuickActionsProps.safeParse({ location: 'record_header' })); - expect(message).toContain('`record_header` became `record_page`'); - expect(message).not.toContain('is not a place a `record:quick_actions` bar'); + // The retired words get a prescription written for a BAR: it names the + // one place to write and never offers `record`, which the bar refuses (the + // shared prescriptions are written for an action, and offer it). + it('answers each retired word on the bar with a single place, never `record`', () => { + const expected: Record = { + list_toolbar: "location: 'list'", + list_item: "location: 'record_row'", + record_header: "location: 'record_page'", + record_more: '`record_page`', + global_nav: '`record_page`', + }; + for (const [word, place] of Object.entries(expected)) { + const result = RecordQuickActionsProps.safeParse({ location: word }); + expect(result.success, word).toBe(false); + const issues = result.error!.issues; + expect(issues, word).toHaveLength(1); + expect(issues[0], word).toMatchObject({ code: 'invalid_value', path: ['location'] }); + const message = issues[0]!.message; + expect(message, word).toMatch(new RegExp(`^\`${word}\``)); + expect(message, word).toContain(place); + expect(message, word).not.toMatch(/`record`/); + expect(message, word).not.toContain('is not a place a `record:quick_actions` bar'); + } + // …while the shared enum keeps its action-side prescription, `record` offer included. + const shared = messagesOf(ActionLocationSchema.safeParse('record_header')); + expect(shared).toContain('or `record`'); }); }); From 7fb066f76770832ece0fed4ebd445db9ffa8ec92 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 29 Nov 2026 12:10:22 +0000 Subject: [PATCH 8/9] chore: regenerate the protocol reference index after merging main Main dropped one published schema while this branch adds RecordQuickActionsLocation, so the counts read 1742 total and 187 in UI. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01QsR2jT4byCJU6xgZwQDh8y --- content/docs/references/index.mdx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/content/docs/references/index.mdx b/content/docs/references/index.mdx index af3d18c41ba..251bd5a0b69 100644 --- a/content/docs/references/index.mdx +++ b/content/docs/references/index.mdx @@ -1,7 +1,7 @@ --- title: Protocol reference — every schema by module navTitle: Protocol Reference -description: Every schema published by @objectstack/spec — 1743 schemas across 14 protocol modules +description: Every schema published by @objectstack/spec — 1742 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/. */} @@ -23,7 +23,7 @@ counts are sums of the rows they head. Regenerate with | Module | Pages | Schemas | Description | | :--- | ---: | ---: | :--- | | [AI Protocol](/docs/references/ai) | 17 | 102 | Agents, tools, skills, RAG and knowledge sources, model registry, conversations. | -| [API Protocol](https://github.com/objectstack-ai/objectstack/tree/main/packages/spec/docs/references/api) | 37 | 529 | REST contracts, endpoints, routing, realtime, batch, discovery. | +| [API Protocol](https://github.com/objectstack-ai/objectstack/tree/main/packages/spec/docs/references/api) | 37 | 528 | REST contracts, endpoints, routing, realtime, batch, discovery. | | [Automation Protocol](/docs/references/automation) | 16 | 82 | Flows and their nodes, approvals, ETL pipelines, webhooks, state machines, execution records. | | [Data Protocol](/docs/references/data) | 35 | 197 | Objects, fields, queries, filters, datasources and drivers — the ObjectQL layer. | | [Identity Protocol](https://github.com/objectstack-ai/objectstack/tree/main/packages/spec/docs/references/identity) | 5 | 27 | Users and accounts, organizations, positions, SCIM provisioning. | @@ -36,7 +36,7 @@ counts are sums of the rows they head. Regenerate with | [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 | 187 | Apps, pages, views, dashboards, reports, actions and themes — the ObjectUI layer. | -| **Total** | **223** | **1743** | 14 protocol modules | +| **Total** | **223** | **1742** | 14 protocol modules | --- @@ -70,7 +70,7 @@ Agents, tools, skills, RAG and knowledge sources, model registry, conversations. ## API Protocol -**Source:** `packages/spec/src/api/` · **Import:** `@objectstack/spec/api` · **37 pages, 529 schemas** +**Source:** `packages/spec/src/api/` · **Import:** `@objectstack/spec/api` · **37 pages, 528 schemas** REST contracts, endpoints, routing, realtime, batch, discovery. @@ -98,7 +98,7 @@ REST contracts, endpoints, routing, realtime, batch, discovery. | [`odata.zod.ts`](https://github.com/objectstack-ai/objectstack/blob/main/packages/spec/docs/references/api/odata.md) | `ODataConfig`, `ODataError`, `ODataFilterFunction`, `ODataMetadata`, `ODataQuery`, `ODataResponse` | | [`package-api.zod.ts`](https://github.com/objectstack-ai/objectstack/blob/main/packages/spec/docs/references/api/package-api.md) | `GetInstalledPackageRequest`, `ListInstalledPackagesRequest`, `PackageApiErrorCode`, `PackageInstallBody`, `PackageInstallManifest`, `PackageInstallRequest`, `PackageInstallResponse`, `PackagePathParams`, `PackageRollbackRequest`, `PackageUpgradeRequest`, `PackageUpgradeResponse`, `ResolveDependenciesRequest`, `ResolveDependenciesResponse`, `UninstallPackageApiRequest`, `UninstallPackageApiResponse`, `UploadArtifactRequest`, `UploadArtifactResponse` | | [`package-api-assembled.zod.ts`](https://github.com/objectstack-ai/objectstack/blob/main/packages/spec/docs/references/api/package-api-assembled.md) | `AssembledInstalledPackage`, `GetInstalledPackageResponse`, `InstalledPackageAtEitherStage`, `ListInstalledPackagesResponse` | -| [`package-lifecycle.zod.ts`](https://github.com/objectstack-ai/objectstack/blob/main/packages/spec/docs/references/api/package-lifecycle.md) | `DiscardPackageDraftsResponse`, `DuplicatePackageResponse`, `EnsureCustomizationPackageRequest`, `EnsureCustomizationPackageResponse`, `GetPackageCustomizationsRequest`, `GetPackageCustomizationsResponse`, `ImportUnmanagedPackageRequest`, `ImportUnmanagedPackageResponse`, `ListPackageCommitsResponse`, `MoveIntoPackageItem`, `MoveIntoPackageMovedItem`, `MoveIntoPackageRefusedItem`, `MoveIntoPackageRequest`, `MoveIntoPackageResponse`, `PackageExportBundle`, `PackageExportManifest`, `PackagePublishResult`, `ReassignOrphanedMetadataResponse`, `RevertPackageCommitResponse`, `RollbackToPackageCommitResponse` | +| [`package-lifecycle.zod.ts`](https://github.com/objectstack-ai/objectstack/blob/main/packages/spec/docs/references/api/package-lifecycle.md) | `DiscardPackageDraftsResponse`, `DuplicatePackageResponse`, `EnsureCustomizationPackageRequest`, `EnsureCustomizationPackageResponse`, `GetPackageCustomizationsRequest`, `GetPackageCustomizationsResponse`, `ImportUnmanagedPackageRequest`, `ImportUnmanagedPackageResponse`, `ListPackageCommitsResponse`, `MoveIntoPackageItem`, `MoveIntoPackageMovedItem`, `MoveIntoPackageRefusedItem`, `MoveIntoPackageRequest`, `MoveIntoPackageResponse`, `PackageExportBundle`, `PackageExportManifest`, `PackagePublishResult`, `RevertPackageCommitResponse`, `RollbackToPackageCommitResponse` | | [`plugin-rest-api.zod.ts`](https://github.com/objectstack-ai/objectstack/blob/main/packages/spec/docs/references/api/plugin-rest-api.md) | `ErrorHandlingConfig`, `OpenApiGenerationConfig`, `RequestValidationConfig`, `ResponseEnvelopeConfig`, `RestApiEndpoint`, `RestApiPluginConfig`, `RestApiRouteCategory`, `RestApiRouteRegistration`, `ValidationMode` | | [`protocol.zod.ts`](https://github.com/objectstack-ai/objectstack/blob/main/packages/spec/docs/references/api/protocol.md) | `AiAgentCapabilities`, `AiAgentChatRequest`, `AiAgentSummary`, `AiAgentsResponse`, `AiChatRequest`, `AiChatResponse`, `AiCompleteRequest`, `AiConversation`, `AiConversationMessage`, `AiMessage`, `AiModelsResponse`, `AiPendingAction`, `AiPendingActionStatus`, `AiStreamChunk`, `ApproveAiPendingActionResponse`, `AuditMetaItemRequest`, `AuditMetaItemResponse`, `AutomationActionsResponse`, `AutomationTriggerRequest`, `AutomationTriggerResponse`, `BatchDataRequest`, `BatchDataResponse`, `BuildProbeReport`, `CheckPermissionRequest`, `CheckPermissionResponse`, `CloneDataResponse`, `CreateAiConversationRequest`, `CreateDataRequest`, `CreateDataResponse`, `CreateManyDataRequest`, `CreateManyDataResponse`, `DeleteDataRequest`, `DeleteDataResponse`, `DeleteManyDataRequest`, `DeleteManyDataResponse`, `DeleteMetaItemRequest`, `DeleteMetaItemResponse`, `DestructiveChangeIssue`, `DiffMetaItemRequest`, `DiffMetaItemResponse`, `DisablePackageRequest`, `DisablePackageResponse`, `EnablePackageRequest`, `EnablePackageResponse`, `FieldStillShownBy`, `FindDataRequest`, `FindDataResponse`, `FindReferencesToMetaResponse`, `FlowRegistration`, `FlowRegistrationRefusal`, `GetDataRequest`, `GetDataResponse`, `GetDiscoveryRequest`, `GetDiscoveryResponse`, `GetEffectivePermissionsRequest`, `GetEffectivePermissionsResponse`, `GetFieldLabelsRequest`, `GetFieldLabelsResponse`, `GetLocalesRequest`, `GetLocalesResponse`, `GetMetaDiagnosticsResponse`, `GetMetaItemCachedRequest`, `GetMetaItemCachedResponse`, `GetMetaItemLayeredRequest`, `GetMetaItemLayeredResponse`, `GetMetaItemRequest`, `GetMetaItemResponse`, `GetMetaItemsRequest`, `GetMetaItemsResponse`, `GetMetaTypesRequest`, `GetMetaTypesResponse`, `GetNotificationPreferencesRequest`, `GetNotificationPreferencesResponse`, `GetObjectPermissionsRequest`, `GetObjectPermissionsResponse`, `GetPackageRequest`, `GetPackageResponse`, `GetPresenceRequest`, `GetPresenceResponse`, `GetPublishedMetaItemResponse`, `GetRecordFieldAccessResponse`, `GetTranslationsRequest`, `GetTranslationsResponse`, `GetUiViewRequest`, `GetUiViewResponse`, `HistoryMetaItemRequest`, `HistoryMetaItemResponse`, `HttpFindQueryParams`, `InstallPackageRequest`, `InstallPackageResponse`, `ListAiConversationsRequest`, `ListAiConversationsResponse`, `ListAiPendingActionsRequest`, `ListAiPendingActionsResponse`, `ListDraftsResponse`, `ListNotificationsRequest`, `ListNotificationsResponse`, `ListPackagesRequest`, `ListPackagesResponse`, `MarkAllNotificationsReadRequest`, `MarkAllNotificationsReadResponse`, `MarkNotificationsReadRequest`, `MarkNotificationsReadResponse`, `MetadataAuthoringClient`, `MetadataAuthoringSurface`, `MetadataConflictError`, `Notification`, `NotificationPreferences`, `PublicFormSubmitResponse`, `PublishMetaItemRequest`, `PublishMetaItemResponse`, `PublishPackageDraftsRequest`, `PublishPackageDraftsResponse`, `RealtimeConnectRequest`, `RealtimeConnectResponse`, `RealtimeDisconnectRequest`, `RealtimeDisconnectResponse`, `RealtimeSubscribeRequest`, `RealtimeSubscribeResponse`, `RealtimeUnsubscribeRequest`, `RealtimeUnsubscribeResponse`, `RegisterDeviceRequest`, `RegisterDeviceResponse`, `RejectAiPendingActionResponse`, `RollbackMetaItemRequest`, `RollbackMetaItemResponse`, `RuntimeAuthoringIssue`, `RuntimeBuildIssue`, `SaveMetaItemRequest`, `SaveMetaItemResponse`, `SearchAllHit`, `SearchAllPageHit`, `SearchAllResponse`, `SeedAppliedIdList`, `SeedAppliedLanded`, `SetPresenceRequest`, `SetPresenceResponse`, `UninstallPackageRequest`, `UninstallPackageResponse`, `UnregisterDeviceRequest`, `UnregisterDeviceResponse`, `UpdateAiConversationRequest`, `UpdateDataRequest`, `UpdateDataResponse`, `UpdateManyDataRequest`, `UpdateManyDataResponse`, `UpdateNotificationPreferencesRequest`, `UpdateNotificationPreferencesResponse`, `ValidateDataIssue`, `ValidateDataRequest`, `ValidateDataResponse` | | [`push-delivery.zod.ts`](https://github.com/objectstack-ai/objectstack/blob/main/packages/spec/docs/references/api/push-delivery.md) | `PushDeliveryData`, `PushRoute` | From 5496b7a4f5d724d6fc307244608d0c9cfc1acf41 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 29 Nov 2026 12:11:54 +0000 Subject: [PATCH 9/9] fix(spec): a bar's global_nav prescription drops the migrate sentence no conversion backs On a record:quick_actions bar, the five retired location words shared one tail ending in the `os migrate meta --from 18` sentence. Protocol 19's step covers the four page-part words on a bar, but no conversion ever covered a bar's own `global_nav`, so the sentence was untrue for that row. The tail is split: the places sentence for all five, the migrate sentence for the four. The bar's pin now holds both halves. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01QsR2jT4byCJU6xgZwQDh8y --- packages/spec/src/ui/action.zod.ts | 14 +++++++++++--- .../spec/src/ui/component-record-blocks.test.ts | 10 ++++++++-- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/packages/spec/src/ui/action.zod.ts b/packages/spec/src/ui/action.zod.ts index cdca673184b..676d70247e8 100644 --- a/packages/spec/src/ui/action.zod.ts +++ b/packages/spec/src/ui/action.zod.ts @@ -886,13 +886,21 @@ const RECORD_IS_NO_QUICK_ACTIONS_LOCATION = // The retired words, answered for a BAR. The shared prescriptions above are // written for an action and offer `record` (an action on the record page AND // each list row), which a bar refuses; a bar is told the one place to write. -const QUICK_ACTIONS_BAR_PLACES_TAIL = +const QUICK_ACTIONS_BAR_PLACES = ' A `record:quick_actions` bar names the one place it draws: `record_page` (its default), `record_row`, ' - + '`record_related`, `record_section` or `list`. ' + + '`record_related`, `record_section` or `list`.'; +// The house migrate sentence (`shared/retired-key.ts`), true only where a +// conversion covers the word: protocol 19's `action-locations-acted-on` +// rewrites a bar's `list_toolbar` / `list_item` / `record_header` and reports +// `record_more` as a TODO. No conversion ever covered a bar's own +// `global_nav` (the protocol-17 step stripped it from `action.locations` +// only), so that row carries no migrate sentence. +const QUICK_ACTIONS_BAR_PLACES_TAIL = + QUICK_ACTIONS_BAR_PLACES + ' ' + '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 QUICK_ACTIONS_BAR_RETIRED: Readonly> = { global_nav: '`global_nav` was removed from the action locations in @objectstack/spec 17: no surface ever drew it.' - + QUICK_ACTIONS_BAR_PLACES_TAIL, + + QUICK_ACTIONS_BAR_PLACES, list_toolbar: '`list_toolbar` became `list` in @objectstack/spec 19: a bar on the list page toolbar writes ' + '`location: \'list\'`.' + QUICK_ACTIONS_BAR_PLACES_TAIL, list_item: '`list_item` became `record_row` in @objectstack/spec 19: a bar on each list row writes ' diff --git a/packages/spec/src/ui/component-record-blocks.test.ts b/packages/spec/src/ui/component-record-blocks.test.ts index 86528564071..e3570daf6a9 100644 --- a/packages/spec/src/ui/component-record-blocks.test.ts +++ b/packages/spec/src/ui/component-record-blocks.test.ts @@ -221,8 +221,9 @@ describe('ComponentPropsMap["record:quick_actions"]', () => { it('vets `location` against the shared action-location vocabulary — one vocabulary, not a restatement', () => { 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. + // The retired location keeps a retirement prescription (the bar's own, + // written for a bar); the positive pin below is the proof the row rides + // the shared enum rather than a copy of its values. const message = messagesOf(RecordQuickActionsProps.safeParse({ location: 'global_nav' })); expect(message).toContain('global_nav'); }); @@ -304,6 +305,11 @@ describe('record:quick_actions `location` — single places only, never `record` expect(message, word).toContain(place); expect(message, word).not.toMatch(/`record`/); expect(message, word).not.toContain('is not a place a `record:quick_actions` bar'); + // The house migrate sentence only where a conversion covers the word on + // a bar: protocol 19's step rewrites the four page-part words (or reports + // a TODO for `record_more`); nothing ever converted a bar's `global_nav`. + if (word === 'global_nav') expect(message, word).not.toMatch(/os migrate meta --from/); + else expect(message, word).toContain('`os migrate meta --from 18`'); } // …while the shared enum keeps its action-side prescription, `record` offer included. const shared = messagesOf(ActionLocationSchema.safeParse('record_header'));