From e18e4eeed789d9a3aaf4eea12bbde13dbc4c0de2 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 27 Nov 2026 09:25:46 +0000 Subject: [PATCH 1/8] =?UTF-8?q?wip(spec):=20action=20locations=20say=20wha?= =?UTF-8?q?t=20an=20action=20acts=20on=20=E2=80=94=20enum,=20conversion,?= =?UTF-8?q?=20codemod=20pass?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Claude-Session: https://claude.ai/code/session_01L9qic11optJUat6U8X67jY Co-authored-by: Claude --- .../build-with-claude-code.mdx | 2 +- content/docs/ui/actions.mdx | 4 +- content/docs/ui/print-pages.mdx | 2 +- .../src/actions/convert-lead.action.ts | 2 +- examples/app-showcase/src/ui/actions/index.ts | 26 +- .../src/ui/actions/predicate-matrix.action.ts | 6 +- examples/app-todo/src/actions/task.actions.ts | 16 +- packages/cli/src/commands/generate.ts | 4 +- ...install-local-handlers.integration.test.ts | 2 +- ...-boot-diagnostics-noise-budget.e2e.test.ts | 4 +- .../cli/test/verify-author-time-stage.test.ts | 2 +- ...ace-install-local-register-refusal.test.ts | 2 +- .../runtime-gate.inert-type-writes.test.ts | 2 +- .../src/validate-action-locations.test.ts | 2 +- .../src/validate-action-name-refs.test.ts | 14 +- .../validate-action-object-binding.test.ts | 8 +- .../lint/src/validate-expressions.test.ts | 2 +- .../src/validate-object-action-layout.test.ts | 8 +- .../src/validate-record-page-header.test.ts | 18 +- .../src/protocol-extension-arrangement.ts | 2 +- ...ocol.object-cascade-delete-objects.test.ts | 4 +- .../protocol.object-disabled-actions.test.ts | 4 +- ...ject-duplicate-action-name-refusal.test.ts | 2 +- .../src/bound-action-collision-report.test.ts | 6 +- .../src/bound-action-foreign-object.test.ts | 22 +- .../src/protocol-flow-custom-override.test.ts | 2 +- .../protocol-meta-disabled-actions.test.ts | 4 +- .../src/audit/sys-notification.object.ts | 2 +- .../src/identity/sys-account.object.ts | 2 +- .../src/identity/sys-api-key.object.ts | 6 +- .../sys-idp-group-mapping-actions.test.ts | 6 +- .../identity/sys-idp-group-mapping.object.ts | 6 +- .../src/identity/sys-invitation.object.ts | 12 +- .../src/identity/sys-member.object.ts | 10 +- .../identity/sys-oauth-application.object.ts | 10 +- .../src/identity/sys-organization.object.ts | 14 +- ...scim-connection-credential-actions.test.ts | 4 +- .../sys-scim-connection-credential.object.ts | 4 +- .../src/identity/sys-session.object.ts | 4 +- .../src/identity/sys-sso-provider.object.ts | 24 +- .../src/identity/sys-team-member.object.ts | 4 +- .../src/identity/sys-team.object.ts | 8 +- .../src/identity/sys-two-factor.object.ts | 6 +- ...-user-platform-admin-roster-action.test.ts | 2 +- .../src/identity/sys-user.object.ts | 40 +- .../src/sys-approval-request.object.ts | 4 +- ...t-packageless-other-object.dogfood.test.ts | 2 +- ...e-packageless-other-object.dogfood.test.ts | 2 +- .../api-action-door-forward.dogfood.test.ts | 4 +- ...p-oauth-api-action-forward.dogfood.test.ts | 8 +- ...g-change-slug-bound-action.dogfood.test.ts | 4 +- .../src/log-call.action.ts | 2 +- .../downstream-contract/src/modern.action.ts | 2 +- .../src/action-flow-input-params.test.ts | 4 +- .../action-selection-caller-scope.pin.test.ts | 2 +- packages/runtime/src/http-dispatcher.test.ts | 6 +- .../src/mcp-list-actions-flow-params.test.ts | 2 +- packages/runtime/src/mcp-resume-run.test.ts | 4 +- .../src/datasource-admin-plugin.ts | 4 +- packages/spec/src/compose-stacks.test.ts | 10 +- .../entries/19/action-locations-acted-on.ts | 403 ++++++++++++++++++ packages/spec/src/conversions/registry.ts | 2 + .../api-methods-batch-conformance.test.ts | 2 +- .../spec/src/data/object-action-layout.ts | 8 +- packages/spec/src/data/object.test.ts | 6 +- .../spec/src/kernel/public-auth-features.ts | 2 +- .../19.action-locations-page-parts-retired.ts | 35 ++ .../spec/src/migrations/registry.ts.template | 6 +- packages/spec/src/stack.zod.ts | 4 +- packages/spec/src/studio/plugin.zod.ts | 5 +- packages/spec/src/ui/action-ask-ai.test.ts | 2 +- .../spec/src/ui/action-declarative-update.ts | 8 +- packages/spec/src/ui/action-pressed.test.ts | 2 +- .../spec/src/ui/action-row-update.test.ts | 4 +- .../ui/action-undoable-fulfillment.test.ts | 2 +- packages/spec/src/ui/action.test.ts | 18 +- packages/spec/src/ui/action.zod.ts | 114 +++-- ...nent-action-row-declarative-update.test.ts | 4 +- ...ort-items-action-members-typed.pin.test.ts | 6 +- packages/spec/src/ui/component.zod.ts | 28 +- .../ui/dashboard-header-ask-ai-37142.test.ts | 2 +- packages/spec/src/ui/dashboard.zod.ts | 2 +- packages/spec/src/ui/page.zod.ts | 2 +- .../src/action-flow-dropped-fields.test.ts | 4 +- .../record-block-record-reach.test.tsx | 4 +- .../src/dev/DevRecordHeaderActions.tsx | 4 +- ui/apps/console/src/preview-samples.ts | 2 +- ...alRequestsDataSource.decisionPage.test.tsx | 4 +- ...ataSource.recordPagePayload-28546.test.tsx | 4 +- ...ovalRequestsDataSource.servedPage.test.tsx | 4 +- ...aSource.servedPageApprovers-12482.test.tsx | 4 +- ...servedPageMemberPermissions-13324.test.tsx | 4 +- ...taSource.servedPageStepLine-12491.test.tsx | 2 +- ...ataSource.servedPageSummary-12483.test.tsx | 4 +- ...rce.servedPageSummaryAmount-12534.test.tsx | 2 +- ui/e2e/list-header-narrow-35446.spec.ts | 2 +- ui/e2e/list-no-actions-column-35554.spec.ts | 10 +- ...ListView.gridRowColorSelect-12393.test.tsx | 2 +- .../environment/EnvironmentListToolbar.tsx | 4 +- ...ronmentListToolbar.deepLinkArming.test.tsx | 4 +- ...nmentListToolbar.deepLinkOverflow.test.tsx | 8 +- .../__tests__/EnvironmentListToolbar.test.tsx | 8 +- ...eActionRuntime.apiNewTabUrl-26747.test.tsx | 2 +- ...ctionRuntime.flowActionDoor-12037.test.tsx | 2 +- ...eActionRuntime.flowRowGuard-13397.test.tsx | 6 +- .../useConsoleActionRuntime.test.tsx | 16 +- ...eActionRuntime.undoLookupId-11122.test.tsx | 2 +- .../__tests__/useOfferedNavRunAction.test.tsx | 6 +- .../DesignModeHeaderPins-36366.test.tsx | 8 +- .../designModeHeaderPinsModel-36366.test.ts | 16 +- .../designModeHeaderPinsSave-36366.test.ts | 10 +- .../currentUserCan-4421.render.test.tsx | 4 +- ...UserCan-disabledLegs-11242.render.test.tsx | 6 +- ...ntUserCan-failClosed-11212.render.test.tsx | 8 +- .../__tests__/consoleServerAction.test.tsx | 2 +- .../__tests__/managedByEmptyState.test.ts | 8 +- .../app-shell/src/views/InterfaceListPage.tsx | 4 +- ...ew.bulkWiredHeaderDuplicate-12462.test.tsx | 6 +- ...ctView.cardFacesOpenNothing-33548.test.tsx | 2 +- ...tView.emptyStateMatchesPage-11687.test.tsx | 8 +- .../ObjectView.headerFold-12705.test.tsx | 12 +- ...ectView.headerSelectionGate-27831.test.tsx | 4 +- .../ObjectView.inviteFeedback-11817.test.tsx | 4 +- .../ObjectView.inviteOutcome-27797.test.tsx | 6 +- ...ectView.listActionsReadGate-12109.test.tsx | 4 +- ...jectView.listOnlyRecordPage-33219.test.tsx | 2 +- ...bjectView.objectBoundActions-7234.test.tsx | 4 +- ...w.recordRelatedNotOnOwnList-11270.test.tsx | 4 +- .../ObjectView.rowOpensNothing-33317.test.tsx | 2 +- ...View.toolbarScriptSelection-12331.test.tsx | 2 +- ...ew.accessEndedAfterDecision-26589.test.tsx | 4 +- ...dDetailView.accessibleNames-12625.test.tsx | 2 +- ...cordDetailView.actionLayout-36366.test.tsx | 8 +- ...cordDetailView.apiNewTabUrl-26747.test.tsx | 4 +- ...etailView.approvalDeclaredActions.test.tsx | 4 +- ...iew.authoredPageDesktopOnly-36150.test.tsx | 2 +- ...w.childWriteRefreshesParent-12244.test.tsx | 2 +- ...rdDetailView.designModeTabs-36737.test.tsx | 2 +- ...rdDetailView.flowActionDoor-12037.test.tsx | 6 +- ...lView.headerActionLookupPredicate.test.tsx | 2 +- ...dDetailView.headerMenuIcons-12529.test.tsx | 2 +- .../RecordDetailView.phoneFace-27058.test.tsx | 2 +- ...ailView.placedHeaderActions-29951.test.tsx | 10 +- ...View.printPageHeaderActions-12906.test.tsx | 2 +- .../app-shell/src/views/RecordDetailView.tsx | 20 +- ...ailView.updateActionRefresh-29935.test.tsx | 4 +- .../__tests__/DeclaredActionsBar.test.tsx | 2 +- .../PageView.listViewAddRecord-13089.test.tsx | 4 +- ...PageView.relatedListActions-12870.test.tsx | 4 +- ...dActionsBridge.blankVisible-11294.test.tsx | 2 +- ...ActionsBridge.recordRelated-11270.test.tsx | 6 +- ...taTypeActions.confirmDialog-13333.test.tsx | 2 +- ...TypeActions.paramDialogClose-6473.test.tsx | 2 +- .../MetadataTypeActions.test.tsx | 16 +- ...ceEditPage.actionServedRows-35650.test.tsx | 2 +- .../capabilityGateChannel-7234.test.tsx | 2 +- ...ionDefaultInspector.aiBlock-26728.test.tsx | 2 +- ...faultInspector.capabilities-29181.test.tsx | 4 +- ...ultInspector.fieldValueRows-26735.test.tsx | 2 +- ...nspector.scriptBodyLanguage-11921.test.tsx | 12 +- ...DefaultInspector.scriptType-26734.test.tsx | 6 +- ...DefaultInspector.typeSwitch-26736.test.tsx | 2 +- ...ctorStrings.hookAction.i18n-10586.test.tsx | 16 +- .../ActionPreview.copyEnvelope-27948.test.tsx | 2 +- .../automationPreviews.i18n-10862.test.tsx | 2 +- .../src/views/objectViewHeaderChrome.tsx | 2 +- .../src/views/objectViewHeaderToolbar.ts | 2 +- ...ViewPageHeader.actionLayout-36366.test.tsx | 6 +- .../DataPillar.actionDeepLink-34724.test.tsx | 2 +- .../DataPillar.actionRefusal-26736.test.tsx | 2 +- ...DataPillar.actionServedRows-35650.test.tsx | 2 +- .../DataPillar.pairActions-30088.test.tsx | 6 +- ...ar.pairActionsPublishPinned-36726.test.tsx | 4 +- .../DataPillar.panelHold-27629.test.tsx | 2 +- .../DataPillar.showMeFocus-26730.test.tsx | 2 +- ...tionsPanel.newActionDefault-11820.test.tsx | 4 +- .../ObjectActionsPanel.presets-11861.test.tsx | 10 +- ...ectActionsPanel.renameTaken-26725.test.tsx | 2 +- .../studio-design/ObjectActionsPanel.tsx | 4 +- .../StudioEmptyState.panels-12514.test.tsx | 2 +- .../metadataError.actionHeld-26736.test.ts | 2 +- .../src/__tests__/action-bar.test.tsx | 68 +-- .../src/__tests__/action-group.test.tsx | 12 +- .../page-header-action-i18n.test.tsx | 2 +- .../page-header-action-ids.dist.spec.tsx | 4 +- .../__tests__/page-header-action-ids.test.tsx | 20 +- .../page-header-actions-shared-12906.test.tsx | 14 +- .../__tests__/page-header-actions.test.tsx | 112 ++--- .../page-header-capability-gate.test.tsx | 6 +- .../page-header-danger-12764.test.tsx | 2 +- .../page-header-disabledReason-11811.test.tsx | 8 +- .../page-header-disabledReason-26619.test.tsx | 4 +- .../page-header-edit-outline-36049.test.tsx | 2 +- .../page-header-lookup-predicate.test.tsx | 2 +- .../page-header-more-actions-i18n.test.tsx | 8 +- .../page-header-overflow-close-36499.test.tsx | 8 +- .../page-header-phone-bar-27058.test.tsx | 12 +- .../page-header-predicate-dialect.test.tsx | 4 +- .../page-header-pressed-28242.test.tsx | 6 +- .../page-header-primary-12617.test.tsx | 2 +- .../page-header-record-bar-35593.test.tsx | 2 +- .../__tests__/page-header-refresh.test.tsx | 12 +- .../page-header-switched-off-27504.test.tsx | 6 +- .../page-header-title-width.test.tsx | 8 +- .../page-header-toolbar-name-i18n.test.tsx | 4 +- .../page-header-trailing-27241.test.tsx | 4 +- .../action-bar-danger-variant-26781.test.tsx | 8 +- .../action-button-icon-inputs-11168.test.tsx | 4 +- .../action-entry-object-params-10462.test.tsx | 2 +- .../__tests__/action-forward-parity.test.tsx | 10 +- .../action-forward-precedence.test.tsx | 2 +- .../action-group-menu-inputs-11168.test.tsx | 8 +- .../action-icon-autotrigger.test.tsx | 6 +- .../action-onSuccess-forward.test.tsx | 2 +- ...ion-outcomeMessages-forward-11344.test.tsx | 2 +- .../action-overflow-autotrigger.test.tsx | 18 +- .../src/renderers/action/action-bar.tsx | 2 +- .../form-formula-recompute-35033.test.tsx | 2 +- .../form-required-for-action-28382.test.tsx | 6 +- .../src/renderers/layout/containers.tsx | 2 +- .../actions/__tests__/ActionEngine.test.ts | 8 +- .../__tests__/ActionEngine.visibility.test.ts | 2 +- .../ActionRunner.askAi-37142.test.ts | 4 +- .../ActionRunner.launchRefusal-27831.test.ts | 4 +- .../ActionRunner.recordRowGuard-13384.test.ts | 4 +- .../actions/__tests__/actionKeys.pin.test.ts | 2 +- .../__tests__/actionKeys.types.test.ts | 2 +- .../__tests__/serverActionHandler.test.ts | 14 +- .../utils/__tests__/action-activation.test.ts | 4 +- .../utils/__tests__/predicate-fields.test.ts | 4 +- ui/packages/layout/src/PageHeader.tsx | 4 +- ui/packages/plugin-detail/src/DetailView.tsx | 2 +- .../plugin-detail/src/RecordDetailPanel.tsx | 2 +- ui/packages/plugin-detail/src/RelatedList.tsx | 2 +- ...istRenderer.authoredActions-11163.test.tsx | 12 +- ...istRenderer.refusalAudience-11768.test.tsx | 4 +- ...edList.defaultFromRowSelect-10277.test.tsx | 2 +- ...latedList.rowActionDisabled-33215.test.tsx | 2 +- ...claredActionIds.twoRenderers-7182.test.tsx | 10 +- ...ActionsInputs.actionNamesFallback.test.tsx | 2 +- ...ord-alert.declared-action-id-7382.test.tsx | 2 +- ...ord-quick-actions.actionText-i18n.test.tsx | 2 +- .../record-quick-actions.ariaLabel.test.tsx | 2 +- ...-actions.declared-action-ids-7182.test.tsx | 8 +- ...ck-actions.disabled-declared-gate.test.tsx | 2 +- .../record-quick-actions.icon-12772.test.tsx | 2 +- ...-actions.requiredPermissions-gate.test.tsx | 2 +- ...-quick-actions.template-predicate.test.tsx | 2 +- ...ecord-quick-actions.variant-12986.test.tsx | 2 +- ...quick-actions.withheldEmpty-12995.test.tsx | 2 +- ...elated-list.unservedActions-12870.test.tsx | 2 +- .../recordAriaLabelRetired-9945.test.tsx | 2 +- .../recordBinding.appPage-12294.test.tsx | 2 +- .../recordBinding.emptyState-12932.test.tsx | 2 +- .../recordComponentAria-9556.test.tsx | 4 +- ...tedListActions.recordRelated-11270.test.ts | 8 +- ...ildDefaultPageSchema.strictPayload.test.ts | 4 +- .../__tests__/buildDefaultPageSchema.test.ts | 2 +- .../src/synth/buildDefaultPageSchema.ts | 4 +- ui/packages/plugin-grid/demo/bulk-actions.tsx | 6 +- ui/packages/plugin-grid/src/ObjectGrid.tsx | 2 +- .../bulkResultPerRecord-27380.test.tsx | 2 +- .../defaultFromRowProjection-10277.test.tsx | 6 +- .../src/__tests__/gridNonAuthorKeys.test.tsx | 6 +- .../legacyRowActionDispatch.test.tsx | 8 +- .../phoneCardRowActions-29150.test.tsx | 6 +- .../predicate-surface-parity.test.tsx | 2 +- .../src/__tests__/projectionFls-6898.test.tsx | 4 +- .../recordIdFieldProjection.test.tsx | 4 +- ...elatedListRowActionDisabled-33215.test.tsx | 2 +- .../src/__tests__/resolveBulkActions.test.ts | 2 +- .../__tests__/resolveLegacyRowActions.test.ts | 8 +- .../rowActionRecordHole-12967.test.tsx | 2 +- .../__tests__/rowContextMenu-28434.test.tsx | 16 +- .../__tests__/undoProjectedRow-10404.test.tsx | 2 +- .../plugin-grid/src/resolveBulkActions.ts | 2 +- .../src/resolveLegacyRowActions.ts | 4 +- .../ListView.allDeniedSelect-10275.test.tsx | 2 +- .../useActionEngine.capabilityGate.test.tsx | 4 +- .../context/RelatedRecordActionsContext.tsx | 2 +- .../hooks/__tests__/useActionEngine.test.ts | 6 +- ...tionTextLocalizer.keyObject-11439.test.tsx | 2 +- ...xtLocalizer.outcomeMessages-11344.test.tsx | 2 +- .../__tests__/useActionTextLocalizer.test.tsx | 2 +- .../action-bar-chart-flag-11355.test.ts | 2 +- .../arranged-header-actions-36366.test.ts | 14 +- .../declared-action-ids-7182.test.ts | 4 +- 287 files changed, 1342 insertions(+), 857 deletions(-) create mode 100644 packages/spec/src/conversions/entries/19/action-locations-acted-on.ts create mode 100644 packages/spec/src/migrations/entries/semantic/19.action-locations-page-parts-retired.ts diff --git a/content/docs/getting-started/build-with-claude-code.mdx b/content/docs/getting-started/build-with-claude-code.mdx index 71933220a9c..4fd446740e8 100644 --- a/content/docs/getting-started/build-with-claude-code.mdx +++ b/content/docs/getting-started/build-with-claude-code.mdx @@ -175,7 +175,7 @@ export const ResolveTicketAction = defineAction({ // to write or register; the platform performs the update. operation: 'update', patch: { status: 'resolved' }, - locations: ['record_header', 'list_item'], + locations: ['record'], // Only offer "Resolve" on tickets that aren't already resolved or closed. // Predicates are CEL, record-scoped — `record.status`, never bare `status`. // `has()` guards the sparse list row; the rule and its guard table live in diff --git a/content/docs/ui/actions.mdx b/content/docs/ui/actions.mdx index a6f3c1f57c8..4d1f43b4959 100644 --- a/content/docs/ui/actions.mdx +++ b/content/docs/ui/actions.mdx @@ -47,7 +47,7 @@ export const CompleteTaskAction = defineAction({ icon: 'check-circle', type: 'script', target: 'completeTask', // resolved to the handler registered below - locations: ['record_header', 'list_item'], + locations: ['record'], successMessage: 'Task marked as complete!', refreshAfter: true, ai: { @@ -95,7 +95,7 @@ export const MarkDoneAction = defineAction({ }, successMessage: 'Task marked done.', visible: 'has(record.done) && record.done != true', - locations: ['list_item', 'record_header', 'record_section'], + locations: ['record', 'record_section'], refreshAfter: true, }); ``` diff --git a/content/docs/ui/print-pages.mdx b/content/docs/ui/print-pages.mdx index 5ecd1ba7dbc..d4f2d9136ff 100644 --- a/content/docs/ui/print-pages.mdx +++ b/content/docs/ui/print-pages.mdx @@ -199,7 +199,7 @@ export const GenerateInvoicePdf = defineAction({ method: 'POST', recordIdParam: 'recordId', // the clicked record's id bodyExtra: { app: 'sales', object: 'invoice', page: 'invoice_document' }, - locations: ['list_item'], + locations: ['record_row'], refreshAfter: true, }); ``` diff --git a/examples/app-crm/src/actions/convert-lead.action.ts b/examples/app-crm/src/actions/convert-lead.action.ts index e5801236156..3aa0953dba2 100644 --- a/examples/app-crm/src/actions/convert-lead.action.ts +++ b/examples/app-crm/src/actions/convert-lead.action.ts @@ -13,7 +13,7 @@ export const ConvertLeadAction = defineAction({ objectName: 'crm_lead', type: 'flow', target: 'crm_convert_lead_wizard', - locations: ['list_item', 'record_header', 'record_more'], + locations: ['record'], recordIdParam: 'recordId', // Conditional visibility (CEL): hide the action once the lead is already // converted — so the button disappears rather than the user clicking it and diff --git a/examples/app-showcase/src/ui/actions/index.ts b/examples/app-showcase/src/ui/actions/index.ts index be0fd4a42d7..0af99e7532b 100644 --- a/examples/app-showcase/src/ui/actions/index.ts +++ b/examples/app-showcase/src/ui/actions/index.ts @@ -92,7 +92,7 @@ export const MarkDoneAction = defineAction({ visible: 'has(record.done) && record.done != true', // No `record_section`: the Task Detail header already draws it, and its // quick-actions bar carries only what the header does not (one action row). - locations: ['list_item', 'record_header'], + locations: ['record'], refreshAfter: true, }); @@ -125,7 +125,7 @@ export const ReopenTaskAction = defineAction({ // `test/record-action-location-hosts.test.ts` holds that list equal to the // task's `record_header` / `record_more` set, so adding `record_header` here // means adding the id to that header too. - locations: ['list_item'], + locations: ['record_row'], refreshAfter: true, }); @@ -137,7 +137,7 @@ export const OpenDocsAction = defineAction({ objectName: task, type: 'url', target: 'https://objectstack.ai', - locations: ['record_more'], + locations: ['record_page'], component: 'action:menu', refreshAfter: false, }); @@ -154,7 +154,7 @@ export const BulkReassignAction = defineAction({ objectName: task, type: 'flow', target: 'showcase_reassign_wizard', - locations: ['list_item', 'list_toolbar'], + locations: ['record_row', 'list'], refreshAfter: true, }); @@ -166,7 +166,7 @@ export const QuickViewAction = defineAction({ objectName: task, type: 'modal', target: 'showcase_component_gallery', - locations: ['list_item'], + locations: ['record_row'], refreshAfter: false, }); @@ -197,7 +197,7 @@ export const RecalcEstimateAction = defineAction({ // ⋯ overflow is where the action is found there. The authored header lists // its action ids and leaves this one out, so the full page still draws it // once, in the bar. - locations: ['record_section', 'record_more'], + locations: ['record_section', 'record_page'], component: 'action:menu', // The endpoint is record-scoped and rejects a body without an id. On a // record surface the page supplies it; invoked from a LIST ROW (see the // `legacy_row_actions` view) nothing else can, so name the body key the @@ -258,7 +258,7 @@ export const RecalcSelectionAction = defineAction({ // `result`, never the selection. So it names the record it ran against, and // says "the whole selection" only when no record is bound. successMessage: "Estimates recalculated for {{ record.title | default:'the whole selection' }}.", - locations: ['record_more'], + locations: ['record_page'], component: 'action:menu', recordIdParam: 'recordId', refreshAfter: true, }); @@ -275,7 +275,7 @@ export const LogTimeAction = defineAction({ // implicitly claims the `default` key), so pointing a form action there opens // a list as a form — now a build error (#2554). target: 'showcase_task.form', - locations: ['record_header', 'record_related'], + locations: ['record_page', 'record_related'], refreshAfter: true, }); @@ -291,7 +291,7 @@ export const AskAboutTaskAction = defineAction({ icon: 'sparkles', objectName: task, type: 'ask_ai', - locations: ['record_header'], + locations: ['record_page'], }); /** @@ -369,7 +369,7 @@ export const SubmitForSignoffAction = defineAction({ // `!=` against a literal never faults on a projected NULL, so `has()` alone // is the whole guard. visible: "has(record.status) && record.status != 'sent'", - locations: ['list_item', 'record_header'], + locations: ['record'], refreshAfter: true, }); @@ -413,7 +413,7 @@ export const GenerateInvoicePdfAction = defineAction({ recordIdParam: 'recordId', bodyExtra: { app: 'com.example.showcase', object: invoice, page: 'showcase_invoice_document' }, successMessage: 'The PDF is attached to the invoice.', - locations: ['list_item', 'record_header'], + locations: ['record'], refreshAfter: true, }); @@ -484,7 +484,7 @@ export const ActionParamGalleryAction = defineAction({ capabilities: [], }, successMessage: 'Params received — every widget type rendered through the shared field-widget map.', - locations: ['record_header', 'list_item'], + locations: ['record'], refreshAfter: false, }); @@ -522,7 +522,7 @@ export const ArchiveTaskAction = defineAction({ // "Not available for this record", which names neither. Display only; it // never gates the dispatch. disabledReason: 'Mark the task done first.', - locations: ['record_header'], + locations: ['record_page'], refreshAfter: false, }); diff --git a/examples/app-showcase/src/ui/actions/predicate-matrix.action.ts b/examples/app-showcase/src/ui/actions/predicate-matrix.action.ts index b8c889dd5e0..9ccb4af0112 100644 --- a/examples/app-showcase/src/ui/actions/predicate-matrix.action.ts +++ b/examples/app-showcase/src/ui/actions/predicate-matrix.action.ts @@ -312,7 +312,7 @@ export const ZooToolbarGateAction = defineAction({ body: echo, successMessage: 'Toolbar gate passed.', visible: 'os.user.id != null', - locations: ['list_toolbar'], + locations: ['list'], refreshAfter: false, }); @@ -372,7 +372,7 @@ export const ZooDisabledAction = defineAction({ type: 'script', body: echo, disabled: 'has(record.f_rating) && record.f_rating != null && record.f_rating < 4', - locations: ['record_header', 'record_section'], + locations: ['record_page', 'record_section'], refreshAfter: false, }); @@ -485,7 +485,7 @@ const zooTypeGate = (name: string, label: string, visible: string) => type: 'script', body: echo, visible, - locations: ['record_more'], + locations: ['record_page'], component: 'action:menu', refreshAfter: false, }); diff --git a/examples/app-todo/src/actions/task.actions.ts b/examples/app-todo/src/actions/task.actions.ts index fa9b1c3cf2f..f4bb9cfe615 100644 --- a/examples/app-todo/src/actions/task.actions.ts +++ b/examples/app-todo/src/actions/task.actions.ts @@ -10,7 +10,7 @@ export const CompleteTaskAction = defineAction({ icon: 'check-circle', type: 'script', target: 'completeTask', - locations: ['record_header', 'list_item'], + locations: ['record'], successMessage: 'Task marked as complete!', refreshAfter: true, ai: { @@ -27,7 +27,7 @@ export const StartTaskAction = defineAction({ icon: 'play-circle', type: 'script', target: 'startTask', - locations: ['record_header', 'list_item'], + locations: ['record'], successMessage: 'Task started!', refreshAfter: true, ai: { @@ -55,7 +55,7 @@ export const DeferTaskAction = defineAction({ icon: 'clock', type: 'script', target: 'deferTask', - locations: ['record_header'], + locations: ['record_page'], params: [ { name: 'new_due_date', @@ -82,7 +82,7 @@ export const SetReminderAction = defineAction({ icon: 'bell', type: 'script', target: 'setReminder', - locations: ['record_header', 'list_item'], + locations: ['record'], params: [ { name: 'reminder_date', @@ -103,7 +103,7 @@ export const CloneTaskAction = defineAction({ icon: 'copy', type: 'script', target: 'cloneTask', - locations: ['record_header'], + locations: ['record_page'], successMessage: 'Task cloned successfully!', refreshAfter: true, ai: { @@ -126,7 +126,7 @@ export const MassCompleteTasksAction = defineAction({ type: 'script', target: 'massCompleteTasks', execution: 'perRecord', - locations: ['list_toolbar'], + locations: ['list'], successMessage: 'Selected tasks marked as complete!', refreshAfter: true, ai: { @@ -143,7 +143,7 @@ export const DeleteCompletedAction = defineAction({ icon: 'trash', type: 'script', target: 'deleteCompletedTasks', - locations: ['list_toolbar'], + locations: ['list'], // Destructive + irreversible — flag as danger so Studio paints it red // and the AI tool runtime routes through the HITL approval queue when // `enableActionApproval` is on. @@ -168,7 +168,7 @@ export const ExportToCsvAction = defineAction({ icon: 'download', type: 'script', target: 'exportTasksToCSV', - locations: ['list_toolbar'], + locations: ['list'], successMessage: 'Export completed!', refreshAfter: false, ai: { diff --git a/packages/cli/src/commands/generate.ts b/packages/cli/src/commands/generate.ts index 7a7a6cc3d30..2e9dd199f65 100644 --- a/packages/cli/src/commands/generate.ts +++ b/packages/cli/src/commands/generate.ts @@ -560,7 +560,7 @@ export default ${toCamelCase(name)}Action; // 'record_section', 'list_item' (not 'list_toolbar': an update needs the // record it writes). An action meant only for REST / MCP / AI callers says // so with an empty list. - locations: ['record_header'], + locations: ['record_page'], ${footer}`; } return `${header} @@ -570,7 +570,7 @@ ${footer}`; // Where the button is drawn: the record's header. Others: 'record_more', // 'record_section', 'list_item', 'list_toolbar'. An action meant only for // REST / MCP / AI callers says so with an empty list. - locations: ['record_header'], + locations: ['record_page'], ${footer}`; }, }, diff --git a/packages/cli/test/package-install-local-handlers.integration.test.ts b/packages/cli/test/package-install-local-handlers.integration.test.ts index 31de0eec3eb..423cd3bf749 100644 --- a/packages/cli/test/package-install-local-handlers.integration.test.ts +++ b/packages/cli/test/package-install-local-handlers.integration.test.ts @@ -88,7 +88,7 @@ const COMPLETE_TASK = { name: 'complete_task', label: 'Complete Task', objectName: OBJECT, - locations: ['record_header'], + locations: ['record_page'], type: 'script', body: { language: 'js', diff --git a/packages/cli/test/serve-boot-diagnostics-noise-budget.e2e.test.ts b/packages/cli/test/serve-boot-diagnostics-noise-budget.e2e.test.ts index b9e3809fa90..8eb3237bf65 100644 --- a/packages/cli/test/serve-boot-diagnostics-noise-budget.e2e.test.ts +++ b/packages/cli/test/serve-boot-diagnostics-noise-budget.e2e.test.ts @@ -99,7 +99,7 @@ export const ResolveTicketAction = defineAction({ icon: 'check-circle', operation: 'update', patch: { status: 'resolved' }, - locations: ['record_header', 'list_item'], + locations: ['record'], visible: 'has(record.status) && record.status != "resolved" && record.status != "closed"', successMessage: 'Ticket resolved.', refreshAfter: true, @@ -112,7 +112,7 @@ export const EscalateTicketAction = defineAction({ icon: 'arrow-up', type: 'script', target: 'escalateTicket', - locations: ['record_header'], + locations: ['record_page'], }); `; diff --git a/packages/cli/test/verify-author-time-stage.test.ts b/packages/cli/test/verify-author-time-stage.test.ts index 48b4ebe6e42..8f323ffbe33 100644 --- a/packages/cli/test/verify-author-time-stage.test.ts +++ b/packages/cli/test/verify-author-time-stage.test.ts @@ -101,7 +101,7 @@ function taskApp(planted: boolean): Record { objectName: 'vg_task', type: 'url', target: 'https://example.com/help', - locations: ['record_header'], + locations: ['record_page'], visible: planted ? 'done != true' : 'record.done != true', }, ], diff --git a/packages/cloud-connection/src/marketplace-install-local-register-refusal.test.ts b/packages/cloud-connection/src/marketplace-install-local-register-refusal.test.ts index 37b7d8af11b..d8930f24f66 100644 --- a/packages/cloud-connection/src/marketplace-install-local-register-refusal.test.ts +++ b/packages/cloud-connection/src/marketplace-install-local-register-refusal.test.ts @@ -101,7 +101,7 @@ const obj = (name: string, fields: Bag = { title: { name: 'title', type: 'text', const recordPage = (name: string, object: string) => ({ name, label: name, type: 'record', object, isDefault: true, regions: [] }); /** A top-level action bound by `objectName` to `objectName`. */ const boundAction = (objectName: string) => ({ - name: 'routing_ping', label: 'Ping', objectName, type: 'url', target: 'https://example.com/ping', locations: ['record_header'], + name: 'routing_ping', label: 'Ping', objectName, type: 'url', target: 'https://example.com/ping', locations: ['record_page'], }); /** A package version whose namespace is its id's last segment. */ diff --git a/packages/lint/src/runtime-gate.inert-type-writes.test.ts b/packages/lint/src/runtime-gate.inert-type-writes.test.ts index 4b2c2beafed..2b234e80b03 100644 --- a/packages/lint/src/runtime-gate.inert-type-writes.test.ts +++ b/packages/lint/src/runtime-gate.inert-type-writes.test.ts @@ -244,7 +244,7 @@ describe('#19542 — the `action` door (validateStackExpressions)', () => { label: 'Convert Lead', objectName: 'crm_lead', icon: 'ArrowRightCircle', - locations: ['list_item', 'record_header', 'record_more'], + locations: ['record'], type: 'flow', target: 'crm_convert_lead_wizard', refreshAfter: false, diff --git a/packages/lint/src/validate-action-locations.test.ts b/packages/lint/src/validate-action-locations.test.ts index 92586001873..82c67b92765 100644 --- a/packages/lint/src/validate-action-locations.test.ts +++ b/packages/lint/src/validate-action-locations.test.ts @@ -26,7 +26,7 @@ const placed = () => ({ name: 'crm_convert_lead', label: 'Convert', type: 'script', - locations: ['record_header'], + locations: ['record_page'], }, ], }); diff --git a/packages/lint/src/validate-action-name-refs.test.ts b/packages/lint/src/validate-action-name-refs.test.ts index 34827f0a558..3583f293ab2 100644 --- a/packages/lint/src/validate-action-name-refs.test.ts +++ b/packages/lint/src/validate-action-name-refs.test.ts @@ -325,24 +325,24 @@ describe('validateActionNameRefs — record:related_list actions', () => { { name: 'crm_account', fields: { name: { type: 'text' } }, - actions: [{ name: 'crm_merge_accounts', type: 'script', locations: ['record_header'] }], + actions: [{ name: 'crm_merge_accounts', type: 'script', locations: ['record_page'] }], }, { name: 'crm_contact', fields: { name: { type: 'text' } }, actions: [ { name: 'crm_log_call', type: 'script', locations: ['record_related'] }, - { name: 'crm_new_contact', type: 'script', locations: ['list_toolbar'] }, - { name: 'crm_email_contact', type: 'script', locations: ['list_item'] }, - { name: 'crm_pin_contact', type: 'script', locations: ['record_header'] }, + { name: 'crm_new_contact', type: 'script', locations: ['list'] }, + { name: 'crm_email_contact', type: 'script', locations: ['record_row'] }, + { name: 'crm_pin_contact', type: 'script', locations: ['record_page'] }, { name: 'crm_sync_contact', type: 'script', locations: [] }, { name: 'crm_score_contact', type: 'script' }, ], }, ], actions: [ - { name: 'crm_tag_contact', objectName: 'crm_contact', type: 'script', locations: ['list_item'] }, - { name: 'crm_export_all', type: 'script', locations: ['list_toolbar'] }, + { name: 'crm_tag_contact', objectName: 'crm_contact', type: 'script', locations: ['record_row'] }, + { name: 'crm_export_all', type: 'script', locations: ['list'] }, ], pages: [ { @@ -682,7 +682,7 @@ describe('[#22161] one-line verdicts — action-name-undefined', () => { fields: { name: { type: 'text' } }, actions: [ { name: 'crm_log_call', type: 'script', locations: ['record_related'] }, - { name: 'crm_pin', type: 'script', locations: ['record_header', 'record_more', 'record_section', 'list_item_x'] }, + { name: 'crm_pin', type: 'script', locations: ['record_page', 'record_section', 'list_item_x'] }, { name: 'crm_score', type: 'script' }, ], }, diff --git a/packages/lint/src/validate-action-object-binding.test.ts b/packages/lint/src/validate-action-object-binding.test.ts index bbba2fbc6ec..ee3a4eb48eb 100644 --- a/packages/lint/src/validate-action-object-binding.test.ts +++ b/packages/lint/src/validate-action-object-binding.test.ts @@ -8,7 +8,7 @@ const action = (extra: Record) => ({ name: 'mark_done', label: describe('action-no-object-binding', () => { it('refuses a standalone action that declares a location and no objectName', () => { - const findings = validateActionObjectBinding({ actions: [action({ locations: ['record_header'] })] }); + const findings = validateActionObjectBinding({ actions: [action({ locations: ['record_page'] })] }); expect(findings).toHaveLength(1); expect(findings[0]).toMatchObject({ rule: ACTION_NO_OBJECT_BINDING, severity: 'error', path: 'actions[0].objectName' }); expect(findings[0].hint).toContain('locations: []'); @@ -17,16 +17,16 @@ describe('action-no-object-binding', () => { it('is silent on a bound action, a headless one, one with no `locations`, and one embedded on its object', () => { expect(validateActionObjectBinding({ actions: [ - action({ objectName: 'qa_task', locations: ['record_header'] }), + action({ objectName: 'qa_task', locations: ['record_page'] }), action({ name: 'sync_all', locations: [] }), action({ name: 'unplaced' }), ], - objects: [{ name: 'qa_task', actions: [action({ locations: ['record_header'] })] }], + objects: [{ name: 'qa_task', actions: [action({ locations: ['record_page'] })] }], })).toEqual([]); }); it('the runtime publish gate refuses the `action` write', () => { - const verdict = runRuntimeAuthoringRules({ type: 'action', item: action({ locations: ['list_toolbar'] }) }); + const verdict = runRuntimeAuthoringRules({ type: 'action', item: action({ locations: ['list'] }) }); expect(verdict.errors.map((f) => f.rule)).toContain(ACTION_NO_OBJECT_BINDING); }); }); diff --git a/packages/lint/src/validate-expressions.test.ts b/packages/lint/src/validate-expressions.test.ts index 97ff18ee0bb..9843a5a6ae1 100644 --- a/packages/lint/src/validate-expressions.test.ts +++ b/packages/lint/src/validate-expressions.test.ts @@ -1685,7 +1685,7 @@ describe('validateStackExpressions (ADR-0032 build-time)', () => { it('flags a bare-field `visible` on a stack action (the trap that hid Mark Done)', () => { const issues = validateStackExpressions({ objects: [{ name: 'showcase_task', fields: { done: { type: 'boolean' }, status: { type: 'select' } } }], - actions: [{ name: 'mark_done', objectName: 'showcase_task', type: 'script', locations: ['record_header'], visible: '!done' }], + actions: [{ name: 'mark_done', objectName: 'showcase_task', type: 'script', locations: ['record_page'], visible: '!done' }], }); const v = issues.filter(i => i.where.includes("action 'mark_done' visible")); expect(v).toHaveLength(1); diff --git a/packages/lint/src/validate-object-action-layout.test.ts b/packages/lint/src/validate-object-action-layout.test.ts index 66945fab9ab..4181f810a5a 100644 --- a/packages/lint/src/validate-object-action-layout.test.ts +++ b/packages/lint/src/validate-object-action-layout.test.ts @@ -22,16 +22,16 @@ const LEAD = { name: 'crm_lead', fields: { title: { type: 'text' } }, actions: [ - { name: 'convert_lead', label: 'Convert', locations: ['record_header'] }, - { name: 'log_call', label: 'Log call', locations: ['record_more'] }, - { name: 'mass_assign', label: 'Assign', locations: ['list_toolbar'] }, + { name: 'convert_lead', label: 'Convert', locations: ['record_page'] }, + { name: 'log_call', label: 'Log call', locations: ['record_page'], component: 'action:menu' }, + { name: 'mass_assign', label: 'Assign', locations: ['list'] }, { name: 'headless', label: 'Headless', locations: [] }, ], }; const stack = (extra: Record = {}, actionLayout?: unknown) => ({ objects: [{ ...LEAD, ...(actionLayout ? { actionLayout } : {}) }], - actions: [{ name: 'send_email', objectName: 'crm_lead', label: 'Send email', locations: ['record_header', 'list_toolbar'] }], + actions: [{ name: 'send_email', objectName: 'crm_lead', label: 'Send email', locations: ['record_page', 'list'] }], ...extra, }); diff --git a/packages/lint/src/validate-record-page-header.test.ts b/packages/lint/src/validate-record-page-header.test.ts index d4e2c4c98b4..74e9cd4c644 100644 --- a/packages/lint/src/validate-record-page-header.test.ts +++ b/packages/lint/src/validate-record-page-header.test.ts @@ -36,9 +36,9 @@ const LEAD = { /** The lead's actions in source order, none declaring `order` or a variant. */ const leadActions = (): AnyRec[] => [ - { name: 'convert_lead', objectName: 'crm_lead', type: 'script', locations: ['record_header'] }, - { name: 'qualify_lead', objectName: 'crm_lead', type: 'script', locations: ['record_header'] }, - { name: 'schedule_followup', objectName: 'crm_lead', type: 'script', locations: ['record_header'] }, + { name: 'convert_lead', objectName: 'crm_lead', type: 'script', locations: ['record_page'] }, + { name: 'qualify_lead', objectName: 'crm_lead', type: 'script', locations: ['record_page'] }, + { name: 'schedule_followup', objectName: 'crm_lead', type: 'script', locations: ['record_page'] }, ]; const header = (properties: AnyRec): AnyRec => ({ type: 'page:header', properties }); @@ -153,13 +153,13 @@ describe('validateRecordPageHeader · the actions', () => { it('compares the row of buttons and the overflow menu apart, as they are drawn', () => { // `archive_lead` is overflow-only: wherever the list names it, it is drawn after every button. - const actions = [...leadActions(), { name: 'archive_lead', objectName: 'crm_lead', locations: ['record_more'] }]; + const actions = [...leadActions(), { name: 'archive_lead', objectName: 'crm_lead', locations: ['record_page'], component: 'action:menu' }]; const list = ['archive_lead', 'convert_lead', 'qualify_lead', 'schedule_followup']; expect(validateRecordPageHeader(stackOf(leadPage({ actions: list }), actions))).toEqual([]); }); it('counts an unlisted placed action that leads the standard page', () => { - const actions = [{ name: 'log_call', objectName: 'crm_lead', locations: ['record_header'], order: -5 }, ...leadActions()]; + const actions = [{ name: 'log_call', objectName: 'crm_lead', locations: ['record_page'], order: -5 }, ...leadActions()]; const list = ['convert_lead', 'qualify_lead', 'schedule_followup']; const findings = validateRecordPageHeader(stackOf(leadPage({ actions: list }), actions)); expect(findings.map((f) => f.rule)).toEqual([RECORD_PAGE_HEADER_ACTIONS_DIFFER]); @@ -167,7 +167,7 @@ describe('validateRecordPageHeader · the actions', () => { }); it('reads the object\'s own actions ahead of the stack\'s bound ones', () => { - const lead = { ...LEAD, actions: [{ name: 'qualify_lead', locations: ['record_header'] }] }; + const lead = { ...LEAD, actions: [{ name: 'qualify_lead', locations: ['record_page'] }] }; const stack = stackOf(leadPage({ actions: LISTED }), leadActions().slice(0, 1).concat(leadActions().slice(2)), [lead]); expect(validateRecordPageHeader(stack)).toEqual([]); }); @@ -175,9 +175,9 @@ describe('validateRecordPageHeader · the actions', () => { it('skips a destructive or menu-only action when picking the primary, as the renderer does', () => { // Unlisted, so only the standard page draws them, and first by order: neither is its primary. const actions = [ - { name: 'delete_lead', objectName: 'crm_lead', locations: ['record_header'], order: -9, variant: 'danger' }, - { name: 'more_menu', objectName: 'crm_lead', locations: ['record_header'], order: -8, component: 'action:menu' }, - { name: 'archive_lead', objectName: 'crm_lead', locations: ['record_more'], order: -7 }, + { name: 'delete_lead', objectName: 'crm_lead', locations: ['record_page'], order: -9, variant: 'danger' }, + { name: 'more_menu', objectName: 'crm_lead', locations: ['record_page'], order: -8, component: 'action:menu' }, + { name: 'archive_lead', objectName: 'crm_lead', locations: ['record_page'], component: 'action:menu', order: -7 }, ...leadActions(), ]; const list = ['convert_lead', 'qualify_lead', 'schedule_followup']; diff --git a/packages/metadata-protocol/src/protocol-extension-arrangement.ts b/packages/metadata-protocol/src/protocol-extension-arrangement.ts index d347533ba14..23005045e63 100644 --- a/packages/metadata-protocol/src/protocol-extension-arrangement.ts +++ b/packages/metadata-protocol/src/protocol-extension-arrangement.ts @@ -77,7 +77,7 @@ const PRESCRIPTION: Readonly> = Object.free fieldGroups: "place what this package brings with `place`, e.g. `place: [{ field: 'tax_id', group: 'basic', after: 'industry' }]`", relatedLists: "place what this package brings with `place`, e.g. `place: [{ list: 'contract', after: 'opportunity' }]`", actionLayout: "place an action this package brings by the action's own `locations` and `order`, e.g. " - + "`{ name: 'send_quote', objectName: 'crm_lead', locations: ['record_more'], order: 50 }`", + + "`{ name: 'send_quote', objectName: 'crm_lead', locations: ['record_page'], component: 'action:menu', order: 50 }`", }); /** The sentence. Prescription inside the first 500 characters: a 4xx message crosses the REST boundary capped there. */ diff --git a/packages/metadata-protocol/src/protocol.object-cascade-delete-objects.test.ts b/packages/metadata-protocol/src/protocol.object-cascade-delete-objects.test.ts index 9ee8d9855d1..368f00f7760 100644 --- a/packages/metadata-protocol/src/protocol.object-cascade-delete-objects.test.ts +++ b/packages/metadata-protocol/src/protocol.object-cascade-delete-objects.test.ts @@ -57,8 +57,8 @@ const TASK = { label: 'Task', fields: { title: { name: 'title', type: 'text', label: 'Title' } }, actions: [ - { name: 'showcase_mark_done', label: 'Mark Done', type: 'script', locations: ['record_header'] }, - { name: 'showcase_snooze', label: 'Snooze', type: 'script', locations: ['record_header'] }, + { name: 'showcase_mark_done', label: 'Mark Done', type: 'script', locations: ['record_page'] }, + { name: 'showcase_snooze', label: 'Snooze', type: 'script', locations: ['record_page'] }, ], }; const PROJECT = { diff --git a/packages/metadata-protocol/src/protocol.object-disabled-actions.test.ts b/packages/metadata-protocol/src/protocol.object-disabled-actions.test.ts index 4f2cdb2bf7b..f2e228a2b5b 100644 --- a/packages/metadata-protocol/src/protocol.object-disabled-actions.test.ts +++ b/packages/metadata-protocol/src/protocol.object-disabled-actions.test.ts @@ -59,8 +59,8 @@ const TASK = { label: 'Task', fields: { title: { name: 'title', type: 'text', label: 'Title' } }, actions: [ - { name: 'showcase_mark_done', label: 'Mark Done', type: 'script', locations: ['record_header'] }, - { name: 'showcase_snooze', label: 'Snooze', type: 'script', locations: ['record_header'] }, + { name: 'showcase_mark_done', label: 'Mark Done', type: 'script', locations: ['record_page'] }, + { name: 'showcase_snooze', label: 'Snooze', type: 'script', locations: ['record_page'] }, ], }; const PROJECT = { diff --git a/packages/metadata-protocol/src/protocol.object-duplicate-action-name-refusal.test.ts b/packages/metadata-protocol/src/protocol.object-duplicate-action-name-refusal.test.ts index cf363c4c8c2..6dc15c5cec3 100644 --- a/packages/metadata-protocol/src/protocol.object-duplicate-action-name-refusal.test.ts +++ b/packages/metadata-protocol/src/protocol.object-duplicate-action-name-refusal.test.ts @@ -52,7 +52,7 @@ async function rejection(promise: Promise): Promise { throw new Error('expected the save to be rejected, but it resolved'); } -const act = (name: string, label: string) => ({ name, label, type: 'script', target: 'noop', locations: ['record_header'] }); +const act = (name: string, label: string) => ({ name, label, type: 'script', target: 'noop', locations: ['record_page'] }); const itemWith = (actions: unknown[]) => ({ name: 'dup_item', diff --git a/packages/objectql/src/bound-action-collision-report.test.ts b/packages/objectql/src/bound-action-collision-report.test.ts index add561cd63f..1bc5cbb96a4 100644 --- a/packages/objectql/src/bound-action-collision-report.test.ts +++ b/packages/objectql/src/bound-action-collision-report.test.ts @@ -36,14 +36,14 @@ const OWNER = { objects: [ObjectSchema.create({ name: 'bc_org', label: 'Org', fields: { name: { name: 'name', type: 'text', label: 'Name' } }, - actions: [{ name: 'rename', label: 'Rename', type: 'url', target: 'https://example.com/own', locations: ['record_header'] }], + actions: [{ name: 'rename', label: 'Rename', type: 'url', target: 'https://example.com/own', locations: ['record_page'] }], } as any)], }; /** Another package binding an action of the same NAME to the owner's object — a different declaration. */ const TWIN = { id: 'com.test.twin', name: 'twin', - actions: [{ name: 'rename', label: 'Rename (twin)', objectName: 'bc_org', type: 'url', target: 'https://example.com/twin', locations: ['record_header'] }], + actions: [{ name: 'rename', label: 'Rename (twin)', objectName: 'bc_org', type: 'url', target: 'https://example.com/twin', locations: ['record_page'] }], }; /** Another package carrying the owner's declaration itself, bound by `objectName` — one declaration, two packages. */ @@ -92,7 +92,7 @@ describe('the registry\'s bound-action collision audit', () => { const stack = defineStack({ manifest: { id: 'com.test.same', name: 'same', version: '1.0.0', type: 'app' }, objects: [{ name: 'bc_same', label: 'Same', fields: { name: { name: 'name', type: 'text', label: 'Name' } } }], - actions: [{ name: 'same_action', label: 'Same', objectName: 'bc_same', type: 'url', target: 'https://example.com', locations: ['record_header'] }], + actions: [{ name: 'same_action', label: 'Same', objectName: 'bc_same', type: 'url', target: 'https://example.com', locations: ['record_page'] }], } as any); // The JSON round trip is the compiled artifact's shape: two copies, not one reference. const engine = await engineWith([JSON.parse(JSON.stringify({ ...stack, ...stack.manifest }))]); diff --git a/packages/objectql/src/bound-action-foreign-object.test.ts b/packages/objectql/src/bound-action-foreign-object.test.ts index 7a2ed187def..b881290ccb7 100644 --- a/packages/objectql/src/bound-action-foreign-object.test.ts +++ b/packages/objectql/src/bound-action-foreign-object.test.ts @@ -157,14 +157,14 @@ const OWNER = { objects: [{ name: 'ba_org', label: 'Org', fields: { name: { name: 'name', type: 'text', label: 'Name' } }, - actions: [{ name: 'own_action', label: 'Own', type: 'url', target: 'https://example.com/own', locations: ['record_header'] }], + actions: [{ name: 'own_action', label: 'Own', type: 'url', target: 'https://example.com/own', locations: ['record_page'] }], }], }; /** The bound action another package declares for the owner's object. */ const BOUND = { name: 'rename_org', label: 'Rename', objectName: 'ba_org', type: 'url', - target: 'https://example.com/rename', locations: ['record_header'], + target: 'https://example.com/rename', locations: ['record_page'], requiredPermissions: ['org_admin'], }; @@ -235,7 +235,7 @@ describe('a bound top-level action reaches another package\'s object as served', const stack = defineStack({ manifest: { id: 'com.test.same', name: 'same', version: '1.0.0', type: 'app' }, objects: [{ name: 'ba_same', label: 'Same', fields: { name: { name: 'name', type: 'text', label: 'Name' } } }], - actions: [{ name: 'same_action', label: 'Same', objectName: 'ba_same', type: 'url', target: 'https://example.com', locations: ['record_header'] }], + actions: [{ name: 'same_action', label: 'Same', objectName: 'ba_same', type: 'url', target: 'https://example.com', locations: ['record_page'] }], } as any); const { protocol } = await hostWith([{ ...stack, ...stack.manifest }]); const served: any = await protocol.getMetaItem({ type: 'object', name: 'ba_same' } as any); @@ -436,7 +436,7 @@ describe('a bound action saved at runtime through the metadata door reaches its /** The standalone action an author saves for the owner's object — no package ships it. */ const RUNTIME = { name: 'rt_action', label: 'Runtime', objectName: 'ba_org', type: 'url', - target: 'https://example.com/rt', locations: ['record_header'], + target: 'https://example.com/rt', locations: ['record_page'], }; const save = (protocol: ObjectStackProtocolImplementation, item: any, extra: Record = {}) => protocol.saveMetaItem({ type: 'action', name: item.name, item: structuredClone(item), ...extra } as any); @@ -553,28 +553,28 @@ const LAUNCHER = { fields: { name: { name: 'name', type: 'text', label: 'Name' } }, // An inline action, as the same-stack merge leaves a bound one: in the // object's own `actions`, not in the standalone collection. - actions: [{ name: 'inline_enroll', label: 'Enroll', type: 'flow', target: 'mk_enroll', locations: ['record_header'] }], + actions: [{ name: 'inline_enroll', label: 'Enroll', type: 'flow', target: 'mk_enroll', locations: ['record_page'] }], }], flows: [{ name: 'app_flow', label: 'App flow', type: 'autolaunched', nodes: [], edges: [] }], actions: [ // Withheld once the module is disabled: the flow only the module ships. - { name: 'bound_enroll', label: 'Enroll', objectName: 'mk_lead', type: 'flow', target: 'mk_enroll', locations: ['record_header'] }, + { name: 'bound_enroll', label: 'Enroll', objectName: 'mk_lead', type: 'flow', target: 'mk_enroll', locations: ['record_page'] }, // Withheld: a param backed by the module's object. { name: 'bound_override', label: 'Add to campaign', objectName: 'mk_lead', type: 'flow', target: 'app_flow', - locations: ['record_header'], + locations: ['record_page'], params: [{ name: 'campaignId', field: 'mk_campaign', objectOverride: 'mk_member', label: 'Campaign', required: true }], }, // Controls: an enabled flow, and a field param on the action's own object. - { name: 'bound_app_flow', label: 'Run', objectName: 'mk_lead', type: 'flow', target: 'app_flow', locations: ['record_header'] }, + { name: 'bound_app_flow', label: 'Run', objectName: 'mk_lead', type: 'flow', target: 'app_flow', locations: ['record_page'] }, { name: 'bound_field_param', label: 'Note', objectName: 'mk_lead', type: 'flow', target: 'app_flow', - locations: ['record_header'], params: [{ name: 'note', field: 'name', label: 'Note' }], + locations: ['record_page'], params: [{ name: 'note', field: 'name', label: 'Note' }], }, // Control: a URL action that names the module's object only in its text. - { name: 'bound_url_mention', label: 'Docs', objectName: 'mk_lead', type: 'url', target: 'https://example.com/mk_member', locations: ['record_header'] }, + { name: 'bound_url_mention', label: 'Docs', objectName: 'mk_lead', type: 'url', target: 'https://example.com/mk_member', locations: ['record_page'] }, // Withheld from GET /meta/action: bound to the module's object, whose own read is refused. - { name: 'bound_to_member', label: 'Member', objectName: 'mk_member', type: 'url', target: 'https://example.com/m', locations: ['record_header'] }, + { name: 'bound_to_member', label: 'Member', objectName: 'mk_member', type: 'url', target: 'https://example.com/m', locations: ['record_page'] }, ], }; diff --git a/packages/objectql/src/protocol-flow-custom-override.test.ts b/packages/objectql/src/protocol-flow-custom-override.test.ts index fc8152e0f52..aa0ba56c7a5 100644 --- a/packages/objectql/src/protocol-flow-custom-override.test.ts +++ b/packages/objectql/src/protocol-flow-custom-override.test.ts @@ -162,7 +162,7 @@ const actionBody = (label: string, extra: Record = {}) => ({ objectName: 'showcase_task', type: 'script', body: { language: 'js', source: `return { ran: '${label}' };` }, - locations: ['record_header', 'list_item'], + locations: ['record'], ...ACTION_GATES, ...extra, }); diff --git a/packages/objectql/src/protocol-meta-disabled-actions.test.ts b/packages/objectql/src/protocol-meta-disabled-actions.test.ts index 6d4c060ee0c..e8441789608 100644 --- a/packages/objectql/src/protocol-meta-disabled-actions.test.ts +++ b/packages/objectql/src/protocol-meta-disabled-actions.test.ts @@ -151,8 +151,8 @@ const SHOWCASE = { name: 'da_task', label: 'Task', fields: { name: { name: 'name', type: 'text', label: 'Name' } }, actions: [ - { name: 'da_mark_done', label: 'Mark Done', type: 'url', target: 'https://example.com/done', locations: ['record_header'] }, - { name: 'da_snooze', label: 'Snooze', type: 'url', target: 'https://example.com/snooze', locations: ['record_header'] }, + { name: 'da_mark_done', label: 'Mark Done', type: 'url', target: 'https://example.com/done', locations: ['record_page'] }, + { name: 'da_snooze', label: 'Snooze', type: 'url', target: 'https://example.com/snooze', locations: ['record_page'] }, ], }], }; diff --git a/packages/platform-objects/src/audit/sys-notification.object.ts b/packages/platform-objects/src/audit/sys-notification.object.ts index d7bdf56a51e..cb26db35184 100644 --- a/packages/platform-objects/src/audit/sys-notification.object.ts +++ b/packages/platform-objects/src/audit/sys-notification.object.ts @@ -100,7 +100,7 @@ export const SysNotification = ObjectSchema.create({ 'Send a message to everyone in your organization, or to the members you pick. It appears in each recipient’s notifications.', icon: 'send', variant: 'primary', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', target: '/api/v1/messaging/in-app-messages', requiredPermissions: ['setup.write'], diff --git a/packages/platform-objects/src/identity/sys-account.object.ts b/packages/platform-objects/src/identity/sys-account.object.ts index 7537ae960ab..fcd0134eb9a 100644 --- a/packages/platform-objects/src/identity/sys-account.object.ts +++ b/packages/platform-objects/src/identity/sys-account.object.ts @@ -63,7 +63,7 @@ export const SysAccount = ObjectSchema.create({ icon: 'unlink', variant: 'danger', mode: 'delete', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', target: '/api/v1/auth/unlink-account', // Confirm question on `description`, not `confirmText`: this action collects diff --git a/packages/platform-objects/src/identity/sys-api-key.object.ts b/packages/platform-objects/src/identity/sys-api-key.object.ts index f2685705fed..a85487c05f5 100644 --- a/packages/platform-objects/src/identity/sys-api-key.object.ts +++ b/packages/platform-objects/src/identity/sys-api-key.object.ts @@ -103,7 +103,7 @@ export const SysApiKey = ObjectSchema.create({ icon: 'plus-circle', variant: 'primary', mode: 'create', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', method: 'POST', target: '/api/v1/keys', @@ -145,7 +145,7 @@ export const SysApiKey = ObjectSchema.create({ icon: 'shield-off', variant: 'danger', mode: 'custom', - locations: ['list_item'], + locations: ['record_row'], type: 'api', method: 'PATCH', target: '/api/v1/data/sys_api_key/{id}', @@ -175,7 +175,7 @@ export const SysApiKey = ObjectSchema.create({ icon: 'shield-check', variant: 'secondary', mode: 'custom', - locations: ['list_item'], + locations: ['record_row'], type: 'api', method: 'PATCH', target: '/api/v1/data/sys_api_key/{id}', diff --git a/packages/platform-objects/src/identity/sys-idp-group-mapping-actions.test.ts b/packages/platform-objects/src/identity/sys-idp-group-mapping-actions.test.ts index 6340afcd634..8c78afd3d26 100644 --- a/packages/platform-objects/src/identity/sys-idp-group-mapping-actions.test.ts +++ b/packages/platform-objects/src/identity/sys-idp-group-mapping-actions.test.ts @@ -62,7 +62,7 @@ function offered(source: string, user: Record): string { describe('sys_idp_group_mapping: Map and Delete reach the platform-admin mounts', () => { it('Map SSO Group POSTs the save from the list toolbar, naming the provider, with the body keys the save reads', () => { const map = action('map_sso_group'); - expect(map).toMatchObject({ type: 'api', method: 'POST', target: SET_ROUTE, locations: ['list_toolbar'] }); + expect(map).toMatchObject({ type: 'api', method: 'POST', target: SET_ROUTE, locations: ['list'] }); const params = paramsOf(map); expect(params.map((p) => p.name)).toEqual(['providerId', 'groupExternalId', 'groupDisplayName', 'permissionSet']); // The source and the set are required; the group is one of two, judged by the door. @@ -71,7 +71,7 @@ describe('sys_idp_group_mapping: Map and Delete reach the platform-admin mounts' it('Map SCIM Group POSTs the save from the list toolbar, naming the connection, with the body keys the save reads', () => { const map = action('map_scim_group'); - expect(map).toMatchObject({ type: 'api', method: 'POST', target: SET_ROUTE, locations: ['list_toolbar'] }); + expect(map).toMatchObject({ type: 'api', method: 'POST', target: SET_ROUTE, locations: ['list'] }); const params = paramsOf(map); expect(params.map((p) => p.name)).toEqual(['connectionId', 'groupExternalId', 'groupDisplayName', 'permissionSet']); expect(params.filter((p) => p.required).map((p) => p.name)).toEqual(['connectionId', 'permissionSet']); @@ -101,7 +101,7 @@ describe('sys_idp_group_mapping: Map and Delete reach the platform-admin mounts' method: 'POST', target: DELETE_ROUTE, recordIdParam: 'mappingId', - locations: ['list_item', 'record_header'], + locations: ['record'], }); // No param dialog: the row is the whole input, so the confirmation is the one dialog. expect(del.params ?? []).toEqual([]); diff --git a/packages/platform-objects/src/identity/sys-idp-group-mapping.object.ts b/packages/platform-objects/src/identity/sys-idp-group-mapping.object.ts index 4776744f986..40d27582b28 100644 --- a/packages/platform-objects/src/identity/sys-idp-group-mapping.object.ts +++ b/packages/platform-objects/src/identity/sys-idp-group-mapping.object.ts @@ -100,7 +100,7 @@ export const SysIdpGroupMapping = ObjectSchema.create({ icon: 'plus-circle', variant: 'primary', mode: 'create', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', method: 'POST', target: '/api/v1/auth/admin/scim/set-group-mapping', @@ -148,7 +148,7 @@ export const SysIdpGroupMapping = ObjectSchema.create({ icon: 'plus-circle', variant: 'secondary', mode: 'create', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', method: 'POST', target: '/api/v1/auth/admin/scim/set-group-mapping', @@ -201,7 +201,7 @@ export const SysIdpGroupMapping = ObjectSchema.create({ icon: 'trash-2', variant: 'danger', mode: 'custom', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', method: 'POST', target: '/api/v1/auth/admin/scim/delete-group-mapping', diff --git a/packages/platform-objects/src/identity/sys-invitation.object.ts b/packages/platform-objects/src/identity/sys-invitation.object.ts index 20f06da4569..bfcfd636bfe 100644 --- a/packages/platform-objects/src/identity/sys-invitation.object.ts +++ b/packages/platform-objects/src/identity/sys-invitation.object.ts @@ -87,7 +87,7 @@ export const SysInvitation = ObjectSchema.create({ 'Invite someone by email address. They join this organization with the chosen role when they accept the invitation.', icon: 'user-plus', variant: 'primary', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', target: '/api/v1/auth/organization/invite-member', // Inviting/managing invitations is a multi-org-only flow (the @@ -131,7 +131,7 @@ export const SysInvitation = ObjectSchema.create({ icon: 'x-circle', variant: 'danger', mode: 'delete', - locations: ['list_item'], + locations: ['record_row'], type: 'api', target: '/api/v1/auth/organization/cancel-invitation', recordIdParam: 'invitationId', @@ -168,7 +168,7 @@ export const SysInvitation = ObjectSchema.create({ 'Resend the invitation to {{ record.email }}? The expiry date starts over, and an invitation that has already expired is replaced by a new one.', icon: 'send', variant: 'secondary', - locations: ['list_item'], + locations: ['record_row'], type: 'api', target: '/api/v1/auth/organization/invite-member', bodyExtra: { resend: true }, @@ -213,7 +213,7 @@ export const SysInvitation = ObjectSchema.create({ label: 'Copy Invite Link', icon: 'link', variant: 'secondary', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'script', target: 'copy_invitation_link', // The gates of `resend_invitation` (the organization capability and the @@ -262,7 +262,7 @@ export const SysInvitation = ObjectSchema.create({ label: 'Accept Invitation', icon: 'check', variant: 'primary', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', target: '/api/v1/auth/organization/accept-invitation', recordIdParam: 'invitationId', @@ -285,7 +285,7 @@ export const SysInvitation = ObjectSchema.create({ label: 'Decline Invitation', icon: 'x', variant: 'ghost', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', target: '/api/v1/auth/organization/reject-invitation', recordIdParam: 'invitationId', diff --git a/packages/platform-objects/src/identity/sys-member.object.ts b/packages/platform-objects/src/identity/sys-member.object.ts index e45915520af..4e9a2f3f07d 100644 --- a/packages/platform-objects/src/identity/sys-member.object.ts +++ b/packages/platform-objects/src/identity/sys-member.object.ts @@ -100,7 +100,7 @@ export const SysMember = ObjectSchema.create({ 'Invite someone by email address. They join this organization with the chosen role when they accept the invitation.', icon: 'user-plus', variant: 'primary', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', target: '/api/v1/auth/organization/invite-member', // Same gate as the other two mirrors — the org CAPABILITY, not @@ -176,7 +176,7 @@ export const SysMember = ObjectSchema.create({ label: 'Add Member', icon: 'link-2', variant: 'secondary', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', target: '/api/v1/auth/organization/add-member', // The door's platform-admin gate, declared where both action doors read it (#30771). @@ -225,7 +225,7 @@ export const SysMember = ObjectSchema.create({ description: "Choose the new organization role for {{ record.user_id.name | default:'this member' }}.", icon: 'shield', mode: 'edit', - locations: ['list_item'], + locations: ['record_row'], type: 'api', target: '/api/v1/auth/organization/update-member-role', recordIdParam: 'memberId', @@ -254,7 +254,7 @@ export const SysMember = ObjectSchema.create({ icon: 'user-minus', variant: 'danger', mode: 'delete', - locations: ['list_item'], + locations: ['record_row'], type: 'api', target: '/api/v1/auth/organization/remove-member', recordIdParam: 'memberIdOrEmail', @@ -293,7 +293,7 @@ export const SysMember = ObjectSchema.create({ icon: 'crown', variant: 'danger', mode: 'custom', - locations: ['list_item'], + locations: ['record_row'], type: 'api', target: '/api/v1/auth/organization/update-member-role', recordIdParam: 'memberId', diff --git a/packages/platform-objects/src/identity/sys-oauth-application.object.ts b/packages/platform-objects/src/identity/sys-oauth-application.object.ts index 315b4781a6d..6c7c3be0f07 100644 --- a/packages/platform-objects/src/identity/sys-oauth-application.object.ts +++ b/packages/platform-objects/src/identity/sys-oauth-application.object.ts @@ -96,7 +96,7 @@ export const SysOauthApplication = ObjectSchema.create({ icon: 'pause-circle', variant: 'secondary', mode: 'custom', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', method: 'POST', target: '/api/v1/auth/admin/oauth2/toggle-disabled', @@ -131,7 +131,7 @@ export const SysOauthApplication = ObjectSchema.create({ icon: 'play-circle', variant: 'primary', mode: 'custom', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', method: 'POST', target: '/api/v1/auth/admin/oauth2/toggle-disabled', @@ -160,7 +160,7 @@ export const SysOauthApplication = ObjectSchema.create({ icon: 'plus-circle', variant: 'primary', mode: 'create', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', method: 'POST', target: '/api/v1/auth/sys-oauth-application/register', @@ -216,7 +216,7 @@ export const SysOauthApplication = ObjectSchema.create({ icon: 'refresh-cw', variant: 'secondary', mode: 'custom', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', method: 'POST', target: '/api/v1/auth/oauth2/client/rotate-secret', @@ -253,7 +253,7 @@ export const SysOauthApplication = ObjectSchema.create({ icon: 'trash', variant: 'danger', mode: 'delete', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', method: 'POST', target: '/api/v1/auth/oauth2/delete-client', diff --git a/packages/platform-objects/src/identity/sys-organization.object.ts b/packages/platform-objects/src/identity/sys-organization.object.ts index cc8e360b7c1..d1fb7b5d3c4 100644 --- a/packages/platform-objects/src/identity/sys-organization.object.ts +++ b/packages/platform-objects/src/identity/sys-organization.object.ts @@ -69,7 +69,7 @@ export const SysOrganization = ObjectSchema.create({ label: 'Create Organization', icon: 'plus', variant: 'primary', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', target: '/api/v1/auth/organization/create', // Hidden while cloud-managed: creating an organization makes the caller @@ -101,7 +101,7 @@ export const SysOrganization = ObjectSchema.create({ label: 'Edit Organization', icon: 'pencil', mode: 'edit', - locations: ['list_item'], + locations: ['record_row'], type: 'api', target: '/api/v1/auth/organization/update', recordIdParam: 'organizationId', @@ -133,7 +133,7 @@ export const SysOrganization = ObjectSchema.create({ icon: 'trash', variant: 'danger', mode: 'delete', - locations: ['list_item'], + locations: ['record_row'], type: 'api', target: '/api/v1/auth/organization/delete', recordIdParam: 'organizationId', @@ -157,7 +157,7 @@ export const SysOrganization = ObjectSchema.create({ icon: 'check-circle-2', variant: 'secondary', mode: 'custom', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', target: '/api/v1/auth/organization/set-active', recordIdParam: 'organizationId', @@ -193,7 +193,7 @@ export const SysOrganization = ObjectSchema.create({ // Lower than every sibling (unset = 0), so the stable `order` sort puts // it first in the record header. order: -1, - locations: ['record_header'], + locations: ['record_page'], type: 'api', target: '/api/v1/auth/organization/invite-member', recordIdParam: 'organizationId', @@ -246,7 +246,7 @@ export const SysOrganization = ObjectSchema.create({ // grade may leave. order: 1, mode: 'custom', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', target: '/api/v1/auth/organization/leave', recordIdParam: 'organizationId', @@ -288,7 +288,7 @@ export const SysOrganization = ObjectSchema.create({ icon: 'pencil', variant: 'secondary', mode: 'edit', - locations: ['record_header', 'list_item'], + locations: ['record'], type: 'api', target: '/api/v1/auth/organization/update', recordIdParam: 'organizationId', diff --git a/packages/platform-objects/src/identity/sys-scim-connection-credential-actions.test.ts b/packages/platform-objects/src/identity/sys-scim-connection-credential-actions.test.ts index 7dbf72bd887..9f5d03641fa 100644 --- a/packages/platform-objects/src/identity/sys-scim-connection-credential-actions.test.ts +++ b/packages/platform-objects/src/identity/sys-scim-connection-credential-actions.test.ts @@ -51,7 +51,7 @@ function offered(source: string, record: Record): string { describe('sys_scim_connection_credential: mint and revoke reach the platform-admin mounts', () => { it('mint POSTs the mint mount from the list toolbar, with the body keys the mount reads', () => { const mint = action('mint_scim_credential'); - expect(mint).toMatchObject({ type: 'api', method: 'POST', target: MINT_ROUTE, locations: ['list_toolbar'] }); + expect(mint).toMatchObject({ type: 'api', method: 'POST', target: MINT_ROUTE, locations: ['list'] }); const params = (mint.params ?? []) as Array<{ name?: string; required?: boolean; type?: string; reference?: string }>; expect(params.map((p) => p.name)).toEqual(['connectionId', 'label', 'organizationId', 'provisioningDomainId', 'expiresAt']); // The mount refuses a mint with no connection id; nothing else is required. @@ -69,7 +69,7 @@ describe('sys_scim_connection_credential: mint and revoke reach the platform-adm method: 'POST', target: REVOKE_ROUTE, recordIdParam: 'credentialId', - locations: ['list_item', 'record_header'], + locations: ['record'], }); // No param dialog: the row is the whole input, so the confirmation is the one dialog. expect(revoke.params ?? []).toEqual([]); diff --git a/packages/platform-objects/src/identity/sys-scim-connection-credential.object.ts b/packages/platform-objects/src/identity/sys-scim-connection-credential.object.ts index ae4cece9b57..6b41cf06ce6 100644 --- a/packages/platform-objects/src/identity/sys-scim-connection-credential.object.ts +++ b/packages/platform-objects/src/identity/sys-scim-connection-credential.object.ts @@ -90,7 +90,7 @@ export const SysScimConnectionCredential = ObjectSchema.create({ icon: 'plus-circle', variant: 'primary', mode: 'create', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', method: 'POST', target: '/api/v1/auth/admin/scim/mint-credential', @@ -156,7 +156,7 @@ export const SysScimConnectionCredential = ObjectSchema.create({ icon: 'shield-off', variant: 'danger', mode: 'custom', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', method: 'POST', target: '/api/v1/auth/admin/scim/revoke-credential', diff --git a/packages/platform-objects/src/identity/sys-session.object.ts b/packages/platform-objects/src/identity/sys-session.object.ts index a72912180fe..494cbac87dd 100644 --- a/packages/platform-objects/src/identity/sys-session.object.ts +++ b/packages/platform-objects/src/identity/sys-session.object.ts @@ -80,7 +80,7 @@ export const SysSession = ObjectSchema.create({ label: 'Sign out other devices', icon: 'log-out', variant: 'danger', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', target: '/api/v1/auth/revoke-other-sessions', confirmText: 'Sign out of every other device where you\'re currently logged in? Your current session will remain active.', @@ -101,7 +101,7 @@ export const SysSession = ObjectSchema.create({ icon: 'log-out', variant: 'danger', mode: 'delete', - locations: ['list_item'], + locations: ['record_row'], type: 'api', // Keyed on the row's `id` — every list row carries it — and resolved to // the session SERVER-side by plugin-auth's `sys-session/revoke` door, so diff --git a/packages/platform-objects/src/identity/sys-sso-provider.object.ts b/packages/platform-objects/src/identity/sys-sso-provider.object.ts index ce1336114a4..aef2e8d310a 100644 --- a/packages/platform-objects/src/identity/sys-sso-provider.object.ts +++ b/packages/platform-objects/src/identity/sys-sso-provider.object.ts @@ -96,7 +96,7 @@ export const SysSsoProvider = ObjectSchema.create({ icon: 'plus-circle', variant: 'primary', mode: 'create', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', method: 'POST', // Routed through the env-side bridge (plugin-auth `auth-plugin.ts`), which @@ -167,7 +167,7 @@ export const SysSsoProvider = ObjectSchema.create({ icon: 'shield', variant: 'primary', mode: 'create', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', method: 'POST', // SAML 2.0 via @better-auth/sso (samlify-backed). Routed through the @@ -213,7 +213,7 @@ export const SysSsoProvider = ObjectSchema.create({ label: 'Request Domain Verification', icon: 'globe', variant: 'secondary', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', method: 'POST', // ADR-0135 D6 (opt-in OS_SSO_DOMAIN_VERIFICATION). Asks @better-auth/sso @@ -259,7 +259,7 @@ export const SysSsoProvider = ObjectSchema.create({ label: 'Verify Domain', icon: 'shield-check', variant: 'secondary', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', method: 'POST', // ADR-0135 D6. Re-checks the DNS-TXT record and flips `domain_verified` @@ -282,7 +282,7 @@ export const SysSsoProvider = ObjectSchema.create({ icon: 'trash', variant: 'danger', mode: 'delete', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', method: 'POST', target: '/api/v1/auth/sso/delete-provider', @@ -335,7 +335,7 @@ export const SysSsoProvider = ObjectSchema.create({ label: 'Edit Sign-In Options', icon: 'settings', variant: 'secondary', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', method: 'POST', // The provider's two sign-in toggles (ruling record 6718355623 on the @@ -381,7 +381,7 @@ export const SysSsoProvider = ObjectSchema.create({ label: 'Edit SAML Settings', icon: 'pencil', variant: 'secondary', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', method: 'POST', target: '/api/v1/auth/admin/sso/update-provider', @@ -409,7 +409,7 @@ export const SysSsoProvider = ObjectSchema.create({ label: 'Edit OIDC Settings', icon: 'pencil', variant: 'secondary', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', method: 'POST', target: '/api/v1/auth/admin/sso/update-provider', @@ -444,7 +444,7 @@ export const SysSsoProvider = ObjectSchema.create({ label: 'Show Groups Claim', icon: 'users', variant: 'secondary', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', method: 'POST', target: '/api/v1/auth/admin/sso/get-groups-claim', @@ -468,7 +468,7 @@ export const SysSsoProvider = ObjectSchema.create({ label: 'Edit Groups Claim', icon: 'users', variant: 'secondary', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', method: 'POST', target: '/api/v1/auth/admin/sso/set-groups-claim', @@ -500,7 +500,7 @@ export const SysSsoProvider = ObjectSchema.create({ label: 'Show Attribute Mapping', icon: 'id-card', variant: 'secondary', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', method: 'POST', target: '/api/v1/auth/admin/sso/get-attribute-mapping', @@ -528,7 +528,7 @@ export const SysSsoProvider = ObjectSchema.create({ label: 'Edit Attribute Mapping', icon: 'id-card', variant: 'secondary', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', method: 'POST', target: '/api/v1/auth/admin/sso/set-attribute-mapping', diff --git a/packages/platform-objects/src/identity/sys-team-member.object.ts b/packages/platform-objects/src/identity/sys-team-member.object.ts index 39e32e6eb25..c374b0f4807 100644 --- a/packages/platform-objects/src/identity/sys-team-member.object.ts +++ b/packages/platform-objects/src/identity/sys-team-member.object.ts @@ -53,7 +53,7 @@ export const SysTeamMember = ObjectSchema.create({ label: 'Add Member', icon: 'user-plus', variant: 'primary', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', target: '/api/v1/auth/organization/add-team-member', // Team membership lives under organizations — multi-org-only. Gate @@ -84,7 +84,7 @@ export const SysTeamMember = ObjectSchema.create({ icon: 'user-minus', variant: 'danger', mode: 'delete', - locations: ['list_item'], + locations: ['record_row'], type: 'api', target: '/api/v1/auth/organization/remove-team-member', requiresFeature: 'organization', diff --git a/packages/platform-objects/src/identity/sys-team.object.ts b/packages/platform-objects/src/identity/sys-team.object.ts index 491f5226da6..3d1725c4e5d 100644 --- a/packages/platform-objects/src/identity/sys-team.object.ts +++ b/packages/platform-objects/src/identity/sys-team.object.ts @@ -42,7 +42,7 @@ export const SysTeam = ObjectSchema.create({ label: 'Create Team', icon: 'plus', variant: 'primary', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', target: '/api/v1/auth/organization/create-team', // Teams are nested inside organizations — a multi-org-only concept. @@ -71,7 +71,7 @@ export const SysTeam = ObjectSchema.create({ label: 'Edit Team', icon: 'pencil', mode: 'edit', - locations: ['list_item'], + locations: ['record_row'], type: 'api', target: '/api/v1/auth/organization/update-team', recordIdParam: 'teamId', @@ -100,7 +100,7 @@ export const SysTeam = ObjectSchema.create({ name: 'add_team_member', label: 'Add Member', icon: 'user-plus', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', target: '/api/v1/auth/organization/add-team-member', recordIdParam: 'teamId', @@ -129,7 +129,7 @@ export const SysTeam = ObjectSchema.create({ icon: 'trash', variant: 'danger', mode: 'delete', - locations: ['list_item'], + locations: ['record_row'], type: 'api', target: '/api/v1/auth/organization/remove-team', recordIdParam: 'teamId', diff --git a/packages/platform-objects/src/identity/sys-two-factor.object.ts b/packages/platform-objects/src/identity/sys-two-factor.object.ts index cd6c0150ea7..9c2177f8d89 100644 --- a/packages/platform-objects/src/identity/sys-two-factor.object.ts +++ b/packages/platform-objects/src/identity/sys-two-factor.object.ts @@ -74,7 +74,7 @@ export const SysTwoFactor = ObjectSchema.create({ label: 'Enable 2FA', icon: 'shield-check', variant: 'primary', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', target: '/api/v1/auth/two-factor/enable', requiresFeature: 'twoFactor', @@ -99,7 +99,7 @@ export const SysTwoFactor = ObjectSchema.create({ label: 'Disable 2FA', icon: 'shield-off', variant: 'danger', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', target: '/api/v1/auth/two-factor/disable', requiresFeature: 'twoFactor', @@ -118,7 +118,7 @@ export const SysTwoFactor = ObjectSchema.create({ label: 'Regenerate Backup Codes', icon: 'refresh-cw', variant: 'secondary', - locations: ['list_toolbar', 'list_item'], + locations: ['list', 'record_row'], type: 'api', target: '/api/v1/auth/two-factor/generate-backup-codes', requiresFeature: 'twoFactor', diff --git a/packages/platform-objects/src/identity/sys-user-platform-admin-roster-action.test.ts b/packages/platform-objects/src/identity/sys-user-platform-admin-roster-action.test.ts index 0318427f8af..19b13537d99 100644 --- a/packages/platform-objects/src/identity/sys-user-platform-admin-roster-action.test.ts +++ b/packages/platform-objects/src/identity/sys-user-platform-admin-roster-action.test.ts @@ -44,7 +44,7 @@ describe('[ADR-0095 D3] sys_user list_platform_admins', () => { expect(roster.map((a) => a.name)).toEqual(['list_platform_admins']); expect(action()).toMatchObject({ type: 'api', - locations: ['list_toolbar'], + locations: ['list'], visible: { dialect: 'cel', source: 'current_user.isPlatformAdmin == true' }, refreshAfter: false, }); diff --git a/packages/platform-objects/src/identity/sys-user.object.ts b/packages/platform-objects/src/identity/sys-user.object.ts index 47d931456ce..a3e7b760674 100644 --- a/packages/platform-objects/src/identity/sys-user.object.ts +++ b/packages/platform-objects/src/identity/sys-user.object.ts @@ -141,7 +141,7 @@ export const SysUser = ObjectSchema.create({ 'Invite someone by email address. They join this organization with the chosen role when they accept the invitation.', icon: 'user-plus', variant: 'primary', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', target: '/api/v1/auth/organization/invite-member', // Gated on the org CAPABILITY, not multi-org (cloud ADR-0081 D1): the @@ -245,7 +245,7 @@ export const SysUser = ObjectSchema.create({ label: 'Ban User', icon: 'ban', variant: 'danger', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', target: '/api/v1/auth/admin/ban-user', // The door's platform-admin gate, declared where both action doors read it (#30771). @@ -283,7 +283,7 @@ export const SysUser = ObjectSchema.create({ label: 'Unban User', icon: 'check-circle-2', variant: 'secondary', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', target: '/api/v1/auth/admin/unban-user', // The door's platform-admin gate, declared where both action doors read it (#30771). @@ -312,7 +312,7 @@ export const SysUser = ObjectSchema.create({ label: 'Unlock Account', icon: 'lock-open', variant: 'secondary', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', target: '/api/v1/auth/admin/unlock-user', // The door's platform-admin gate, declared where both action doors read it (#30771). @@ -352,7 +352,7 @@ export const SysUser = ObjectSchema.create({ label: 'Create User', icon: 'user-plus', variant: 'secondary', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', target: '/api/v1/auth/admin/create-user', // The door's platform-admin gate, declared where both action doors read it (#30771). @@ -479,7 +479,7 @@ export const SysUser = ObjectSchema.create({ "Add someone by email address before their first sign-in. They sign in through your organization's identity provider; no password is set here.", icon: 'user-plus', variant: 'primary', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', target: '/api/v1/auth/admin/add-sso-user', requiredPermissions: [...PLATFORM_ADMIN_USERS_GATE], @@ -541,7 +541,7 @@ export const SysUser = ObjectSchema.create({ "Add many people at once from CSV text. Each row is added on its own, so a bad row fails alone. They sign in through your organization's identity provider; no password is set here.", icon: 'upload', variant: 'secondary', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', target: '/api/v1/auth/admin/import-sso-users', requiredPermissions: [...PLATFORM_ADMIN_USERS_GATE], @@ -606,7 +606,7 @@ export const SysUser = ObjectSchema.create({ label: 'Remove Pending User', icon: 'user-minus', variant: 'danger', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', target: '/api/v1/auth/admin/remove-sso-user', requiredPermissions: [...PLATFORM_ADMIN_USERS_GATE], @@ -623,7 +623,7 @@ export const SysUser = ObjectSchema.create({ label: 'Set Password', icon: 'key-round', variant: 'secondary', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', // #2766 V1 — same path as better-auth's stock route, but served by the // plugin-auth wrapper registered ahead of the catch-all: it accepts the @@ -693,7 +693,7 @@ export const SysUser = ObjectSchema.create({ label: 'Impersonate User', icon: 'user-cog', variant: 'secondary', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', target: '/api/v1/auth/admin/impersonate-user', // The door's platform-admin gate, declared where both action doors read it (#30771). @@ -745,7 +745,7 @@ export const SysUser = ObjectSchema.create({ label: 'Set Manager', icon: 'network', variant: 'secondary', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', target: '/api/v1/auth/admin/set-user-manager', // The door's platform-admin gate, declared where both action doors read it (#30771). @@ -833,7 +833,7 @@ export const SysUser = ObjectSchema.create({ label: 'Remove Manager', icon: 'user-minus', variant: 'secondary', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', target: '/api/v1/auth/admin/set-user-manager', // The door's platform-admin gate, declared where both action doors read it (#30771). @@ -862,7 +862,7 @@ export const SysUser = ObjectSchema.create({ label: 'Platform Administrators', icon: 'shield-check', variant: 'secondary', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', target: '/api/v1/auth/admin/list-platform-admins', // The door's platform-admin gate, declared where both action doors read it (#30771). @@ -896,7 +896,7 @@ export const SysUser = ObjectSchema.create({ label: 'Register AI Service Account', icon: 'bot', variant: 'secondary', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', target: '/api/v1/auth/service-account/register', // Offered in a cloud-managed environment too: an account is no person @@ -932,7 +932,7 @@ export const SysUser = ObjectSchema.create({ label: 'Create API Key', icon: 'key-round', variant: 'secondary', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'api', target: '/api/v1/auth/service-account/create-key', // An AI service account's row only. Its owner is admitted by the door @@ -992,7 +992,7 @@ export const SysUser = ObjectSchema.create({ icon: 'user-pen', variant: 'primary', mode: 'edit', - locations: ['record_header'], + locations: ['record_page'], type: 'api', target: '/api/v1/auth/update-user', visible: 'has(record.id) && record.id == ctx.user.id', @@ -1014,7 +1014,7 @@ export const SysUser = ObjectSchema.create({ label: 'Change Password', icon: 'key', variant: 'secondary', - locations: ['record_header', 'record_more', 'record_section'], + locations: ['record_page', 'record_section'], type: 'api', target: '/api/v1/auth/change-password', // Managed (IdP-provisioned) users hold no local credential — hide the @@ -1035,7 +1035,7 @@ export const SysUser = ObjectSchema.create({ label: 'Change Email', icon: 'mail', variant: 'secondary', - locations: ['record_header', 'record_more', 'record_section'], + locations: ['record_page', 'record_section'], type: 'api', target: '/api/v1/auth/change-email', // A managed user's email is owned by the IdP — a local change would @@ -1052,7 +1052,7 @@ export const SysUser = ObjectSchema.create({ label: 'Resend Verification Email', icon: 'mail-check', variant: 'secondary', - locations: ['record_header', 'record_more', 'record_section'], + locations: ['record_page', 'record_section'], type: 'api', target: '/api/v1/auth/send-verification-email', // Only render for the row owner AND when their email is still @@ -1074,7 +1074,7 @@ export const SysUser = ObjectSchema.create({ icon: 'user-x', variant: 'danger', mode: 'delete', - locations: ['record_more', 'record_section'], + locations: ['record_page', 'record_section'], component: 'action:menu', type: 'api', target: '/api/v1/auth/delete-user', // Self-delete needs a local password; managed users are deprovisioned diff --git a/packages/plugins/plugin-approvals/src/sys-approval-request.object.ts b/packages/plugins/plugin-approvals/src/sys-approval-request.object.ts index 5abd9aedaf7..f606582d10c 100644 --- a/packages/plugins/plugin-approvals/src/sys-approval-request.object.ts +++ b/packages/plugins/plugin-approvals/src/sys-approval-request.object.ts @@ -725,7 +725,7 @@ export const SysApprovalRequest = ObjectSchema.create({ visible: 'has(record.viewer) && has(record.viewer.can_act) && record.viewer.can_act == true' + ' || has(record.viewer) && has(record.viewer.can_override_approve) && record.viewer.can_override_approve == true', - locations: ['record_section', 'list_item'], + locations: ['record_section', 'record_row'], // Names what was approved, in the inbox's inline Approve wording. The // decide route answers `ApprovalDecisionResult`, whose `request` is the // read-back row with its display enrichment, so `record_title` is the @@ -780,7 +780,7 @@ export const SysApprovalRequest = ObjectSchema.create({ visible: 'has(record.viewer) && has(record.viewer.can_act) && record.viewer.can_act == true' + ' || has(record.viewer) && has(record.viewer.can_override) && record.viewer.can_override == true', - locations: ['record_section', 'list_item'], + locations: ['record_section', 'record_row'], successMessage: 'Rejected "{{ result.request.record_title }}"', refreshAfter: true, ai: { diff --git a/packages/qa/dogfood/test/action-list-packageless-other-object.dogfood.test.ts b/packages/qa/dogfood/test/action-list-packageless-other-object.dogfood.test.ts index 51b4172f71a..39124ff663a 100644 --- a/packages/qa/dogfood/test/action-list-packageless-other-object.dogfood.test.ts +++ b/packages/qa/dogfood/test/action-list-packageless-other-object.dogfood.test.ts @@ -29,7 +29,7 @@ import { bootShowcase } from './showcase-boot.js'; const PKG = 'com.example.qalistagree'; const action = (name: string, label: string, objectName: string) => ({ - name, label, objectName, type: 'url', target: 'https://example.com', locations: ['record_more'], + name, label, objectName, type: 'url', target: 'https://example.com', locations: ['record_page'], component: 'action:menu', }); describe('[#33904] the action list agrees with the by-name read beside a package-less save on another object', () => { diff --git a/packages/qa/dogfood/test/action-save-packageless-other-object.dogfood.test.ts b/packages/qa/dogfood/test/action-save-packageless-other-object.dogfood.test.ts index a16c72f34de..b60425f8a4a 100644 --- a/packages/qa/dogfood/test/action-save-packageless-other-object.dogfood.test.ts +++ b/packages/qa/dogfood/test/action-save-packageless-other-object.dogfood.test.ts @@ -34,7 +34,7 @@ import { bootShowcase } from './showcase-boot.js'; const PKG = 'com.example.qasaveother'; const action = (name: string, label: string, objectName: string) => ({ - name, label, objectName, type: 'url', target: `https://example.invalid/${label}`, locations: ['record_more'], + name, label, objectName, type: 'url', target: `https://example.invalid/${label}`, locations: ['record_page'], component: 'action:menu', }); describe('[ADR-0150 D4] a package-less action save on an object the package does not bind', () => { diff --git a/packages/qa/dogfood/test/api-action-door-forward.dogfood.test.ts b/packages/qa/dogfood/test/api-action-door-forward.dogfood.test.ts index 11dcff40f19..14411f2d956 100644 --- a/packages/qa/dogfood/test/api-action-door-forward.dogfood.test.ts +++ b/packages/qa/dogfood/test/api-action-door-forward.dogfood.test.ts @@ -81,7 +81,7 @@ const RemoteProbe = ObjectSchema.create({ label: 'Ping Remote', type: 'api', target: 'https://example.invalid/ping', - locations: ['record_header'], + locations: ['record_page'], }, { name: 'rename_probe', @@ -90,7 +90,7 @@ const RemoteProbe = ObjectSchema.create({ method: 'PATCH', target: '/api/v1/data/probe_remote_thing/${ctx.recordId}', bodyExtra: { name: 'renamed-through-the-door' }, - locations: ['record_header'], + locations: ['record_page'], }, ], } as any); diff --git a/packages/qa/dogfood/test/mcp-oauth-api-action-forward.dogfood.test.ts b/packages/qa/dogfood/test/mcp-oauth-api-action-forward.dogfood.test.ts index 91cc421df87..b4249e0fda1 100644 --- a/packages/qa/dogfood/test/mcp-oauth-api-action-forward.dogfood.test.ts +++ b/packages/qa/dogfood/test/mcp-oauth-api-action-forward.dogfood.test.ts @@ -61,10 +61,10 @@ const Probe = ObjectSchema.create({ sharingModel: 'public_read_write', fields: { name: Field.text({ label: 'Name' }) }, actions: [ - { name: 'probe_update_me', label: 'Update Me', type: 'api', method: 'POST', target: '/api/v1/auth/update-user', bodyExtra: { name: 'Renamed By Agent' }, locations: ['record_header'], ai: ai('Rename the signed-in user through the identity route as the caller.') }, - { name: 'probe_data_patch', label: 'Data Patch', type: 'api', method: 'PATCH', target: '/api/v1/data/probe_fwd_thing/${ctx.recordId}', bodyExtra: { name: 'patched' }, locations: ['record_header'], ai: ai('Patch the probe record through the data door as the caller.') }, - { name: 'probe_ban', label: 'Ban', type: 'api', method: 'POST', target: '/api/v1/auth/admin/ban-user', params: [{ name: 'userId', label: 'User', type: 'text', required: true }], locations: ['record_header'], ai: ai('Ban the probe target user through the better-auth admin endpoint.') }, - { name: 'probe_meta_put', label: 'Meta Put', type: 'api', method: 'PUT', target: '/api/v1/meta/object/probe_fwd_thing', locations: ['record_header'], ai: ai('Rewrite the probe object definition through the metadata door.') }, + { name: 'probe_update_me', label: 'Update Me', type: 'api', method: 'POST', target: '/api/v1/auth/update-user', bodyExtra: { name: 'Renamed By Agent' }, locations: ['record_page'], ai: ai('Rename the signed-in user through the identity route as the caller.') }, + { name: 'probe_data_patch', label: 'Data Patch', type: 'api', method: 'PATCH', target: '/api/v1/data/probe_fwd_thing/${ctx.recordId}', bodyExtra: { name: 'patched' }, locations: ['record_page'], ai: ai('Patch the probe record through the data door as the caller.') }, + { name: 'probe_ban', label: 'Ban', type: 'api', method: 'POST', target: '/api/v1/auth/admin/ban-user', params: [{ name: 'userId', label: 'User', type: 'text', required: true }], locations: ['record_page'], ai: ai('Ban the probe target user through the better-auth admin endpoint.') }, + { name: 'probe_meta_put', label: 'Meta Put', type: 'api', method: 'PUT', target: '/api/v1/meta/object/probe_fwd_thing', locations: ['record_page'], ai: ai('Rewrite the probe object definition through the metadata door.') }, ], } as any); diff --git a/packages/qa/dogfood/test/org-change-slug-bound-action.dogfood.test.ts b/packages/qa/dogfood/test/org-change-slug-bound-action.dogfood.test.ts index 1b2e0e245a3..848216088cc 100644 --- a/packages/qa/dogfood/test/org-change-slug-bound-action.dogfood.test.ts +++ b/packages/qa/dogfood/test/org-change-slug-bound-action.dogfood.test.ts @@ -57,7 +57,7 @@ const cloudShaped = defineStack({ icon: 'edit-3', variant: 'secondary', mode: 'custom', - locations: ['record_header'], + locations: ['record_page'], type: 'api', target: TARGET, method: 'POST', @@ -113,7 +113,7 @@ describe('a cloud-shaped composition binds change_slug to sys_organization, and it('serves change_slug once, with the orchestrator target, its location and its one slug param', () => { const served = actions.filter((a) => a.name === 'change_slug'); expect(served).toHaveLength(1); - expect(served[0]).toMatchObject({ type: 'api', target: TARGET, method: 'POST', locations: ['record_header'] }); + expect(served[0]).toMatchObject({ type: 'api', target: TARGET, method: 'POST', locations: ['record_page'] }); expect(served[0].params).toEqual([{ field: 'slug', required: true, defaultFromRow: true }]); }); diff --git a/packages/qa/downstream-contract/src/log-call.action.ts b/packages/qa/downstream-contract/src/log-call.action.ts index a34a18d2059..0c6aa0fa57e 100644 --- a/packages/qa/downstream-contract/src/log-call.action.ts +++ b/packages/qa/downstream-contract/src/log-call.action.ts @@ -12,6 +12,6 @@ export const LogCallAction: Action = { objectName: 'dc_account', type: 'script', target: 'logCall', - locations: ['record_header'], + locations: ['record_page'], successMessage: 'Call logged.', }; diff --git a/packages/qa/downstream-contract/src/modern.action.ts b/packages/qa/downstream-contract/src/modern.action.ts index 12d5b2114e2..7d91d72b505 100644 --- a/packages/qa/downstream-contract/src/modern.action.ts +++ b/packages/qa/downstream-contract/src/modern.action.ts @@ -9,5 +9,5 @@ export const ArchiveAccountAction = defineAction({ objectName: 'dc_account', type: 'script', target: 'archiveAccount', - locations: ['record_header'], + locations: ['record_page'], }); diff --git a/packages/runtime/src/action-flow-input-params.test.ts b/packages/runtime/src/action-flow-input-params.test.ts index 5ac0ae48b3d..d5725bcd6db 100644 --- a/packages/runtime/src/action-flow-input-params.test.ts +++ b/packages/runtime/src/action-flow-input-params.test.ts @@ -47,7 +47,7 @@ const FLOW_ACTION = { type: 'flow', target: 'schedule_followup', ai: { exposed: true }, - locations: ['record_header'], + locations: ['record_page'], }; /** @@ -145,7 +145,7 @@ describe('summarizeActionParams / summarizeAction fall back to the flow (#15705) }); it('CONTROL — a non-flow action handed a flow is unchanged (the caller resolves none)', () => { - const script = { name: 'close_case', type: 'script', target: 'closeCase', locations: ['record_header'] }; + const script = { name: 'close_case', type: 'script', target: 'closeCase', locations: ['record_page'] }; expect(summarizeActionParams(NO_DEPS, script, undefined)).toEqual([]); expect(summarizeAction(NO_DEPS, script, undefined, 'crm_case')).not.toHaveProperty('params'); }); diff --git a/packages/runtime/src/action-selection-caller-scope.pin.test.ts b/packages/runtime/src/action-selection-caller-scope.pin.test.ts index 182bb0ba372..bf298739226 100644 --- a/packages/runtime/src/action-selection-caller-scope.pin.test.ts +++ b/packages/runtime/src/action-selection-caller-scope.pin.test.ts @@ -75,7 +75,7 @@ const SELECTION_ACTION = { label: 'Close selected', type: 'script', target: ACTION, - locations: ['list_toolbar'], + locations: ['list'], execution: 'aggregate', ai: { exposed: true, description: 'Close every selected ticket in one call.' }, }; diff --git a/packages/runtime/src/http-dispatcher.test.ts b/packages/runtime/src/http-dispatcher.test.ts index 8e227a57ff9..a58253c7ae0 100644 --- a/packages/runtime/src/http-dispatcher.test.ts +++ b/packages/runtime/src/http-dispatcher.test.ts @@ -4465,7 +4465,7 @@ describe('HttpDispatcher — MCP action bridge (list_actions / run_action)', () objectName: 'todo_task', type: 'script', target: 'completeTask', // handler key differs from the declarative name - locations: ['record_header', 'list_item'], + locations: ['record'], ai: { exposed: true, description: 'Mark a todo task as complete.' }, }; const gatedAction = { @@ -4673,7 +4673,7 @@ describe('HttpDispatcher — MCP action bridge (list_actions / run_action)', () objectName: 'todo_task', type: 'flow', target: 'escalation_flow', - locations: ['record_header'], + locations: ['record_page'], ai: { exposed: true, description: 'Escalate a ticket to the on-call team.' }, }; const makeFlowBridge = (execCtx: any, automation: any) => { @@ -4763,7 +4763,7 @@ describe('HttpDispatcher — MCP action bridge (list_actions / run_action)', () objectName: 'todo_task', type: 'script', body: { language: 'js', source: 'ctx.record.archived = true;' }, - locations: ['record_header'], + locations: ['record_page'], params: [{ name: 'reason', type: 'text', required: true }], ai: { exposed: true, description: 'Archive a completed todo task.' }, }; diff --git a/packages/runtime/src/mcp-list-actions-flow-params.test.ts b/packages/runtime/src/mcp-list-actions-flow-params.test.ts index 4882bf4afec..212464a3b14 100644 --- a/packages/runtime/src/mcp-list-actions-flow-params.test.ts +++ b/packages/runtime/src/mcp-list-actions-flow-params.test.ts @@ -29,7 +29,7 @@ const FLOW_ACTION = { objectName: 'crm_lead', type: 'flow', target: 'schedule_followup', - locations: ['record_header'], + locations: ['record_page'], ai: { exposed: true, description: 'Schedule a follow-up task for this lead.' }, }; diff --git a/packages/runtime/src/mcp-resume-run.test.ts b/packages/runtime/src/mcp-resume-run.test.ts index 2ae673a4244..65e3d8c17db 100644 --- a/packages/runtime/src/mcp-resume-run.test.ts +++ b/packages/runtime/src/mcp-resume-run.test.ts @@ -62,7 +62,7 @@ const SCHEDULE = { objectName: OBJECT, type: 'flow', target: 'schedule_followup', - locations: ['record_header'], + locations: ['record_page'], ai: { exposed: true, description: 'Schedule a follow-up task for this lead.' }, }; /** Two screens in a row, so a resume can pause again. */ @@ -72,7 +72,7 @@ const WIZARD = { objectName: OBJECT, type: 'flow', target: 'followup_wizard', - locations: ['record_header'], + locations: ['record_page'], ai: { exposed: true, description: 'Walk through a two-step follow-up wizard.' }, }; /** Gated on a capability the default caller does not hold. */ diff --git a/packages/services/service-datasource/src/datasource-admin-plugin.ts b/packages/services/service-datasource/src/datasource-admin-plugin.ts index 9d5577207f3..e5335b67a0c 100644 --- a/packages/services/service-datasource/src/datasource-admin-plugin.ts +++ b/packages/services/service-datasource/src/datasource-admin-plugin.ts @@ -355,7 +355,7 @@ export class DatasourceAdminServicePlugin implements Plugin { method: 'POST', variant: 'secondary', refreshAfter: false, - locations: ['record_header', 'list_item'], + locations: ['record'], }, // The #8155 migration's operator-initiated door: one datasource, one // click, by a human who is looking at the row. Deliberately NOT a @@ -379,7 +379,7 @@ export class DatasourceAdminServicePlugin implements Plugin { method: 'POST', variant: 'secondary', refreshAfter: true, - locations: ['record_header'], + locations: ['record_page'], }, ] as any); diff --git a/packages/spec/src/compose-stacks.test.ts b/packages/spec/src/compose-stacks.test.ts index f74c2d90564..60c94b46ddf 100644 --- a/packages/spec/src/compose-stacks.test.ts +++ b/packages/spec/src/compose-stacks.test.ts @@ -543,9 +543,9 @@ describe('Action order sorting', () => { name: 'deal', fields: { title: { type: 'text' } }, actions: [ - { name: 'close_deal', label: 'Close', locations: ['record_header'] }, - { name: 'print', label: 'Print', locations: ['record_header'], order: 5 }, - { name: 'approve', label: 'Approve', locations: ['record_header'], order: -10 }, + { name: 'close_deal', label: 'Close', locations: ['record_page'] }, + { name: 'print', label: 'Print', locations: ['record_page'], order: 5 }, + { name: 'approve', label: 'Approve', locations: ['record_page'], order: -10 }, ], }, ], @@ -627,14 +627,14 @@ describe('Action order sorting', () => { { name: 'deal', fields: { title: { type: 'text' } }, - actions: [{ name: 'app_action', label: 'App', locations: ['record_header'] }], + actions: [{ name: 'app_action', label: 'App', locations: ['record_page'] }], }, ], }); // A plugin (e.g. plugin-approvals) contributes a high-priority decision. const approvals = makeStack({ actions: [ - { name: 'approve', label: 'Approve', objectName: 'deal', locations: ['record_header'], order: -100 }, + { name: 'approve', label: 'Approve', objectName: 'deal', locations: ['record_page'], order: -100 }, ], }); const combined = composeStacks([base, approvals]); diff --git a/packages/spec/src/conversions/entries/19/action-locations-acted-on.ts b/packages/spec/src/conversions/entries/19/action-locations-acted-on.ts new file mode 100644 index 00000000000..5d8802a4803 --- /dev/null +++ b/packages/spec/src/conversions/entries/19/action-locations-acted-on.ts @@ -0,0 +1,403 @@ +// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license. + +// The `action-locations-acted-on` conversion (`toMajor: 19`; objectstack#36495, +// maintainer rulings 7213534162 and 7213827153). A LEAF: it imports neither +// `registry.ts` nor another conversion's module. `registry.ts` imports +// `actionLocationsActedOn` and lists it in `MAJOR_19_CONVERSIONS`. + +import type { ConversionApplication, ConversionContext, MetadataConversion } from '../../types.js'; +import { mapCollection, mapPageComponents } from '../../walk.js'; +import { ACTION_CONTAINER_BLOCK_TYPES, ACTION_RUNNER_BLOCK_TYPES, type Dict, isDict } from '../shared.js'; + +/** + * Action locations name what an action acts on (protocol 19). + * + * Until 19 an action's `locations` named page parts: `list_toolbar`, + * `list_item`, `record_header`, `record_more`, `record_related`, + * `record_section`. Once the object's `actionLayout` took over which actions + * are buttons and in what order, a location only has to say what the action + * acts on: `list` (no record) and `record` (one record, on the record page and + * on each list row), with the narrow words `record_page`, `record_row`, + * `record_related` and `record_section` for an action that is on one of those + * surfaces only. + * + * ## The rewrite of one action's `locations` (the ruling, word for word) + * + * - `list_toolbar` → `list`; + * - `record_header` or `record_more` → `record_page`; + * - `list_item` → `record_row`; + * - both sides (a `list_item` beside `record_header` or `record_more`) → + * `record`; + * - `record_related`, `record_section` and every word already canonical stay; + * - a `record_more`-only action (`record_more` without `record_header`) keeps + * its fold into the record page's ⋯ menu through `component: 'action:menu'`. + * + * Order is kept: each word is rewritten where it stands, and a word the + * rewrite makes twice (`record_header` beside `record_more`) is kept once, at + * its first position. + * + * ## Lossless — every action is drawn where it is drawn today + * + * The record page header drew an action placed at `record_header` as a + * button (within its budget) and one placed at `record_more` only in its ⋯ + * menu, as it drew any action with `component: 'action:menu'`. After the + * rewrite both are `record_page`, and the fold is the component. On every + * other surface the component is not read for an object's action (the list + * row menu, a related list, a record section block), so writing it changes + * nothing there. That a `component` the author wrote is replaced for a + * `record_more`-only action is lossless for the same reason: the header put + * such an action in the ⋯ menu whatever its component said. + * + * The one surface that does read an object action's `component` is the list + * page toolbar, which folds `action:menu` into its own overflow. An action + * placed at `record_more` only and at `list_toolbar` has no lossless rewrite: + * the fold would reach the toolbar too. It is left as stored and reported as a + * structured TODO (ADR-0087 D3); the hand rewrite chooses between the fold on + * both surfaces and none. + * + * ## Page components + * + * The same rewrite runs on the `locations` of a page's action rows + * (`action:button` / `action:icon` properties, and each member of an + * `action:group` / `action:menu` / `action:bar`), which tell the runner a + * record-scoped action from an object-level one. A row has no `component`, so + * a `record_more`-only row is `record_page` and nothing more. + * + * A component's single `location` (the location a `record:quick_actions` bar, + * an `action:group` or an `action:bar` draws) is rewritten by surface: + * `list_toolbar` → `list`, `list_item` → `record_row`, `record_header` → + * `record_page`. A bar at `record_page` draws the record page's actions that + * are not folded into its ⋯ menu, which is the set it drew at `record_header`. + * Two are TODOs, left as stored: + * - `record_more`: the ⋯ menu's actions are no location of their own now, so + * a bar that drew only them has no word. + * - an `action:group` at `record_header` with a `record_more`-only member: a + * group member has no `component` to keep its fold, so at `record_page` the + * group would draw that member too. + * + * ## Where it replays + * + * Retired from the load path, as the other protocol-19 entries are: an author + * writing an old word meets the location enum's own prescription at parse. + * Data at rest (`applyConversionsToStoredItem`), built artifacts and + * `os migrate meta --from 18` replay it. Idempotent by construction: every + * word it writes is canonical, and a canonical word is never rewritten. + */ + +const RECORD_PAGE_WORDS = new Set(['record_header', 'record_more']); + +/** A stored action's (or page row's) `locations`, rewritten; `undefined` when nothing changes. */ +function rewriteLocations(locations: readonly unknown[]): unknown[] | undefined { + const onPage = locations.some((l) => typeof l === 'string' && RECORD_PAGE_WORDS.has(l)); + const onRow = locations.includes('list_item'); + let changed = false; + const out: unknown[] = []; + for (const word of locations) { + let next: unknown = word; + if (word === 'list_toolbar') next = 'list'; + else if (typeof word === 'string' && RECORD_PAGE_WORDS.has(word)) next = onRow ? 'record' : 'record_page'; + else if (word === 'list_item') next = onPage ? 'record' : 'record_row'; + if (next !== word) changed = true; + if (typeof next === 'string' && out.includes(next)) { + changed = true; + continue; + } + out.push(next); + } + return changed ? out : undefined; +} + +/** `record_more` declared without `record_header`: the action was drawn only in the record page's ⋯ menu. */ +function isMoreOnly(locations: readonly unknown[]): boolean { + return locations.includes('record_more') && !locations.includes('record_header'); +} + +/** + * One object action (top-level `actions[]` or `objects[].actions[]`). A + * `record_more`-only action keeps its fold through `component`, unless it is + * on the list toolbar too (a TODO, left as stored). + */ +function convertAction( + action: Dict, + path: string, + emit: (detail: ConversionApplication) => void, + context: ConversionContext | undefined, +): Dict { + const locations = action.locations; + if (!Array.isArray(locations)) return action; + const next = rewriteLocations(locations); + if (!next) return action; + const moreOnly = isMoreOnly(locations); + if (moreOnly && locations.includes('list_toolbar')) { + context?.reportTodo?.({ + path: `${path}.locations`, + from: JSON.stringify(locations), + reason: + 'This action is in the record page\'s ⋯ menu only (`record_more` without `record_header`) and on the list ' + + 'page toolbar (`list_toolbar`). Protocol 19 keeps the ⋯ fold with `component: \'action:menu\'`, which ' + + 'the list toolbar reads too: it would fold the action into the toolbar\'s overflow as well. Left as ' + + 'stored; rewrite it by hand to `[\'list\', \'record_page\']`, with `component: \'action:menu\'` to keep ' + + 'the fold on both surfaces or without it to draw a button on both.', + }); + return action; + } + emit({ from: JSON.stringify(locations), to: JSON.stringify(next), path: `${path}.locations` }); + let rewritten: Dict = { ...action, locations: next }; + if (moreOnly && action.component !== 'action:menu') { + emit({ + from: action.component === undefined ? '(omitted)' : JSON.stringify(action.component), + to: 'action:menu', + path: `${path}.component`, + }); + rewritten = { ...rewritten, component: 'action:menu' }; + } + return rewritten; +} + +/** A page action row's `locations` (a row has no `component`). */ +function convertRow(row: Dict, path: string, emit: (detail: ConversionApplication) => void): Dict { + const locations = row.locations; + if (!Array.isArray(locations)) return row; + const next = rewriteLocations(locations); + if (!next) return row; + emit({ from: JSON.stringify(locations), to: JSON.stringify(next), path: `${path}.locations` }); + return { ...row, locations: next }; +} + +const SINGLE_LOCATION: Readonly> = { + list_toolbar: 'list', + list_item: 'record_row', + record_header: 'record_page', +}; + +/** The component types whose own `location` names the surface they draw. */ +const LOCATION_COMPONENT_TYPES = new Set(['record:quick_actions', 'action:group', 'action:bar']); + +/** The member lists of an action container whose rows carry `locations`. */ +function memberListsOf(type: string): readonly string[] { + if (ACTION_CONTAINER_BLOCK_TYPES.has(type)) return ['actions']; + if (type === 'action:bar') return ['actions', 'systemActions']; + return []; +} + +function convertComponent( + component: Dict, + path: string, + emit: (detail: ConversionApplication) => void, + context: ConversionContext | undefined, +): Dict { + const type = component.type; + if (typeof type !== 'string') return component; + const properties = component.properties; + if (!isDict(properties)) return component; + const memberLists = memberListsOf(type); + const runner = ACTION_RUNNER_BLOCK_TYPES.has(type); + const located = LOCATION_COMPONENT_TYPES.has(type); + if (!runner && !located && memberLists.length === 0) return component; + + const location = properties.location; + if (located && typeof location === 'string') { + const todo = (reason: string) => { + context?.reportTodo?.({ path: `${path}.properties.location`, from: JSON.stringify(location), reason }); + return component; + }; + if (location === 'record_more') { + return todo( + `The \`${type}\` block draws the actions in the record page's ⋯ menu (\`location: 'record_more'\`). Protocol 19 ` + + 'keeps that fold with each action\'s `component: \'action:menu\'` and gives the ⋯ menu no location of its ' + + 'own, so no word draws only those actions. Left as stored; choose `record_page` (every record page ' + + 'action that is not folded into the ⋯ menu) or name the actions this block should draw.', + ); + } + if (location === 'record_header' && type === 'action:group') { + const members = properties.actions; + const foldedMember = Array.isArray(members) + && members.some((m) => isDict(m) && Array.isArray(m.locations) && isMoreOnly(m.locations)); + if (foldedMember) { + return todo( + 'This `action:group` draws its members placed at `record_header`, and one of its members is placed at ' + + '`record_more` only. Protocol 19 writes both `record_page`, and a group member has no `component` to keep ' + + 'the ⋯ fold, so at `record_page` the group would draw that member too. Left as stored; remove the ' + + 'member or accept it at `record_page`.', + ); + } + } + } + + let next = properties; + if (runner) next = convertRow(next, `${path}.properties`, emit); + if (located && typeof location === 'string' && Object.prototype.hasOwnProperty.call(SINGLE_LOCATION, location)) { + const to = SINGLE_LOCATION[location]!; + emit({ from: location, to, path: `${path}.properties.location` }); + next = { ...next, location: to }; + } + for (const key of memberLists) { + const members = next[key]; + if (!Array.isArray(members)) continue; + let changed = false; + const nextMembers = members.map((member, i) => { + if (!isDict(member)) return member; + const mapped = convertRow(member, `${path}.properties.${key}[${i}]`, emit); + if (mapped !== member) changed = true; + return mapped; + }); + if (changed) next = { ...next, [key]: nextMembers }; + } + return next === properties ? component : { ...component, properties: next }; +} + +const actionLocationsActedOn: MetadataConversion = { + id: 'action-locations-acted-on', + toMajor: 19, + retiredFromLoadPath: true, + retiredAfter: '18.6.0', + surface: 'action.locations / action.component / object.actions[].locations / object.actions[].component / ' + + 'page.component.action:button.locations / page.component.action:icon.locations / ' + + 'page.component.action:group.actions[].locations / page.component.action:menu.actions[].locations / ' + + 'page.component.action:bar.actions[].locations / page.component.action:bar.systemActions[].locations / ' + + 'page.component.record:quick_actions.location / page.component.action:group.location / ' + + 'page.component.action:bar.location', + summary: + "action locations say what an action acts on: 'list_toolbar' → 'list', 'record_header' / 'record_more' → " + + "'record_page', 'list_item' → 'record_row', a 'list_item' beside either record word → 'record'; a " + + "'record_more'-only action keeps its ⋯ fold with component 'action:menu', so every action is drawn where " + + 'it was drawn before', + apply(stack, emit, context) { + const onAction = (action: Dict, path: string): Dict => convertAction(action, path, emit, context); + let next = mapCollection(stack, 'actions', onAction); + next = mapCollection(next, 'objects', (obj, path) => + mapCollection(obj, 'actions', (action, actionPath) => onAction(action, `${path}.${actionPath}`)), + ); + return mapPageComponents(next, (component, path) => convertComponent(component, path, emit, context)); + }, + fixture: { + before: { + actions: [ + // A toolbar action, a row action, a header action, a ⋯-only action. + { name: 'import_leads', label: 'Import', objectName: 'crm_lead', type: 'script', locations: ['list_toolbar'] }, + { name: 'quick_view', label: 'Quick view', objectName: 'crm_lead', type: 'script', locations: ['list_item'] }, + { name: 'convert_lead', label: 'Convert', objectName: 'crm_lead', type: 'script', locations: ['record_header'] }, + { name: 'clone_lead', label: 'Clone', objectName: 'crm_lead', type: 'script', locations: ['record_more'] }, + // Both sides, the header word twice over: one `record`. + { + name: 'assign_lead', + label: 'Assign', + objectName: 'crm_lead', + type: 'script', + locations: ['list_item', 'record_header', 'record_more'], + }, + // ⋯-only on both sides, beside an exception word: `record` and the fold; + // an authored component is replaced (the header folded it whatever it said). + { + name: 'archive_lead', + label: 'Archive', + objectName: 'crm_lead', + type: 'script', + component: 'action:icon', + locations: ['record_more', 'record_section', 'list_item'], + }, + // Already canonical, headless, and exception-only: untouched. + { name: 'score_lead', label: 'Score', objectName: 'crm_lead', type: 'script', locations: ['record'] }, + { name: 'sync_leads', label: 'Sync', type: 'script', locations: [] }, + { name: 'log_call', label: 'Log call', objectName: 'crm_lead', type: 'script', locations: ['record_related'] }, + // ⋯-only and on the toolbar: no lossless rewrite, left as stored (a TODO). + { + name: 'export_one', + label: 'Export', + objectName: 'crm_lead', + type: 'script', + locations: ['list_toolbar', 'record_more'], + }, + ], + objects: [{ + name: 'crm_account', + label: 'Account', + actions: [{ name: 'merge_account', label: 'Merge', type: 'script', locations: ['record_more', 'record_header'] }], + }], + pages: [{ + name: 'lead_detail', + regions: [{ + name: 'main', + components: [ + { type: 'record:quick_actions', properties: { location: 'record_header', actionNames: ['convert_lead'] } }, + { type: 'record:quick_actions', properties: { location: 'record_section', actionNames: ['assign_lead'] } }, + // The ⋯ menu's own bar has no word now: a TODO, left as stored. + { type: 'record:quick_actions', properties: { location: 'record_more' } }, + { type: 'action:button', properties: { label: 'Run', actionType: 'script', locations: ['list_item', 'record_header'] } }, + { + type: 'action:group', + properties: { + location: 'list_toolbar', + actions: [{ name: 'refresh', label: 'Refresh', type: 'script', locations: ['list_toolbar'] }], + }, + }, + ], + }], + }], + }, + after: { + actions: [ + { name: 'import_leads', label: 'Import', objectName: 'crm_lead', type: 'script', locations: ['list'] }, + { name: 'quick_view', label: 'Quick view', objectName: 'crm_lead', type: 'script', locations: ['record_row'] }, + { name: 'convert_lead', label: 'Convert', objectName: 'crm_lead', type: 'script', locations: ['record_page'] }, + { + name: 'clone_lead', + label: 'Clone', + objectName: 'crm_lead', + type: 'script', + locations: ['record_page'], + component: 'action:menu', + }, + { name: 'assign_lead', label: 'Assign', objectName: 'crm_lead', type: 'script', locations: ['record'] }, + { + name: 'archive_lead', + label: 'Archive', + objectName: 'crm_lead', + type: 'script', + component: 'action:menu', + locations: ['record', 'record_section'], + }, + { name: 'score_lead', label: 'Score', objectName: 'crm_lead', type: 'script', locations: ['record'] }, + { name: 'sync_leads', label: 'Sync', type: 'script', locations: [] }, + { name: 'log_call', label: 'Log call', objectName: 'crm_lead', type: 'script', locations: ['record_related'] }, + { + name: 'export_one', + label: 'Export', + objectName: 'crm_lead', + type: 'script', + locations: ['list_toolbar', 'record_more'], + }, + ], + objects: [{ + name: 'crm_account', + label: 'Account', + actions: [{ name: 'merge_account', label: 'Merge', type: 'script', locations: ['record_page'] }], + }], + pages: [{ + name: 'lead_detail', + regions: [{ + name: 'main', + components: [ + { type: 'record:quick_actions', properties: { location: 'record_page', actionNames: ['convert_lead'] } }, + { type: 'record:quick_actions', properties: { location: 'record_section', actionNames: ['assign_lead'] } }, + { type: 'record:quick_actions', properties: { location: 'record_more' } }, + { type: 'action:button', properties: { label: 'Run', actionType: 'script', locations: ['record'] } }, + { + type: 'action:group', + properties: { + location: 'list', + actions: [{ name: 'refresh', label: 'Refresh', type: 'script', locations: ['list'] }], + }, + }, + ], + }], + }], + }, + // Actions: import, quick view, convert, clone (+ its component), assign, + // archive (+ its component), merge = 9. Page: the header bar's location, + // the button's locations, the group's location and its member = 4. + expectedNotices: 13, + }, +}; + +export { actionLocationsActedOn }; diff --git a/packages/spec/src/conversions/registry.ts b/packages/spec/src/conversions/registry.ts index c402e587509..55485b0a036 100644 --- a/packages/spec/src/conversions/registry.ts +++ b/packages/spec/src/conversions/registry.ts @@ -138,6 +138,7 @@ import { permissionRlsTagsRemoved } from './entries/18/permission-rls-tags-remov import { flowDecisionModeInclusiveExplicit } from './entries/18/flow-decision-mode-inclusive-explicit.js'; // Major 19: imported after every major-18 conversion, in `MAJOR_19_CONVERSIONS`'s // identifier order. +import { actionLocationsActedOn } from './entries/19/action-locations-acted-on.js'; import { agentModelProviderRemoved } from './entries/19/agent-model-provider-removed.js'; import { permissionViewAllFieldsBesideRecordBypass } from './entries/19/permission-view-all-fields-beside-record-bypass.js'; @@ -315,6 +316,7 @@ const MAJOR_18_CONVERSIONS: readonly OrderedConversion[] = [ * `CONVERSIONS_BY_MAJOR[19]`, which is this list in `order`. */ const MAJOR_19_CONVERSIONS: readonly OrderedConversion[] = [ + { conversion: actionLocationsActedOn, order: 3 }, { conversion: agentModelProviderRemoved, order: 2 }, { conversion: permissionViewAllFieldsBesideRecordBypass, order: 1 }, ]; diff --git a/packages/spec/src/data/api-methods-batch-conformance.test.ts b/packages/spec/src/data/api-methods-batch-conformance.test.ts index 41eda68572f..59defe2f604 100644 --- a/packages/spec/src/data/api-methods-batch-conformance.test.ts +++ b/packages/spec/src/data/api-methods-batch-conformance.test.ts @@ -71,7 +71,7 @@ const SINGLE_RECORD_WRITE_ONLY: Record = { // default, `userActions` opens `edit` alone, and `delete` is not in // `apiMethods`). So there is no selection to batch. // · A multi-select revoke, if the product ever wants one, still would not - // reach `/batch`. Both actions are `locations: ['list_item']`; naming one + // reach `/batch`. Both actions are `locations: ['record_row']`; naming one // in a view's `bulkActions` promotes it to `operation: 'custom'` + // `actionDef`, which `useBulkExecutor` fans out through the action runner // as N single-record PATCHes against the route #7769 opened. The data-plane diff --git a/packages/spec/src/data/object-action-layout.ts b/packages/spec/src/data/object-action-layout.ts index 610b16e62c9..db190db10ff 100644 --- a/packages/spec/src/data/object-action-layout.ts +++ b/packages/spec/src/data/object-action-layout.ts @@ -14,10 +14,10 @@ import { strictObject } from '../shared/strict-object'; * one scope: * * - `list`: the actions that act on no record, drawn on the object's list - * page toolbar (placed at `list_toolbar`), with the list page's built-ins + * page toolbar (placed at `list`), with the list page's built-ins * `$import` and `$export`. * - `record`: the actions that act on one record, drawn in the record page's - * header (placed at `record_header` or `record_more`). The same arm orders + * header (placed at `record` or `record_page`). The same arm orders * every surface that draws that header: the record page, the side preview * and a phone's bottom action bar. It also orders the actions a grid row * already offers, adding none: the row's ⋮ menu, its right-click menu and, @@ -200,14 +200,14 @@ export const OBJECT_ACTION_LAYOUT_SCHEMA = strictObject( list: layoutArm('list') .optional() .describe( - "The list scope's arrangement: actions of the object placed at `list_toolbar`, as drawn on the list page " + + "The list scope's arrangement: actions of the object placed at `list`, as drawn on the list page " + 'toolbar, and `$import` / `$export` as pinned buttons (not pinned, they stay in the page\'s own Import / ' + 'Export menu). Omit to draw it as before.', ), record: layoutArm('record') .optional() .describe( - "The record scope's arrangement: actions of the object placed at `record_header` or `record_more`, as " + + "The record scope's arrangement: actions of the object placed at `record` or `record_page`, as " + "drawn in the record header (record page, side preview, a phone's bottom bar). The same order leads the " + "actions a grid row already offers, adding none: the row's ⋮ menu, its right-click menu and, on a list " + "page, the selection bar's actions for one selected record (`pinned` names first, then `more` names, then " + diff --git a/packages/spec/src/data/object.test.ts b/packages/spec/src/data/object.test.ts index 2557f9b3636..59704181f97 100644 --- a/packages/spec/src/data/object.test.ts +++ b/packages/spec/src/data/object.test.ts @@ -1414,7 +1414,7 @@ describe('ObjectSchema.create()', () => { name: 'clone_demo', label: 'Clone', mode: 'custom', - locations: ['list_item'], + locations: ['record_row'], type: 'api', method: 'POST', target: '/api/v1/data/demo', @@ -1442,7 +1442,7 @@ describe('ObjectSchema.create()', () => { name: 'activate_demo', label: 'Activate', mode: 'custom', - locations: ['list_item'], + locations: ['record_row'], type: 'api', method: 'PATCH', target: '/api/v1/data/demo/{id}', @@ -1451,7 +1451,7 @@ describe('ObjectSchema.create()', () => { name: 'clone_demo', label: 'Clone', mode: 'custom', - locations: ['list_item'], + locations: ['record_row'], type: 'api', method: 'POST', target: '/api/v1/data/demo', diff --git a/packages/spec/src/kernel/public-auth-features.ts b/packages/spec/src/kernel/public-auth-features.ts index 5ad782c51cd..7cf16c203cd 100644 --- a/packages/spec/src/kernel/public-auth-features.ts +++ b/packages/spec/src/kernel/public-auth-features.ts @@ -155,7 +155,7 @@ export const PUBLIC_AUTH_FEATURES = { 'sys_team_member.actions.add_team_member', 'sys_team_member.actions.remove_team_member', // Fourth mirror of the email-invite entry, at the organization record - // page's `record_header` — a `page:header` resolves ids against its own + // page's header (`record_page`) — a `page:header` resolves ids against its own // object's actions only (ruling 6228318638, B′ on #24034). 'sys_organization.actions.invite_user', // The name/logo-only rename door, at the record header and the row: diff --git a/packages/spec/src/migrations/entries/semantic/19.action-locations-page-parts-retired.ts b/packages/spec/src/migrations/entries/semantic/19.action-locations-page-parts-retired.ts new file mode 100644 index 00000000000..27de1df649f --- /dev/null +++ b/packages/spec/src/migrations/entries/semantic/19.action-locations-page-parts-retired.ts @@ -0,0 +1,35 @@ +// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license. + +import type { SemanticMigration } from '../../types.js'; + +// #36495 — maintainer rulings 7213534162 and 7213827153 — the D3 entry of the +// action-location vocabulary move. The data half is mechanical (the D2 +// conversion `action-locations-acted-on` rewrites every location losslessly); +// what it cannot do is the two sites it leaves as stored, and code: a plugin or +// a hand-written page that compares a location to an old word. +export const entry: SemanticMigration = { + id: 'action-locations-page-parts-retired', + surface: 'action.locations / page component location — `list_toolbar`, `list_item`, `record_header` and ' + + '`record_more` left the enum; `list`, `record`, `record_page` and `record_row` joined ' + + '`record_related` and `record_section`', + replacement: + 'name what the action acts on: `list` for no record (the list page toolbar), `record` for one record on the ' + + 'record page and on each list row, `record_page` or `record_row` for one of the two only. A ' + + '`record_more`-only action keeps its fold into the record page\'s ⋯ menu with `component: \'action:menu\'`; ' + + 'the order and the buttons of an object\'s actions are its `actionLayout`', + reason: + 'With the object\'s `actionLayout` deciding which actions are buttons and in what order, a location only ' + + 'says what the action acts on. The D2 conversion `action-locations-acted-on` rewrites existing sources and ' + + 'stored rows, and every action is drawn where it was drawn before. It leaves two sites as stored, each with ' + + 'a TODO: an action in the ⋯ menu only that is on the list toolbar too (the fold would reach the toolbar), ' + + 'and a block whose own `location` is `record_more` or an `action:group` at `record_header` with a ⋯-only ' + + 'member (the ⋯ menu has no location of its own now). Code is the other part no conversion reaches: a ' + + 'plugin or a hand-written component that compares a location to an old word no longer matches anything, ' + + 'silently', + acceptanceCriteria: + 'No action, page row or page block names `list_toolbar`, `list_item`, `record_header` or `record_more`; ' + + 'each is refused at parse with the word that replaced it. Every TODO `os migrate meta --from 18` reports is ' + + 'rewritten by hand, and no plugin code compares a location to an old word.', + conversionIds: ['action-locations-acted-on'], + relevantWhen: { kind: 'stack-declares', keys: ['actions', 'objects', 'pages'] }, +}; diff --git a/packages/spec/src/migrations/registry.ts.template b/packages/spec/src/migrations/registry.ts.template index 747150bb016..866caf7f682 100644 --- a/packages/spec/src/migrations/registry.ts.template +++ b/packages/spec/src/migrations/registry.ts.template @@ -3731,7 +3731,11 @@ const step19: MigrationStep = { + 'serves an agent is the deployment\'s choice, so the key is deleted and the model name stays. ' + 'View All and Modify All stop casting a field vote: `viewAllFields: true` is written beside them ' + 'in every permission set entry of a source that predates the switch, so the migrated source keeps ' - + 'the field reads those bits cast; the semantic entry names what it does not keep.', + + 'the field reads those bits cast; the semantic entry names what it does not keep. ' + + 'Action locations say what an action acts on: `list_toolbar` becomes `list`, `record_header` and ' + + '`record_more` become `record_page`, `list_item` becomes `record_row`, and an action on both a row and ' + + 'the record page becomes `record`; an action that sat in the record page\'s ⋯ menu only keeps that fold ' + + 'with `component: \'action:menu\'`, so every action is drawn where it was.', // Derived, not listed, as step 18's are: every major-19 conversion graduates // into this step in the order `CONVERSIONS_BY_MAJOR[19]` applies them. Add a // conversion there, never here. diff --git a/packages/spec/src/stack.zod.ts b/packages/spec/src/stack.zod.ts index 18fd1efd06c..1a6388dc22a 100644 --- a/packages/spec/src/stack.zod.ts +++ b/packages/spec/src/stack.zod.ts @@ -6834,7 +6834,7 @@ function validateCrossReferences( * - The sort is STABLE (`Array.prototype.sort` is stable since ES2019), so * actions that tie on `order` — including the overwhelmingly common case where * NOBODY sets `order` — keep their original registration order. This is what - * lets `order` promote a `record_header` action into the primary-button slot + * lets `order` promote a record page action into the primary-button slot * without disturbing everything else. * - Returns the SAME array reference untouched when no action opts in, so callers * pay zero allocation on the common path and can cheaply detect "unchanged". @@ -6880,7 +6880,7 @@ function sortActionsByOrder(actions: T[]): T[] { * `actions`) is stable-sorted by `order` via {@link sortActionsByOrder}. Because * that sort is a no-op unless an author sets `order`, this is fully backward * compatible — arrays with no `order` keep their exact registration order and - * reference. Renderers that pick a single primary action from `record_header` + * reference. Renderers that pick a single primary action from the record page header * (objectui) therefore see approve/reject-style actions in their declared * priority rather than in fragile cross-file registration order. * diff --git a/packages/spec/src/studio/plugin.zod.ts b/packages/spec/src/studio/plugin.zod.ts index 80fe4b0affc..510fb611c49 100644 --- a/packages/spec/src/studio/plugin.zod.ts +++ b/packages/spec/src/studio/plugin.zod.ts @@ -147,8 +147,9 @@ export type SidebarGroupContributionParsed = z.infer i.path.join('.')); diff --git a/packages/spec/src/ui/action-declarative-update.ts b/packages/spec/src/ui/action-declarative-update.ts index 5c613c715ea..11caa8aaca4 100644 --- a/packages/spec/src/ui/action-declarative-update.ts +++ b/packages/spec/src/ui/action-declarative-update.ts @@ -39,7 +39,7 @@ import { onSuccessBesideUpdateOperationRefusal } from './action-on-success-execu * is no `patch` and no non-empty `params`, refused at `patch`. On a page * action row it is no `name`, refused at `name`: the row runs the declared * action its `name` names, and the route writes THAT action's `patch`. - * 5. A `list_toolbar` location is refused: no current record there. + * 5. A `list` location is refused: no current record there. * * Deliberately NOT judged here: `objectName`. `ActionSchema` parses an action * embedded on an object (object implicit) and a standalone one in @@ -248,13 +248,13 @@ export function refuseDeclarativeUpdateContradictions(surface: DeclarativeUpdate if (Array.isArray(data.locations)) { data.locations.forEach((location, index) => { - if (location !== 'list_toolbar') return; + if (location !== 'list') return; ctx.addIssue({ code: 'custom', path: ['locations', index], message: - "`list_toolbar` has no current record — an `operation: 'update'` action writes ONE record, the one it " - + 'runs on. Use a record location (`list_item`, `record_header`, `record_more`, `record_section`) or, ' + "`list` has no current record — an `operation: 'update'` action writes ONE record, the one it " + + 'runs on. Use a record location (`record`, `record_page`, `record_row`, `record_section`) or, ' + "for the selection bar, a `bulkActionDefs` entry on the list view (`{ operation: 'update', patch }`).", }); }); diff --git a/packages/spec/src/ui/action-pressed.test.ts b/packages/spec/src/ui/action-pressed.test.ts index 5084b4f30bb..fbfb71019bc 100644 --- a/packages/spec/src/ui/action-pressed.test.ts +++ b/packages/spec/src/ui/action-pressed.test.ts @@ -24,7 +24,7 @@ const base = { objectName: 'kb_article', type: 'script', target: 'markHelpful', - locations: ['record_header'], + locations: ['record_page'], } as const; const PRESSED = "has(record.viewer) && record.viewer.vote == 'helpful'"; diff --git a/packages/spec/src/ui/action-row-update.test.ts b/packages/spec/src/ui/action-row-update.test.ts index af94e480cc7..cf5121bf58b 100644 --- a/packages/spec/src/ui/action-row-update.test.ts +++ b/packages/spec/src/ui/action-row-update.test.ts @@ -273,12 +273,12 @@ describe('mixing rule: one refusal per contradiction, at the contradicting key', }); it('refuses a `list_toolbar` location — no current record there; the selection bar is the bulk def\'s home', () => { - const result = ActionSchema.safeParse({ ...duly, locations: ['record_header', 'list_toolbar'] }); + const result = ActionSchema.safeParse({ ...duly, locations: ['record_page', 'list'] }); const issue = issueAt(result, 'locations.1'); expect(issue?.code).toBe('custom'); expect(issue?.message).toMatch(/^`list_toolbar` has no current record — an `operation: 'update'` action writes ONE record, the one it runs on\./); expect(issueAt(result, 'locations.0')).toBeUndefined(); - expect(ActionSchema.safeParse({ ...duly, locations: ['list_item', 'record_header', 'record_more', 'record_section'] }).success).toBe(true); + expect(ActionSchema.safeParse({ ...duly, locations: ['record', 'record_section'] }).success).toBe(true); }); it('refuses the bulk-only operations with the reason, not a bare enum list', () => { diff --git a/packages/spec/src/ui/action-undoable-fulfillment.test.ts b/packages/spec/src/ui/action-undoable-fulfillment.test.ts index b80ff740aec..8b0fbeec7d6 100644 --- a/packages/spec/src/ui/action-undoable-fulfillment.test.ts +++ b/packages/spec/src/ui/action-undoable-fulfillment.test.ts @@ -76,7 +76,7 @@ describe('ActionSchema — `undoable: true` is refused where no runtime fulfils ...base, type: 'api', target: 'lead', - locations: ['record_header', 'list_item'], + locations: ['record'], params: [{ field: 'assigned_to', required: true }], undoable: true, successMessage: 'Lead reassigned.', diff --git a/packages/spec/src/ui/action.test.ts b/packages/spec/src/ui/action.test.ts index 52550d68737..f825a5e6c1f 100644 --- a/packages/spec/src/ui/action.test.ts +++ b/packages/spec/src/ui/action.test.ts @@ -529,7 +529,7 @@ describe('ActionSchema', () => { name: 'toolbar_action', label: 'Toolbar Action', target: 'noop', - locations: ['list_toolbar'], + locations: ['list'], }; expect(() => ActionSchema.parse(action)).not.toThrow(); @@ -729,7 +729,7 @@ describe('ActionSchema', () => { label: 'Approve', icon: 'check-circle', type: 'script', - locations: ['record_header', 'record_more'], + locations: ['record_page'], target: 'approveOpportunity', confirmText: 'Are you sure you want to approve this opportunity?', successMessage: 'Opportunity approved successfully!', @@ -747,7 +747,7 @@ describe('ActionSchema', () => { icon: 'arrow-right', type: 'modal', target: 'transfer_case_modal', - locations: ['record_more'], + locations: ['record_page'], component: 'action:menu', params: [ { name: 'new_owner', @@ -783,7 +783,7 @@ describe('ActionSchema', () => { icon: 'mail', type: 'flow', target: 'send_quote_flow', - locations: ['record_header', 'list_item'], + locations: ['record'], params: [ { name: 'recipient', @@ -815,7 +815,7 @@ describe('ActionSchema', () => { icon: 'file-spreadsheet', type: 'api', target: '/api/export/excel', - locations: ['list_toolbar'], + locations: ['list'], successMessage: 'Export started. You will receive an email when ready.', }; @@ -828,7 +828,7 @@ describe('ActionSchema', () => { label: 'Delete', icon: 'trash', type: 'script', - locations: ['record_more'], + locations: ['record_page'], component: 'action:menu', target: 'deleteRecord', confirmText: 'Are you sure you want to delete this record? This action cannot be undone.', successMessage: 'Record deleted successfully!', @@ -845,7 +845,7 @@ describe('ActionSchema', () => { label: 'Clone', icon: 'copy', type: 'script', - locations: ['record_more', 'list_item'], + locations: ['record'], component: 'action:menu', target: 'cloneRecord', params: [ { @@ -1116,7 +1116,7 @@ describe('ActionSchema - ai block (ADR-0011)', () => { label: 'Hint', target: 'noop', objectName: 'task', - locations: ['record_header'], + locations: ['record_page'], ai: { exposed: true, description: longDescription, paramHints: { recordId: { description: 'The task id.' } } }, }), ).not.toThrow(); @@ -1249,7 +1249,7 @@ describe('ActionSchema - order', () => { name: 'approve', label: 'Approve', target: 'approve_handler', - locations: ['record_header', 'record_more'], + locations: ['record_page'], variant: 'primary', order: -10, }); diff --git a/packages/spec/src/ui/action.zod.ts b/packages/spec/src/ui/action.zod.ts index 25cc2698a9a..a0d05750afa 100644 --- a/packages/spec/src/ui/action.zod.ts +++ b/packages/spec/src/ui/action.zod.ts @@ -521,7 +521,7 @@ export const ActionParamSchema = lazySchema(() => strictObject( reference: SnakeCaseIdentifierSchema.optional().describe('Reference target object for inline lookup/master_detail params; mirrors FieldSchema.reference.').meta({ title: 'Reference Object' }), /** * When true, the param's default value is pulled from the current row record - * (key = the resolved field name) when the action runs from a list_item + * (key = the resolved field name) when the action runs from a list row (`record_row` / `record`) * context. Useful for edit dialogs that pre-fill from the selected row. */ defaultFromRow: z.boolean().optional().meta({ title: 'Default From Row' }), @@ -797,7 +797,7 @@ function refuseAskAiContradictions( * Note: The action name is the configuration ID. JavaScript function names can use camelCase, * but the metadata ID must be lowercase snake_case. */ -// Retired-VALUE prescription. Declared with `//` (never `/** */`) and ABOVE the +// Retired-VALUE prescriptions. Declared with `//` (never `/** */`) and ABOVE the // enum's JSDoc deliberately: `build-docs.ts` takes a doc comment adjacent to the // declaration as the reference entry's blurb, so a `/** */` here would displace // the location table below. (House style set by the `crypto.hash` / @@ -811,68 +811,108 @@ const GLOBAL_NAV_RETIRED = + 'never reached a user. The only thing that DID draw it was the Studio designer, which ' + 'previewed a command-palette frame for a surface the product does not have — an authoring ' + 'tool teaching authors to write dead metadata (ADR-0078). Place the action on a location a ' - + 'renderer serves (`list_toolbar`, `list_item`, `record_header`, `record_more`, ' - + '`record_related`, `record_section`), or — for an action that deliberately has no UI home, ' + + 'renderer serves (`list`, `record`, `record_page`, `record_row`, `record_related`, ' + + '`record_section`), or — for an action that deliberately has no UI home, ' + 'such as an object-less one invoked over REST/MCP/AI — declare it headless with ' + '`locations: []`, which keeps its capability gate, param contract and audit trail. ' + 'This edit left `os migrate meta` with the protocol-16.x conversions: apply it by hand, or run the tool on a release that still carries the conversion — https://objectstack.ai/docs/protocol-upgrade.'; +// The four page-part words protocol 19 replaced (objectstack#36495): a location +// now says what the action acts on. Each keeps a prescription keyed on the +// received value, so only a spelling that used to be legal is told it moved. +const PAGE_PART_LOCATIONS_RETIRED_TAIL = + ' Protocol 19 names what an action acts on, not the part of the page it sits in: `list` (acts on ' + + 'no record), `record` (acts on one record: the record page and each list row), and the narrow ' + + 'words `record_page`, `record_row`, `record_related` and `record_section`. Which actions are ' + + 'buttons and in what order is the object\'s `actionLayout`. `os migrate meta --from 18` rewrites ' + + 'every location for you, keeping every action where it is drawn today.'; +const PAGE_PART_LOCATIONS_RETIRED: Readonly> = { + list_toolbar: '`list_toolbar` became `list` in @objectstack/spec 19: write `list`.' + + PAGE_PART_LOCATIONS_RETIRED_TAIL, + list_item: '`list_item` became `record_row` in @objectstack/spec 19 — or `record`, when the action is also ' + + 'on the record page (`record_header` / `record_more` beside it).' + PAGE_PART_LOCATIONS_RETIRED_TAIL, + record_header: '`record_header` became `record_page` in @objectstack/spec 19 — or `record`, when the action ' + + 'is also on each list row (`list_item` beside it).' + PAGE_PART_LOCATIONS_RETIRED_TAIL, + record_more: '`record_more` became `record_page` in @objectstack/spec 19 — or `record`, when the action is ' + + 'also on each list row (`list_item` beside it). An action that was only in the record page\'s ⋯ menu ' + + '(`record_more` without `record_header`) keeps that fold with `component: \'action:menu\'`.' + + PAGE_PART_LOCATIONS_RETIRED_TAIL, +}; + /** - * Action Location — where an action is allowed to surface in the UI. + * Action Location — what an action acts on, and so where it can surface. * * Canonical list (single source of truth for the whole platform). Renderers, * the ActionEngine, the Studio designer dropdowns, and `objectui` consumers * MUST import from this constant rather than re-declaring their own enum — * adding a new location should require touching this one file only. * - * Semantics: - * - `list_toolbar` — header/toolbar of a list view (bulk actions, "New", export). - * - `list_item` — per-row action on a list/grid row (Salesforce row-level menu). - * - `record_header` — primary actions in the record-detail title bar. - * - `record_more` — overflow menu under the "More" / ⋯ button on a record. + * Semantics (protocol 19, objectstack#36495; maintainer rulings 7213534162 + * and 7213827153): + * - `list` — acts on no record: drawn on the object's list page + * toolbar ("New", import, export, an object-level run). + * - `record` — acts on one record: drawn on the record page (its + * header, the side preview, a phone's bottom bar) AND + * on each list row (the row's ⋮ menu). The word an + * action that acts on a record writes by default. + * - `record_page` — acts on one record, on the record page only (not on + * list rows). + * - `record_row` — acts on one record, on each list row only (every row + * wherever the object is listed; not on the record page). * - `record_related` — per-row action on each row of a related list shown inside * a parent record, in that parent's context only. Unlike - * `list_item` (every row wherever the object is listed), it + * `record_row` (every row wherever the object is listed), it * never surfaces on the object's own list views. * - `record_section` — actions surfaced inside a body section/tab of a record * (e.g. a Security tab grouping change-password, 2FA, etc.). * Drawn only by an authored record page block that renders * it; the standard record page (a phone, the side preview, * and an object with no authored page) does not draw it, so - * an action that must reach every surface adds `record_more`. + * an action that must reach every surface adds `record_page`. + * + * Which of an object's record-page actions are buttons and which sit in the + * page's ⋯ menu, and in what order, is the object's `actionLayout`; without + * it, an action with `component: 'action:menu'` is drawn in the ⋯ menu only. + * + * Until protocol 19 the words named page parts: `list_toolbar` (now `list`), + * `list_item` (now `record_row`), `record_header` and `record_more` (now + * `record_page`, the `record_more`-only fold kept by `component: + * 'action:menu'`), and an action on both a row and the record page now writes + * `record`. The conversion `action-locations-acted-on` rewrites stored and + * source metadata losslessly; the enum's error map tells an author who writes + * an old word which word replaced it. * * `global_nav` was REMOVED in 17 (#6888, maintainer ruling 2026-08-09). It had * been declared here since the vocabulary was written and no product surface * ever served it: the console's ⌘K palette composes its groups from nav items, * objects, dashboards, pages, reports, recent items and record search, and - * references no action metadata. Four of the five references to the value in - * the whole UI repo were the Studio designer — which drew the author a mock - * "⌘K · Command palette" frame, promising a rendering the product cannot do - * (the ADR-0078 declares-renders-does-nothing shape, arriving through the - * location vocabulary rather than through a missing key). Retired rather than - * implemented: no user has asked for command-palette actions and the only two - * declarers were our own showcase corpus, so wiring the palette would have been - * capability expansion with no pull. This is an enum VALUE, not a key, so there - * is no `retiredKey()` tombstone — the prescription lives on the enum's own - * error map above, keyed on `issue.input` so that only the spelling which used - * to be legal is told it "was removed". An object-less action's honest - * declaration is `locations: []` (headless), not a location nothing renders. + * references no action metadata. Retired rather than implemented. This is an + * enum VALUE, not a key, so there is no `retiredKey()` tombstone — the + * prescription lives on the enum's own error map above, keyed on + * `issue.input` so that only the spelling which used to be legal is told it + * "was removed". An object-less action's honest declaration is + * `locations: []` (headless), not a location nothing renders. */ export const ACTION_LOCATIONS = [ - 'list_toolbar', - 'list_item', - 'record_header', - 'record_more', + 'list', + 'record', + 'record_page', + 'record_row', 'record_related', 'record_section', ] as const; export const ActionLocationSchema = z.enum(ACTION_LOCATIONS, { - // Only the spelling that USED to be legal gets the retirement message. + // Only a spelling that USED to be legal gets a retirement message. // Telling the author of `globalnav` that their value "was removed" would // misinform, so everything else keeps zod's own enum error, which already // lists the legal locations. (`array_agg` / `crypto.hash` precedent.) - error: (issue) => (issue.input === 'global_nav' ? GLOBAL_NAV_RETIRED : undefined), + error: (issue) => { + if (issue.input === 'global_nav') return GLOBAL_NAV_RETIRED; + return typeof issue.input === 'string' && Object.prototype.hasOwnProperty.call(PAGE_PART_LOCATIONS_RETIRED, issue.input) + ? PAGE_PART_LOCATIONS_RETIRED[issue.input] + : undefined; + }, }); export type ActionLocation = z.input; @@ -1422,7 +1462,7 @@ const actionObject = () => strictObject({ icon: z.string().optional().describe('Icon name'), /** Where does this action appear? */ - locations: z.array(ActionLocationSchema).optional().describe('Locations where this action is visible. `record_section` is drawn only by an authored record page block that renders it; the standard record page (on a phone, in the side preview, and for an object with no authored page) does not draw it, so an action that must reach every surface adds `record_more` as well.'), + locations: z.array(ActionLocationSchema).optional().describe('Locations where this action is visible. `record_section` is drawn only by an authored record page block that renders it; the standard record page (on a phone, in the side preview, and for an object with no authored page) does not draw it, so an action that must reach every surface adds `record_page` as well. `list` acts on no record (the list page toolbar); `record` acts on one record, on the record page and on each list row; `record_page` and `record_row` are one of those two only.'), /** * Visual Component Type @@ -1678,7 +1718,7 @@ const actionObject = () => strictObject({ * `bodyExtra`, `bodyShape`, `recordIdParam`/`recordIdField`, `onSuccess`, * `opensInNewTab`/`newTabUrl` and any other explicit `type` are each refused * with their own message ({@link refuseDeclarativeUpdateContradictions}). - * A `list_toolbar` location is refused too: there is no current record + * A `list` location is refused too: there is no current record * there — the selection bar is the bulk def's home. * * EXECUTOR CONTRACT (the halves that perform the write are downstream cards @@ -1858,7 +1898,7 @@ const actionObject = () => strictObject({ * instead of relying on cross-file `defineStack({ actions })` registration * order — which is fragile and couples unrelated features. * - * In `record_header` the first visible action becomes the primary button, so + * On the record page the first visible action becomes the primary button, so * a low (or negative) `order` promotes an action into the primary slot and a * high `order` demotes it toward the `⋯` overflow menu. This is the * declarative lever a plugin (e.g. plugin-approvals) or app author uses to @@ -1871,7 +1911,7 @@ const actionObject = () => strictObject({ * backward compatible. Renderers MAY additionally prefer a `variant:'primary'` * action when two actions tie on `order` (see objectui record-header renderer). */ - order: z.number().optional().describe('Sort order within a location group (lower = higher). Promotes/demotes an action toward the record_header primary button; stable, so actions without `order` keep their registration order.'), + order: z.number().optional().describe('Sort order within a location group (lower = higher). Promotes/demotes an action toward the record page header's primary button; stable, so actions without `order` keep their registration order.'), /** UX Behavior */ // NB this describe() renders into the InlineAction reference table too (both @@ -2284,11 +2324,11 @@ const actionObject = () => strictObject({ ai: ActionAiSchema.optional().describe('AI exposure (opt-in). Set ai.exposed=true + ai.description to make this callable by agents.'), /** - * Row-context: when the action runs from a list_item location, this body key + * Row-context: when the action runs from a list row (`record_row` / `record`), this body key * receives the row's id (or the field named by `recordIdField`). Defaults to * `id` when omitted but `recordIdField` is set; otherwise no injection. */ - recordIdParam: z.string().optional().describe('Body key to inject the row id into when running from a list_item context.'), + recordIdParam: z.string().optional().describe('Body key to inject the row id into when running from a list row (`record_row` / `record`).'), /** * Row field whose value seeds `recordIdParam`. Defaults to `'id'` when * `recordIdParam` is set. Use this when the body key expects a non-id value @@ -2593,7 +2633,7 @@ const actionObject = () => strictObject({ * `patch` only beside `operation: 'update'`; beside it, `type` stays at its * default `'script'` (the platform action route), every key that binds or * shapes a dispatch the update does not make is refused at its own path, there - * is a `patch` or a non-empty `params` to write, and no `list_toolbar` + * is a `patch` or a non-empty `params` to write, and no `list` * location. `objectName` is judged by `defineStack`'s walk instead * (`stack.zod.ts`, `collectGlobalUpdateActionErrors`). */ diff --git a/packages/spec/src/ui/component-action-row-declarative-update.test.ts b/packages/spec/src/ui/component-action-row-declarative-update.test.ts index d84a81bd53f..9358eeb1b98 100644 --- a/packages/spec/src/ui/component-action-row-declarative-update.test.ts +++ b/packages/spec/src/ui/component-action-row-declarative-update.test.ts @@ -145,9 +145,9 @@ const MEMBERS: readonly Member[] = [ }, { title: "5. `operation: 'update'` + a `list_toolbar` location", - keys: () => ({ ...UPDATE, locations: ['record_header', 'list_toolbar'] }), + keys: () => ({ ...UPDATE, locations: ['record_page', 'list'] }), at: () => ['locations', 1], - control: () => ({ ...UPDATE, locations: ['record_header'] }), + control: () => ({ ...UPDATE, locations: ['record_page'] }), }, ]; diff --git a/packages/spec/src/ui/component-report-items-action-members-typed.pin.test.ts b/packages/spec/src/ui/component-report-items-action-members-typed.pin.test.ts index 34af888c4a7..669b7b440a5 100644 --- a/packages/spec/src/ui/component-report-items-action-members-typed.pin.test.ts +++ b/packages/spec/src/ui/component-report-items-action-members-typed.pin.test.ts @@ -178,8 +178,8 @@ describe('§1 each member accepts every shape a measured writer authors', () => // objectui `components/src/__tests__/action-group.test.tsx:33`, `action-bodyShape-forward.test.tsx:120`. ['members placed by location', 'action:group', { actions: [ - { name: 'here', label: 'Here', type: 'script', locations: ['list_toolbar'] }, - { name: 'elsewhere', label: 'Elsewhere', type: 'script', locations: ['record_header'] }, + { name: 'here', label: 'Here', type: 'script', locations: ['list'] }, + { name: 'elsewhere', label: 'Elsewhere', type: 'script', locations: ['record_page'] }, ], }], ['an api member with a body shape', 'action:group', { @@ -220,7 +220,7 @@ describe('§1 each member accepts every shape a measured writer authors', () => confirmText: { dialect: 'template', source: 'Close it?' }, successMessage: { dialect: 'template', source: 'Closed' }, errorMessage: { dialect: 'template', source: 'Could not close' }, - refreshAfter: true, locations: ['record_header'], objectName: 'case', + refreshAfter: true, locations: ['record_page'], objectName: 'case', }], }], // #30017: an array `params` beside `confirmText` is refused (two dialogs for diff --git a/packages/spec/src/ui/component.zod.ts b/packages/spec/src/ui/component.zod.ts index c95e9ed541b..5ececaf9328 100644 --- a/packages/spec/src/ui/component.zod.ts +++ b/packages/spec/src/ui/component.zod.ts @@ -606,8 +606,8 @@ export type PageContainerProps = z.input; * `placedActions: true` beside an authored `actions` list: two answers to the * one question of which of the bound object's actions a `page:header` draws. * The list is the whole set (#11592's meaning, kept by ruling record - * 6624172200, letter A); the switch is every action placed at `record_header` / - * `record_more`, read live. Neither can be read as narrowing the other without + * 6624172200, letter A); the switch is every action placed on the record page + * (`record` / `record_page`), read live. Neither can be read as narrowing the other without * inventing a rule nobody authored, so the pair is refused at authoring and the * author keeps one. `placedActions: false` beside a list says nothing new and * is not the pair. @@ -624,7 +624,7 @@ export type PageContainerProps = z.input; const PAGE_HEADER_PLACED_ACTIONS_BESIDE_LIST = { message: 'A `page:header` that sets `placedActions: true` draws every action of the bound object placed at ' - + '`record_header` or `record_more`, read live, so an `actions` list beside it is a second, different ' + + '`record` or `record_page`, read live, so an `actions` list beside it is a second, different ' + 'answer to which actions the header draws. Keep one: `actions` for a curated list that is the whole ' + 'set the header draws, or `placedActions: true` for every placed action, and delete the other key.', path: ['placedActions'], @@ -713,17 +713,17 @@ export const PageHeaderProps = strictObject({ * declare a header placement. objectui's `PageHeaderRenderer` * (`resolvedHeaderActions` then `headerActionPlan`; read points recorded in * `liveness/page.json`, row `regions`) resolves each id against the actions declared on the bound object, keeps - * those whose `locations` include `record_header` or `record_more`, and draws + * those whose `locations` include `record` or `record_page`, and draws * no other action of the object: * - * - an action that declares `record_header` and is NOT named here is not + * - an action that declares `record_page` and is NOT named here is not * drawn in this header. Declaring the placement does not add it, so the * list is the author's curation of the header, and a new header action is * added to the list as well as to the object; * - with the key omitted, an authored `page:header` draws none of the * object's own actions (the list resolves to empty), unless it sets * `placedActions: true` below: the other, explicit way to say which - * actions, namely every `record_header` / `record_more` action of the + * actions, namely every `record` / `record_page` action of the * object, read live. That is the set the platform's synthesized default * record page, used when no page is assigned, builds its header from; * - a named id whose action declares neither location renders nowhere; @@ -737,11 +737,11 @@ export const PageHeaderProps = strictObject({ * here and added the switch beside it. */ actions: z.array(z.string()).optional().describe( - 'Action IDs the header draws, resolved against the actions declared on the page\'s object. An authored list is the whole set: an action that declares `record_header` (or `record_more`) in its `locations` but is not named here is not drawn, and a header with neither this key nor `placedActions: true` draws none of the object\'s actions. `placedActions: true` is the other way to say which actions the header draws (every one placed at `record_header` / `record_more`, read live), and the two are refused together. A named action that declares neither location renders nowhere. The host\'s own Edit / Share / Delete chrome is separate from this list.', + 'Action IDs the header draws, resolved against the actions declared on the page\'s object. An authored list is the whole set: an action that declares `record` or `record_page` in its `locations` but is not named here is not drawn, and a header with neither this key nor `placedActions: true` draws none of the object\'s actions. `placedActions: true` is the other way to say which actions the header draws (every one placed at `record` / `record_page`, read live), and the two are refused together. A named action that declares neither location renders nowhere. The host\'s own Edit / Share / Delete chrome is separate from this list.', ), /** * The explicit opt-in to draw EVERY action of the bound object whose - * `locations` include `record_header` or `record_more`, read live from the + * `locations` include `record` or `record_page`, read live from the * object's metadata, in place of an authored `actions` id list (ruling * record 6624172200, letter A). An action another package places on the * object is drawn without editing this page, which is what a platform record @@ -772,7 +772,7 @@ export const PageHeaderProps = strictObject({ * container). */ placedActions: z.boolean().optional().describe( - 'Draw every action of the page\'s object whose `locations` include `record_header` or `record_more`, read live from the object\'s metadata, in place of an authored `actions` list: an action added to the object later, by any package, is drawn without editing the page. Omit it, or set false, to keep the `actions` list as the whole set. Refused as `true` beside an authored `actions` list: keep one.', + 'Draw every action of the page\'s object whose `locations` include `record` or `record_page`, read live from the object\'s metadata, in place of an authored `actions` list: an action added to the object later, by any package, is drawn without editing the page. Omit it, or set false, to keep the `actions` list as the whole set. Refused as `true` beside an authored `actions` list: keep one.', ), /** * Which of the two page-header layouts the renderer builds (#6776). @@ -2498,7 +2498,7 @@ export const RecordQuickActionsProps = strictObject({ }, { actionNames: z.array(z.string()).optional().describe('Names of actions declared on this object (`actions[]`), in display order. The engine still location-filters named actions. Measured: when omitted (and the host supplies nothing) the bar resolves NO actions and renders its empty placeholder — it does not fall back to "every action at this location", whatever the registration\'s input list claims.'), requiredPermissions: z.array(z.string()).optional().describe(RECORD_BLOCK_REQUIRED_PERMISSIONS_DESCRIPTION), - location: ActionLocationSchema.optional().describe('Which declared action location this bar renders (renderer default: `record_header`).'), + location: ActionLocationSchema.optional().describe('Which declared action location this bar renders (renderer default: `record_page`). At `record_page` it draws the record page\'s actions that are not folded into its ⋯ menu (`component: \'action:menu\'`); an action placed at `record` is drawn at `record_page` and at `record_row`.'), align: z.enum(['start', 'center', 'end']).optional().describe('Horizontal alignment of the button row (renderer default: `end`).'), inline: z.boolean().optional().describe('Render in the flow instead of pulling up into the record-header band. The page header sets this itself when it hosts the bar in its own action slot.'), variant: z.enum(['default', 'destructive', 'outline', 'secondary', 'ghost', 'link']).optional().describe('Button variant for every action — the Button primitive\'s own vocabulary; a per-action `variant` on the resolved def wins (renderer default: `default`).'), @@ -3994,7 +3994,7 @@ function refuseRowOnSuccessBesideExecutor(executorKey: 'actionType' | 'type', ow * {@link actionContainerMemberParamsFitType}. Whether the named action * exists, is an `operation: 'update'` action and declares those params is a * cross-reference this row cannot see; - * - beside it, a `list_toolbar` location — refused at `locations.N`. + * - beside it, a `list` location — refused at `locations.N`. * * Applied first on each row, as the runner reads `operation` first: the row's * url-target, executor-alias and `onSuccess`-executor judgments stand down @@ -4122,7 +4122,7 @@ export const ActionButtonPropsSchema = lazySchema(() => strictObject({ method: z.string().optional().describe('HTTP method for an `api` action, forwarded to the runner'), bodyExtra: z.unknown().optional().describe('Static request-body fields for an `api` action, forwarded to the runner'), bodyShape: z.unknown().optional().describe('How an `api` action shapes its request body, forwarded to the runner'), - operation: actionOperation().optional().describe('Declarative single-record write: `ActionSchema`\'s own `operation`, whose one member is `update`. The row runs the declared action its `name` names. The runner reads `operation` before any executor and posts the row\'s values to the platform action route under that `name`; the route resolves that action by name and writes ITS `patch`, so the row has no `patch` of its own and needs a `name`. What the row\'s `params` supply rides the request as params, written only where that action declares them and otherwise refused by the route. Judged as `ActionSchema` judges it: beside it the executor key is absent or `script`, `target`, `method`, `bodyExtra`, `bodyShape`, `recordIdField` and `onSuccess` are refused, and `list_toolbar` is not a location'), + operation: actionOperation().optional().describe('Declarative single-record write: `ActionSchema`\'s own `operation`, whose one member is `update`. The row runs the declared action its `name` names. The runner reads `operation` before any executor and posts the row\'s values to the platform action route under that `name`; the route resolves that action by name and writes ITS `patch`, so the row has no `patch` of its own and needs a `name`. What the row\'s `params` supply rides the request as params, written only where that action declares them and otherwise refused by the route. Judged as `ActionSchema` judges it: beside it the executor key is absent or `script`, `target`, `method`, `bodyExtra`, `bodyShape`, `recordIdField` and `onSuccess` are refused, and `list` is not a location'), patch: rowPatchRetired("An `action:button`'s"), confirmText: actionRowCopy('confirmText').optional() .describe(`${ACTION_ROW_COPY_DESCRIBE.confirmText} Beside a non-empty array \`params\` it is refused — the runner would show the confirm and then the param dialog, two dialogs for one decision; put the question on \`description\` instead. Correct with no \`params\`, beside \`params: []\`, and beside an object \`params\` (static values, no param dialog)`), @@ -4231,7 +4231,7 @@ export const ActionIconPropsSchema = lazySchema(() => strictObject({ method: z.string().optional().describe('HTTP method for an `api` action, forwarded to the runner'), bodyExtra: z.unknown().optional().describe('Static request-body fields for an `api` action, forwarded to the runner'), bodyShape: z.unknown().optional().describe('How an `api` action shapes its request body, forwarded to the runner'), - operation: actionOperation().optional().describe('Declarative single-record write: `ActionSchema`\'s own `operation`, whose one member is `update`. The row runs the declared action its `name` names. The runner reads `operation` before any executor and posts the row\'s values to the platform action route under that `name`; the route resolves that action by name and writes ITS `patch`, so the row has no `patch` of its own and needs a `name`. What the row\'s `params` supply rides the request as params, written only where that action declares them and otherwise refused by the route. Judged as `ActionSchema` judges it: beside it the executor key is absent or `script`, `target`, `method`, `bodyExtra`, `bodyShape` and `onSuccess` are refused, and `list_toolbar` is not a location'), + operation: actionOperation().optional().describe('Declarative single-record write: `ActionSchema`\'s own `operation`, whose one member is `update`. The row runs the declared action its `name` names. The runner reads `operation` before any executor and posts the row\'s values to the platform action route under that `name`; the route resolves that action by name and writes ITS `patch`, so the row has no `patch` of its own and needs a `name`. What the row\'s `params` supply rides the request as params, written only where that action declares them and otherwise refused by the route. Judged as `ActionSchema` judges it: beside it the executor key is absent or `script`, `target`, `method`, `bodyExtra`, `bodyShape` and `onSuccess` are refused, and `list` is not a location'), patch: rowPatchRetired("An `action:icon`'s"), confirmText: actionRowCopy('confirmText').optional() .describe(`${ACTION_ROW_COPY_DESCRIBE.confirmText} Beside a non-empty array \`params\` it is refused — the runner would show the confirm and then the param dialog, two dialogs for one decision; put the question on \`description\` instead. Correct with no \`params\`, beside \`params: []\`, and beside an object \`params\` (static values, no param dialog)`), @@ -4389,7 +4389,7 @@ function actionContainerMemberShape() { method: z.string().optional().describe('HTTP method for an `api` action, forwarded to the runner'), bodyExtra: z.unknown().optional().describe('Static request-body fields for an `api` action, forwarded to the runner'), bodyShape: z.unknown().optional().describe('How an `api` action shapes its request body, forwarded to the runner'), - operation: actionOperation().optional().describe('Declarative single-record write: `ActionSchema`\'s own `operation`, whose one member is `update`. The row runs the declared action its `name` names. The runner reads `operation` before any executor and posts the row\'s values to the platform action route under that `name`; the route resolves that action by name and writes ITS `patch`, so the row has no `patch` of its own and needs a `name`. What the row\'s `params` supply rides the request as params, written only where that action declares them and otherwise refused by the route. Judged as `ActionSchema` judges it: beside it the executor key is absent or `script`, `target`, `method`, `bodyExtra`, `bodyShape` and `onSuccess` are refused, and `list_toolbar` is not a location'), + operation: actionOperation().optional().describe('Declarative single-record write: `ActionSchema`\'s own `operation`, whose one member is `update`. The row runs the declared action its `name` names. The runner reads `operation` before any executor and posts the row\'s values to the platform action route under that `name`; the route resolves that action by name and writes ITS `patch`, so the row has no `patch` of its own and needs a `name`. What the row\'s `params` supply rides the request as params, written only where that action declares them and otherwise refused by the route. Judged as `ActionSchema` judges it: beside it the executor key is absent or `script`, `target`, `method`, `bodyExtra`, `bodyShape` and `onSuccess` are refused, and `list` is not a location'), patch: rowPatchRetired('An `action:group` or `action:menu` member\'s'), confirmText: actionRowCopy('confirmText').optional() .describe(`${ACTION_ROW_COPY_DESCRIBE.confirmText} Beside a non-empty array \`params\` it is refused — the runner would show the confirm and then the param dialog, two dialogs for one decision; put the question on \`description\` instead. Correct with no \`params\`, beside \`params: []\`, and beside a \`type: 'api'\` member's object \`params\` (its request payload, no param dialog)`), diff --git a/packages/spec/src/ui/dashboard-header-ask-ai-37142.test.ts b/packages/spec/src/ui/dashboard-header-ask-ai-37142.test.ts index a922457842a..690a9ee6f4f 100644 --- a/packages/spec/src/ui/dashboard-header-ask-ai-37142.test.ts +++ b/packages/spec/src/ui/dashboard-header-ask-ai-37142.test.ts @@ -15,7 +15,7 @@ describe('DashboardHeaderActionSchema — `actionType: ask_ai`', () => { const issues = r.error!.issues; expect(issues.map((i) => i.path.join('.'))).toEqual(['actionType']); expect(issues[0].code).toBe('custom'); - expect(issues[0].message).toContain("locations: ['record_header']"); + expect(issues[0].message).toContain("locations: ['record_page']"); }); it('keeps the vocabulary derived: ask_ai is still a member, refused by the header alone', () => { diff --git a/packages/spec/src/ui/dashboard.zod.ts b/packages/spec/src/ui/dashboard.zod.ts index fcb1f7adf49..df73376260d 100644 --- a/packages/spec/src/ui/dashboard.zod.ts +++ b/packages/spec/src/ui/dashboard.zod.ts @@ -131,7 +131,7 @@ function refuseRecordlessAskAi( message: "A dashboard header action cannot be `actionType: 'ask_ai'`: that type focuses the in-app assistant on " + 'the one record an action runs on, and a dashboard header runs on none. Put an `ask_ai` action on the ' - + "object (`locations: ['record_header']` or `['record_more']`), where it runs on the record shown.", + + "object (`locations: ['record_page']` or `['record']`), where it runs on the record shown.", }); } diff --git a/packages/spec/src/ui/page.zod.ts b/packages/spec/src/ui/page.zod.ts index d3a9089cec7..344bba436d6 100644 --- a/packages/spec/src/ui/page.zod.ts +++ b/packages/spec/src/ui/page.zod.ts @@ -2162,7 +2162,7 @@ export const PageSchema = lazySchema(() => strictObject({ "Do not author Tailwind classes in page source in either tier: `source` is " + "runtime metadata the build-time Tailwind never scans, so utility classNames " + "silently produce no CSS (ADR-0065; ADR-0080). " + - "Where it is drawn: an object's assigned record page of kind 'full', 'html' or 'react' (its `isDefault` page, or an app's page named by `apps`) is drawn on the desktop full record page only. On a phone and in the side preview (the drawer a list opens, a split pane, an interface page's preview) the record opens on the standard record page, built from the object's own metadata, so the page's layout and what lives only on it (its own blocks, tabs and sections, and `record_section` actions, which the standard page does not draw; give such an action `record_more` as well) do not appear there. A page named in the URL (a print page and other named page routes) is drawn wherever that route opens, the platform's own approval request and user pages keep their page on every surface, and a `kind: 'slotted'` page is the standard page with its slots filled, on every surface.", + "Where it is drawn: an object's assigned record page of kind 'full', 'html' or 'react' (its `isDefault` page, or an app's page named by `apps`) is drawn on the desktop full record page only. On a phone and in the side preview (the drawer a list opens, a split pane, an interface page's preview) the record opens on the standard record page, built from the object's own metadata, so the page's layout and what lives only on it (its own blocks, tabs and sections, and `record_section` actions, which the standard page does not draw; give such an action `record_page` as well) do not appear there. A page named in the URL (a print page and other named page routes) is drawn wherever that route opens, the platform's own approval request and user pages keep their page on every surface, and a `kind: 'slotted'` page is the standard page with its slots filled, on every surface.", ), /** diff --git a/packages/verify/src/action-flow-dropped-fields.test.ts b/packages/verify/src/action-flow-dropped-fields.test.ts index 8557c9525d0..c9a7b5800c5 100644 --- a/packages/verify/src/action-flow-dropped-fields.test.ts +++ b/packages/verify/src/action-flow-dropped-fields.test.ts @@ -100,8 +100,8 @@ const fixtureStack = defineStack({ objects: [Report], flows: [writer(SUBMIT, { status: 'submitted', note: 'submitted by the button' }), writer(ADD_NOTE, { note: 'noted by the button' })], actions: [ - { name: 'submit_for_approval', label: 'Submit for approval', objectName: REPORT, type: 'flow', target: SUBMIT, locations: ['record_header'] }, - { name: 'add_note', label: 'Add note', objectName: REPORT, type: 'flow', target: ADD_NOTE, locations: ['record_header'] }, + { name: 'submit_for_approval', label: 'Submit for approval', objectName: REPORT, type: 'flow', target: SUBMIT, locations: ['record_page'] }, + { name: 'add_note', label: 'Add note', objectName: REPORT, type: 'flow', target: ADD_NOTE, locations: ['record_page'] }, ], } as never); diff --git a/ui/apps/console/src/__tests__/record-block-record-reach.test.tsx b/ui/apps/console/src/__tests__/record-block-record-reach.test.tsx index 2382b805240..7d6030fde79 100644 --- a/ui/apps/console/src/__tests__/record-block-record-reach.test.tsx +++ b/ui/apps/console/src/__tests__/record-block-record-reach.test.tsx @@ -167,7 +167,7 @@ const PROBE_OBJECT_SCHEMA = { name: PROBE_ACTION, label: 'Probe Action', type: 'url', - locations: ['record_header'], + locations: ['record_page'], visible: "record.stage == 'qualified'", }, ], @@ -286,7 +286,7 @@ const SAMPLE_BY_INPUT: Readonly> = { // other two) point the bar at a location with no actions. relationshipValueField: 'id', showHeader: false, - location: 'record_header', + location: 'record_page', align: 'end', variant: 'default', size: 'sm', diff --git a/ui/apps/console/src/dev/DevRecordHeaderActions.tsx b/ui/apps/console/src/dev/DevRecordHeaderActions.tsx index a78d0afe4a2..6033621ed13 100644 --- a/ui/apps/console/src/dev/DevRecordHeaderActions.tsx +++ b/ui/apps/console/src/dev/DevRecordHeaderActions.tsx @@ -2,7 +2,7 @@ * Dev-only harness for record-header `type:'api'` actions (objectui#3391). * * Reproduces the issue's exact declaration: an object action on - * `locations:['record_header']` whose target is + * `locations:['record_page']` whose target is * `/api/v1/data/os_tianshun_ehr_production_plan/{id}`, with a required * field-backed param, `bodyExtra` and a confirm dialog. Before the fix the * header executor never stashed the record under `params._rowRecord`, so the @@ -40,7 +40,7 @@ const OBJECT_DEF = { { name: 'copy_plan_row', label: '复制', - locations: ['record_header'], + locations: ['record_page'], type: 'api', method: 'PATCH', target: `/api/v1/data/${OBJECT_NAME}/{id}`, diff --git a/ui/apps/console/src/preview-samples.ts b/ui/apps/console/src/preview-samples.ts index eeb24dec282..2422db5c2de 100644 --- a/ui/apps/console/src/preview-samples.ts +++ b/ui/apps/console/src/preview-samples.ts @@ -194,7 +194,7 @@ export const SAMPLES: Record> = { // Spec-17 placement vocabulary; the pre-17 `record`/`list` shorthands are // not in the enum (and the ActionPreview placement mock renders nothing // for them, so the "Where it appears" section was empty). - locations: ['record_header', 'list_toolbar'], + locations: ['record_page', 'list'], confirmText: 'Close this order? This cannot be undone.', successMessage: 'Order closed.', // No `bulkEnabled`: RETIRED in spec 17 (objectstack#3896). The multi-select diff --git a/ui/apps/console/src/services/approvalRequestsDataSource.decisionPage.test.tsx b/ui/apps/console/src/services/approvalRequestsDataSource.decisionPage.test.tsx index a90beab9cc8..306631d345c 100644 --- a/ui/apps/console/src/services/approvalRequestsDataSource.decisionPage.test.tsx +++ b/ui/apps/console/src/services/approvalRequestsDataSource.decisionPage.test.tsx @@ -124,12 +124,12 @@ const REQUEST_DEF = { { name: 'approval_approve', label: 'Approve', type: 'api', method: 'POST', target: '/api/v1/approvals/requests/{id}/approve', params: DECISION_PARAMS, - visible: DECIDE, locations: ['record_section', 'list_item'], refreshAfter: true, + visible: DECIDE, locations: ['record_section', 'record_row'], refreshAfter: true, }, { name: 'approval_reject', label: 'Reject', type: 'api', method: 'POST', target: '/api/v1/approvals/requests/{id}/reject', params: DECISION_PARAMS, - visible: DECIDE, locations: ['record_section', 'list_item'], refreshAfter: true, + visible: DECIDE, locations: ['record_section', 'record_row'], refreshAfter: true, }, { // The submitter's own control on a pending request: drawn by the same bar, diff --git a/ui/apps/console/src/services/approvalRequestsDataSource.recordPagePayload-28546.test.tsx b/ui/apps/console/src/services/approvalRequestsDataSource.recordPagePayload-28546.test.tsx index 2714bd696a8..7a59fa3df8f 100644 --- a/ui/apps/console/src/services/approvalRequestsDataSource.recordPagePayload-28546.test.tsx +++ b/ui/apps/console/src/services/approvalRequestsDataSource.recordPagePayload-28546.test.tsx @@ -149,12 +149,12 @@ const REQUEST_DEF = { { name: 'approval_approve', label: 'Approve', type: 'api', method: 'POST', target: '/api/v1/approvals/requests/{id}/approve', params: DECISION_PARAMS, - visible: CAN_ACT, locations: ['record_section', 'list_item'], refreshAfter: true, + visible: CAN_ACT, locations: ['record_section', 'record_row'], refreshAfter: true, }, { name: 'approval_reject', label: 'Reject', type: 'api', method: 'POST', target: '/api/v1/approvals/requests/{id}/reject', params: DECISION_PARAMS, - visible: CAN_ACT, locations: ['record_section', 'list_item'], refreshAfter: true, + visible: CAN_ACT, locations: ['record_section', 'record_row'], refreshAfter: true, }, ], enable: { apiMethods: ['get', 'list'] }, diff --git a/ui/apps/console/src/services/approvalRequestsDataSource.servedPage.test.tsx b/ui/apps/console/src/services/approvalRequestsDataSource.servedPage.test.tsx index eed2d286611..2b897661278 100644 --- a/ui/apps/console/src/services/approvalRequestsDataSource.servedPage.test.tsx +++ b/ui/apps/console/src/services/approvalRequestsDataSource.servedPage.test.tsx @@ -109,12 +109,12 @@ const REQUEST_DEF = { { name: 'approval_approve', label: 'Approve', type: 'api', method: 'POST', target: '/api/v1/approvals/requests/{id}/approve', params: DECISION_PARAMS, - visible: CAN_ACT, locations: ['record_section', 'list_item'], refreshAfter: true, + visible: CAN_ACT, locations: ['record_section', 'record_row'], refreshAfter: true, }, { name: 'approval_reject', label: 'Reject', type: 'api', method: 'POST', target: '/api/v1/approvals/requests/{id}/reject', params: DECISION_PARAMS, - visible: CAN_ACT, locations: ['record_section', 'list_item'], refreshAfter: true, + visible: CAN_ACT, locations: ['record_section', 'record_row'], refreshAfter: true, }, ], enable: { apiMethods: ['get', 'list'] }, diff --git a/ui/apps/console/src/services/approvalRequestsDataSource.servedPageApprovers-12482.test.tsx b/ui/apps/console/src/services/approvalRequestsDataSource.servedPageApprovers-12482.test.tsx index 2fe3328d60a..4195e760fad 100644 --- a/ui/apps/console/src/services/approvalRequestsDataSource.servedPageApprovers-12482.test.tsx +++ b/ui/apps/console/src/services/approvalRequestsDataSource.servedPageApprovers-12482.test.tsx @@ -137,12 +137,12 @@ const REQUEST_DEF = { { name: 'approval_approve', label: 'Approve', type: 'api', method: 'POST', target: '/api/v1/approvals/requests/{id}/approve', params: DECISION_PARAMS, - visible: CAN_ACT, locations: ['record_section', 'list_item'], refreshAfter: true, + visible: CAN_ACT, locations: ['record_section', 'record_row'], refreshAfter: true, }, { name: 'approval_reject', label: 'Reject', type: 'api', method: 'POST', target: '/api/v1/approvals/requests/{id}/reject', params: DECISION_PARAMS, - visible: CAN_ACT, locations: ['record_section', 'list_item'], refreshAfter: true, + visible: CAN_ACT, locations: ['record_section', 'record_row'], refreshAfter: true, }, ], enable: { apiMethods: ['get', 'list'] }, diff --git a/ui/apps/console/src/services/approvalRequestsDataSource.servedPageMemberPermissions-13324.test.tsx b/ui/apps/console/src/services/approvalRequestsDataSource.servedPageMemberPermissions-13324.test.tsx index 90cb2a73314..5cc0c44beb1 100644 --- a/ui/apps/console/src/services/approvalRequestsDataSource.servedPageMemberPermissions-13324.test.tsx +++ b/ui/apps/console/src/services/approvalRequestsDataSource.servedPageMemberPermissions-13324.test.tsx @@ -103,12 +103,12 @@ const REQUEST_DEF = { { name: 'approval_approve', label: 'Approve', type: 'api', method: 'POST', target: '/api/v1/approvals/requests/{id}/approve', params: DECISION_PARAMS, - visible: CAN_ACT, locations: ['record_section', 'list_item'], refreshAfter: true, + visible: CAN_ACT, locations: ['record_section', 'record_row'], refreshAfter: true, }, { name: 'approval_reject', label: 'Reject', type: 'api', method: 'POST', target: '/api/v1/approvals/requests/{id}/reject', params: DECISION_PARAMS, - visible: CAN_ACT, locations: ['record_section', 'list_item'], refreshAfter: true, + visible: CAN_ACT, locations: ['record_section', 'record_row'], refreshAfter: true, }, ], enable: { apiMethods: ['get', 'list'] }, diff --git a/ui/apps/console/src/services/approvalRequestsDataSource.servedPageStepLine-12491.test.tsx b/ui/apps/console/src/services/approvalRequestsDataSource.servedPageStepLine-12491.test.tsx index 2f3dbd965cb..efee5e77618 100644 --- a/ui/apps/console/src/services/approvalRequestsDataSource.servedPageStepLine-12491.test.tsx +++ b/ui/apps/console/src/services/approvalRequestsDataSource.servedPageStepLine-12491.test.tsx @@ -153,7 +153,7 @@ const REQUEST_DEF = { { name: 'approval_approve', label: 'Approve', type: 'api', method: 'POST', target: '/api/v1/approvals/requests/{id}/approve', params: DECISION_PARAMS, - visible: CAN_ACT, locations: ['record_section', 'list_item'], refreshAfter: true, + visible: CAN_ACT, locations: ['record_section', 'record_row'], refreshAfter: true, }, ], enable: { apiMethods: ['get', 'list'] }, diff --git a/ui/apps/console/src/services/approvalRequestsDataSource.servedPageSummary-12483.test.tsx b/ui/apps/console/src/services/approvalRequestsDataSource.servedPageSummary-12483.test.tsx index 37e76b2aedd..c106557edf3 100644 --- a/ui/apps/console/src/services/approvalRequestsDataSource.servedPageSummary-12483.test.tsx +++ b/ui/apps/console/src/services/approvalRequestsDataSource.servedPageSummary-12483.test.tsx @@ -156,12 +156,12 @@ const REQUEST_DEF = { { name: 'approval_approve', label: 'Approve', type: 'api', method: 'POST', target: '/api/v1/approvals/requests/{id}/approve', params: DECISION_PARAMS, - visible: CAN_ACT, locations: ['record_section', 'list_item'], refreshAfter: true, + visible: CAN_ACT, locations: ['record_section', 'record_row'], refreshAfter: true, }, { name: 'approval_reject', label: 'Reject', type: 'api', method: 'POST', target: '/api/v1/approvals/requests/{id}/reject', params: DECISION_PARAMS, - visible: CAN_ACT, locations: ['record_section', 'list_item'], refreshAfter: true, + visible: CAN_ACT, locations: ['record_section', 'record_row'], refreshAfter: true, }, ], enable: { apiMethods: ['get', 'list'] }, diff --git a/ui/apps/console/src/services/approvalRequestsDataSource.servedPageSummaryAmount-12534.test.tsx b/ui/apps/console/src/services/approvalRequestsDataSource.servedPageSummaryAmount-12534.test.tsx index 0ea80933c08..5fd4fe639ff 100644 --- a/ui/apps/console/src/services/approvalRequestsDataSource.servedPageSummaryAmount-12534.test.tsx +++ b/ui/apps/console/src/services/approvalRequestsDataSource.servedPageSummaryAmount-12534.test.tsx @@ -200,7 +200,7 @@ const REQUEST_DEF = { { name: 'approval_approve', label: 'Approve', type: 'api', method: 'POST', target: '/api/v1/approvals/requests/{id}/approve', - visible: CAN_ACT, locations: ['record_section', 'list_item'], refreshAfter: true, + visible: CAN_ACT, locations: ['record_section', 'record_row'], refreshAfter: true, }, ], enable: { apiMethods: ['get', 'list'] }, diff --git a/ui/e2e/list-header-narrow-35446.spec.ts b/ui/e2e/list-header-narrow-35446.spec.ts index 2628e2d27c7..4a77fb9f23a 100644 --- a/ui/e2e/list-header-narrow-35446.spec.ts +++ b/ui/e2e/list-header-narrow-35446.spec.ts @@ -128,7 +128,7 @@ const TEXT = { }; const t = (key, opts) => TEXT[key] ?? (opts && opts.defaultValue) ?? key; const objectDef = { name: 'opportunity', label: 'Opportunity', pluralLabel: 'Opportunities', icon: 'briefcase', description: ${JSON.stringify(DESCRIPTION)} }; -const toolbarBar = { type: 'action:bar', location: 'list_toolbar', actions: [], maxVisible: 3, mobileMaxVisible: 0 }; +const toolbarBar = { type: 'action:bar', location: 'list', actions: [], maxVisible: 3, mobileMaxVisible: 0 }; const listFavorite = { isFavorite: false, toggle: () => {} }; const VIEW_LABEL = ${JSON.stringify(VIEW_LABEL)}; diff --git a/ui/e2e/list-no-actions-column-35554.spec.ts b/ui/e2e/list-no-actions-column-35554.spec.ts index 494f0f16c13..2075aed0871 100644 --- a/ui/e2e/list-no-actions-column-35554.spec.ts +++ b/ui/e2e/list-no-actions-column-35554.spec.ts @@ -180,9 +180,9 @@ const dataSource = { }; const record = (name) => async () => { window.__dispatched.push(name); return { success: true }; }; const rowActionDefs = [ - { name: 'submit_approval', label: '提交审批', locations: ['list_item'] }, - { name: 'make_quote', label: '生成报价单', locations: ['list_item'] }, - { name: 'clone_opportunity', label: '复制', locations: ['list_item'] }, + { name: 'submit_approval', label: '提交审批', locations: ['record_row'] }, + { name: 'make_quote', label: '生成报价单', locations: ['record_row'] }, + { name: 'clone_opportunity', label: '复制', locations: ['record_row'] }, ]; const bulkActionDefs = [ { name: 'mass_update', label: '批量更新' }, @@ -233,7 +233,7 @@ function Header() { actions: { create: () => {} }, t, listActions: [], toolbarActionsWithDeepLink: [], identityImportEnabled: false, objectCanImport: false, importVisible: false, importDisabled: false, setShowImport: () => {}, listFavorite: null, isEnvironmentList: false, - toolbarBar: { type: 'action:bar', location: 'list_toolbar', actions: [], maxVisible: 3, mobileMaxVisible: 0 }, + toolbarBar: { type: 'action:bar', location: 'list', actions: [], maxVisible: 3, mobileMaxVisible: 0 }, viewAccess: { refusal: null }, createLabel: '新建商机', }); return h(ObjectViewPageHeader, { @@ -249,7 +249,7 @@ function Header() { isEnvironmentList: false, headerToolbarActions: [], environmentEntitlements: undefined, - toolbarBar: { type: 'action:bar', location: 'list_toolbar', actions: [], maxVisible: 3, mobileMaxVisible: 0 }, + toolbarBar: { type: 'action:bar', location: 'list', actions: [], maxVisible: 3, mobileMaxVisible: 0 }, listFavorite: null, foldedHeaderActions: chrome.foldedHeaderActions, }); diff --git a/ui/packages/app-shell/src/__tests__/ListView.gridRowColorSelect-12393.test.tsx b/ui/packages/app-shell/src/__tests__/ListView.gridRowColorSelect-12393.test.tsx index a2729d5d302..454f5b8715b 100644 --- a/ui/packages/app-shell/src/__tests__/ListView.gridRowColorSelect-12393.test.tsx +++ b/ui/packages/app-shell/src/__tests__/ListView.gridRowColorSelect-12393.test.tsx @@ -113,7 +113,7 @@ const objectDef = { stage: { name: 'stage', type: 'text', label: 'Stage' }, due_date: { name: 'due_date', type: 'date', label: 'Due' }, }, - actions: [{ name: 'approve', label: 'Approve', locations: ['list_item'], visible: "record.approver == 'u1'" }], + actions: [{ name: 'approve', label: 'Approve', locations: ['record_row'], visible: "record.approver == 'u1'" }], userActions: { edit: { visibleWhen: 'record.locked != true' } }, }; diff --git a/ui/packages/app-shell/src/environment/EnvironmentListToolbar.tsx b/ui/packages/app-shell/src/environment/EnvironmentListToolbar.tsx index 59344815865..60d6b20e11d 100644 --- a/ui/packages/app-shell/src/environment/EnvironmentListToolbar.tsx +++ b/ui/packages/app-shell/src/environment/EnvironmentListToolbar.tsx @@ -118,7 +118,7 @@ function OtherActionsBar({ actions }: { actions: any[] }) { // Typed as the `action:bar` node it is (objectui#11355), not as the // `BaseSchema` the `schema` prop accepts: a key `ActionBarSchema` does not // declare is refused here. - const bar: ActionBarSchema = { type: 'action:bar', location: 'list_toolbar', actions, size: 'sm', variant: 'outline' }; + const bar: ActionBarSchema = { type: 'action:bar', location: 'list', actions, size: 'sm', variant: 'outline' }; return ; } @@ -213,7 +213,7 @@ export function EnvironmentListToolbar({ actions, entitlements }: Props) { // Typed as the `action:bar` node it is (objectui#11355); see `OtherActionsBar`. const bar: ActionBarSchema = { type: 'action:bar', - location: 'list_toolbar', + location: 'list', actions: renderedActions, size: 'sm', variant: 'outline', diff --git a/ui/packages/app-shell/src/environment/__tests__/EnvironmentListToolbar.deepLinkArming.test.tsx b/ui/packages/app-shell/src/environment/__tests__/EnvironmentListToolbar.deepLinkArming.test.tsx index 822dc21667a..0456764c8df 100644 --- a/ui/packages/app-shell/src/environment/__tests__/EnvironmentListToolbar.deepLinkArming.test.tsx +++ b/ui/packages/app-shell/src/environment/__tests__/EnvironmentListToolbar.deepLinkArming.test.tsx @@ -43,14 +43,14 @@ const CREATE = { label: 'Create Environment', type: 'api', variant: 'primary', - locations: ['list_toolbar'], + locations: ['list'], }; /** A perfectly ordinary second toolbar action — the one the old predicate counted. */ const REFRESH = { name: 'refresh_environments', label: 'Refresh', type: 'api', - locations: ['list_toolbar'], + locations: ['list'], }; const st = (o: Partial): EnvironmentEntitlementsState => diff --git a/ui/packages/app-shell/src/environment/__tests__/EnvironmentListToolbar.deepLinkOverflow.test.tsx b/ui/packages/app-shell/src/environment/__tests__/EnvironmentListToolbar.deepLinkOverflow.test.tsx index 345d0f498ed..e30f8796e12 100644 --- a/ui/packages/app-shell/src/environment/__tests__/EnvironmentListToolbar.deepLinkOverflow.test.tsx +++ b/ui/packages/app-shell/src/environment/__tests__/EnvironmentListToolbar.deepLinkOverflow.test.tsx @@ -61,12 +61,12 @@ const CREATE = { name: 'create_environment', label: 'Create Environment', type: 'api', - locations: ['list_toolbar'], + locations: ['list'], }; const FILLERS = [ - { name: 'a1', label: 'a1', type: 'api', order: -1, locations: ['list_toolbar'] }, - { name: 'a2', label: 'a2', type: 'api', order: -1, locations: ['list_toolbar'] }, - { name: 'a3', label: 'a3', type: 'api', order: -1, locations: ['list_toolbar'] }, + { name: 'a1', label: 'a1', type: 'api', order: -1, locations: ['list'] }, + { name: 'a2', label: 'a2', type: 'api', order: -1, locations: ['list'] }, + { name: 'a3', label: 'a3', type: 'api', order: -1, locations: ['list'] }, ]; /** ready + no production env yet → `setup_production`. */ diff --git a/ui/packages/app-shell/src/environment/__tests__/EnvironmentListToolbar.test.tsx b/ui/packages/app-shell/src/environment/__tests__/EnvironmentListToolbar.test.tsx index 1034157cac6..6973e097a06 100644 --- a/ui/packages/app-shell/src/environment/__tests__/EnvironmentListToolbar.test.tsx +++ b/ui/packages/app-shell/src/environment/__tests__/EnvironmentListToolbar.test.tsx @@ -43,7 +43,7 @@ const renderToolbar = (ui: React.ReactElement) => const CREATE = { name: 'create_environment', label: 'Create Environment', - type: 'api', variant: 'primary', locations: ['list_toolbar'], + type: 'api', variant: 'primary', locations: ['list'], }; const st = (o: Partial): EnvironmentEntitlementsState => ({ ready: true, hasProductionEnv: true, upgradeUrl: '/settings/billing', source: 'summary', ...o }); @@ -57,7 +57,7 @@ const UNRESOLVED: EnvironmentEntitlementsState = { ready: false, hasProductionEnv: false, source: 'unknown', }; -const REFRESH = { name: 'refresh_all', label: 'Refresh', type: 'api', locations: ['list_toolbar'] }; +const REFRESH = { name: 'refresh_all', label: 'Refresh', type: 'api', locations: ['list'] }; describe('EnvironmentListToolbar', () => { it('no production env → "Set up your production environment" (primary)', () => { @@ -166,7 +166,7 @@ describe('EnvironmentListToolbar — loading state (objectui#3482)', () => { }); it('non-create toolbar actions still render while resolving (they never re-label)', () => { - const REFRESH = { name: 'refresh_all', label: 'Refresh', type: 'api', locations: ['list_toolbar'] }; + const REFRESH = { name: 'refresh_all', label: 'Refresh', type: 'api', locations: ['list'] }; renderToolbar( , ); @@ -176,7 +176,7 @@ describe('EnvironmentListToolbar — loading state (objectui#3482)', () => { }); it('no create action in the toolbar → nothing can jump, so no skeleton', () => { - const REFRESH = { name: 'refresh_all', label: 'Refresh', type: 'api', locations: ['list_toolbar'] }; + const REFRESH = { name: 'refresh_all', label: 'Refresh', type: 'api', locations: ['list'] }; renderToolbar(); expect(screen.getByText('Refresh')).toBeTruthy(); expect(screen.queryByTestId(CREATE_LOADING)).toBeNull(); diff --git a/ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.apiNewTabUrl-26747.test.tsx b/ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.apiNewTabUrl-26747.test.tsx index 5b6e628ae0e..6420404abe3 100644 --- a/ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.apiNewTabUrl-26747.test.tsx +++ b/ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.apiNewTabUrl-26747.test.tsx @@ -79,7 +79,7 @@ const NEW_TAB_ACTION = { target: TARGET, opensInNewTab: true, newTabUrl: '/export/{recordId}', - locations: ['list_toolbar'], + locations: ['list'], }; function stubWindowOpen() { diff --git a/ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.flowActionDoor-12037.test.tsx b/ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.flowActionDoor-12037.test.tsx index 49d90305603..f82353bab43 100644 --- a/ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.flowActionDoor-12037.test.tsx +++ b/ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.flowActionDoor-12037.test.tsx @@ -58,7 +58,7 @@ const DECLARED = { label: 'Reassign…', type: 'flow', target: FLOW, - locations: ['list_item', 'list_toolbar'], + locations: ['record_row', 'list'], requiredPermissions: ['showcase.reassign'], }; const OBJECTS = [{ name: OBJECT, label: 'Task', fields: {}, actions: [DECLARED] }]; diff --git a/ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.flowRowGuard-13397.test.tsx b/ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.flowRowGuard-13397.test.tsx index 75b53fd1700..73c8d40aaaf 100644 --- a/ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.flowRowGuard-13397.test.tsx +++ b/ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.flowRowGuard-13397.test.tsx @@ -95,7 +95,7 @@ const REASSIGN = { type: 'flow', name: 'reassign', target: 'reassign_wizard', - locations: ['list_item', 'list_toolbar'], + locations: ['record_row', 'list'], params: [{ name: 'owner', label: 'Owner', type: 'text', required: true }], }; const launch = (extra: Record = {}): ActionDef => ({ ...JSON.parse(JSON.stringify(REASSIGN)), ...extra }); @@ -128,7 +128,7 @@ describe('flowHandler.refuseBeforeInput — the resolver its dispatch runs (obje it('control: an object-level toolbar flow with 0 rows is not refused', () => { expect(runtime().flowHandler.refuseBeforeInput?.( - launch({ locations: ['list_toolbar'] }), + launch({ locations: ['list'] }), rowsContext([]), )).toBeUndefined(); }); @@ -184,7 +184,7 @@ describe('a toolbar flow launch through the console runtime (objectui#13397)', ( }); it('control: an object-level toolbar flow with 0 rows still opens its dialog', async () => { - mount([], launch({ locations: ['list_toolbar'] })); + mount([], launch({ locations: ['list'] })); await screen.findByTestId('param-dialog'); expect(toastError).not.toHaveBeenCalled(); diff --git a/ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.test.tsx b/ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.test.tsx index f0894f94ec1..35e8d59c723 100644 --- a/ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.test.tsx +++ b/ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.test.tsx @@ -687,7 +687,7 @@ describe('flowHandler — list_toolbar selection fallback', () => { res = await result.current.flowHandler( { type: 'flow', name: 'showcase_bulk_reassign', target: 'showcase_reassign_wizard', - locations: ['list_item', 'list_toolbar'], + locations: ['record_row', 'list'], } as any, { selectedRecords: [] } as any, ); @@ -707,7 +707,7 @@ describe('flowHandler — list_toolbar selection fallback', () => { let res: any; await act(async () => { res = await result.current.flowHandler( - { type: 'flow', name: 'monthly_close', target: 'monthly_close', locations: ['list_toolbar'] } as any, + { type: 'flow', name: 'monthly_close', target: 'monthly_close', locations: ['list'] } as any, { selectedRecords: [] } as any, ); }); @@ -739,8 +739,8 @@ describe('flowHandler — list_toolbar selection fallback', () => { // The same action shape and selection reach both handlers here, and each // answer must be the rule's own. it.each([ - ['several rows', { locations: ['list_toolbar'] }, [{ id: 'a' }, { id: 'b' }]], - ['zero rows on a record-scoped action', { locations: ['list_item', 'list_toolbar'] }, []], + ['several rows', { locations: ['list'] }, [{ id: 'a' }, { id: 'b' }]], + ['zero rows on a record-scoped action', { locations: ['record_row', 'list'] }, []], ])('refuses %s with the same answer as the script launcher (objectui#12331)', async (_label, shape, rows) => { const { result } = renderHook(() => useConsoleActionRuntime({ dataSource: {}, objects: [], objectName: 'inv' }), @@ -778,7 +778,7 @@ describe('flowHandler — list_toolbar selection fallback', () => { res = await result.current.flowHandler( { type: 'flow', name: 'bulk_close', target: 'bulk_close_flow', - locations: ['list_item', 'list_toolbar'], + locations: ['record_row', 'list'], params: { _selectedIds: ['a', 'b'] }, } as any, { selectedRecords: [{ id: 'a' }, { id: 'b' }] } as any, @@ -1140,7 +1140,7 @@ describe('serverActionHandler — list_toolbar selection fallback', () => { let res: any; await act(async () => { res = await result.current.serverActionHandler( - { type: 'script', name: 'archive', locations: ['list_item', 'list_toolbar'] } as any, + { type: 'script', name: 'archive', locations: ['record_row', 'list'] } as any, { selectedRecords: [] } as any, ); }); @@ -1159,7 +1159,7 @@ describe('serverActionHandler — list_toolbar selection fallback', () => { let res: any; await act(async () => { res = await result.current.serverActionHandler( - { type: 'script', name: 'export_all', locations: ['list_toolbar'] } as any, + { type: 'script', name: 'export_all', locations: ['list'] } as any, { selectedRecords: [] } as any, ); }); @@ -1180,7 +1180,7 @@ describe('serverActionHandler — list_toolbar selection fallback', () => { { type: 'script', name: 'generate_qr_zip', - locations: ['list_item', 'list_toolbar'], + locations: ['record_row', 'list'], params: { _selectedIds: ['a', 'b'], format: 'png' }, } as any, // Multi-select would block a single-record dispatch — the injected diff --git a/ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.undoLookupId-11122.test.tsx b/ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.undoLookupId-11122.test.tsx index d94d4ffa135..2b875170d6b 100644 --- a/ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.undoLookupId-11122.test.tsx +++ b/ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.undoLookupId-11122.test.tsx @@ -144,7 +144,7 @@ async function runOnGridRow(action: Record) { type: 'object-grid', objectName: OBJECT, columns: ['name', 'account'], - rowActionDefs: [{ locations: ['list_item'], successMessage: MESSAGE, ...action }], + rowActionDefs: [{ locations: ['record_row'], successMessage: MESSAGE, ...action }], } as never} dataSource={dataSource as never} /> diff --git a/ui/packages/app-shell/src/hooks/__tests__/useOfferedNavRunAction.test.tsx b/ui/packages/app-shell/src/hooks/__tests__/useOfferedNavRunAction.test.tsx index 661fdfe89d7..d595bc7397b 100644 --- a/ui/packages/app-shell/src/hooks/__tests__/useOfferedNavRunAction.test.tsx +++ b/ui/packages/app-shell/src/hooks/__tests__/useOfferedNavRunAction.test.tsx @@ -47,7 +47,7 @@ const CREATE = { name: 'create_account', label: 'Create Account', type: 'api', - locations: ['list_toolbar'], + locations: ['list'], }; function land(name: string | null): void { @@ -62,7 +62,7 @@ function Toolbar({ actions, enabled = true }: { actions: any[]; enabled?: boolea const armed = useOfferedNavRunAction(actions, (a: any) => actionRendersAt(a, 'list_toolbar'), enabled); const composed = armed === null ? actions : actions.map((a) => (a?.name === armed ? { ...a, autoTrigger: true } : a)); // Typed as the `action:bar` node it is (objectui#11355), as `ObjectView` types its own. - const bar: ActionBarSchema = { type: 'action:bar', location: 'list_toolbar', actions: composed }; + const bar: ActionBarSchema = { type: 'action:bar', location: 'list', actions: composed }; return ; } @@ -144,7 +144,7 @@ describe('the deep-link preparation step honours the declared visible gate (obje it('a name this surface does not render is the old quiet case — no notice, URL untouched', async () => { land(CREATE.name); - const { run } = mount([{ ...CREATE, locations: ['record_header'], visible: false }]); + const { run } = mount([{ ...CREATE, locations: ['record_page'], visible: false }]); await flush(); expect(notice).not.toHaveBeenCalled(); expect(run).not.toHaveBeenCalled(); diff --git a/ui/packages/app-shell/src/layout/__tests__/DesignModeHeaderPins-36366.test.tsx b/ui/packages/app-shell/src/layout/__tests__/DesignModeHeaderPins-36366.test.tsx index dd2b878ee3b..26819682c4b 100644 --- a/ui/packages/app-shell/src/layout/__tests__/DesignModeHeaderPins-36366.test.tsx +++ b/ui/packages/app-shell/src/layout/__tests__/DesignModeHeaderPins-36366.test.tsx @@ -68,10 +68,10 @@ import { DesignModeBar } from '../DesignModeBar'; import { DesignModeHeaderPins, useObjectPins } from '../DesignModeHeaderPins'; const ACTIONS = [ - { name: 'convert', label: 'Convert', locations: ['record_header'], order: 1 }, - { name: 'mark_won', label: 'Mark won', locations: ['record_header'], order: 2 }, - { name: 'clone', label: 'Clone', locations: ['record_header'], order: 3 }, - { name: 'log_call', label: 'Log call', locations: ['record_more'], order: 4 }, + { name: 'convert', label: 'Convert', locations: ['record_page'], order: 1 }, + { name: 'mark_won', label: 'Mark won', locations: ['record_page'], order: 2 }, + { name: 'clone', label: 'Clone', locations: ['record_page'], order: 3 }, + { name: 'log_call', label: 'Log call', locations: ['record_page'], component: 'action:menu', order: 4 }, ]; function Harness({ objectDef }: { objectDef: Record }) { diff --git a/ui/packages/app-shell/src/layout/__tests__/designModeHeaderPinsModel-36366.test.ts b/ui/packages/app-shell/src/layout/__tests__/designModeHeaderPinsModel-36366.test.ts index c1f804cf6cf..df1de8f3882 100644 --- a/ui/packages/app-shell/src/layout/__tests__/designModeHeaderPinsModel-36366.test.ts +++ b/ui/packages/app-shell/src/layout/__tests__/designModeHeaderPinsModel-36366.test.ts @@ -24,14 +24,14 @@ import { } from '../designModeHeaderPinsModel'; const ACTIONS = [ - { name: 'log_call', label: 'Log call', locations: ['record_more'] }, - { name: 'mark_won', label: 'Mark won', locations: ['record_header'], order: 2 }, - { name: 'convert', label: 'Convert', locations: ['record_header'], order: 1 }, - { name: 'clone', label: 'Clone', locations: ['record_header'], order: 3 }, - { name: 'share', label: 'Share', locations: ['record_header'], order: 4 }, - { name: 'archive', label: 'Archive', locations: ['record_header'], component: 'action:menu' }, - { name: 'mass_assign', label: 'Assign', locations: ['list_toolbar'] }, - { name: 'new_task', label: 'New task', locations: ['list_toolbar'], variant: 'primary' }, + { name: 'log_call', label: 'Log call', locations: ['record_page'], component: 'action:menu' }, + { name: 'mark_won', label: 'Mark won', locations: ['record_page'], order: 2 }, + { name: 'convert', label: 'Convert', locations: ['record_page'], order: 1 }, + { name: 'clone', label: 'Clone', locations: ['record_page'], order: 3 }, + { name: 'share', label: 'Share', locations: ['record_page'], order: 4 }, + { name: 'archive', label: 'Archive', locations: ['record_page'], component: 'action:menu' }, + { name: 'mass_assign', label: 'Assign', locations: ['list'] }, + { name: 'new_task', label: 'New task', locations: ['list'], variant: 'primary' }, ]; const TEXTS = { unknown: (n: string) => `unknown ${n}`, notPlaced: (n: string) => `not placed ${n}` }; diff --git a/ui/packages/app-shell/src/layout/__tests__/designModeHeaderPinsSave-36366.test.ts b/ui/packages/app-shell/src/layout/__tests__/designModeHeaderPinsSave-36366.test.ts index 55ea50bf5c6..af49833ea44 100644 --- a/ui/packages/app-shell/src/layout/__tests__/designModeHeaderPinsSave-36366.test.ts +++ b/ui/packages/app-shell/src/layout/__tests__/designModeHeaderPinsSave-36366.test.ts @@ -34,9 +34,9 @@ const SERVED = { label: 'Lead', _packageId: 'com.acme.crm', actions: [ - { name: 'convert', locations: ['record_header'] }, - { name: 'log_call', locations: ['record_more'] }, - { name: 'mass_assign', locations: ['list_toolbar'] }, + { name: 'convert', locations: ['record_page'] }, + { name: 'log_call', locations: ['record_page'], component: 'action:menu' }, + { name: 'mass_assign', locations: ['list'] }, ], }; @@ -89,7 +89,7 @@ beforeEach(() => emitMetadataRefresh.mockReset()); describe('saving the header pins (objectstack#36366)', () => { it('a writable package: the object as its author wrote it, with the new pins, saved as a draft and published', async () => { - const authored = { name: 'crm_lead', label: 'Lead', actions: [{ name: 'convert', locations: ['record_header'] }] }; + const authored = { name: 'crm_lead', label: 'Lead', actions: [{ name: 'convert', locations: ['record_page'] }] }; const { d, calls } = doors({ writable: true, layers: { code: authored } }); await saveObjectPins(input({ record: { pinned: ['log_call', 'convert'] } }), TEXTS, d); expect(calls).toEqual([ @@ -237,7 +237,7 @@ describe('saving the header pins (objectstack#36366)', () => { }); describe('the header pins Save publishes only the draft it wrote (objectstack#37440)', () => { - const authored = { name: 'crm_lead', label: 'Lead', actions: [{ name: 'convert', locations: ['record_header'] }] }; + const authored = { name: 'crm_lead', label: 'Lead', actions: [{ name: 'convert', locations: ['record_page'] }] }; function doorDoors() { const door = draftPublishDoor(); door.seedLive('object', 'crm_lead', 'com.acme.crm', authored); diff --git a/ui/packages/app-shell/src/providers/__tests__/currentUserCan-4421.render.test.tsx b/ui/packages/app-shell/src/providers/__tests__/currentUserCan-4421.render.test.tsx index d5bf6f05a64..759b8a524ca 100644 --- a/ui/packages/app-shell/src/providers/__tests__/currentUserCan-4421.render.test.tsx +++ b/ui/packages/app-shell/src/providers/__tests__/currentUserCan-4421.render.test.tsx @@ -172,8 +172,8 @@ const SURFACES: Record = { h(RecordQuickActionsRenderer, { schema: { actions: [ - { name, label: LABEL, type: 'script', locations: ['record_header'], visible: gate }, - { name: 'print', label: COMPANION_LABEL, type: 'script', locations: ['record_header'] }, + { name, label: LABEL, type: 'script', locations: ['record_page'], visible: gate }, + { name: 'print', label: COMPANION_LABEL, type: 'script', locations: ['record_page'] }, ], } as never, }), @@ -317,8 +317,8 @@ function header(name: string, gate: unknown) { title: 'Northwind', maxVisible: 10, actions: [ - { name, label: LABEL, type: 'api', locations: ['record_header'], disabled: gate }, - { name: 'print', label: COMPANION_LABEL, type: 'api', locations: ['record_header'] }, + { name, label: LABEL, type: 'api', locations: ['record_page'], disabled: gate }, + { name: 'print', label: COMPANION_LABEL, type: 'api', locations: ['record_page'] }, ], }, }), diff --git a/ui/packages/app-shell/src/utils/__tests__/consoleServerAction.test.tsx b/ui/packages/app-shell/src/utils/__tests__/consoleServerAction.test.tsx index e42a26b3f1b..12bed9a370f 100644 --- a/ui/packages/app-shell/src/utils/__tests__/consoleServerAction.test.tsx +++ b/ui/packages/app-shell/src/utils/__tests__/consoleServerAction.test.tsx @@ -427,7 +427,7 @@ describe('the early record-id refusal is forwarded to the runner (objectui#13384 type: 'script', name: 'add_to_campaign', objectName: 'crm_lead', - locations: ['list_toolbar', 'list_item'], + locations: ['list', 'record_row'], actionParams: [{ name: 'campaign', label: 'Campaign', type: 'text', required: true }], }; const launch = () => JSON.parse(JSON.stringify(ADD_TO_CAMPAIGN)); diff --git a/ui/packages/app-shell/src/utils/__tests__/managedByEmptyState.test.ts b/ui/packages/app-shell/src/utils/__tests__/managedByEmptyState.test.ts index 243753e957c..668c2161e66 100644 --- a/ui/packages/app-shell/src/utils/__tests__/managedByEmptyState.test.ts +++ b/ui/packages/app-shell/src/utils/__tests__/managedByEmptyState.test.ts @@ -138,7 +138,7 @@ describe('resolveManagedByEmptyState', () => { const invite = { name: 'invite_user', label: 'Invite User', - locations: ['list_toolbar'], + locations: ['list'], // `requiresFeature: 'organization'` as the spec lowers it (default-on flag). visible: { dialect: 'cel', source: 'features.organization != false' }, }; @@ -152,19 +152,19 @@ describe('resolveManagedByEmptyState', () => { }); it('does not count an action placed only on rows or the record header', () => { - const rowOnly = { name: 'cancel_invitation', locations: ['list_item', 'record_header'] }; + const rowOnly = { name: 'cancel_invitation', locations: ['record'] }; const unplaced = { name: 'orphan' }; expect(listToolbarDrawsAction([rowOnly, unplaced], allowAll, {})).toBe(false); }); it('does not count an action the caller may not invoke', () => { - const gated = { name: 'create_x', locations: ['list_toolbar'], requiredPermissions: ['manage_x'] }; + const gated = { name: 'create_x', locations: ['list'], requiredPermissions: ['manage_x'] }; expect(listToolbarDrawsAction([gated], () => false, {})).toBe(false); expect(listToolbarDrawsAction([gated], allowAll, {})).toBe(true); }); it('fails closed on a `visible` that throws, as the button does', () => { - const broken = { name: 'x', locations: ['list_toolbar'], visible: { dialect: 'cel', source: 'nope.missing ==' } }; + const broken = { name: 'x', locations: ['list'], visible: { dialect: 'cel', source: 'nope.missing ==' } }; expect(listToolbarDrawsAction([broken], allowAll, {})).toBe(false); }); diff --git a/ui/packages/app-shell/src/views/InterfaceListPage.tsx b/ui/packages/app-shell/src/views/InterfaceListPage.tsx index dd07a81ac75..f8c673e2f22 100644 --- a/ui/packages/app-shell/src/views/InterfaceListPage.tsx +++ b/ui/packages/app-shell/src/views/InterfaceListPage.tsx @@ -670,12 +670,12 @@ export function InterfaceListPage({ page, className, onConfigChange, reserveEdit // The author explicitly chose these as page buttons, so surface them in // the toolbar regardless of the action's own `locations` (the action:bar // filters by location). - .map((a: any) => ({ ...a, locations: ['list_toolbar'] })) + .map((a: any) => ({ ...a, locations: ['list'] })) : []; // Typed as the `action:bar` node it is (objectui#11355), not as the // `BaseSchema` the `schema` prop accepts: a key `ActionBarSchema` does not // declare is refused here. - const buttonBar: ActionBarSchema = { type: 'action:bar', location: 'list_toolbar', actions: buttonActions, size: 'sm', variant: 'outline' }; + const buttonBar: ActionBarSchema = { type: 'action:bar', location: 'list', actions: buttonActions, size: 'sm', variant: 'outline' }; // The page's `label` and `description` are `I18nLabel`s — a string or an // inline locale map — resolved in the viewer's language (#25901). Only a page diff --git a/ui/packages/app-shell/src/views/ObjectView.bulkWiredHeaderDuplicate-12462.test.tsx b/ui/packages/app-shell/src/views/ObjectView.bulkWiredHeaderDuplicate-12462.test.tsx index fb9125ba8d5..51312b3d8c8 100644 --- a/ui/packages/app-shell/src/views/ObjectView.bulkWiredHeaderDuplicate-12462.test.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.bulkWiredHeaderDuplicate-12462.test.tsx @@ -12,7 +12,7 @@ * selection bar AND that is record-scoped. * * Measured on HotCRM's Leads list: `create_campaign` ("Add to Campaign", - * `locations: ['list_toolbar', 'list_item']`) is wired by the `all_leads` + * `locations: ['list', 'record_row']`) is wired by the `all_leads` * view's `bulkActions`, so the selection bar already carried it with rows * ticked while the header also drew it at every selection. The selection bar is * the list toolbar in its selection mode, so the action stays at its declared @@ -93,7 +93,7 @@ const CREATE_CAMPAIGN = { label: 'Add to Campaign', objectName: 'crm_lead', type: 'script', - locations: ['list_toolbar', 'list_item'], + locations: ['list', 'record_row'], params: [{ name: 'campaign', type: 'text', label: 'Campaign', required: true }], }; @@ -103,7 +103,7 @@ const REFRESH_SCORES = { label: 'Refresh Scores', objectName: 'crm_lead', type: 'script', - locations: ['list_toolbar'], + locations: ['list'], }; const LIST_VIEWS = { diff --git a/ui/packages/app-shell/src/views/ObjectView.cardFacesOpenNothing-33548.test.tsx b/ui/packages/app-shell/src/views/ObjectView.cardFacesOpenNothing-33548.test.tsx index 9fe8c459fd2..781c92c62ab 100644 --- a/ui/packages/app-shell/src/views/ObjectView.cardFacesOpenNothing-33548.test.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.cardFacesOpenNothing-33548.test.tsx @@ -122,7 +122,7 @@ function objectsWith(view: ViewShape) { objectName: OBJECT_NAME, type: 'script', target: 'revoke_credential', - locations: ['list_item', 'record_header'], + locations: ['record'], }, ], listViews: { diff --git a/ui/packages/app-shell/src/views/ObjectView.emptyStateMatchesPage-11687.test.tsx b/ui/packages/app-shell/src/views/ObjectView.emptyStateMatchesPage-11687.test.tsx index d4e58f7c736..709e1c9ca5b 100644 --- a/ui/packages/app-shell/src/views/ObjectView.emptyStateMatchesPage-11687.test.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.emptyStateMatchesPage-11687.test.tsx @@ -115,7 +115,7 @@ const SYS_INVITATION = { name: 'invite_user', label: 'Invite User', variant: 'primary', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', target: '/api/v1/auth/organization/invite-member', visible: { dialect: 'cel', source: INVITE_MEMBER_GATE }, @@ -124,7 +124,7 @@ const SYS_INVITATION = { name: 'cancel_invitation', label: 'Cancel Invitation', mode: 'delete', - locations: ['list_item'], + locations: ['record_row'], type: 'api', target: '/api/v1/auth/organization/cancel-invitation', }, @@ -156,7 +156,7 @@ const SYS_API_KEY = { name: 'revoke_api_key', label: 'Revoke API Key', mode: 'custom', - locations: ['list_item'], + locations: ['record_row'], type: 'api', method: 'PATCH', target: '/api/v1/data/sys_api_key/{id}', @@ -182,7 +182,7 @@ const SYS_OAUTH_APPLICATION = { name: 'create_oauth_application', label: 'Register OAuth Application', mode: 'create', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', target: '/api/v1/auth/oauth2/create-client', // `requiresFeature: 'oidcProvider'`, lowered (a default-on flag). diff --git a/ui/packages/app-shell/src/views/ObjectView.headerFold-12705.test.tsx b/ui/packages/app-shell/src/views/ObjectView.headerFold-12705.test.tsx index edc0fc1d050..d630eb47fa4 100644 --- a/ui/packages/app-shell/src/views/ObjectView.headerFold-12705.test.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.headerFold-12705.test.tsx @@ -124,9 +124,9 @@ import { ExpressionProvider } from '../providers/ExpressionProvider'; const USER = { id: 'u1', name: 'Ada', profile: 'admin' }; -const UPDATE_STAGE = { name: 'update_stage', label: 'Update Stage', type: 'script', locations: ['list_toolbar'] }; -const INVITE = { name: 'invite_user', label: 'Invite User', type: 'script', variant: 'primary', locations: ['list_toolbar'] }; -const CREATE_USER = { name: 'create_user', label: 'Create User', type: 'script', locations: ['list_toolbar'] }; +const UPDATE_STAGE = { name: 'update_stage', label: 'Update Stage', type: 'script', locations: ['list'] }; +const INVITE = { name: 'invite_user', label: 'Invite User', type: 'script', variant: 'primary', locations: ['list'] }; +const CREATE_USER = { name: 'create_user', label: 'Create User', type: 'script', locations: ['list'] }; /** An opportunity-like list: New, Import, one toolbar action. */ const OPPORTUNITY = { @@ -300,7 +300,7 @@ describe('the object list’s header folds its actions (objectui#12705)', () => type: 'url', target: 'https://example.test/report', openIn: 'new-tab', - locations: ['list_toolbar'], + locations: ['list'], }; headerWidth = 400; const { cluster } = renderList({ ...OPPORTUNITY, actions: [UPDATE_STAGE, OPEN_REPORT] }, '?runAction=open_report'); @@ -319,7 +319,7 @@ describe('the object list’s header folds its actions (objectui#12705)', () => * header keeps `actions` at every width and the description truncates instead. */ describe('a list with no declared primary keeps its actions labelled (objectstack#33988)', () => { - const LAUNCH = { name: 'launch_contract', label: 'Launch Contract', type: 'script', locations: ['list_toolbar'] }; + const LAUNCH = { name: 'launch_contract', label: 'Launch Contract', type: 'script', locations: ['list'] }; /** The card's object: no New for the reader, one undeclared toolbar action, its English description. */ const CONTRACTS = { name: 'demo_contract', @@ -359,6 +359,6 @@ describe('declaredPrimaryToolbarAction (objectui#12705)', () => { expect(declaredPrimaryToolbarAction([CREATE_USER, INVITE] as any)?.name).toBe('invite_user'); expect(declaredPrimaryToolbarAction([CREATE_USER, late, early] as any)?.name).toBe('early'); expect(declaredPrimaryToolbarAction([CREATE_USER, UPDATE_STAGE] as any)).toBeUndefined(); - expect(declaredPrimaryToolbarAction([{ ...INVITE, locations: ['record_header'] }] as any)).toBeUndefined(); + expect(declaredPrimaryToolbarAction([{ ...INVITE, locations: ['record_page'] }] as any)).toBeUndefined(); }); }); diff --git a/ui/packages/app-shell/src/views/ObjectView.headerSelectionGate-27831.test.tsx b/ui/packages/app-shell/src/views/ObjectView.headerSelectionGate-27831.test.tsx index 15d274e1bef..540c03235b1 100644 --- a/ui/packages/app-shell/src/views/ObjectView.headerSelectionGate-27831.test.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.headerSelectionGate-27831.test.tsx @@ -98,7 +98,7 @@ const REASSIGN = { objectName: 'showcase_task', type: 'flow', target: 'showcase_reassign_wizard', - locations: ['list_item', 'list_toolbar'], + locations: ['record_row', 'list'], refreshAfter: true, }; @@ -108,7 +108,7 @@ const EXPORT_TASKS = { label: 'Export Tasks', objectName: 'showcase_task', type: 'script', - locations: ['list_toolbar'], + locations: ['list'], }; const REASSIGN_URL = '/api/v1/actions/showcase_task/showcase_bulk_reassign'; diff --git a/ui/packages/app-shell/src/views/ObjectView.inviteFeedback-11817.test.tsx b/ui/packages/app-shell/src/views/ObjectView.inviteFeedback-11817.test.tsx index 49350510782..30d10bb0bb2 100644 --- a/ui/packages/app-shell/src/views/ObjectView.inviteFeedback-11817.test.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.inviteFeedback-11817.test.tsx @@ -119,7 +119,7 @@ function inviteUser(successMessage: string) { name: 'invite_user', label: 'Invite User', variant: 'primary', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', target: '/api/v1/auth/organization/invite-member', visible: { dialect: 'cel', source: INVITE_MEMBER_GATE }, @@ -149,7 +149,7 @@ function sysUser(inviteCopy = 'Invitation sent') { { name: 'ban_user', label: 'Ban User', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', target: '/api/v1/auth/admin/ban-user', description: 'Ban this user? They will be signed out and unable to sign in until unbanned.', diff --git a/ui/packages/app-shell/src/views/ObjectView.inviteOutcome-27797.test.tsx b/ui/packages/app-shell/src/views/ObjectView.inviteOutcome-27797.test.tsx index 042c14a69f1..6c241efab55 100644 --- a/ui/packages/app-shell/src/views/ObjectView.inviteOutcome-27797.test.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.inviteOutcome-27797.test.tsx @@ -131,7 +131,7 @@ const SYS_INVITATION = { { name: 'invite_user', label: 'Invite User', - locations: ['list_toolbar'], + locations: ['list'], type: 'api', target: '/api/v1/auth/organization/invite-member', params: [ @@ -153,7 +153,7 @@ const SYS_INVITATION = { { name: 'resend_invitation', label: 'Resend Invitation', - locations: ['list_item'], + locations: ['record_row'], type: 'api', target: '/api/v1/auth/organization/invite-member', params: [ @@ -173,7 +173,7 @@ const SYS_INVITATION = { { name: 'copy_invitation_link', label: 'Copy Invite Link', - locations: ['list_item', 'record_header'], + locations: ['record'], type: 'script', target: 'copy_invitation_link', variant: 'secondary', diff --git a/ui/packages/app-shell/src/views/ObjectView.listActionsReadGate-12109.test.tsx b/ui/packages/app-shell/src/views/ObjectView.listActionsReadGate-12109.test.tsx index 0dda4bcc3e7..a1e08cabcc8 100644 --- a/ui/packages/app-shell/src/views/ObjectView.listActionsReadGate-12109.test.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.listActionsReadGate-12109.test.tsx @@ -14,7 +14,7 @@ * no read on `crm_opportunity` was shown "Update Stage" over the opportunity * list's "You don't have access". That entry is not a navigation item: it is * HotCRM's `MassUpdateStageAction` (`objectName: 'crm_opportunity'`, - * `locations: ['list_toolbar']`), drawn by THIS page's schema-driven toolbar. + * `locations: ['list']`), drawn by THIS page's schema-driven toolbar. * The fixture carries the keys of that declaration this toolbar reads. * * The verdict is the REAL `MePermissionsProvider`'s, holding the caller's @@ -100,7 +100,7 @@ const UPDATE_STAGE = { label: 'Update Stage', objectName: OBJECT_NAME, type: 'script', - locations: ['list_toolbar'], + locations: ['list'], }; const OBJECTS = [ diff --git a/ui/packages/app-shell/src/views/ObjectView.listOnlyRecordPage-33219.test.tsx b/ui/packages/app-shell/src/views/ObjectView.listOnlyRecordPage-33219.test.tsx index 4ae28a59b2b..388045be5b2 100644 --- a/ui/packages/app-shell/src/views/ObjectView.listOnlyRecordPage-33219.test.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.listOnlyRecordPage-33219.test.tsx @@ -107,7 +107,7 @@ const OBJECTS = [ objectName: OBJECT_NAME, type: 'script', target: 'revoke_credential', - locations: ['list_item', 'record_header'], + locations: ['record'], }, ], listViews: { diff --git a/ui/packages/app-shell/src/views/ObjectView.objectBoundActions-7234.test.tsx b/ui/packages/app-shell/src/views/ObjectView.objectBoundActions-7234.test.tsx index 3628bc4bf3d..151a6ba4077 100644 --- a/ui/packages/app-shell/src/views/ObjectView.objectBoundActions-7234.test.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.objectBoundActions-7234.test.tsx @@ -184,7 +184,7 @@ const APPLY_TO_PEOPLE = { objectName: OBJECT_NAME, type: 'script', label: 'Apply to people', - locations: ['list_toolbar'], + locations: ['list'], }; /** The same declaration as the app that found this ships it: capability-gated. */ @@ -276,7 +276,7 @@ describe('objectui#7234 — object-declared actions reach the list toolbar', () }); it('C (control): the same action at record_header only is not on this toolbar', async () => { - renderList(objectsWithActions([{ ...APPLY_TO_PEOPLE, locations: ['record_header'] }])); + renderList(objectsWithActions([{ ...APPLY_TO_PEOPLE, locations: ['record_page'] }])); await settle(); expect(toolbarButton()).toBeNull(); }); diff --git a/ui/packages/app-shell/src/views/ObjectView.recordRelatedNotOnOwnList-11270.test.tsx b/ui/packages/app-shell/src/views/ObjectView.recordRelatedNotOnOwnList-11270.test.tsx index 9b81f862ffb..61e0b96af2b 100644 --- a/ui/packages/app-shell/src/views/ObjectView.recordRelatedNotOnOwnList-11270.test.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.recordRelatedNotOnOwnList-11270.test.tsx @@ -94,9 +94,9 @@ const OBJECT_NAME = 'task'; /** The same child actions the positive half places on related-list rows. */ const ACTIONS = [ - { name: 'send_reminder', label: 'Send Reminder', type: 'api', target: '/api/remind', locations: ['list_item'] }, + { name: 'send_reminder', label: 'Send Reminder', type: 'api', target: '/api/remind', locations: ['record_row'] }, { name: 'log_time', label: 'Log Time', type: 'form', target: 'task.edit', locations: ['record_related'] }, - { name: 'archive', label: 'Archive', type: 'api', target: '/api/archive', locations: ['list_item', 'record_related'] }, + { name: 'archive', label: 'Archive', type: 'api', target: '/api/archive', locations: ['record_row', 'record_related'] }, ]; const OBJECTS = [ diff --git a/ui/packages/app-shell/src/views/ObjectView.rowOpensNothing-33317.test.tsx b/ui/packages/app-shell/src/views/ObjectView.rowOpensNothing-33317.test.tsx index 3464b487619..84965953083 100644 --- a/ui/packages/app-shell/src/views/ObjectView.rowOpensNothing-33317.test.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.rowOpensNothing-33317.test.tsx @@ -110,7 +110,7 @@ function objectsWith(navigation?: AuthoredNavigation) { objectName: OBJECT_NAME, type: 'script', target: 'revoke_credential', - locations: ['list_item', 'record_header'], + locations: ['record'], }, ], listViews: { diff --git a/ui/packages/app-shell/src/views/ObjectView.toolbarScriptSelection-12331.test.tsx b/ui/packages/app-shell/src/views/ObjectView.toolbarScriptSelection-12331.test.tsx index d34a56581da..c898a3aed81 100644 --- a/ui/packages/app-shell/src/views/ObjectView.toolbarScriptSelection-12331.test.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.toolbarScriptSelection-12331.test.tsx @@ -320,7 +320,7 @@ const HOTCRM_CREATE_CAMPAIGN = { label: 'Add to Campaign', objectName: 'crm_lead', type: 'script', - locations: ['list_toolbar', 'list_item'], + locations: ['list', 'record_row'], successMessage: 'Leads added to campaign!', refreshAfter: true, params: [{ field: 'crm_campaign', objectOverride: 'crm_campaign_member', label: 'Campaign', required: true }], diff --git a/ui/packages/app-shell/src/views/RecordDetailView.accessEndedAfterDecision-26589.test.tsx b/ui/packages/app-shell/src/views/RecordDetailView.accessEndedAfterDecision-26589.test.tsx index a79727ef10d..d747c2e85ca 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.accessEndedAfterDecision-26589.test.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.accessEndedAfterDecision-26589.test.tsx @@ -142,7 +142,7 @@ const SYS_APPROVAL_REQUEST_DEF = { target: '/api/v1/approvals/requests/{id}/approve', params: [{ name: 'comment', label: 'Comment', type: 'textarea', required: false }], visible: 'record.viewer.can_act || record.viewer.can_override', - locations: ['record_section', 'list_item'], + locations: ['record_section', 'record_row'], successMessage: 'Approved.', refreshAfter: true, }, { @@ -151,7 +151,7 @@ const SYS_APPROVAL_REQUEST_DEF = { params: [{ name: 'comment', label: 'Comment', type: 'textarea', required: false }], visible: 'record.viewer.can_act || record.viewer.can_override', confirmText: 'Reject this request?', - locations: ['record_section', 'list_item'], + locations: ['record_section', 'record_row'], successMessage: 'Rejected.', refreshAfter: true, }, ], diff --git a/ui/packages/app-shell/src/views/RecordDetailView.accessibleNames-12625.test.tsx b/ui/packages/app-shell/src/views/RecordDetailView.accessibleNames-12625.test.tsx index cf9233b445b..7c3f78c56c9 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.accessibleNames-12625.test.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.accessibleNames-12625.test.tsx @@ -73,7 +73,7 @@ const headerAction = (name: string, label: string) => ({ label, type: 'api', target: '/api/v1/noop', - locations: ['record_header'], + locations: ['record_page'], }); const LEAD = { diff --git a/ui/packages/app-shell/src/views/RecordDetailView.actionLayout-36366.test.tsx b/ui/packages/app-shell/src/views/RecordDetailView.actionLayout-36366.test.tsx index adc3e869fcc..2a2fabb164d 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.actionLayout-36366.test.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.actionLayout-36366.test.tsx @@ -52,10 +52,10 @@ import { DesignModeProvider } from '../layout/designMode'; const RECORD_ID = 'rec-1'; -const CONVERT = { name: 'convert', label: 'Convert', type: 'url', target: 'https://example.com/c', locations: ['record_header'], order: 1 }; -const MARK_WON = { name: 'mark_won', label: 'Mark Won', type: 'url', target: 'https://example.com/w', locations: ['record_header'], order: 2 }; -const SHARE = { name: 'share', label: 'Share', type: 'url', target: 'https://example.com/s', locations: ['record_header'], order: 3 }; -const LOG_CALL = { name: 'log_call', label: 'Log Call', type: 'url', target: 'https://example.com/l', locations: ['record_more'], order: 4 }; +const CONVERT = { name: 'convert', label: 'Convert', type: 'url', target: 'https://example.com/c', locations: ['record_page'], order: 1 }; +const MARK_WON = { name: 'mark_won', label: 'Mark Won', type: 'url', target: 'https://example.com/w', locations: ['record_page'], order: 2 }; +const SHARE = { name: 'share', label: 'Share', type: 'url', target: 'https://example.com/s', locations: ['record_page'], order: 3 }; +const LOG_CALL = { name: 'log_call', label: 'Log Call', type: 'url', target: 'https://example.com/l', locations: ['record_page'], component: 'action:menu', order: 4 }; const ACTIONS = [CONVERT, MARK_WON, SHARE, LOG_CALL]; const LABELS = ACTIONS.map((a) => a.label); diff --git a/ui/packages/app-shell/src/views/RecordDetailView.apiNewTabUrl-26747.test.tsx b/ui/packages/app-shell/src/views/RecordDetailView.apiNewTabUrl-26747.test.tsx index eaed37fd078..e0a4b54771d 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.apiNewTabUrl-26747.test.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.apiNewTabUrl-26747.test.tsx @@ -81,7 +81,7 @@ const newTabAction = (name: string, label: string) => ({ target: TARGET, opensInNewTab: true, newTabUrl: '/export/{recordId}', - locations: ['record_header'], + locations: ['record_page'], }); const urlAction = (name: string, label: string) => ({ @@ -89,7 +89,7 @@ const urlAction = (name: string, label: string) => ({ label, type: 'url', target: `https://example.com/${name}`, - locations: ['record_header'], + locations: ['record_page'], }); async function mountRecordPage(actions: unknown[]) { diff --git a/ui/packages/app-shell/src/views/RecordDetailView.approvalDeclaredActions.test.tsx b/ui/packages/app-shell/src/views/RecordDetailView.approvalDeclaredActions.test.tsx index b86e9afbd20..b114bfb082b 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.approvalDeclaredActions.test.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.approvalDeclaredActions.test.tsx @@ -185,7 +185,7 @@ const SYS_APPROVAL_REQUEST_DEF = { { name: 'attachments', label: 'Attachments', type: 'file', multiple: true, required: false }, ], visible: 'record.viewer.can_act || record.viewer.can_override', - locations: ['record_section', 'list_item'], + locations: ['record_section', 'record_row'], successMessage: 'Approved.', refreshAfter: true, }, { @@ -197,7 +197,7 @@ const SYS_APPROVAL_REQUEST_DEF = { ], visible: 'record.viewer.can_act || record.viewer.can_override', confirmText: 'Reject this request? A rejection is final for every approver.', - locations: ['record_section', 'list_item'], + locations: ['record_section', 'record_row'], successMessage: 'Rejected.', refreshAfter: true, }, { diff --git a/ui/packages/app-shell/src/views/RecordDetailView.authoredPageDesktopOnly-36150.test.tsx b/ui/packages/app-shell/src/views/RecordDetailView.authoredPageDesktopOnly-36150.test.tsx index 3a7477d2a1b..00d573f92cc 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.authoredPageDesktopOnly-36150.test.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.authoredPageDesktopOnly-36150.test.tsx @@ -68,7 +68,7 @@ const RECORD_ID = 'rec-1'; const AUTHORED_MARK = 'Authored page block'; const SLOT_MARK = 'Slotted alert'; -const MORE_ACTION = { name: 'qa_recalc', label: 'Recalculate', type: 'api', target: '/api/v1/x', locations: ['record_section', 'record_more'] }; +const MORE_ACTION = { name: 'qa_recalc', label: 'Recalculate', type: 'api', target: '/api/v1/x', locations: ['record_section', 'record_page'], component: 'action:menu' }; function objectDef(name: string) { return { diff --git a/ui/packages/app-shell/src/views/RecordDetailView.childWriteRefreshesParent-12244.test.tsx b/ui/packages/app-shell/src/views/RecordDetailView.childWriteRefreshesParent-12244.test.tsx index 463e22ba496..34effa74f58 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.childWriteRefreshesParent-12244.test.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.childWriteRefreshesParent-12244.test.tsx @@ -415,7 +415,7 @@ describe('RecordDetailView — a header action with `refreshAfter` refreshes the type: 'api', target: '/api/v1/quotes/add-line', recordIdParam: 'quoteId', - locations: ['record_header'], + locations: ['record_page'], refreshAfter: true, }, ], diff --git a/ui/packages/app-shell/src/views/RecordDetailView.designModeTabs-36737.test.tsx b/ui/packages/app-shell/src/views/RecordDetailView.designModeTabs-36737.test.tsx index 5c5f1705d62..d01417fb6d0 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.designModeTabs-36737.test.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.designModeTabs-36737.test.tsx @@ -75,7 +75,7 @@ import { DesignModeProvider, useDesignModeController } from '../layout/designMod import { DesignModeBar } from '../layout/DesignModeBar'; const RECORD_ID = 'rec-1'; -const SHARE = { name: 'share', label: 'Share', type: 'url', target: 'https://example.com/s', locations: ['record_more'], order: 3 }; +const SHARE = { name: 'share', label: 'Share', type: 'url', target: 'https://example.com/s', locations: ['record_page'], component: 'action:menu', order: 3 }; const OBJECTS = [ { diff --git a/ui/packages/app-shell/src/views/RecordDetailView.flowActionDoor-12037.test.tsx b/ui/packages/app-shell/src/views/RecordDetailView.flowActionDoor-12037.test.tsx index 6df1ab35b46..68253878d81 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.flowActionDoor-12037.test.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.flowActionDoor-12037.test.tsx @@ -88,7 +88,7 @@ const CHILD_ACTION = { label: 'Escalate', type: 'flow', target: 'escalate_task_flow', - locations: ['list_item'], + locations: ['record_row'], requiredPermissions: ['lead_task.escalate'], }; /** Declared on this page's object, offered in the header. */ @@ -97,7 +97,7 @@ const HEADER_ACTION = { label: 'Qualify', type: 'flow', target: 'qualify_lead_wizard', - locations: ['record_header'], + locations: ['record_page'], }; const OBJECTS = [ { @@ -223,7 +223,7 @@ describe('objectui#12037 — record-page flow clicks on a declared action use th const runner = await mountRunner(); authFetchSpy.mockResolvedValue(answered({ success: true, status: 'completed' })); - const { url, body } = await run(runner, { ...CHILD_ACTION, locations: ['list_toolbar'], objectName: CHILD }); + const { url, body } = await run(runner, { ...CHILD_ACTION, locations: ['list'], objectName: CHILD }); expect(url).toBe(`/api/v1/actions/${CHILD}/escalate_task`); expect(body).toEqual({ params: {} }); diff --git a/ui/packages/app-shell/src/views/RecordDetailView.headerActionLookupPredicate.test.tsx b/ui/packages/app-shell/src/views/RecordDetailView.headerActionLookupPredicate.test.tsx index 268b4fac31f..ca85bb32e9e 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.headerActionLookupPredicate.test.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.headerActionLookupPredicate.test.tsx @@ -152,7 +152,7 @@ const headerAction = (name: string, visible: unknown) => ({ label: name, type: 'api', target: '/api/v1/noop', - locations: ['record_header'], + locations: ['record_page'], visible, }); diff --git a/ui/packages/app-shell/src/views/RecordDetailView.headerMenuIcons-12529.test.tsx b/ui/packages/app-shell/src/views/RecordDetailView.headerMenuIcons-12529.test.tsx index b76e583c90f..00c217dbfb7 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.headerMenuIcons-12529.test.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.headerMenuIcons-12529.test.tsx @@ -76,7 +76,7 @@ const appAction = (name: string, label: string) => ({ label, type: 'url', target: `https://example.com/${name}`, - locations: ['record_header'], + locations: ['record_page'], }); function objectsWith(actions: unknown[]) { diff --git a/ui/packages/app-shell/src/views/RecordDetailView.phoneFace-27058.test.tsx b/ui/packages/app-shell/src/views/RecordDetailView.phoneFace-27058.test.tsx index c055be3ea8a..e7ae0ee27d8 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.phoneFace-27058.test.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.phoneFace-27058.test.tsx @@ -88,7 +88,7 @@ const action = (name: string, label: string) => ({ label, type: 'api', target: '/api/v1/noop', - locations: ['record_header'], + locations: ['record_page'], }); function objectsWith(actions: unknown[]) { diff --git a/ui/packages/app-shell/src/views/RecordDetailView.placedHeaderActions-29951.test.tsx b/ui/packages/app-shell/src/views/RecordDetailView.placedHeaderActions-29951.test.tsx index f379bdf58dd..ccdaea08abc 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.placedHeaderActions-29951.test.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.placedHeaderActions-29951.test.tsx @@ -71,14 +71,14 @@ import { FavoritesProvider } from '../context/FavoritesProvider'; const RECORD_ID = 'rec-1'; // The platform's own header actions, as `sys_user` places them. -const BAN_USER = { name: 'ban_user', label: 'Ban User', type: 'api', target: '/api/v1/x', locations: ['list_item', 'record_header'] }; -const IMPERSONATE = { name: 'impersonate_user', label: 'Impersonate User', type: 'api', target: '/api/v1/y', locations: ['record_more'] }; +const BAN_USER = { name: 'ban_user', label: 'Ban User', type: 'api', target: '/api/v1/x', locations: ['record'] }; +const IMPERSONATE = { name: 'impersonate_user', label: 'Impersonate User', type: 'api', target: '/api/v1/y', locations: ['record_page'], component: 'action:menu' }; // Placed elsewhere: never a header action. -const LIST_ONLY = { name: 'export_users', label: 'Export Users', type: 'api', target: '/api/v1/z', locations: ['list_toolbar'] }; +const LIST_ONLY = { name: 'export_users', label: 'Export Users', type: 'api', target: '/api/v1/z', locations: ['list'] }; const SECTION_ONLY = { name: 'reset_mfa', label: 'Reset MFA', type: 'api', target: '/api/v1/w', locations: ['record_section'] }; // What another package adds to `sys_user` (the folded registry appends it). -const PACKAGED_URL = { name: 'qa_open_profile', label: 'Open Profile', type: 'url', target: 'https://example.com/u', locations: ['record_header'], _packageId: 'com.qa.hdr' }; -const PACKAGED_MORE = { name: 'qa_profile_link', label: 'Copy Profile Link', type: 'url', target: 'https://example.com/l', locations: ['record_more'], _packageId: 'com.qa.hdr' }; +const PACKAGED_URL = { name: 'qa_open_profile', label: 'Open Profile', type: 'url', target: 'https://example.com/u', locations: ['record_page'], _packageId: 'com.qa.hdr' }; +const PACKAGED_MORE = { name: 'qa_profile_link', label: 'Copy Profile Link', type: 'url', target: 'https://example.com/l', locations: ['record_page'], component: 'action:menu', _packageId: 'com.qa.hdr' }; const ACTIONS = [BAN_USER, IMPERSONATE, LIST_ONLY, SECTION_ONLY, PACKAGED_URL, PACKAGED_MORE]; diff --git a/ui/packages/app-shell/src/views/RecordDetailView.printPageHeaderActions-12906.test.tsx b/ui/packages/app-shell/src/views/RecordDetailView.printPageHeaderActions-12906.test.tsx index 9c1dcad1105..05622171266 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.printPageHeaderActions-12906.test.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.printPageHeaderActions-12906.test.tsx @@ -105,7 +105,7 @@ const OBJECTS = [ type: 'api', method: 'POST', target: SUBMIT_TARGET, - locations: ['record_header'], + locations: ['record_page'], }, ], }, diff --git a/ui/packages/app-shell/src/views/RecordDetailView.tsx b/ui/packages/app-shell/src/views/RecordDetailView.tsx index 2528c3e2e0d..4e7cf1b770f 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.tsx @@ -5370,7 +5370,7 @@ export function RecordDetailView({ dataSource, objects, onEdit, objectNameOverri label: t('detail.claim', { defaultValue: 'Claim' }), icon: 'hand', type: 'script', - locations: ['record_header'], + locations: ['record_page'], order: 95, disabled: claiming, onClick: handleClaim, @@ -5387,7 +5387,7 @@ export function RecordDetailView({ dataSource, objects, onEdit, objectNameOverri label: t('detail.cancel', { defaultValue: 'Cancel' }), icon: 'x', type: 'script', - locations: ['record_header'], + locations: ['record_page'], variant: 'outline', order: 99, disabled: recordEditSaving, @@ -5400,7 +5400,7 @@ export function RecordDetailView({ dataSource, objects, onEdit, objectNameOverri : t('detail.save', { defaultValue: 'Save' }), icon: 'check', type: 'script', - locations: ['record_header'], + locations: ['record_page'], // objectstack#35816 — Save is the edit state's one filled button, and // keeps its place after Cancel, as a form's footer orders them. variant: 'primary', @@ -5437,7 +5437,7 @@ export function RecordDetailView({ dataSource, objects, onEdit, objectNameOverri // to read. icon: 'pencil', type: 'script', - locations: ['record_header'], + locations: ['record_page'], order: 100, // objectui#2572 item 4 — while a shared inline-edit draft is live, // the page:header renderer greys this CTA out so the classic form @@ -5508,7 +5508,7 @@ export function RecordDetailView({ dataSource, objects, onEdit, objectNameOverri : t('common.addToFavorites', { defaultValue: 'Add to favorites' }), icon: 'star', type: 'script', - locations: ['record_header'], + locations: ['record_page'], variant: 'outline', order: 105, component: 'action:menu', @@ -5520,7 +5520,7 @@ export function RecordDetailView({ dataSource, objects, onEdit, objectNameOverri label: t('detail.share', { defaultValue: 'Share' }), icon: 'share', type: 'script', - locations: ['record_header'], + locations: ['record_page'], variant: 'outline', order: 110, component: 'action:menu', @@ -5572,7 +5572,7 @@ export function RecordDetailView({ dataSource, objects, onEdit, objectNameOverri label: t('console.changeOwner.title', { defaultValue: 'Change Owner' }), icon: 'user-cog', type: 'script', - locations: ['record_header'], + locations: ['record_page'], variant: 'outline', order: 112, component: 'action:menu', @@ -5589,7 +5589,7 @@ export function RecordDetailView({ dataSource, objects, onEdit, objectNameOverri label: t('detail.openAsFullPage', { defaultValue: 'Open as full page' }), icon: 'arrow-up-right', type: 'script', - locations: ['record_header'], + locations: ['record_page'], variant: 'outline', order: 115, component: 'action:menu', @@ -5604,7 +5604,7 @@ export function RecordDetailView({ dataSource, objects, onEdit, objectNameOverri label: t('detail.copyRecordId', { defaultValue: 'Copy record ID' }), icon: 'copy', type: 'script', - locations: ['record_header'], + locations: ['record_page'], variant: 'outline', order: 113, component: 'action:menu', @@ -5628,7 +5628,7 @@ export function RecordDetailView({ dataSource, objects, onEdit, objectNameOverri // destructive entry apart at the bottom of the menu (objectui#12529). icon: 'trash', type: 'script', - locations: ['record_header'], + locations: ['record_page'], variant: 'danger', order: 120, component: 'action:menu', diff --git a/ui/packages/app-shell/src/views/RecordDetailView.updateActionRefresh-29935.test.tsx b/ui/packages/app-shell/src/views/RecordDetailView.updateActionRefresh-29935.test.tsx index 5737ba0d22b..758201da2be 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.updateActionRefresh-29935.test.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.updateActionRefresh-29935.test.tsx @@ -109,7 +109,7 @@ const resolveTicket = { type: 'script', operation: 'update', patch: { status: 'resolved' }, - locations: ['record_header'], + locations: ['record_page'], visible: 'record.status != "resolved" && record.status != "closed"', successMessage: 'Ticket resolved.', refreshAfter: false, @@ -121,7 +121,7 @@ const notifyOwner = { label: 'Notify owner', objectName: OBJECT_NAME, type: 'script', - locations: ['record_header'], + locations: ['record_page'], successMessage: 'Owner notified.', refreshAfter: false, }; diff --git a/ui/packages/app-shell/src/views/__tests__/DeclaredActionsBar.test.tsx b/ui/packages/app-shell/src/views/__tests__/DeclaredActionsBar.test.tsx index cd07334d71a..3500ae61130 100644 --- a/ui/packages/app-shell/src/views/__tests__/DeclaredActionsBar.test.tsx +++ b/ui/packages/app-shell/src/views/__tests__/DeclaredActionsBar.test.tsx @@ -118,7 +118,7 @@ const ACTIONS = [ { name: 'approval_bulk', type: 'api', label: 'Bulk', target: '/api/v1/approvals/bulk', - locations: ['list_toolbar'], + locations: ['list'], }, ]; diff --git a/ui/packages/app-shell/src/views/__tests__/PageView.listViewAddRecord-13089.test.tsx b/ui/packages/app-shell/src/views/__tests__/PageView.listViewAddRecord-13089.test.tsx index b09c5938e82..a522440288c 100644 --- a/ui/packages/app-shell/src/views/__tests__/PageView.listViewAddRecord-13089.test.tsx +++ b/ui/packages/app-shell/src/views/__tests__/PageView.listViewAddRecord-13089.test.tsx @@ -89,8 +89,8 @@ const OBJECTS = [ fields: FIELDS, // One of each placement, so a served executor would show up as a key. actions: [ - { name: 'invite_user', label: 'Invite user', type: 'api', target: '/api/v1/org/invite', locations: ['list_toolbar'] }, - { name: 'remove', label: 'Remove', type: 'api', target: '/api/v1/members/{id}/remove', locations: ['list_item'] }, + { name: 'invite_user', label: 'Invite user', type: 'api', target: '/api/v1/org/invite', locations: ['list'] }, + { name: 'remove', label: 'Remove', type: 'api', target: '/api/v1/members/{id}/remove', locations: ['record_row'] }, ], }, { name: PAGE_MODE, label: 'Contract', editMode: 'page', fields: { name: FIELDS.name } }, diff --git a/ui/packages/app-shell/src/views/__tests__/PageView.relatedListActions-12870.test.tsx b/ui/packages/app-shell/src/views/__tests__/PageView.relatedListActions-12870.test.tsx index c53d625ec72..39f44a5b424 100644 --- a/ui/packages/app-shell/src/views/__tests__/PageView.relatedListActions-12870.test.tsx +++ b/ui/packages/app-shell/src/views/__tests__/PageView.relatedListActions-12870.test.tsx @@ -73,9 +73,9 @@ const CHILD = 'sys_member'; * `list_item` row action. */ const CHILD_ACTIONS = [ - { name: 'invite_user', label: 'Invite user', type: 'api', target: '/api/v1/org/invite', locations: ['list_toolbar'] }, + { name: 'invite_user', label: 'Invite user', type: 'api', target: '/api/v1/org/invite', locations: ['list'] }, { name: 'change_role', label: 'Change role', type: 'api', target: '/api/v1/members/{id}/role', locations: ['record_related'] }, - { name: 'remove', label: 'Remove', type: 'api', target: '/api/v1/members/{id}/remove', locations: ['list_item'] }, + { name: 'remove', label: 'Remove', type: 'api', target: '/api/v1/members/{id}/remove', locations: ['record_row'] }, ]; const OBJECTS = [ diff --git a/ui/packages/app-shell/src/views/__tests__/RelatedRecordActionsBridge.blankVisible-11294.test.tsx b/ui/packages/app-shell/src/views/__tests__/RelatedRecordActionsBridge.blankVisible-11294.test.tsx index c059bc0b509..b97fe452b05 100644 --- a/ui/packages/app-shell/src/views/__tests__/RelatedRecordActionsBridge.blankVisible-11294.test.tsx +++ b/ui/packages/app-shell/src/views/__tests__/RelatedRecordActionsBridge.blankVisible-11294.test.tsx @@ -71,7 +71,7 @@ const both = (row: 'record_related' | 'list_item') => ['list_toolbar', row]; */ const ROW_ONLY_BLANK = ' '; const CHILD_ACTIONS = [ - { name: 'send_reminder', label: 'Send Reminder', type: 'api', target: '/api/remind', locations: ['list_item'] }, + { name: 'send_reminder', label: 'Send Reminder', type: 'api', target: '/api/remind', locations: ['record_row'] }, { name: 'blank_rr', label: 'Blank RR', type: 'api', target: '/api/b1', locations: both('record_related'), visible: ' ' }, { name: 'blank_li', label: 'Blank LI', type: 'api', target: '/api/b2', locations: both('list_item'), visible: ' ' }, { name: 'empty_rr', label: 'Empty RR', type: 'api', target: '/api/e1', locations: both('record_related'), visible: '' }, diff --git a/ui/packages/app-shell/src/views/__tests__/RelatedRecordActionsBridge.recordRelated-11270.test.tsx b/ui/packages/app-shell/src/views/__tests__/RelatedRecordActionsBridge.recordRelated-11270.test.tsx index c027d4e430b..8eec9fad192 100644 --- a/ui/packages/app-shell/src/views/__tests__/RelatedRecordActionsBridge.recordRelated-11270.test.tsx +++ b/ui/packages/app-shell/src/views/__tests__/RelatedRecordActionsBridge.recordRelated-11270.test.tsx @@ -63,10 +63,10 @@ const CHILD_NAME = 'task'; * `archive` declares both, so it must render once. */ const CHILD_ACTIONS = [ - { name: 'send_reminder', label: 'Send Reminder', type: 'api', target: '/api/remind', locations: ['list_item'] }, + { name: 'send_reminder', label: 'Send Reminder', type: 'api', target: '/api/remind', locations: ['record_row'] }, { name: 'log_time', label: 'Log Time', type: 'form', target: 'task.edit', locations: ['record_related'] }, - { name: 'archive', label: 'Archive', type: 'api', target: '/api/archive', locations: ['list_item', 'record_related'] }, - { name: 'header_only', label: 'Header Only', type: 'api', target: '/api/h', locations: ['record_header'] }, + { name: 'archive', label: 'Archive', type: 'api', target: '/api/archive', locations: ['record_row', 'record_related'] }, + { name: 'header_only', label: 'Header Only', type: 'api', target: '/api/h', locations: ['record_page'] }, ]; const CHILD = { diff --git a/ui/packages/app-shell/src/views/metadata-admin/MetadataTypeActions.confirmDialog-13333.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/MetadataTypeActions.confirmDialog-13333.test.tsx index f82b0cd4307..3174e469506 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/MetadataTypeActions.confirmDialog-13333.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/MetadataTypeActions.confirmDialog-13333.test.tsx @@ -41,7 +41,7 @@ const PURGE = { type: 'api' as const, target: '/api/v1/datasources/${ctx.recordId}/purge', confirmText: 'Every cached row of this datasource is dropped.', - locations: ['record_header', 'list_toolbar'], + locations: ['record_page', 'list'], }; const nativeConfirm = vi.fn(() => true); diff --git a/ui/packages/app-shell/src/views/metadata-admin/MetadataTypeActions.paramDialogClose-6473.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/MetadataTypeActions.paramDialogClose-6473.test.tsx index 5a9b8289e6a..89db853b0a5 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/MetadataTypeActions.paramDialogClose-6473.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/MetadataTypeActions.paramDialogClose-6473.test.tsx @@ -129,7 +129,7 @@ const ACTION = { label: 'Sync datasource', type: 'api', target: '/api/v1/datasources/${ctx.recordId}/sync', - locations: ['record_header'], + locations: ['record_page'], params: PARAMS, }; diff --git a/ui/packages/app-shell/src/views/metadata-admin/MetadataTypeActions.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/MetadataTypeActions.test.tsx index 85e5890b224..f731ad47fa1 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/MetadataTypeActions.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/MetadataTypeActions.test.tsx @@ -63,8 +63,8 @@ describe('MetadataTypeActions', () => { recordId="ds1" entry={{ actions: [ - { name: 'here', label: 'Here', type: 'api', target: '/x', locations: ['record_header'] }, - { name: 'elsewhere', label: 'Elsewhere', type: 'api', target: '/x', locations: ['list_toolbar'] }, + { name: 'here', label: 'Here', type: 'api', target: '/x', locations: ['record_page'] }, + { name: 'elsewhere', label: 'Elsewhere', type: 'api', target: '/x', locations: ['list'] }, { name: 'undeclared', label: 'Undeclared', type: 'api', target: '/x' }, ], }} @@ -91,7 +91,7 @@ describe('MetadataTypeActions', () => { , ); fireEvent.click(screen.getByTitle('Test')); @@ -106,7 +106,7 @@ describe('MetadataTypeActions', () => { , ); fireEvent.click(screen.getByTitle('Sync')); @@ -124,7 +124,7 @@ describe('MetadataTypeActions', () => { , ); fireEvent.click(screen.getByTitle('Probe')); @@ -149,7 +149,7 @@ describe('MetadataTypeActions', () => { , ); fireEvent.click(screen.getByTitle('Probe')); @@ -171,7 +171,7 @@ describe('MetadataTypeActions', () => { , ); fireEvent.click(screen.getByTitle('Probe')); @@ -192,7 +192,7 @@ describe('MetadataTypeActions', () => { , ); fireEvent.click(screen.getByTitle('Probe')); diff --git a/ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.actionServedRows-35650.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.actionServedRows-35650.test.tsx index 103553085d4..f7338f38acc 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.actionServedRows-35650.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.actionServedRows-35650.test.tsx @@ -49,7 +49,7 @@ const STORED = { label: 'Sign contract', objectName: 'contract', type: 'script', - locations: ['record_header'], + locations: ['record_page'], body: { language: 'js', source: "throw { code: 'SIGN_IN_REQUIRED' };" }, refusals: { SIGN_IN_REQUIRED: { message: 'Sign in first.', status: 401 } }, texts: { email_subject: { message: 'Contract signed' } }, diff --git a/ui/packages/app-shell/src/views/metadata-admin/capabilityGateChannel-7234.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/capabilityGateChannel-7234.test.tsx index 2cb25080b79..3e7ff8e09a1 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/capabilityGateChannel-7234.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/capabilityGateChannel-7234.test.tsx @@ -98,7 +98,7 @@ const GATED = { type: 'script', objectName: 'duly_catalog_item', target: 'true', - locations: ['list_toolbar'], + locations: ['list'], requiredPermissions: ['duly.catalog.apply'], }; diff --git a/ui/packages/app-shell/src/views/metadata-admin/inspectors/ActionDefaultInspector.aiBlock-26728.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/inspectors/ActionDefaultInspector.aiBlock-26728.test.tsx index 1dcecbaf2e5..88d562789ba 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/inspectors/ActionDefaultInspector.aiBlock-26728.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/inspectors/ActionDefaultInspector.aiBlock-26728.test.tsx @@ -46,7 +46,7 @@ const SCRIPT_ACTION: Draft = { name: 'invoice_send', label: 'Send', objectName: 'invoice', - locations: ['record_more'], + locations: ['record_page'], component: 'action:menu', type: 'script', body: { language: 'expression', source: 'true' }, }; diff --git a/ui/packages/app-shell/src/views/metadata-admin/inspectors/ActionDefaultInspector.capabilities-29181.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/inspectors/ActionDefaultInspector.capabilities-29181.test.tsx index 73133572d05..64c6fe2b0d5 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/inspectors/ActionDefaultInspector.capabilities-29181.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/inspectors/ActionDefaultInspector.capabilities-29181.test.tsx @@ -52,7 +52,7 @@ const NEW_ACTION: Draft = { name: 'invoice_action_1', label: 'New action', objectName: 'invoice', - locations: ['record_header'], + locations: ['record_page'], operation: 'update', patch: {}, }; @@ -62,7 +62,7 @@ const STORED_JS: Draft = { name: 'invoice_stamp', label: 'Stamp', objectName: 'invoice', - locations: ['record_more'], + locations: ['record_page'], component: 'action:menu', type: 'script', body: { language: 'js', source: 'return { ok: true };' }, }; diff --git a/ui/packages/app-shell/src/views/metadata-admin/inspectors/ActionDefaultInspector.fieldValueRows-26735.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/inspectors/ActionDefaultInspector.fieldValueRows-26735.test.tsx index 1230be909f3..e7590530bfc 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/inspectors/ActionDefaultInspector.fieldValueRows-26735.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/inspectors/ActionDefaultInspector.fieldValueRows-26735.test.tsx @@ -79,7 +79,7 @@ const NEW_UPDATE_ACTION: Draft = { name: 'invoice_action_2', label: 'New action', objectName: 'invoice', - locations: ['record_header'], + locations: ['record_page'], operation: 'update', patch: {}, }; diff --git a/ui/packages/app-shell/src/views/metadata-admin/inspectors/ActionDefaultInspector.scriptBodyLanguage-11921.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/inspectors/ActionDefaultInspector.scriptBodyLanguage-11921.test.tsx index db340c0f3d4..483346ea3ef 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/inspectors/ActionDefaultInspector.scriptBodyLanguage-11921.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/inspectors/ActionDefaultInspector.scriptBodyLanguage-11921.test.tsx @@ -73,7 +73,7 @@ const NEW_ACTION: Draft = { name: 'invoice_action_1', label: 'New action', objectName: 'invoice', - locations: ['record_header'], + locations: ['record_page'], operation: 'update', patch: {}, }; @@ -177,7 +177,7 @@ describe('scriptBodyPin — the switch to "Run a script" seeds the language (obj name: 'invoice_send', label: 'Send', objectName: 'invoice', - locations: ['record_more'], + locations: ['record_page'], component: 'action:menu', type: 'script', body: { language: 'js', source: 'return { ok: true }' }, }); @@ -194,7 +194,7 @@ describe('scriptBodyPin — the switch to "Run a script" seeds the language (obj it('a script action whose stored body names no language: the first keystroke seeds it and parses', () => { // The shape the Type control, or an older draft, leaves: a script with no body. - const seen = mountHost({ name: 'invoice_go', label: 'Go', objectName: 'invoice', locations: ['record_more'], type: 'script' }); + const seen = mountHost({ name: 'invoice_go', label: 'Go', objectName: 'invoice', locations: ['record_page'], component: 'action:menu', type: 'script' }); expect(refusals(seen.draft)).toEqual(['body:custom']); type('x'); @@ -217,7 +217,7 @@ describe('scriptBodyPin — a language change writes the new language’s shape name: 'invoice_stamp', label: 'Stamp', objectName: 'invoice', - locations: ['record_more'], + locations: ['record_page'], component: 'action:menu', type: 'script', // The spec's own L2 example shape: a grant and a limit beside the source. body: { language: 'js', source: 'return 1', capabilities: ['api.read'], timeoutMs: 250 }, @@ -252,7 +252,7 @@ describe('scriptBodyPin — controls: the other writes (objectui#11921)', () => name: 'invoice_send', label: 'Send', objectName: 'invoice', - locations: ['record_more'], + locations: ['record_page'], component: 'action:menu', type: 'script', body: { language: 'expression', source: 'true' }, }); @@ -284,7 +284,7 @@ describe('scriptBodyPin — controls: the other writes (objectui#11921)', () => ['form', 'Form — open a FormView'], ['url', 'URL — navigate to a link'], ] as const) { - const seen = mountHost({ name: 'invoice_go', label: 'Go', objectName: 'invoice', locations: ['record_more'], type: 'script' }); + const seen = mountHost({ name: 'invoice_go', label: 'Go', objectName: 'invoice', locations: ['record_page'], component: 'action:menu', type: 'script' }); await pick('Type', option); expect(seen.writes, value).toStrictEqual([{ type: value }]); cleanup(); diff --git a/ui/packages/app-shell/src/views/metadata-admin/inspectors/ActionDefaultInspector.scriptType-26734.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/inspectors/ActionDefaultInspector.scriptType-26734.test.tsx index 98a6118300c..8c004303eac 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/inspectors/ActionDefaultInspector.scriptType-26734.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/inspectors/ActionDefaultInspector.scriptType-26734.test.tsx @@ -78,7 +78,7 @@ const NEW_UPDATE_ACTION: Draft = { name: 'invoice_action_2', label: 'New action', objectName: 'invoice', - locations: ['record_header'], + locations: ['record_page'], operation: 'update', patch: {}, }; @@ -106,7 +106,7 @@ describe('scriptTypePin — a script authored here is stored with its type (obje name: 'run_script', label: 'Run', objectName: 'invoice', - locations: ['record_more'], + locations: ['record_page'], component: 'action:menu', body: { language: 'expression', source: 'true' }, }); expect(typeControl()).not.toHaveTextContent(SCRIPT); @@ -138,7 +138,7 @@ describe('scriptTypePin — a script authored here is stored with its type (obje name: 'invoice_sync', label: 'Sync', objectName: 'invoice', - locations: ['record_more'], + locations: ['record_page'], component: 'action:menu', type: 'script', body: { language: 'expression', source: 'true' }, }); diff --git a/ui/packages/app-shell/src/views/metadata-admin/inspectors/ActionDefaultInspector.typeSwitch-26736.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/inspectors/ActionDefaultInspector.typeSwitch-26736.test.tsx index 5c5bcec04bd..44d20c8afdc 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/inspectors/ActionDefaultInspector.typeSwitch-26736.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/inspectors/ActionDefaultInspector.typeSwitch-26736.test.tsx @@ -86,7 +86,7 @@ const SCRIPT_ACTION: Draft = { name: 'invoice_sync', label: 'Sync', objectName: 'invoice', - locations: ['record_more'], + locations: ['record_page'], component: 'action:menu', type: 'script', body: { language: 'expression', source: 'true' }, }; diff --git a/ui/packages/app-shell/src/views/metadata-admin/inspectors/inspectorStrings.hookAction.i18n-10586.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/inspectors/inspectorStrings.hookAction.i18n-10586.test.tsx index a0c6f5fd4ae..8c77254d636 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/inspectors/inspectorStrings.hookAction.i18n-10586.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/inspectors/inspectorStrings.hookAction.i18n-10586.test.tsx @@ -299,7 +299,7 @@ const ACTION_FIXTURES: readonly Fixture[] = [ state.held = ['a.b', 'c.d']; mountAction(lang, { name: 'a2', type: 'api', method: 'PATCH', variant: 'secondary', component: 'action:icon', mode: 'edit', - locations: ['record_header'], requiredPermissions: ['a.b', 'c.d'], + locations: ['record_page'], requiredPermissions: ['a.b', 'c.d'], }); }, // A bound flow action with a field-backed input. @@ -307,16 +307,16 @@ const ACTION_FIXTURES: readonly Fixture[] = [ state.fields = [{ name: 'amount', label: 'Amount' }]; mountAction(lang, { name: 'a3', type: 'flow', objectName: 'account', variant: 'danger', component: 'action:menu', mode: 'delete', - params: [{ field: 'amount' }], locations: ['list_item'], + params: [{ field: 'amount' }], locations: ['record_row'], }); }, - (lang) => mountAction(lang, { name: 'a4', type: 'modal', variant: 'ghost', component: 'action:group', mode: 'custom', locations: ['record_more'] }), - (lang) => mountAction(lang, { name: 'a5', type: 'form', variant: 'link', locations: ['record_more'] }), - (lang) => mountAction(lang, { name: 'a6', type: 'url', locations: ['record_more'] }), - (lang) => mountAction(lang, { name: 'a7', type: 'script', body: { language: 'js' }, locations: ['record_more'] }), + (lang) => mountAction(lang, { name: 'a4', type: 'modal', variant: 'ghost', component: 'action:group', mode: 'custom', locations: ['record_page'], component: 'action:menu' }), + (lang) => mountAction(lang, { name: 'a5', type: 'form', variant: 'link', locations: ['record_page'], component: 'action:menu' }), + (lang) => mountAction(lang, { name: 'a6', type: 'url', locations: ['record_page'], component: 'action:menu' }), + (lang) => mountAction(lang, { name: 'a7', type: 'script', body: { language: 'js' }, locations: ['record_page'], component: 'action:menu' }), // The declarative single-record write, empty and with one row. - (lang) => mountAction(lang, { name: 'a8', type: 'script', operation: 'update', patch: {}, locations: ['record_more'] }), - (lang) => mountAction(lang, { name: 'a9', type: 'script', operation: 'update', patch: { status: 'done' }, locations: ['record_more'] }), + (lang) => mountAction(lang, { name: 'a8', type: 'script', operation: 'update', patch: {}, locations: ['record_page'], component: 'action:menu' }), + (lang) => mountAction(lang, { name: 'a9', type: 'script', operation: 'update', patch: { status: 'done' }, locations: ['record_page'], component: 'action:menu' }), ]; /** The pre-fix English the action fixtures render. */ diff --git a/ui/packages/app-shell/src/views/metadata-admin/previews/__tests__/ActionPreview.copyEnvelope-27948.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/previews/__tests__/ActionPreview.copyEnvelope-27948.test.tsx index fcf1f40c59c..2a9eb8fc7ad 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/previews/__tests__/ActionPreview.copyEnvelope-27948.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/previews/__tests__/ActionPreview.copyEnvelope-27948.test.tsx @@ -31,7 +31,7 @@ function renderDraft(copy: (s: string) => unknown) { label: 'Pause', type: 'script', target: 'pauseAccount', - locations: ['record_header'], + locations: ['record_page'], confirmText: copy('Pause {{ record.name }}?'), successMessage: copy('Paused {{ record.name }}'), params: [{ name: 'reason', label: 'Reason', type: 'text', helpText: copy('Why {{ record.name }} is paused') }], diff --git a/ui/packages/app-shell/src/views/metadata-admin/previews/automationPreviews.i18n-10862.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/previews/automationPreviews.i18n-10862.test.tsx index 2e01589990a..0de14febdce 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/previews/automationPreviews.i18n-10862.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/previews/automationPreviews.i18n-10862.test.tsx @@ -132,7 +132,7 @@ const ACTION_API = { variant: 'primary', refreshAfter: true, ai: { exposed: false }, - locations: ['record_header', 'list_toolbar', 'list_item', 'record_section', 'record_more'], + locations: ['record', 'list', 'record_section'], requiredPermissions: ['account.sync'], visible: "record.status == 'open'", disabled: 'record.locked == true', diff --git a/ui/packages/app-shell/src/views/objectViewHeaderChrome.tsx b/ui/packages/app-shell/src/views/objectViewHeaderChrome.tsx index 33ed0b5a136..800dac3a81d 100644 --- a/ui/packages/app-shell/src/views/objectViewHeaderChrome.tsx +++ b/ui/packages/app-shell/src/views/objectViewHeaderChrome.tsx @@ -137,7 +137,7 @@ export function useObjectViewHeaderChrome({ const importShown = identityImportEnabled || (objectCanImport && importVisible); const foldedMenuBar: ActionBarSchema = { type: 'action:bar', - location: 'list_toolbar', + location: 'list', actions: [ ...(objectSettingsPath ? [{ name: 'object_view_object_settings', diff --git a/ui/packages/app-shell/src/views/objectViewHeaderToolbar.ts b/ui/packages/app-shell/src/views/objectViewHeaderToolbar.ts index 5c936e838e8..9b66073637c 100644 --- a/ui/packages/app-shell/src/views/objectViewHeaderToolbar.ts +++ b/ui/packages/app-shell/src/views/objectViewHeaderToolbar.ts @@ -94,7 +94,7 @@ export function useObjectViewHeaderToolbar({ // off-screen. const toolbarBar: ActionBarSchema = { type: 'action:bar', - location: 'list_toolbar', + location: 'list', actions: toolbarActionsWithDeepLink, size: 'sm', variant: 'outline', diff --git a/ui/packages/app-shell/src/views/objectViewPageHeader.actionLayout-36366.test.tsx b/ui/packages/app-shell/src/views/objectViewPageHeader.actionLayout-36366.test.tsx index 9390812aebf..a60051bd033 100644 --- a/ui/packages/app-shell/src/views/objectViewPageHeader.actionLayout-36366.test.tsx +++ b/ui/packages/app-shell/src/views/objectViewPageHeader.actionLayout-36366.test.tsx @@ -32,9 +32,9 @@ vi.mock('../environment/EnvironmentListToolbar', () => ({ import { ObjectViewPageBarActions } from './objectViewPageHeader'; const TOOLBAR = [ - { name: 'new_task', label: 'New task', locations: ['list_toolbar'] }, - { name: 'mass_assign', label: 'Assign', locations: ['list_toolbar'] }, - { name: 'export_csv', label: 'CSV', locations: ['list_toolbar'] }, + { name: 'new_task', label: 'New task', locations: ['list'] }, + { name: 'mass_assign', label: 'Assign', locations: ['list'] }, + { name: 'export_csv', label: 'CSV', locations: ['list'] }, ]; const t = ((k: string, o?: { defaultValue?: string }) => o?.defaultValue ?? k) as never; diff --git a/ui/packages/app-shell/src/views/studio-design/DataPillar.actionDeepLink-34724.test.tsx b/ui/packages/app-shell/src/views/studio-design/DataPillar.actionDeepLink-34724.test.tsx index 0237fd04c1c..9d698281b9d 100644 --- a/ui/packages/app-shell/src/views/studio-design/DataPillar.actionDeepLink-34724.test.tsx +++ b/ui/packages/app-shell/src/views/studio-design/DataPillar.actionDeepLink-34724.test.tsx @@ -31,7 +31,7 @@ const SEND = { name: 'showcase_task_send', label: 'Send', objectName: 'showcase_task', - locations: ['record_more'], + locations: ['record_page'], component: 'action:menu', type: 'script', body: { language: 'expression', source: 'true' }, }; diff --git a/ui/packages/app-shell/src/views/studio-design/DataPillar.actionRefusal-26736.test.tsx b/ui/packages/app-shell/src/views/studio-design/DataPillar.actionRefusal-26736.test.tsx index ca010ba9bec..770772926a9 100644 --- a/ui/packages/app-shell/src/views/studio-design/DataPillar.actionRefusal-26736.test.tsx +++ b/ui/packages/app-shell/src/views/studio-design/DataPillar.actionRefusal-26736.test.tsx @@ -36,7 +36,7 @@ const SEND = { name: 'showcase_task_send', label: 'Send', objectName: 'showcase_task', - locations: ['record_more'], + locations: ['record_page'], component: 'action:menu', type: 'script', body: { language: 'expression', source: 'true' }, }; diff --git a/ui/packages/app-shell/src/views/studio-design/DataPillar.actionServedRows-35650.test.tsx b/ui/packages/app-shell/src/views/studio-design/DataPillar.actionServedRows-35650.test.tsx index 612c0a28d3c..c78cf2ce3c2 100644 --- a/ui/packages/app-shell/src/views/studio-design/DataPillar.actionServedRows-35650.test.tsx +++ b/ui/packages/app-shell/src/views/studio-design/DataPillar.actionServedRows-35650.test.tsx @@ -41,7 +41,7 @@ const SIGN = { name: 'showcase_task_sign', label: 'Sign', objectName: 'showcase_task', - locations: ['record_more'], + locations: ['record_page'], component: 'action:menu', type: 'script', body: { language: 'js', source: "throw { code: 'SIGN_IN_REQUIRED' };" }, refusals: { SIGN_IN_REQUIRED: { message: 'Sign in first.', status: 401 } }, diff --git a/ui/packages/app-shell/src/views/studio-design/DataPillar.pairActions-30088.test.tsx b/ui/packages/app-shell/src/views/studio-design/DataPillar.pairActions-30088.test.tsx index 1fa07580efb..6d32df78460 100644 --- a/ui/packages/app-shell/src/views/studio-design/DataPillar.pairActions-30088.test.tsx +++ b/ui/packages/app-shell/src/views/studio-design/DataPillar.pairActions-30088.test.tsx @@ -44,7 +44,7 @@ const VENDOR = { name: 'crm_lead_convert', label: 'Convert', objectName: OBJECT, - locations: ['record_header'], + locations: ['record_page'], type: 'script', body: { language: 'expression', source: 'true' }, }; @@ -54,7 +54,7 @@ const KEPT = { name: 'crm_lead_action_7', label: 'Qualify', objectName: OBJECT, - locations: ['record_more'], + locations: ['record_page'], component: 'action:menu', operation: 'update', patch: { status: 'qualified' }, }; @@ -280,7 +280,7 @@ describe('Studio adds an action to an installed app’s object, in its customiza const [, name, body, opts] = actionSaves()[0]!; expect(name).toMatch(/^crm_lead_action_\d+$/); expect(name).not.toBe(VENDOR.name); - expect(body).toMatchObject({ name, objectName: OBJECT, operation: 'update', locations: ['record_header'] }); + expect(body).toMatchObject({ name, objectName: OBJECT, operation: 'update', locations: ['record_page'] }); expect(opts).toMatchObject({ mode: 'draft', packageId: PAIR, ifNoneMatch: '*' }); // Then that one action is published at the pair: live at once, asserting // no published action of its name (objectstack#36726). diff --git a/ui/packages/app-shell/src/views/studio-design/DataPillar.pairActionsPublishPinned-36726.test.tsx b/ui/packages/app-shell/src/views/studio-design/DataPillar.pairActionsPublishPinned-36726.test.tsx index ac14bb2b1f1..85f940fbae2 100644 --- a/ui/packages/app-shell/src/views/studio-design/DataPillar.pairActionsPublishPinned-36726.test.tsx +++ b/ui/packages/app-shell/src/views/studio-design/DataPillar.pairActionsPublishPinned-36726.test.tsx @@ -39,7 +39,7 @@ const VENDOR = { name: 'crm_lead_convert', label: 'Convert', objectName: OBJECT, - locations: ['record_header'], + locations: ['record_page'], type: 'script', body: { language: 'expression', source: 'true' }, }; @@ -49,7 +49,7 @@ const KEPT = { name: 'crm_lead_action_7', label: 'Qualify', objectName: OBJECT, - locations: ['record_more'], + locations: ['record_page'], component: 'action:menu', operation: 'update', patch: { status: 'qualified' }, }; diff --git a/ui/packages/app-shell/src/views/studio-design/DataPillar.panelHold-27629.test.tsx b/ui/packages/app-shell/src/views/studio-design/DataPillar.panelHold-27629.test.tsx index e54ba632df2..ad5c029a4a8 100644 --- a/ui/packages/app-shell/src/views/studio-design/DataPillar.panelHold-27629.test.tsx +++ b/ui/packages/app-shell/src/views/studio-design/DataPillar.panelHold-27629.test.tsx @@ -31,7 +31,7 @@ const ARCHIVE = { name: 'showcase_task_archive', label: 'Archive', objectName: 'showcase_task', - locations: ['record_more'], + locations: ['record_page'], component: 'action:menu', type: 'script', body: { language: 'expression', source: 'true' }, }; diff --git a/ui/packages/app-shell/src/views/studio-design/DataPillar.showMeFocus-26730.test.tsx b/ui/packages/app-shell/src/views/studio-design/DataPillar.showMeFocus-26730.test.tsx index 59274ec4280..52f8002357e 100644 --- a/ui/packages/app-shell/src/views/studio-design/DataPillar.showMeFocus-26730.test.tsx +++ b/ui/packages/app-shell/src/views/studio-design/DataPillar.showMeFocus-26730.test.tsx @@ -25,7 +25,7 @@ const SEND = { name: 'showcase_task_send', label: 'Send', objectName: 'showcase_task', - locations: ['record_more'], + locations: ['record_page'], component: 'action:menu', type: 'script', body: { language: 'expression', source: 'true' }, }; diff --git a/ui/packages/app-shell/src/views/studio-design/ObjectActionsPanel.newActionDefault-11820.test.tsx b/ui/packages/app-shell/src/views/studio-design/ObjectActionsPanel.newActionDefault-11820.test.tsx index 266654299ab..399f7c3caff 100644 --- a/ui/packages/app-shell/src/views/studio-design/ObjectActionsPanel.newActionDefault-11820.test.tsx +++ b/ui/packages/app-shell/src/views/studio-design/ObjectActionsPanel.newActionDefault-11820.test.tsx @@ -31,7 +31,7 @@ const existing = { label: 'Send Email', type: 'script', objectName: 'invoice', - locations: ['record_more'], + locations: ['record_page'], component: 'action:menu', body: { language: 'expression', source: 'true' }, }; @@ -66,7 +66,7 @@ describe('newActionPin — a new action is a declarative field update (objectui# objectName: 'invoice', operation: 'update', patch: {}, - locations: ['record_header'], + locations: ['record_page'], }); expect(added).not.toHaveProperty('body'); expect(added).not.toHaveProperty('target'); diff --git a/ui/packages/app-shell/src/views/studio-design/ObjectActionsPanel.presets-11861.test.tsx b/ui/packages/app-shell/src/views/studio-design/ObjectActionsPanel.presets-11861.test.tsx index 00820ad47a7..d112f0e1195 100644 --- a/ui/packages/app-shell/src/views/studio-design/ObjectActionsPanel.presets-11861.test.tsx +++ b/ui/packages/app-shell/src/views/studio-design/ObjectActionsPanel.presets-11861.test.tsx @@ -81,7 +81,7 @@ const existing = { name: 'open_help', label: 'Open help', objectName: 'invoice', - locations: ['record_more'], + locations: ['record_page'], component: 'action:menu', type: 'url', target: 'https://example.com/help', }; @@ -217,7 +217,7 @@ describe('the Actions New menu opens on presets (objectui#11861)', () => { } expect(onPatch).toHaveBeenCalledTimes(1); const written = lastWritten(onPatch); - expect(written).toMatchObject({ name: 'invoice_action_2', objectName: 'invoice', locations: ['record_header'] }); + expect(written).toMatchObject({ name: 'invoice_action_2', objectName: 'invoice', locations: ['record_page'] }); expectSpecAccepts(written, `${id} preset`); expect(screen.queryByTestId('action-not-saved')).toBeNull(); }, @@ -237,7 +237,7 @@ describe('the Actions New menu opens on presets (objectui#11861)', () => { name: 'invoice_action_2', label: 'Change Status', objectName: 'invoice', - locations: ['record_header'], + locations: ['record_page'], operation: 'update', params: [{ field: 'status' }], }); @@ -271,7 +271,7 @@ describe('the Actions New menu opens on presets (objectui#11861)', () => { name: 'invoice_action_2', label: 'New action', objectName: 'invoice', - locations: ['record_header'], + locations: ['record_page'], type: 'flow', target: 'notify_owner', }); @@ -328,7 +328,7 @@ describe('the Actions New menu opens on presets (objectui#11861)', () => { }); describe('the preset module’s written-out tables agree with the spec (objectui#11861)', () => { - const seed = { name: 'invoice_action_2', label: 'New action', objectName: 'invoice', locations: ['record_header'] }; + const seed = { name: 'invoice_action_2', label: 'New action', objectName: 'invoice', locations: ['record_page'] }; const refusedAt = (action: unknown, path: string) => { const parsed = ActionSchema.safeParse(action); return !parsed.success && parsed.error.issues.some((i) => i.path.join('.') === path); diff --git a/ui/packages/app-shell/src/views/studio-design/ObjectActionsPanel.renameTaken-26725.test.tsx b/ui/packages/app-shell/src/views/studio-design/ObjectActionsPanel.renameTaken-26725.test.tsx index c7848c8e34b..9a4e54e68ee 100644 --- a/ui/packages/app-shell/src/views/studio-design/ObjectActionsPanel.renameTaken-26725.test.tsx +++ b/ui/packages/app-shell/src/views/studio-design/ObjectActionsPanel.renameTaken-26725.test.tsx @@ -40,7 +40,7 @@ const act = (name: string, label: string) => ({ label, type: 'script', objectName: 'invoice', - locations: ['record_header'], + locations: ['record_page'], body: { language: 'expression', source: 'true' }, }); diff --git a/ui/packages/app-shell/src/views/studio-design/ObjectActionsPanel.tsx b/ui/packages/app-shell/src/views/studio-design/ObjectActionsPanel.tsx index 874de3ffca3..c6edd3b436e 100644 --- a/ui/packages/app-shell/src/views/studio-design/ObjectActionsPanel.tsx +++ b/ui/packages/app-shell/src/views/studio-design/ObjectActionsPanel.tsx @@ -456,7 +456,7 @@ export function ObjectActionsPanel({ name, label: t('engine.studio.actions.newLabel', locale), objectName, - locations: ['record_header'], + locations: ['record_page'], operation: 'update', patch: {}, }; @@ -502,7 +502,7 @@ export function ObjectActionsPanel({ name, label: t('engine.studio.actions.newLabel', locale), objectName, - locations: ['record_header'], + locations: ['record_page'], ...plan.keys, }; if (heldInputKey(fresh) === null) { diff --git a/ui/packages/app-shell/src/views/studio-design/StudioEmptyState.panels-12514.test.tsx b/ui/packages/app-shell/src/views/studio-design/StudioEmptyState.panels-12514.test.tsx index de159123302..44b658de823 100644 --- a/ui/packages/app-shell/src/views/studio-design/StudioEmptyState.panels-12514.test.tsx +++ b/ui/packages/app-shell/src/views/studio-design/StudioEmptyState.panels-12514.test.tsx @@ -157,7 +157,7 @@ describe('objectui#12514 — Actions: the empty block opens the header’s New m expect(fromEmpty.length).toBeGreaterThan(0); cleanup(); - const one = { ...emptyDraft, actions: [{ name: 'a1', label: 'A1', type: 'script', objectName: 'invoice', locations: ['record_more'] }] }; + const one = { ...emptyDraft, actions: [{ name: 'a1', label: 'A1', type: 'script', objectName: 'invoice', locations: ['record_page'], component: 'action:menu' }] }; render(); expect(screen.queryByTestId('actions-empty')).toBeNull(); fireEvent.click(screen.getByRole('button', { name: /^New/ })); diff --git a/ui/packages/app-shell/src/views/studio-design/metadataError.actionHeld-26736.test.ts b/ui/packages/app-shell/src/views/studio-design/metadataError.actionHeld-26736.test.ts index ec647bc96b3..4aa15be5757 100644 --- a/ui/packages/app-shell/src/views/studio-design/metadataError.actionHeld-26736.test.ts +++ b/ui/packages/app-shell/src/views/studio-design/metadataError.actionHeld-26736.test.ts @@ -38,7 +38,7 @@ const object = (actions: Action[]) => ({ actions, }); -const base: Action = { name: 'invoice_send', label: 'Send', objectName: 'invoice', locations: ['record_more'] }; +const base: Action = { name: 'invoice_send', label: 'Send', objectName: 'invoice', locations: ['record_page'], component: 'action:menu' }; const DESCRIPTION = 'Send the invoice to its customer once it has been approved by finance.'; describe('actionHeldInput — an action waiting for an input is held (objectstack#26736)', () => { diff --git a/ui/packages/components/src/__tests__/action-bar.test.tsx b/ui/packages/components/src/__tests__/action-bar.test.tsx index e00772640e1..8e53839a784 100644 --- a/ui/packages/components/src/__tests__/action-bar.test.tsx +++ b/ui/packages/components/src/__tests__/action-bar.test.tsx @@ -67,11 +67,11 @@ describe('ActionBar (action:bar)', () => { it('filters actions by location', () => { const { container } = renderComponent(actionBar({ type: 'action:bar', - location: 'list_toolbar', + location: 'list', actions: [ - { name: 'toolbar_action', label: 'Toolbar Action', type: 'script', locations: ['list_toolbar'] }, - { name: 'header_action', label: 'Header Action', type: 'script', locations: ['record_header'] }, - { name: 'both_action', label: 'Both Action', type: 'script', locations: ['list_toolbar', 'record_header'] }, + { name: 'toolbar_action', label: 'Toolbar Action', type: 'script', locations: ['list'] }, + { name: 'header_action', label: 'Header Action', type: 'script', locations: ['record_page'] }, + { name: 'both_action', label: 'Both Action', type: 'script', locations: ['list', 'record_page'] }, ], })); expect(container.textContent).toContain('Toolbar Action'); @@ -89,12 +89,12 @@ describe('ActionBar (action:bar)', () => { it('hides an action that declares no locations when filtering by location', () => { const { container } = renderComponent(actionBar({ type: 'action:bar', - location: 'record_header', + location: 'record_page', actions: [ { name: 'no_loc', label: 'No Location', type: 'script' }, { name: 'empty_loc', label: 'Empty Location', type: 'script', locations: [] }, - { name: 'other_loc', label: 'Other Location', type: 'script', locations: ['list_toolbar'] }, - { name: 'here_loc', label: 'Here Location', type: 'script', locations: ['record_header'] }, + { name: 'other_loc', label: 'Other Location', type: 'script', locations: ['list'] }, + { name: 'here_loc', label: 'Here Location', type: 'script', locations: ['record_page'] }, ], })); expect(container.textContent).not.toContain('No Location'); @@ -109,8 +109,8 @@ describe('ActionBar (action:bar)', () => { const { container } = renderComponent(actionBar({ type: 'action:bar', actions: [ - { name: 'a1', label: 'Action 1', type: 'script', locations: ['list_toolbar'] }, - { name: 'a2', label: 'Action 2', type: 'script', locations: ['record_header'] }, + { name: 'a1', label: 'Action 1', type: 'script', locations: ['list'] }, + { name: 'a2', label: 'Action 2', type: 'script', locations: ['record_page'] }, ], })); expect(container.textContent).toContain('Action 1'); @@ -137,12 +137,12 @@ describe('ActionBar (action:bar)', () => { it('deduplicates actions after location filtering', () => { const { container } = renderComponent(actionBar({ type: 'action:bar', - location: 'record_header', + location: 'record_page', actions: [ - { name: 'change_status', label: 'Change Status', type: 'script', locations: ['record_header'] }, - { name: 'assign_user', label: 'Assign User', type: 'script', locations: ['record_header'] }, - { name: 'change_status', label: 'Change Status', type: 'script', locations: ['record_header', 'record_more'] }, - { name: 'assign_user', label: 'Assign User', type: 'script', locations: ['record_header'] }, + { name: 'change_status', label: 'Change Status', type: 'script', locations: ['record_page'] }, + { name: 'assign_user', label: 'Assign User', type: 'script', locations: ['record_page'] }, + { name: 'change_status', label: 'Change Status', type: 'script', locations: ['record_page'] }, + { name: 'assign_user', label: 'Assign User', type: 'script', locations: ['record_page'] }, ], })); const toolbar = container.querySelector('[role="toolbar"]'); @@ -196,13 +196,13 @@ describe('ActionBar (action:bar)', () => { it('orders inline actions by `order` (lower = earlier / primary slot)', () => { const { container } = renderComponent(actionBar({ type: 'action:bar', - location: 'record_header', + location: 'record_page', maxVisible: 5, actions: [ // Registration order puts the app action first; `order` must reorder. - { name: 'close_deal', label: 'Close', type: 'script', locations: ['record_header'] }, - { name: 'print', label: 'Print', type: 'script', locations: ['record_header'], order: 5 }, - { name: 'approve', label: 'Approve', type: 'script', locations: ['record_header'], order: -10 }, + { name: 'close_deal', label: 'Close', type: 'script', locations: ['record_page'] }, + { name: 'print', label: 'Print', type: 'script', locations: ['record_page'], order: 5 }, + { name: 'approve', label: 'Approve', type: 'script', locations: ['record_page'], order: -10 }, ], })); const toolbar = container.querySelector('[role="toolbar"]'); @@ -217,11 +217,11 @@ describe('ActionBar (action:bar)', () => { it('promotes a low-`order` action into the primary slot even when registered last', () => { const { container } = renderComponent(actionBar({ type: 'action:bar', - location: 'record_header', + location: 'record_page', maxVisible: 1, actions: [ - { name: 'app_action', label: 'App Action', type: 'script', locations: ['record_header'] }, - { name: 'approve', label: 'Approve', type: 'script', locations: ['record_header'], order: -100 }, + { name: 'app_action', label: 'App Action', type: 'script', locations: ['record_page'] }, + { name: 'approve', label: 'Approve', type: 'script', locations: ['record_page'], order: -100 }, ], })); const toolbar = container.querySelector('[role="toolbar"]'); @@ -237,12 +237,12 @@ describe('ActionBar (action:bar)', () => { it('is stable — actions without `order` keep their registration order', () => { const { container } = renderComponent(actionBar({ type: 'action:bar', - location: 'record_header', + location: 'record_page', maxVisible: 5, actions: [ - { name: 'a', label: 'Alpha', type: 'script', locations: ['record_header'] }, - { name: 'b', label: 'Bravo', type: 'script', locations: ['record_header'] }, - { name: 'c', label: 'Charlie', type: 'script', locations: ['record_header'] }, + { name: 'a', label: 'Alpha', type: 'script', locations: ['record_page'] }, + { name: 'b', label: 'Bravo', type: 'script', locations: ['record_page'] }, + { name: 'c', label: 'Charlie', type: 'script', locations: ['record_page'] }, ], })); const toolbar = container.querySelector('[role="toolbar"]'); @@ -256,13 +256,13 @@ describe('ActionBar (action:bar)', () => { it('tie-break: a `primary` action wins the primary slot when nobody sets `order`', () => { const { container } = renderComponent(actionBar({ type: 'action:bar', - location: 'record_header', + location: 'record_page', maxVisible: 1, actions: [ // Registered first, but plain variant — the tie-break must let the // `primary` sibling registered after it claim the primary slot. - { name: 'export', label: 'Export', type: 'script', locations: ['record_header'] }, - { name: 'submit', label: 'Submit', type: 'script', variant: 'primary', locations: ['record_header'] }, + { name: 'export', label: 'Export', type: 'script', locations: ['record_page'] }, + { name: 'submit', label: 'Submit', type: 'script', variant: 'primary', locations: ['record_page'] }, ], })); const toolbar = container.querySelector('[role="toolbar"]'); @@ -278,13 +278,13 @@ describe('ActionBar (action:bar)', () => { it('`order` outranks the `primary` tie-break', () => { const { container } = renderComponent(actionBar({ type: 'action:bar', - location: 'record_header', + location: 'record_page', maxVisible: 5, actions: [ // `primary` variant but no `order` (= 0); the explicit low-`order` // sibling must still sort ahead of it — `order` is the primary key. - { name: 'submit', label: 'Submit', type: 'script', variant: 'primary', locations: ['record_header'] }, - { name: 'approve', label: 'Approve', type: 'script', order: -100, locations: ['record_header'] }, + { name: 'submit', label: 'Submit', type: 'script', variant: 'primary', locations: ['record_page'] }, + { name: 'approve', label: 'Approve', type: 'script', order: -100, locations: ['record_page'] }, ], })); const toolbar = container.querySelector('[role="toolbar"]'); @@ -416,7 +416,7 @@ describe('ActionBar (action:bar)', () => { describe('requiredPermissions capability gate', () => { const Bar = ({ actions, systemActions }: { actions?: any[]; systemActions?: any[] }) => { const Component = ComponentRegistry.get('action:bar')!; - return ; + return ; }; const withUser = (user: unknown, props: { actions?: any[]; systemActions?: any[] }) => render(); @@ -425,8 +425,8 @@ describe('ActionBar (action:bar)', () => { // strict placement filter would drop them before the capability gate ever // ran, and every `not.toContain` below would pass VACUOUSLY — the suite // would keep reporting green while testing nothing. - const gated = { name: 'gated', label: 'Bulk Reassign', type: 'api', locations: ['list_toolbar'], requiredPermissions: ['manage_users'] }; - const plain = { name: 'plain', label: 'Export', type: 'api', locations: ['list_toolbar'] }; + const gated = { name: 'gated', label: 'Bulk Reassign', type: 'api', locations: ['list'], requiredPermissions: ['manage_users'] }; + const plain = { name: 'plain', label: 'Export', type: 'api', locations: ['list'] }; it('hides an action whose capability the caller lacks', () => { const { container } = withUser({ id: 'u1', systemPermissions: ['setup.access'] }, { actions: [gated, plain] }); diff --git a/ui/packages/components/src/__tests__/action-group.test.tsx b/ui/packages/components/src/__tests__/action-group.test.tsx index 971a21d3f0d..7bb52bec84c 100644 --- a/ui/packages/components/src/__tests__/action-group.test.tsx +++ b/ui/packages/components/src/__tests__/action-group.test.tsx @@ -29,10 +29,10 @@ describe('action:group — placement', () => { it('renders only actions that declare the requested location', () => { renderGroup({ type: 'action:group', - location: 'list_toolbar', + location: 'list', actions: [ - { name: 'here', label: 'Here', type: 'script', locations: ['list_toolbar'] }, - { name: 'elsewhere', label: 'Elsewhere', type: 'script', locations: ['record_header'] }, + { name: 'here', label: 'Here', type: 'script', locations: ['list'] }, + { name: 'elsewhere', label: 'Elsewhere', type: 'script', locations: ['record_page'] }, ], }); expect(screen.getByText('Here')).toBeInTheDocument(); @@ -42,11 +42,11 @@ describe('action:group — placement', () => { it('treats an undeclared placement the same as an empty one — both hide', () => { renderGroup({ type: 'action:group', - location: 'list_toolbar', + location: 'list', actions: [ { name: 'undeclared', label: 'Undeclared', type: 'script' }, { name: 'empty', label: 'Empty', type: 'script', locations: [] }, - { name: 'here', label: 'Here', type: 'script', locations: ['list_toolbar'] }, + { name: 'here', label: 'Here', type: 'script', locations: ['list'] }, ], }); // Pre-#3142 `Undeclared` rendered and `Empty` did not — same key, two answers. @@ -60,7 +60,7 @@ describe('action:group — placement', () => { type: 'action:group', actions: [ { name: 'a', label: 'Alpha', type: 'script' }, - { name: 'b', label: 'Beta', type: 'script', locations: ['record_header'] }, + { name: 'b', label: 'Beta', type: 'script', locations: ['record_page'] }, ], }); expect(screen.getByText('Alpha')).toBeInTheDocument(); diff --git a/ui/packages/components/src/__tests__/page-header-action-i18n.test.tsx b/ui/packages/components/src/__tests__/page-header-action-i18n.test.tsx index 806e269bc2f..ff7399a5708 100644 --- a/ui/packages/components/src/__tests__/page-header-action-i18n.test.tsx +++ b/ui/packages/components/src/__tests__/page-header-action-i18n.test.tsx @@ -34,7 +34,7 @@ const CONVERT_LEAD = { label: 'Convert Lead', confirmText: 'Are you sure you want to convert this lead?', successMessage: 'Lead converted.', - locations: ['record_header'], + locations: ['record_page'], }; const ZH_BUNDLE = { diff --git a/ui/packages/components/src/__tests__/page-header-action-ids.dist.spec.tsx b/ui/packages/components/src/__tests__/page-header-action-ids.dist.spec.tsx index 5e5566d02a4..a3da4dec60c 100644 --- a/ui/packages/components/src/__tests__/page-header-action-ids.dist.spec.tsx +++ b/ui/packages/components/src/__tests__/page-header-action-ids.dist.spec.tsx @@ -114,12 +114,12 @@ if (BUILT_ENTRY_PRESENT) { const BODY_MARKER = 'OS6252_DIST_BODY_MARKER'; const ACTIONS: Record> = { - convert: { name: 'convert', label: 'Convert Lead', type: 'flow', locations: ['record_header'], order: 2 }, + convert: { name: 'convert', label: 'Convert Lead', type: 'flow', locations: ['record_page'], order: 2 }, scripted: { name: 'scripted', label: 'Run Script', type: 'script', - locations: ['record_header'], + locations: ['record_page'], order: 3, body: { language: 'js', source: `return { marker: '${BODY_MARKER}' };` }, }, diff --git a/ui/packages/components/src/__tests__/page-header-action-ids.test.tsx b/ui/packages/components/src/__tests__/page-header-action-ids.test.tsx index 029b5e98ca9..6a178650e8d 100644 --- a/ui/packages/components/src/__tests__/page-header-action-ids.test.tsx +++ b/ui/packages/components/src/__tests__/page-header-action-ids.test.tsx @@ -49,30 +49,30 @@ import type { MetadataContextValue } from '@object-ui/react'; const BODY_MARKER = 'OS6252_HANDLER_BODY_MARKER'; const ACTIONS: Record = { - convert: { name: 'convert', label: 'Convert Lead', type: 'flow', locations: ['record_header'], order: 2 }, - qualify: { name: 'qualify', label: 'Qualify', type: 'api', locations: ['record_header'], order: 1 }, + convert: { name: 'convert', label: 'Convert Lead', type: 'flow', locations: ['record_page'], order: 2 }, + qualify: { name: 'qualify', label: 'Qualify', type: 'api', locations: ['record_page'], order: 1 }, scripted: { name: 'scripted', label: 'Run Script', type: 'script', - locations: ['record_header'], + locations: ['record_page'], order: 3, body: { language: 'js', source: `return { marker: '${BODY_MARKER}' };` }, }, - archive: { name: 'archive', label: 'Archive', type: 'api', locations: ['record_more'] }, - list_only: { name: 'list_only', label: 'List Only', type: 'api', locations: ['list_item'] }, + archive: { name: 'archive', label: 'Archive', type: 'api', locations: ['record_page'], component: 'action:menu' }, + list_only: { name: 'list_only', label: 'List Only', type: 'api', locations: ['record_row'] }, gated: { name: 'gated', label: 'Gated Action', type: 'api', - locations: ['record_header'], + locations: ['record_page'], requiredPermissions: ['nobody_holds_this'], }, closed_only: { name: 'closed_only', label: 'Closed Only', type: 'api', - locations: ['record_header'], + locations: ['record_page'], visible: 'record.status == "closed"', }, }; @@ -269,8 +269,8 @@ describe('page:header — declared action-id lookup (objectui#6252)', () => { type: 'page:header', title: 'Lead', actions: [ - { name: 'adhoc', label: 'Ad Hoc', type: 'api', locations: ['record_header'] }, - { name: 'other', label: 'Other', type: 'api', locations: ['record_header'] }, + { name: 'adhoc', label: 'Ad Hoc', type: 'api', locations: ['record_page'] }, + { name: 'other', label: 'Other', type: 'api', locations: ['record_page'] }, ], }); expect(buttonNames(container)).toEqual(['Ad Hoc', 'Other']); @@ -287,7 +287,7 @@ describe('page:header — declared action-id lookup (objectui#6252)', () => { it('refuses a mixed id/object array — nothing authored renders, and the console names the offending index', async () => { const error = vi.spyOn(console, 'error').mockImplementation(() => {}); try { - const adhoc = { name: 'adhoc', label: 'Ad Hoc', type: 'api', locations: ['record_header'] }; + const adhoc = { name: 'adhoc', label: 'Ad Hoc', type: 'api', locations: ['record_page'] }; // Live controls FIRST: each half renders on its own, so the refusal below // is about the MIX and not about either element. const idsOnly = mount({ type: 'page:header', title: 'Lead', actions: ['convert'] }); diff --git a/ui/packages/components/src/__tests__/page-header-actions-shared-12906.test.tsx b/ui/packages/components/src/__tests__/page-header-actions-shared-12906.test.tsx index 1385d2840a2..8ad320523af 100644 --- a/ui/packages/components/src/__tests__/page-header-actions-shared-12906.test.tsx +++ b/ui/packages/components/src/__tests__/page-header-actions-shared-12906.test.tsx @@ -24,15 +24,15 @@ import { PageHeaderActions } from '../index'; const RECORD = { id: 'lead-1', name: 'Ada', status: 'open' }; const OBJECT_SCHEMA = { name: 'lead', label: 'Lead' }; const DECLARED = [ - { name: 'convert', label: 'Convert Lead', type: 'flow', locations: ['record_header'] }, - { name: 'qualify', label: 'Qualify', type: 'flow', locations: ['record_header'], visible: 'record.status == "open"' }, - { name: 'archive', label: 'Archive', type: 'flow', locations: ['record_more'] }, - { name: 'hidden_one', label: 'Never', type: 'flow', locations: ['record_header'], visible: false }, - { name: 'list_only', label: 'List Only', type: 'flow', locations: ['list_item'] }, + { name: 'convert', label: 'Convert Lead', type: 'flow', locations: ['record_page'] }, + { name: 'qualify', label: 'Qualify', type: 'flow', locations: ['record_page'], visible: 'record.status == "open"' }, + { name: 'archive', label: 'Archive', type: 'flow', locations: ['record_page'], component: 'action:menu' }, + { name: 'hidden_one', label: 'Never', type: 'flow', locations: ['record_page'], visible: false }, + { name: 'list_only', label: 'List Only', type: 'flow', locations: ['record_row'] }, ]; const SYSTEM = [ - { name: 'sys_edit', label: 'Edit', type: 'script', locations: ['record_header'], order: 100, onClick: () => {} }, - { name: 'sys_delete', label: 'Delete', type: 'script', locations: ['record_header'], order: 120, component: 'action:menu', onClick: () => {} }, + { name: 'sys_edit', label: 'Edit', type: 'script', locations: ['record_page'], order: 100, onClick: () => {} }, + { name: 'sys_delete', label: 'Delete', type: 'script', locations: ['record_page'], order: 120, component: 'action:menu', onClick: () => {} }, ]; function inRecord(node: React.ReactNode, headerSystemActions: unknown[] = SYSTEM) { diff --git a/ui/packages/components/src/__tests__/page-header-actions.test.tsx b/ui/packages/components/src/__tests__/page-header-actions.test.tsx index 30b28883b6c..0a783ca43cf 100644 --- a/ui/packages/components/src/__tests__/page-header-actions.test.tsx +++ b/ui/packages/components/src/__tests__/page-header-actions.test.tsx @@ -72,7 +72,7 @@ describe('PageHeaderRenderer — actions slot', () => { type: 'page:header', title: 'Lead', actions: [ - { name: 'convert', locations: ['record_header'], label: 'Convert Lead', type: 'flow' }, + { name: 'convert', locations: ['record_page'], label: 'Convert Lead', type: 'flow' }, ], }); expect(screen.getByRole('button', { name: /Convert Lead/i })).toBeTruthy(); @@ -84,7 +84,7 @@ describe('PageHeaderRenderer — actions slot', () => { properties: { title: 'Lead', actions: [ - { name: 'convert', locations: ['record_header'], label: 'Convert Lead', type: 'flow' }, + { name: 'convert', locations: ['record_page'], label: 'Convert Lead', type: 'flow' }, ], }, }); @@ -95,8 +95,8 @@ describe('PageHeaderRenderer — actions slot', () => { renderHeader({ type: 'page:header', actions: [ - { name: 'a', label: 'Header Action', locations: ['record_header'] }, - { name: 'b', label: 'List Only', locations: ['list_item'] }, + { name: 'a', label: 'Header Action', locations: ['record_page'] }, + { name: 'b', label: 'List Only', locations: ['record_row'] }, ], }); expect(screen.getByRole('button', { name: /Header Action/i })).toBeTruthy(); @@ -107,13 +107,13 @@ describe('PageHeaderRenderer — actions slot', () => { // render an undeclared one, alone among the surfaces that draw the same // record's actions (RecordDetailView pre-filters strictly, and the // synthesizer's own contract already said "must include - // `locations: ['record_header']` to render"). Host-injected chrome is + // `locations: ['record_page']` to render"). Host-injected chrome is // exempt, which the next test pins. it('skips an authored action that declares no placement', () => { renderHeader({ type: 'page:header', actions: [ - { name: 'declared', label: 'Declared Action', locations: ['record_header'] }, + { name: 'declared', label: 'Declared Action', locations: ['record_page'] }, { name: 'undeclared', label: 'Undeclared Action' }, { name: 'empty', label: 'Empty Placement', locations: [] }, ], @@ -150,7 +150,7 @@ describe('PageHeaderRenderer — actions slot', () => { actions: [ { name: 'convert', - locations: ['record_header'], + locations: ['record_page'], label: 'Convert Lead', visible: 'record.status == "qualified"', }, @@ -168,7 +168,7 @@ describe('PageHeaderRenderer — actions slot', () => { actions: [ { name: 'convert', - locations: ['record_header'], + locations: ['record_page'], label: 'Convert Lead', visible: 'record.status == "qualified"', }, @@ -186,7 +186,7 @@ describe('PageHeaderRenderer — actions slot', () => { actions: [ { name: 'convert', - locations: ['record_header'], + locations: ['record_page'], label: 'Convert Lead', visible: { dialect: 'cel', source: 'record.status == "qualified"' }, }, @@ -201,8 +201,8 @@ describe('PageHeaderRenderer — actions slot', () => { renderHeader({ type: 'page:header', actions: [ - { name: 'shown', locations: ['record_header'], label: 'Shown' }, - { name: 'gone', locations: ['record_header'], label: 'Hidden Action', hidden: true }, + { name: 'shown', locations: ['record_page'], label: 'Shown' }, + { name: 'gone', locations: ['record_page'], label: 'Hidden Action', hidden: true }, ], }); expect(screen.getByRole('button', { name: /Shown/i })).toBeTruthy(); @@ -212,7 +212,7 @@ describe('PageHeaderRenderer — actions slot', () => { it('emits a toolbar role with aria-label when actions render', () => { renderHeader({ type: 'page:header', - actions: [{ name: 'a', locations: ['record_header'], label: 'A' }], + actions: [{ name: 'a', locations: ['record_page'], label: 'A' }], }); const bar = screen.getByRole('toolbar', { name: /Page header actions/i }); expect(bar).toBeTruthy(); @@ -231,7 +231,7 @@ describe('PageHeaderRenderer — actions slot', () => { const onClick = vi.fn(); renderHeader({ type: 'page:header', - actions: [{ name: 'a', locations: ['record_header'], label: 'Click Me', onClick }], + actions: [{ name: 'a', locations: ['record_page'], label: 'Click Me', onClick }], }); fireEvent.click(screen.getByRole('button', { name: /Click Me/i })); expect(onClick).toHaveBeenCalledTimes(1); @@ -241,7 +241,7 @@ describe('PageHeaderRenderer — actions slot', () => { renderHeader( { type: 'page:header', - actions: [{ name: 'biz', locations: ['record_header'], label: 'Convert Lead' }], + actions: [{ name: 'biz', locations: ['record_page'], label: 'Convert Lead' }], }, { record: { id: '1' }, @@ -265,7 +265,7 @@ describe('PageHeaderRenderer — actions slot', () => { renderHeader( { type: 'page:header', - actions: [{ name: 'sys_edit', locations: ['record_header'], label: 'Authored Edit' }], + actions: [{ name: 'sys_edit', locations: ['record_page'], label: 'Authored Edit' }], }, { record: { id: '1' }, @@ -319,7 +319,7 @@ describe('PageHeaderRenderer — inline-edit session gate (objectui#2572)', () = ); } - const editCta = { name: 'sys_edit', locations: ['record_header'], label: 'Edit', disableDuringInlineEdit: true }; + const editCta = { name: 'sys_edit', locations: ['record_page'], label: 'Edit', disableDuringInlineEdit: true }; it('disables a `disableDuringInlineEdit` action while the session is active', () => { renderWithInlineEdit({ editing: true, actions: [editCta] }); @@ -334,7 +334,7 @@ describe('PageHeaderRenderer — inline-edit session gate (objectui#2572)', () = it('leaves unflagged actions alone during the session', () => { renderWithInlineEdit({ editing: true, - actions: [editCta, { name: 'convert', locations: ['record_header'], label: 'Convert' }], + actions: [editCta, { name: 'convert', locations: ['record_page'], label: 'Convert' }], }); expect(screen.getByRole('button', { name: /Edit/i })).toBeDisabled(); expect(screen.getByRole('button', { name: /Convert/i })).toBeEnabled(); @@ -346,9 +346,9 @@ describe('PageHeaderRenderer — inline/overflow split (objectui#2361)', () => { renderHeader({ type: 'page:header', actions: [ - { name: 'convert', locations: ['record_header'], label: 'Convert Lead' }, - { name: 'assign', locations: ['record_header'], label: 'Assign' }, - { name: 'return', locations: ['record_header'], label: 'Return' }, + { name: 'convert', locations: ['record_page'], label: 'Convert Lead' }, + { name: 'assign', locations: ['record_page'], label: 'Assign' }, + { name: 'return', locations: ['record_page'], label: 'Return' }, ], }); expect(screen.getByRole('button', { name: /Convert Lead/i })).toBeTruthy(); @@ -361,10 +361,10 @@ describe('PageHeaderRenderer — inline/overflow split (objectui#2361)', () => { renderHeader({ type: 'page:header', actions: [ - { name: 'a', locations: ['record_header'], label: 'Action A' }, - { name: 'b', locations: ['record_header'], label: 'Action B' }, - { name: 'c', locations: ['record_header'], label: 'Action C' }, - { name: 'd', locations: ['record_header'], label: 'Action D' }, + { name: 'a', locations: ['record_page'], label: 'Action A' }, + { name: 'b', locations: ['record_page'], label: 'Action B' }, + { name: 'c', locations: ['record_page'], label: 'Action C' }, + { name: 'd', locations: ['record_page'], label: 'Action D' }, ], }); expect(screen.getByRole('button', { name: /Action C/i })).toBeTruthy(); @@ -377,8 +377,8 @@ describe('PageHeaderRenderer — inline/overflow split (objectui#2361)', () => { type: 'page:header', maxVisible: 1, actions: [ - { name: 'a', locations: ['record_header'], label: 'Action A' }, - { name: 'b', locations: ['record_header'], label: 'Action B' }, + { name: 'a', locations: ['record_page'], label: 'Action A' }, + { name: 'b', locations: ['record_page'], label: 'Action B' }, ], }); expect(screen.getByRole('button', { name: /Action A/i })).toBeTruthy(); @@ -392,10 +392,10 @@ describe('PageHeaderRenderer — inline/overflow split (objectui#2361)', () => { properties: { maxVisible: 4, actions: [ - { name: 'a', locations: ['record_header'], label: 'Action A' }, - { name: 'b', locations: ['record_header'], label: 'Action B' }, - { name: 'c', locations: ['record_header'], label: 'Action C' }, - { name: 'd', locations: ['record_header'], label: 'Action D' }, + { name: 'a', locations: ['record_page'], label: 'Action A' }, + { name: 'b', locations: ['record_page'], label: 'Action B' }, + { name: 'c', locations: ['record_page'], label: 'Action C' }, + { name: 'd', locations: ['record_page'], label: 'Action D' }, ], }, }); @@ -408,8 +408,8 @@ describe('PageHeaderRenderer — inline/overflow split (objectui#2361)', () => { type: 'page:header', maxVisible: 1, actions: [ - { name: 'a', locations: ['record_header'], label: 'Action A' }, - { name: 'b', locations: ['record_header'], label: 'Action B', order: -1 }, + { name: 'a', locations: ['record_page'], label: 'Action A' }, + { name: 'b', locations: ['record_page'], label: 'Action B', order: -1 }, ], }); expect(screen.getByRole('button', { name: /Action B/i })).toBeTruthy(); @@ -421,8 +421,8 @@ describe('PageHeaderRenderer — inline/overflow split (objectui#2361)', () => { type: 'page:header', maxVisible: 1, actions: [ - { name: 'a', locations: ['record_header'], label: 'Action A' }, - { name: 'b', locations: ['record_header'], label: 'Action B', variant: 'primary' }, + { name: 'a', locations: ['record_page'], label: 'Action A' }, + { name: 'b', locations: ['record_page'], label: 'Action B', variant: 'primary' }, ], }); expect(screen.getByRole('button', { name: /Action B/i })).toBeTruthy(); @@ -433,8 +433,8 @@ describe('PageHeaderRenderer — inline/overflow split (objectui#2361)', () => { renderHeader({ type: 'page:header', actions: [ - { name: 'convert', locations: ['record_header'], label: 'Convert Lead' }, - { name: 'sys_delete', locations: ['record_header'], label: 'Delete', component: 'action:menu' }, + { name: 'convert', locations: ['record_page'], label: 'Convert Lead' }, + { name: 'sys_delete', locations: ['record_page'], label: 'Delete', component: 'action:menu' }, ], }); expect(screen.getByRole('button', { name: /Convert Lead/i })).toBeTruthy(); @@ -472,10 +472,10 @@ describe('PageHeaderRenderer — inline/overflow split (objectui#2361)', () => { // unrelated reader (provider config). describe('PageHeaderRenderer — maxVisible contract domain (objectui#5006)', () => { const fourActions = [ - { name: 'a', locations: ['record_header'], label: 'Action A' }, - { name: 'b', locations: ['record_header'], label: 'Action B' }, - { name: 'c', locations: ['record_header'], label: 'Action C' }, - { name: 'd', locations: ['record_header'], label: 'Action D' }, + { name: 'a', locations: ['record_page'], label: 'Action A' }, + { name: 'b', locations: ['record_page'], label: 'Action B' }, + { name: 'c', locations: ['record_page'], label: 'Action C' }, + { name: 'd', locations: ['record_page'], label: 'Action D' }, ]; // Asserts the DEFAULT-3 split: A/B/C inline, D folded into the overflow menu. @@ -591,7 +591,7 @@ describe('PageHeaderRenderer — record dispatch shape (objectui#3391)', () => { name: 'copy_plan_row_3391', type: 'api', method: 'PATCH', - locations: ['record_header'], + locations: ['record_page'], label: 'Copy Plan', target: '/api/v1/data/os_plan/{id}', }; @@ -620,7 +620,7 @@ describe('PageHeaderRenderer — record dispatch shape (objectui#3391)', () => { const action = { name: 'copy_plan_params_3391', type: 'api', - locations: ['record_header'], + locations: ['record_page'], label: 'Copy With Params', target: '/api/v1/data/os_plan/{id}', params: paramDefs, @@ -645,7 +645,7 @@ describe('PageHeaderRenderer — record dispatch shape (objectui#3391)', () => { const action = { name: 'object_params_3391', type: 'api', - locations: ['record_header'], + locations: ['record_page'], label: 'Object Params', target: '/api/v1/data/os_plan/{id}', params: { channel: 'header' }, @@ -662,7 +662,7 @@ describe('PageHeaderRenderer — record dispatch shape (objectui#3391)', () => { const action = { name: 'no_record_3391', type: 'api', - locations: ['record_header'], + locations: ['record_page'], label: 'No Record', target: '/api/v1/misc/ping', }; @@ -687,7 +687,7 @@ describe('PageHeaderRenderer — record dispatch shape (objectui#3391)', () => { expect(action).toStrictEqual({ name: 'no_record_3391', type: 'api', - locations: ['record_header'], + locations: ['record_page'], label: 'No Record', target: '/api/v1/misc/ping', }); @@ -704,8 +704,8 @@ describe('PageHeaderRenderer — #2358 action visibility traps', () => { { type: 'page:header', actions: [ - { name: 'convert2358', locations: ['record_header'], label: 'Convert Lead' }, - { name: 'export_pdf_2358', label: 'Export PDF', locations: ['record_more'] }, + { name: 'convert2358', locations: ['record_page'], label: 'Convert Lead' }, + { name: 'export_pdf_2358', label: 'Export PDF', locations: ['record_page'], component: 'action:menu' }, ], }, { record: { id: '1' } }, @@ -722,7 +722,7 @@ describe('PageHeaderRenderer — #2358 action visibility traps', () => { { type: 'page:header', actions: [ - { name: 'archive_2358', label: 'Archive Record', locations: ['record_more'] }, + { name: 'archive_2358', label: 'Archive Record', locations: ['record_page'], component: 'action:menu' }, ], }, { record: { id: '1' } }, @@ -736,7 +736,7 @@ describe('PageHeaderRenderer — #2358 action visibility traps', () => { { type: 'page:header', actions: [ - { name: 'list_only_2358', label: 'List Only', locations: ['list_item'] }, + { name: 'list_only_2358', label: 'List Only', locations: ['record_row'] }, ], }, { record: { id: '1' } }, @@ -754,7 +754,7 @@ describe('PageHeaderRenderer — #2358 action visibility traps', () => { actions: [ { name: 'admin_gate_2358', - locations: ['record_header'], + locations: ['record_page'], label: 'Admin Gate', visible: 'os.user.role == "admin"', }, @@ -772,7 +772,7 @@ describe('PageHeaderRenderer — #2358 action visibility traps', () => { actions: [ { name: 'admin_gate_no_match_2358', - locations: ['record_header'], + locations: ['record_page'], label: 'Admin Gate', visible: 'os.user.role == "admin"', }, @@ -793,7 +793,7 @@ describe('PageHeaderRenderer — #2358 action visibility traps', () => { actions: [ { name: 'bad_scope_2358', - locations: ['record_header'], + locations: ['record_page'], label: 'Bad Scope', visible: 'undeclared_var_2358 == 1', }, @@ -832,7 +832,7 @@ describe('PageHeaderRenderer — #2358 action visibility traps', () => { actions: [ { name: 'hidden_field_gate_2358', - locations: ['record_header'], + locations: ['record_page'], label: 'Hidden Field Gate', visible: 'record.secret_level_2358 == "high"', }, @@ -872,7 +872,7 @@ describe('PageHeaderRenderer — #2358 action visibility traps', () => { actions: [ { name: 'null_field_gate_2358', - locations: ['record_header'], + locations: ['record_page'], label: 'Null Field Gate', visible: 'record.approver_2358 == "u1"', }, @@ -900,7 +900,7 @@ describe('PageHeaderRenderer — in-flight header action (objectstack#34933)', ( const promise = new Promise((res, rej) => { resolve = res; reject = rej; }); return { promise, resolve, reject }; } - const convert = { name: 'convert', locations: ['record_header'], label: 'Convert Lead', type: 'flow', icon: 'ArrowRightCircle' }; + const convert = { name: 'convert', locations: ['record_page'], label: 'Convert Lead', type: 'flow', icon: 'ArrowRightCircle' }; const record = { id: 'lead-1', name: 'Mira Costa' }; function renderWithFlow(flow: (action: ActionDef, ctx: ActionContext) => Promise) { @@ -1064,7 +1064,7 @@ describe('PageHeaderRenderer — in-flight header action (objectstack#34933)', ( schema={{ type: 'page:header', title: 'Lead', - actions: [{ name: 'qualify', type: 'api', target: '/api/v1/qualify', confirmText: 'Qualify this lead?', locations: ['record_header'], label: 'Qualify' }], + actions: [{ name: 'qualify', type: 'api', target: '/api/v1/qualify', confirmText: 'Qualify this lead?', locations: ['record_page'], label: 'Qualify' }], }} /> diff --git a/ui/packages/components/src/__tests__/page-header-capability-gate.test.tsx b/ui/packages/components/src/__tests__/page-header-capability-gate.test.tsx index c8c055719ac..9b46a9855c4 100644 --- a/ui/packages/components/src/__tests__/page-header-capability-gate.test.tsx +++ b/ui/packages/components/src/__tests__/page-header-capability-gate.test.tsx @@ -39,8 +39,8 @@ const schema = { type: 'page:header', title: 'Invoice', actions: [ - { name: 'gated', locations: ['record_header'], label: 'Set Parallel Reviewers', type: 'api', requiredPermissions: ['ehr_probe_capability'] }, - { name: 'plain', locations: ['record_header'], label: 'Print', type: 'api' }, + { name: 'gated', locations: ['record_page'], label: 'Set Parallel Reviewers', type: 'api', requiredPermissions: ['ehr_probe_capability'] }, + { name: 'plain', locations: ['record_page'], label: 'Print', type: 'api' }, ], }; @@ -71,7 +71,7 @@ describe('page:header — ADR-0066 D4 capability gate (#3923)', () => { schema={{ type: 'page:header', title: 'Invoice', - actions: [{ name: 'both', locations: ['record_header'], label: 'Needs Both', type: 'api', requiredPermissions: ['a', 'b'] }], + actions: [{ name: 'both', locations: ['record_page'], label: 'Needs Both', type: 'api', requiredPermissions: ['a', 'b'] }], }} /> , diff --git a/ui/packages/components/src/__tests__/page-header-danger-12764.test.tsx b/ui/packages/components/src/__tests__/page-header-danger-12764.test.tsx index fc0d30e722f..97e6bb3c071 100644 --- a/ui/packages/components/src/__tests__/page-header-danger-12764.test.tsx +++ b/ui/packages/components/src/__tests__/page-header-danger-12764.test.tsx @@ -76,7 +76,7 @@ const act = (name: string, label: string, extra: Record = {}) = label, type: 'url', target: `https://example.com/${name}`, - locations: ['record_header'], + locations: ['record_page'], ...extra, }); diff --git a/ui/packages/components/src/__tests__/page-header-disabledReason-11811.test.tsx b/ui/packages/components/src/__tests__/page-header-disabledReason-11811.test.tsx index af205af4e7c..d5cb5ee0cb3 100644 --- a/ui/packages/components/src/__tests__/page-header-disabledReason-11811.test.tsx +++ b/ui/packages/components/src/__tests__/page-header-disabledReason-11811.test.tsx @@ -48,16 +48,16 @@ const ARCHIVE = { name: 'showcase_archive_task', label: 'Archive', type: 'script', - locations: ['record_header'], + locations: ['record_page'], disabled: DONE_GATE, }; /** A `record_more`-only action: always drawn in the ⋯ overflow. */ -const ARCHIVE_MORE = { ...ARCHIVE, name: 'showcase_archive_more', label: 'Archive later', locations: ['record_more'] }; +const ARCHIVE_MORE = { ...ARCHIVE, name: 'showcase_archive_more', label: 'Archive later', locations: ['record_page'], component: 'action:menu' }; /** The host's chrome, as `RecordDetailView` injects it: a host-computed boolean `disabled`. */ -const HOST_EDIT = { name: 'sys_edit', label: 'Edit', type: 'script', locations: ['record_header'], disabled: true, onClick: () => {} }; +const HOST_EDIT = { name: 'sys_edit', label: 'Edit', type: 'script', locations: ['record_page'], disabled: true, onClick: () => {} }; const HOST_DELETE = { - name: 'sys_delete', label: 'Delete', type: 'script', locations: ['record_header'], + name: 'sys_delete', label: 'Delete', type: 'script', locations: ['record_page'], component: 'action:menu', disabled: true, onClick: () => {}, }; diff --git a/ui/packages/components/src/__tests__/page-header-disabledReason-26619.test.tsx b/ui/packages/components/src/__tests__/page-header-disabledReason-26619.test.tsx index 5a80f0c3217..510f9e22cf8 100644 --- a/ui/packages/components/src/__tests__/page-header-disabledReason-26619.test.tsx +++ b/ui/packages/components/src/__tests__/page-header-disabledReason-26619.test.tsx @@ -31,11 +31,11 @@ const ARCHIVE = { name: 'showcase_archive_task', label: 'Archive', type: 'script', - locations: ['record_header'], + locations: ['record_page'], disabled: DONE_GATE, disabledReason: DECLARED_EN, }; -const ARCHIVE_MORE = { ...ARCHIVE, name: 'showcase_archive_more', label: 'Archive later', locations: ['record_more'] }; +const ARCHIVE_MORE = { ...ARCHIVE, name: 'showcase_archive_more', label: 'Archive later', locations: ['record_page'], component: 'action:menu' }; const { disabledReason: _none, ...ARCHIVE_UNDECLARED } = ARCHIVE; function PageHeader({ schema }: { schema: any }) { diff --git a/ui/packages/components/src/__tests__/page-header-edit-outline-36049.test.tsx b/ui/packages/components/src/__tests__/page-header-edit-outline-36049.test.tsx index 6323c4c27f0..ed2f934295b 100644 --- a/ui/packages/components/src/__tests__/page-header-edit-outline-36049.test.tsx +++ b/ui/packages/components/src/__tests__/page-header-edit-outline-36049.test.tsx @@ -60,7 +60,7 @@ const act = (name: string, label: string, extra: Record = {}) = label, type: 'url', target: `https://example.com/${name}`, - locations: ['record_header'], + locations: ['record_page'], ...extra, }); diff --git a/ui/packages/components/src/__tests__/page-header-lookup-predicate.test.tsx b/ui/packages/components/src/__tests__/page-header-lookup-predicate.test.tsx index 5111c3b39db..bf32c045baa 100644 --- a/ui/packages/components/src/__tests__/page-header-lookup-predicate.test.tsx +++ b/ui/packages/components/src/__tests__/page-header-lookup-predicate.test.tsx @@ -50,7 +50,7 @@ const OBJECT_SCHEMA = { const schema = (visible: string) => ({ type: 'page:header', title: 'Task', - actions: [{ name: 'reassign', locations: ['record_header'], label: 'Reassign', type: 'api', visible }], + actions: [{ name: 'reassign', locations: ['record_page'], label: 'Reassign', type: 'api', visible }], }); function renderHeader(record: any, visible: string) { diff --git a/ui/packages/components/src/__tests__/page-header-more-actions-i18n.test.tsx b/ui/packages/components/src/__tests__/page-header-more-actions-i18n.test.tsx index e09eb71142e..9cbc7cbea62 100644 --- a/ui/packages/components/src/__tests__/page-header-more-actions-i18n.test.tsx +++ b/ui/packages/components/src/__tests__/page-header-more-actions-i18n.test.tsx @@ -45,10 +45,10 @@ const schema = { type: 'page:header', title: 'Acme Corp', actions: [ - { name: 'convert', locations: ['record_header'], label: 'Convert', type: 'flow' }, - { name: 'clone', locations: ['record_header'], label: 'Clone', type: 'flow' }, - { name: 'share', locations: ['record_header'], label: 'Share', type: 'flow' }, - { name: 'archive', locations: ['record_header'], label: 'Archive', type: 'flow' }, + { name: 'convert', locations: ['record_page'], label: 'Convert', type: 'flow' }, + { name: 'clone', locations: ['record_page'], label: 'Clone', type: 'flow' }, + { name: 'share', locations: ['record_page'], label: 'Share', type: 'flow' }, + { name: 'archive', locations: ['record_page'], label: 'Archive', type: 'flow' }, ], }; diff --git a/ui/packages/components/src/__tests__/page-header-overflow-close-36499.test.tsx b/ui/packages/components/src/__tests__/page-header-overflow-close-36499.test.tsx index 2cb76f9577c..67b96765ceb 100644 --- a/ui/packages/components/src/__tests__/page-header-overflow-close-36499.test.tsx +++ b/ui/packages/components/src/__tests__/page-header-overflow-close-36499.test.tsx @@ -64,7 +64,7 @@ afterEach(() => { describe('page:header — a ⋯ entry that finished on the click closes the menu (objectstack#36499)', () => { it('an in-place entry runs once and the menu closes', async () => { const enter = vi.fn(); - renderHeader([{ name: 'configure', label: 'Configure tabs', locations: ['record_header'], component: 'action:menu', onClick: enter }]); + renderHeader([{ name: 'configure', label: 'Configure tabs', locations: ['record_page'], component: 'action:menu', onClick: enter }]); await openMore(); fireEvent.click(screen.getByRole('menuitem', { name: 'Configure tabs' })); expect(enter).toHaveBeenCalledTimes(1); @@ -74,7 +74,7 @@ describe('page:header — a ⋯ entry that finished on the click closes the menu it('an entry still running keeps the menu open, its row busy, until it settles', async () => { let settle: () => void = () => {}; const run = vi.fn(() => new Promise((resolve) => { settle = resolve; })); - renderHeader([{ name: 'recompute', label: 'Recompute', locations: ['record_header'], component: 'action:menu', onClick: run }]); + renderHeader([{ name: 'recompute', label: 'Recompute', locations: ['record_page'], component: 'action:menu', onClick: run }]); await openMore(); fireEvent.click(screen.getByRole('menuitem', { name: 'Recompute' })); expect(run).toHaveBeenCalledTimes(1); @@ -89,7 +89,7 @@ describe('page:header — a host entry declaring leadsMenu opens the ⋯, ahead const host = (name: string, label: string, extra: Record = {}) => ({ name, label, - locations: ['record_header'], + locations: ['record_page'], component: 'action:menu', onClick: vi.fn(), ...extra, @@ -102,7 +102,7 @@ describe('page:header — a host entry declaring leadsMenu opens the ⋯, ahead }); it('an authored action cannot claim the place: it stays in its band, after Refresh', async () => { - renderHeader([{ name: 'approve', label: 'Approve', locations: ['record_more'], leadsMenu: true }], [host('sys_share', 'Share')]); + renderHeader([{ name: 'approve', label: 'Approve', locations: ['record_page'], component: 'action:menu', leadsMenu: true }], [host('sys_share', 'Share')]); await openMore(); expect(screen.getAllByRole('menuitem').map((item) => item.textContent)).toEqual(['Refresh', 'Approve', 'Share']); }); diff --git a/ui/packages/components/src/__tests__/page-header-phone-bar-27058.test.tsx b/ui/packages/components/src/__tests__/page-header-phone-bar-27058.test.tsx index 932336a1a72..978ebff708c 100644 --- a/ui/packages/components/src/__tests__/page-header-phone-bar-27058.test.tsx +++ b/ui/packages/components/src/__tests__/page-header-phone-bar-27058.test.tsx @@ -46,9 +46,9 @@ const HOST_ACTIONS = [ { name: 'sys_delete', label: 'Delete' }, ]; -const convert = { name: 'convert', locations: ['record_header'], label: 'Convert Lead', type: 'flow' }; -const assign = { name: 'assign', locations: ['record_header'], label: 'Assign', type: 'flow' }; -const ret = { name: 'return_to_pool', locations: ['record_header'], label: 'Return', type: 'flow' }; +const convert = { name: 'convert', locations: ['record_page'], label: 'Convert Lead', type: 'flow' }; +const assign = { name: 'assign', locations: ['record_page'], label: 'Assign', type: 'flow' }; +const ret = { name: 'return_to_pool', locations: ['record_page'], label: 'Return', type: 'flow' }; /** A host that owns a bottom bar and hands it to the header, as the console's record page does. */ function PhoneHost({ @@ -198,10 +198,10 @@ describe('a record header on a phone draws its actions into the host\'s bottom b * of the `⋯`. The bar is now Edit, the primary action, then the `⋯`. */ describe('the phone bar keeps Edit visible on an editable record (objectstack#34595)', () => { - const clone = { name: 'clone_opportunity', locations: ['record_header'], label: 'Clone Opportunity', type: 'flow' }; + const clone = { name: 'clone_opportunity', locations: ['record_page'], label: 'Clone Opportunity', type: 'flow' }; // Declared second, so the primary is picked by its `variant`, not by position. - const quote = { name: 'generate_quote', locations: ['record_header'], label: 'Generate Quote', type: 'flow', variant: 'primary' }; - const report = { name: 'print_report', locations: ['record_header'], label: 'Print', type: 'flow' }; + const quote = { name: 'generate_quote', locations: ['record_page'], label: 'Generate Quote', type: 'flow', variant: 'primary' }; + const report = { name: 'print_report', locations: ['record_page'], label: 'Print', type: 'flow' }; const OPPORTUNITY = { type: 'page:header', actions: [clone, quote, report] }; it('draws [Edit][primary][⋯]: the primary is the action declaring variant primary, the rest fold', async () => { diff --git a/ui/packages/components/src/__tests__/page-header-predicate-dialect.test.tsx b/ui/packages/components/src/__tests__/page-header-predicate-dialect.test.tsx index eec57dc877c..745de847c8c 100644 --- a/ui/packages/components/src/__tests__/page-header-predicate-dialect.test.tsx +++ b/ui/packages/components/src/__tests__/page-header-predicate-dialect.test.tsx @@ -87,7 +87,7 @@ function renderHeader(action: Record, record: any = RECORD) { schema={{ type: 'page:header', title: 'Specimen', - actions: [{ locations: ['record_header'], label: 'Zoo Action', type: 'api', ...action }], + actions: [{ locations: ['record_page'], label: 'Zoo Action', type: 'api', ...action }], }} /> @@ -387,7 +387,7 @@ describe('page:header — a record still loading is its own state, not an empty schema={{ type: 'page:header', title: 'Specimen', - actions: [{ locations: ['record_header'], label: 'Zoo Action', type: 'api', ...action }], + actions: [{ locations: ['record_page'], label: 'Zoo Action', type: 'api', ...action }], }} /> diff --git a/ui/packages/components/src/__tests__/page-header-pressed-28242.test.tsx b/ui/packages/components/src/__tests__/page-header-pressed-28242.test.tsx index f060ed8a25a..105961eac02 100644 --- a/ui/packages/components/src/__tests__/page-header-pressed-28242.test.tsx +++ b/ui/packages/components/src/__tests__/page-header-pressed-28242.test.tsx @@ -24,17 +24,17 @@ const HELPFUL = { name: 'mark_article_helpful', label: 'Helpful', type: 'script', - locations: ['record_header'], + locations: ['record_page'], pressed: "has(record.viewer) && record.viewer.vote == 'helpful'", }; const NOT_HELPFUL = { name: 'mark_article_not_helpful', label: 'Not helpful', type: 'script', - locations: ['record_header'], + locations: ['record_page'], pressed: { dialect: 'cel', source: "has(record.viewer) && record.viewer.vote == 'not_helpful'" }, }; -const SHARE = { name: 'share_article', label: 'Share', type: 'script', locations: ['record_header'] }; +const SHARE = { name: 'share_article', label: 'Share', type: 'script', locations: ['record_page'] }; function PageHeader({ schema }: { schema: any }) { const Component = ComponentRegistry.get('page:header'); diff --git a/ui/packages/components/src/__tests__/page-header-primary-12617.test.tsx b/ui/packages/components/src/__tests__/page-header-primary-12617.test.tsx index 3a56c22aa93..82c7aaa6b60 100644 --- a/ui/packages/components/src/__tests__/page-header-primary-12617.test.tsx +++ b/ui/packages/components/src/__tests__/page-header-primary-12617.test.tsx @@ -75,7 +75,7 @@ const act = (name: string, label: string, extra: Record = {}) = label, type: 'url', target: `https://example.com/${name}`, - locations: ['record_header'], + locations: ['record_page'], ...extra, }); diff --git a/ui/packages/components/src/__tests__/page-header-record-bar-35593.test.tsx b/ui/packages/components/src/__tests__/page-header-record-bar-35593.test.tsx index 37fd154fa32..0c9dbca52f1 100644 --- a/ui/packages/components/src/__tests__/page-header-record-bar-35593.test.tsx +++ b/ui/packages/components/src/__tests__/page-header-record-bar-35593.test.tsx @@ -69,7 +69,7 @@ const act = (name: string, label: string, extra: Record = {}) = label, type: 'url', target: `https://example.com/${name}`, - locations: ['record_header'], + locations: ['record_page'], ...extra, }); diff --git a/ui/packages/components/src/__tests__/page-header-refresh.test.tsx b/ui/packages/components/src/__tests__/page-header-refresh.test.tsx index 3cb7c5ee42b..8c6e1edffb2 100644 --- a/ui/packages/components/src/__tests__/page-header-refresh.test.tsx +++ b/ui/packages/components/src/__tests__/page-header-refresh.test.tsx @@ -136,10 +136,10 @@ describe('page:header — 1 primary + 2 secondary + ⋯, refresh first in the renderHeader({ refresh: vi.fn(), actions: [ - { name: 'start', locations: ['record_header'], label: 'Start' }, - { name: 'expedite', locations: ['record_header'], label: 'Expedite' }, - { name: 'report', locations: ['record_header'], label: 'Report' }, - { name: 'archive', locations: ['record_header'], label: 'Archive' }, + { name: 'start', locations: ['record_page'], label: 'Start' }, + { name: 'expedite', locations: ['record_page'], label: 'Expedite' }, + { name: 'report', locations: ['record_page'], label: 'Report' }, + { name: 'archive', locations: ['record_page'], label: 'Archive' }, ], }); @@ -157,8 +157,8 @@ describe('page:header — 1 primary + 2 secondary + ⋯, refresh first in the renderHeader({ refresh: vi.fn(), actions: [ - { name: 'start', locations: ['record_header'], label: 'Start' }, - { name: 'clone', locations: ['record_more'], label: 'Clone' }, + { name: 'start', locations: ['record_page'], label: 'Start' }, + { name: 'clone', locations: ['record_page'], component: 'action:menu', label: 'Clone' }, ], }); diff --git a/ui/packages/components/src/__tests__/page-header-switched-off-27504.test.tsx b/ui/packages/components/src/__tests__/page-header-switched-off-27504.test.tsx index 15585cb3502..bb67bf03779 100644 --- a/ui/packages/components/src/__tests__/page-header-switched-off-27504.test.tsx +++ b/ui/packages/components/src/__tests__/page-header-switched-off-27504.test.tsx @@ -35,8 +35,8 @@ const served = (switchedOff: string[]) => { name: 'showcase_task', actions: [ - { name: 'showcase_mark_done', label: 'Mark Done', type: 'script', locations: ['record_header'] }, - { name: 'showcase_log_time', label: 'Log Time', type: 'script', locations: ['record_header'] }, + { name: 'showcase_mark_done', label: 'Mark Done', type: 'script', locations: ['record_page'] }, + { name: 'showcase_log_time', label: 'Log Time', type: 'script', locations: ['record_page'] }, ], }, switchedOff, @@ -49,7 +49,7 @@ const markDone = () => screen.queryByRole('button', { name: /Mark Done/i }); describe.each([ ['page:header', (actions: any[]) => ({ type: 'page:header', title: 'Task', actions })], - ['action:bar', (actions: any[]) => ({ type: 'action:bar', location: 'record_header', actions })], + ['action:bar', (actions: any[]) => ({ type: 'action:bar', location: 'record_page', actions })], ])('%s — switched-off packaged action (objectstack#27504)', (_type, schemaOf) => { it('does not offer an action the platform served as switched off', () => { renderIn(schemaOf(served(['showcase_mark_done']))); diff --git a/ui/packages/components/src/__tests__/page-header-title-width.test.tsx b/ui/packages/components/src/__tests__/page-header-title-width.test.tsx index 41830afa72b..07060880d44 100644 --- a/ui/packages/components/src/__tests__/page-header-title-width.test.tsx +++ b/ui/packages/components/src/__tests__/page-header-title-width.test.tsx @@ -43,9 +43,9 @@ function PageHeader({ schema }: { schema: any }) { /** The Field Zoo shape from the report: three labelled record-header actions. */ const WIDE_ACTIONS = [ - { name: 'gallery', locations: ['record_header'], label: 'Action Param Gallery' }, - { name: 'lookup_first', locations: ['record_header'], label: 'Lookup == first of many' }, - { name: 'assign_me', locations: ['record_header'], label: 'Assign to me (owner_id)' }, + { name: 'gallery', locations: ['record_page'], label: 'Action Param Gallery' }, + { name: 'lookup_first', locations: ['record_page'], label: 'Lookup == first of many' }, + { name: 'assign_me', locations: ['record_page'], label: 'Assign to me (owner_id)' }, ]; function renderRecordHeader(actions: any[] = WIDE_ACTIONS) { @@ -136,7 +136,7 @@ describe('PageHeaderRenderer — record title width arbitration (#7244)', () => // unconditional, so a header that already fits is unaffected at runtime — // 192px floor + 16px gap + a ~136px tail leaves the row uncrowded. const { header, titleColumn } = renderRecordHeader([ - { name: 'edit', locations: ['record_header'], label: 'Edit' }, + { name: 'edit', locations: ['record_page'], label: 'Edit' }, ]); expect(header.className).toContain('sm:flex-wrap'); expect(titleColumn.className).toMatch(/\bsm:min-w-(?!0\b)\S+/); diff --git a/ui/packages/components/src/__tests__/page-header-toolbar-name-i18n.test.tsx b/ui/packages/components/src/__tests__/page-header-toolbar-name-i18n.test.tsx index 4ba012d2251..e716535c3d8 100644 --- a/ui/packages/components/src/__tests__/page-header-toolbar-name-i18n.test.tsx +++ b/ui/packages/components/src/__tests__/page-header-toolbar-name-i18n.test.tsx @@ -39,8 +39,8 @@ const schema = { type: 'page:header', title: 'Acme Corp', actions: [ - { name: 'convert', locations: ['record_header'], label: 'Convert', type: 'flow' }, - { name: 'clone', locations: ['record_header'], label: 'Clone', type: 'flow' }, + { name: 'convert', locations: ['record_page'], label: 'Convert', type: 'flow' }, + { name: 'clone', locations: ['record_page'], label: 'Clone', type: 'flow' }, ], }; diff --git a/ui/packages/components/src/__tests__/page-header-trailing-27241.test.tsx b/ui/packages/components/src/__tests__/page-header-trailing-27241.test.tsx index 381ec644b65..05b641a8ee3 100644 --- a/ui/packages/components/src/__tests__/page-header-trailing-27241.test.tsx +++ b/ui/packages/components/src/__tests__/page-header-trailing-27241.test.tsx @@ -23,8 +23,8 @@ import { PageHeaderActions, PageHeaderTrailingContext } from '../index'; const RECORD = { id: 'lead-1', name: 'Ada' }; const SYSTEM = [ - { name: 'sys_edit', label: 'Edit', type: 'script', locations: ['record_header'], order: 100, onClick: () => {} }, - { name: 'sys_delete', label: 'Delete', type: 'script', locations: ['record_header'], order: 120, component: 'action:menu', onClick: () => {} }, + { name: 'sys_edit', label: 'Edit', type: 'script', locations: ['record_page'], order: 100, onClick: () => {} }, + { name: 'sys_delete', label: 'Delete', type: 'script', locations: ['record_page'], order: 120, component: 'action:menu', onClick: () => {} }, ]; function inRecord(node: React.ReactNode, headerSystemActions: unknown[] = SYSTEM) { diff --git a/ui/packages/components/src/renderers/action/__tests__/action-bar-danger-variant-26781.test.tsx b/ui/packages/components/src/renderers/action/__tests__/action-bar-danger-variant-26781.test.tsx index 15f6b8a5e9a..1086250b88f 100644 --- a/ui/packages/components/src/renderers/action/__tests__/action-bar-danger-variant-26781.test.tsx +++ b/ui/packages/components/src/renderers/action/__tests__/action-bar-danger-variant-26781.test.tsx @@ -11,7 +11,7 @@ * the destructive button style and confirms through the destructive button. * * The producer is `examples/app-todo`'s `DeleteCompletedAction` - * (`delete_completed`: `locations: ['list_toolbar']`, `variant: 'danger'`, + * (`delete_completed`: `locations: ['list']`, `variant: 'danger'`, * `confirmText`). The list page hands an object's actions to `action:bar` as * they are served, and `action:bar` spreads each one onto an `action:button` * member with `variant: action.variant || schema.variant`. Before @@ -56,7 +56,7 @@ const DELETE_COMPLETED = { icon: 'trash', type: 'script', target: 'deleteCompletedTasks', - locations: ['list_toolbar'], + locations: ['list'], variant: 'danger', confirmText: 'Permanently delete all completed tasks? This cannot be undone.', successMessage: 'Completed tasks deleted!', @@ -76,7 +76,7 @@ const EXPORT_CSV = { icon: 'download', type: 'script', target: 'exportTasksToCSV', - locations: ['list_toolbar'], + locations: ['list'], successMessage: 'Export completed!', refreshAfter: false, ai: { @@ -99,7 +99,7 @@ function renderToolbar() { if (!Bar) throw new Error('action:bar is not registered'); const schema = { type: 'action:bar', - location: 'list_toolbar', + location: 'list', actions: [DELETE_COMPLETED, EXPORT_CSV], size: 'sm', variant: 'outline', diff --git a/ui/packages/components/src/renderers/action/__tests__/action-button-icon-inputs-11168.test.tsx b/ui/packages/components/src/renderers/action/__tests__/action-button-icon-inputs-11168.test.tsx index f7736803e31..837f278598b 100644 --- a/ui/packages/components/src/renderers/action/__tests__/action-button-icon-inputs-11168.test.tsx +++ b/ui/packages/components/src/renderers/action/__tests__/action-button-icon-inputs-11168.test.tsx @@ -516,7 +516,7 @@ describe.each(BLOCKS)('%s — keys the runner acts on, forwarded by the block', }); it('`locations` members: a record-scoped placement refuses to run with no record in scope', async () => { - mount(node(type, { actionType: 'script', locations: ['list_toolbar', 'record_header'] }), { + mount(node(type, { actionType: 'script', locations: ['list', 'record_page'] }), { handlers: { script: serverAction() }, }); press(); @@ -526,7 +526,7 @@ describe.each(BLOCKS)('%s — keys the runner acts on, forwarded by the block', expect(fetchSpy).not.toHaveBeenCalled(); cleanup(); // Control: object-level placements only — the same action runs without a record. - mount(node(type, { actionType: 'script', locations: ['list_toolbar'] }), { + mount(node(type, { actionType: 'script', locations: ['list'] }), { handlers: { script: serverAction() }, }); press(); diff --git a/ui/packages/components/src/renderers/action/__tests__/action-entry-object-params-10462.test.tsx b/ui/packages/components/src/renderers/action/__tests__/action-entry-object-params-10462.test.tsx index 1e45da8d00a..1e9ad0c1d45 100644 --- a/ui/packages/components/src/renderers/action/__tests__/action-entry-object-params-10462.test.tsx +++ b/ui/packages/components/src/renderers/action/__tests__/action-entry-object-params-10462.test.tsx @@ -96,7 +96,7 @@ function nodeFor(surface: Surface, entry: Record): { type: stri default: return { type: 'page:header', - schema: { title: 'Plan', actions: [{ ...entry, locations: ['record_header'] }] }, + schema: { title: 'Plan', actions: [{ ...entry, locations: ['record_page'] }] }, }; } } diff --git a/ui/packages/components/src/renderers/action/__tests__/action-forward-parity.test.tsx b/ui/packages/components/src/renderers/action/__tests__/action-forward-parity.test.tsx index 99b75bbecd0..4a28aec19f1 100644 --- a/ui/packages/components/src/renderers/action/__tests__/action-forward-parity.test.tsx +++ b/ui/packages/components/src/renderers/action/__tests__/action-forward-parity.test.tsx @@ -75,9 +75,9 @@ import '../action-menu'; /** Three ordinary actions — enough to fill the desktop `maxVisible: 3`. */ const FILLERS = [ - { name: 'a1', label: 'a1', type: 'api', locations: ['list_toolbar'] }, - { name: 'a2', label: 'a2', type: 'api', locations: ['list_toolbar'] }, - { name: 'a3', label: 'a3', type: 'api', locations: ['list_toolbar'] }, + { name: 'a1', label: 'a1', type: 'api', locations: ['list'] }, + { name: 'a2', label: 'a2', type: 'api', locations: ['list'] }, + { name: 'a3', label: 'a3', type: 'api', locations: ['list'] }, ]; /** @@ -93,7 +93,7 @@ const CREATE = { label: 'Create Environment', description: 'Provision a new environment for this project', type: 'api', - locations: ['list_toolbar'], + locations: ['list'], params: [{ name: 'title', type: 'text', label: 'Title' }], autoTrigger: true, }; @@ -115,7 +115,7 @@ function Bar({ actions }: { actions: any[] }) { const C = ComponentRegistry.get('action:bar'); if (!C) throw new Error('action:bar is not registered'); // eslint-disable-next-line react-hooks/static-components -- ComponentRegistry.get returns a registered renderer (stable reference), not a component created during render - return ; + return ; } const renderBar = (actions: any[]) => diff --git a/ui/packages/components/src/renderers/action/__tests__/action-forward-precedence.test.tsx b/ui/packages/components/src/renderers/action/__tests__/action-forward-precedence.test.tsx index 9f6e2d6dd81..f12595d5431 100644 --- a/ui/packages/components/src/renderers/action/__tests__/action-forward-precedence.test.tsx +++ b/ui/packages/components/src/renderers/action/__tests__/action-forward-precedence.test.tsx @@ -82,7 +82,7 @@ const ACTION = { properties: { params: { region: 'eu-west-1' } }, bodyExtra: { source: 'console' }, bodyShape: { wrap: 'data' }, - locations: ['list_toolbar'], + locations: ['list'], }; /** The host's override bag: one COLLIDING key, one the action never declared. */ diff --git a/ui/packages/components/src/renderers/action/__tests__/action-group-menu-inputs-11168.test.tsx b/ui/packages/components/src/renderers/action/__tests__/action-group-menu-inputs-11168.test.tsx index b5cab5874bc..0fe2d206516 100644 --- a/ui/packages/components/src/renderers/action/__tests__/action-group-menu-inputs-11168.test.tsx +++ b/ui/packages/components/src/renderers/action/__tests__/action-group-menu-inputs-11168.test.tsx @@ -150,7 +150,7 @@ describe('action:group — the published inputs (objectui#11168)', () => { expect(inputs.has('visible')).toBe(true); expect(inputs.has('name')).toBe(false); // The two published keys are keys the spec row accepts, `name` is not. - expect(specRow('action:group').safeParse({ location: 'list_toolbar', visible: true }).success).toBe(true); + expect(specRow('action:group').safeParse({ location: 'list', visible: true }).success).toBe(true); }); it('`name` is RETIRED: the spec refuses it, and nothing the group renders reads it', () => { @@ -199,10 +199,10 @@ describe('action:group — the published inputs (objectui#11168)', () => { describe('action:group — each published key is honoured through `SchemaRenderer`', () => { it('`location` renders only the members whose `locations` include it', () => { const actions = [ - member('here', { locations: ['list_toolbar'] }), - member('there', { locations: ['record_header'] }), + member('here', { locations: ['list'] }), + member('there', { locations: ['record_page'] }), ]; - mount({ type: 'action:group', location: 'list_toolbar', actions }); + mount({ type: 'action:group', location: 'list', actions }); expect(screen.getByRole('button', { name: 'HERE' })).toBeInTheDocument(); expect(screen.queryByRole('button', { name: 'THERE' })).toBeNull(); cleanup(); diff --git a/ui/packages/components/src/renderers/action/__tests__/action-icon-autotrigger.test.tsx b/ui/packages/components/src/renderers/action/__tests__/action-icon-autotrigger.test.tsx index 9d6b3c01b03..07a272802c2 100644 --- a/ui/packages/components/src/renderers/action/__tests__/action-icon-autotrigger.test.tsx +++ b/ui/packages/components/src/renderers/action/__tests__/action-icon-autotrigger.test.tsx @@ -68,7 +68,7 @@ const ICON = { type: 'api', icon: 'plus', component: 'action:icon', - locations: ['list_toolbar'], + locations: ['list'], }; /** The same declaration rendered by the default member renderer — the control. */ @@ -76,7 +76,7 @@ const BUTTON = { name: 'create_button', label: 'Create button', type: 'api', - locations: ['list_toolbar'], + locations: ['list'], }; /** A declared, evaluable predicate that is false, so the gate really runs. */ @@ -106,7 +106,7 @@ function Bar({ actions }: { actions: Member[] }) { return ( // eslint-disable-next-line react-hooks/static-components -- ComponentRegistry.get returns a registered renderer (stable reference), not a component created during render ); } diff --git a/ui/packages/components/src/renderers/action/__tests__/action-onSuccess-forward.test.tsx b/ui/packages/components/src/renderers/action/__tests__/action-onSuccess-forward.test.tsx index e71de3942ca..7712cc64546 100644 --- a/ui/packages/components/src/renderers/action/__tests__/action-onSuccess-forward.test.tsx +++ b/ui/packages/components/src/renderers/action/__tests__/action-onSuccess-forward.test.tsx @@ -80,7 +80,7 @@ const clone = (onSuccess: unknown, extra: Record = {}) => ({ label: 'Clone', type: 'api', target: '/api/v1/records/clone', - locations: ['list_toolbar'], + locations: ['list'], onSuccess, ...extra, }); diff --git a/ui/packages/components/src/renderers/action/__tests__/action-outcomeMessages-forward-11344.test.tsx b/ui/packages/components/src/renderers/action/__tests__/action-outcomeMessages-forward-11344.test.tsx index e4504e8a23e..dfd07379604 100644 --- a/ui/packages/components/src/renderers/action/__tests__/action-outcomeMessages-forward-11344.test.tsx +++ b/ui/packages/components/src/renderers/action/__tests__/action-outcomeMessages-forward-11344.test.tsx @@ -68,7 +68,7 @@ const declaration = (extra: Record = {}) => ({ name: 'delete_environment', label: 'Delete environment', type: 'script', - locations: ['record_header'], + locations: ['record_page'], outcomeMessages: OUTCOME_MESSAGES, successMessage: 'Environment ${result.name} updated', ...extra, diff --git a/ui/packages/components/src/renderers/action/__tests__/action-overflow-autotrigger.test.tsx b/ui/packages/components/src/renderers/action/__tests__/action-overflow-autotrigger.test.tsx index 357581ec4f2..63d2556bc60 100644 --- a/ui/packages/components/src/renderers/action/__tests__/action-overflow-autotrigger.test.tsx +++ b/ui/packages/components/src/renderers/action/__tests__/action-overflow-autotrigger.test.tsx @@ -60,9 +60,9 @@ import { toast } from '../../../ui/sonner'; /** Three ordinary toolbar actions — enough to fill the desktop `maxVisible: 3`. */ const FILLERS = [ - { name: 'a1', label: 'a1', type: 'api', locations: ['list_toolbar'] }, - { name: 'a2', label: 'a2', type: 'api', locations: ['list_toolbar'] }, - { name: 'a3', label: 'a3', type: 'api', locations: ['list_toolbar'] }, + { name: 'a1', label: 'a1', type: 'api', locations: ['list'] }, + { name: 'a2', label: 'a2', type: 'api', locations: ['list'] }, + { name: 'a3', label: 'a3', type: 'api', locations: ['list'] }, ]; /** @@ -74,7 +74,7 @@ const CREATE = { name: 'create_environment', label: 'Create Environment', type: 'api', - locations: ['list_toolbar'], + locations: ['list'], }; // See action-bodyExtra-forward.test.tsx for why this is not @@ -100,7 +100,7 @@ function Bar({ actions }: { actions: any[] }) { const C = ComponentRegistry.get('action:bar'); if (!C) throw new Error('action:bar is not registered'); // eslint-disable-next-line react-hooks/static-components -- ComponentRegistry.get returns a registered renderer (stable reference), not a component created during render - return ; + return ; } function renderBar(actions: any[]) { @@ -187,7 +187,7 @@ describe('action:menu consumes autoTrigger for the actions it receives (#4162)', it('an overflow action WITHOUT the flag is untouched — nothing runs on mount', async () => { // The refusal half. "The menu executes what it is given" would pass every // assertion above and fire this one. - renderBar([...FILLERS, CREATE, { name: 'a5', label: 'a5', type: 'api', locations: ['list_toolbar'] }]); + renderBar([...FILLERS, CREATE, { name: 'a5', label: 'a5', type: 'api', locations: ['list'] }]); await new Promise((r) => setTimeout(r, 0)); expect(api).not.toHaveBeenCalled(); @@ -206,7 +206,7 @@ describe('action:menu consumes autoTrigger for the actions it receives (#4162)', expect(api).toHaveBeenCalledTimes(2)); @@ -271,7 +271,7 @@ describe('what suppresses an auto-trigger, and what does not (#4162)', () => { = ({ // to mean "show here", which made this header the one surface where an // action nobody placed still appeared; `RecordDetailView` pre-filters the // same actions strictly, and the synthesizer's own contract already says - // "must include `locations: ['record_header']` to render" + // "must include `locations: ['record_page']` to render" // (buildDefaultPageSchema.ts), so the leniency contradicted both. const placedOnHeader = (a: any): boolean => actionRendersAt(a, 'record_header') || actionRendersAt(a, 'record_more'); diff --git a/ui/packages/core/src/actions/__tests__/ActionEngine.test.ts b/ui/packages/core/src/actions/__tests__/ActionEngine.test.ts index 73e9bd75584..d4916bf10c0 100644 --- a/ui/packages/core/src/actions/__tests__/ActionEngine.test.ts +++ b/ui/packages/core/src/actions/__tests__/ActionEngine.test.ts @@ -31,7 +31,7 @@ describe('ActionEngine', () => { it('registers with locations', () => { engine.registerAction( { name: 'delete', type: 'api' }, - { locations: ['record_header', 'list_item'] } + { locations: ['record'] } ); expect(engine.getActionsForLocation('record_header')).toHaveLength(1); expect(engine.getActionsForLocation('list_toolbar')).toHaveLength(0); @@ -84,9 +84,9 @@ describe('ActionEngine', () => { describe('getActionsForLocation', () => { it('returns actions sorted by priority', () => { - engine.registerAction({ name: 'delete', type: 'api' }, { locations: ['list_toolbar'], priority: 200 }); - engine.registerAction({ name: 'create', type: 'modal' }, { locations: ['list_toolbar'], priority: 10 }); - engine.registerAction({ name: 'export', type: 'api' }, { locations: ['list_toolbar'], priority: 100 }); + engine.registerAction({ name: 'delete', type: 'api' }, { locations: ['list'], priority: 200 }); + engine.registerAction({ name: 'create', type: 'modal' }, { locations: ['list'], priority: 10 }); + engine.registerAction({ name: 'export', type: 'api' }, { locations: ['list'], priority: 100 }); const actions = engine.getActionsForLocation('list_toolbar'); expect(actions).toHaveLength(3); diff --git a/ui/packages/core/src/actions/__tests__/ActionEngine.visibility.test.ts b/ui/packages/core/src/actions/__tests__/ActionEngine.visibility.test.ts index 69d309602bb..85f9fefec39 100644 --- a/ui/packages/core/src/actions/__tests__/ActionEngine.visibility.test.ts +++ b/ui/packages/core/src/actions/__tests__/ActionEngine.visibility.test.ts @@ -135,7 +135,7 @@ describe('ActionEngine.getActionsForLocation — visibility filter', () => { const engine = makeEngine(ctx); engine.registerAction( { name: 'in_header_self', type: 'api', visible: 'record.id == ctx.user.id' } as any, - { locations: ['record_header'] } + { locations: ['record_page'] } ); engine.registerAction( { name: 'in_section_self', type: 'api', visible: 'record.id == ctx.user.id' } as any, diff --git a/ui/packages/core/src/actions/__tests__/ActionRunner.askAi-37142.test.ts b/ui/packages/core/src/actions/__tests__/ActionRunner.askAi-37142.test.ts index b9cbbd577e8..e5311569de5 100644 --- a/ui/packages/core/src/actions/__tests__/ActionRunner.askAi-37142.test.ts +++ b/ui/packages/core/src/actions/__tests__/ActionRunner.askAi-37142.test.ts @@ -23,7 +23,7 @@ import { ActionSchema } from '@objectstack/spec/ui'; import { ActionRunner, isAskAiAction, type ActionDef } from '../ActionRunner'; import { ActionEngine } from '../ActionEngine'; -const ASK: ActionDef = { name: 'ask_about_account', label: 'Ask AI', type: 'ask_ai', locations: ['record_header'] }; +const ASK: ActionDef = { name: 'ask_about_account', label: 'Ask AI', type: 'ask_ai', locations: ['record_page'] }; function hostRunner(context: Record = {}) { const runner = new ActionRunner({ objectName: 'account', ...context }); @@ -160,7 +160,7 @@ describe('ask_ai — absent without an in-app assistant', () => { it('is left out of ActionEngine.getActionsForLocation until the runner has an assistant', () => { const engine = new ActionEngine({ objectName: 'account' }); - engine.registerActions([{ ...ASK }, { name: 'edit', type: 'script', target: 'edit', locations: ['record_header'] }]); + engine.registerActions([{ ...ASK }, { name: 'edit', type: 'script', target: 'edit', locations: ['record_page'] }]); expect(engine.getActionsForLocation('record_header').map((a) => a.name)).toEqual(['edit']); engine.getRunner().setAssistantFocusHandler(() => {}); expect(engine.getActionsForLocation('record_header').map((a) => a.name)).toEqual(['ask_about_account', 'edit']); diff --git a/ui/packages/core/src/actions/__tests__/ActionRunner.launchRefusal-27831.test.ts b/ui/packages/core/src/actions/__tests__/ActionRunner.launchRefusal-27831.test.ts index c2043adc68a..814b2bab4b0 100644 --- a/ui/packages/core/src/actions/__tests__/ActionRunner.launchRefusal-27831.test.ts +++ b/ui/packages/core/src/actions/__tests__/ActionRunner.launchRefusal-27831.test.ts @@ -32,7 +32,7 @@ const REASSIGN: ActionDef = { type: 'script', name: 'reassign', objectName: 'task', - locations: ['list_item', 'list_toolbar'], + locations: ['record_row', 'list'], }; /** An object-level action: the toolbar alone. */ @@ -40,7 +40,7 @@ const EXPORT_ALL: ActionDef = { type: 'script', name: 'export_all', objectName: 'task', - locations: ['list_toolbar'], + locations: ['list'], }; function runnerWith(rows?: Record[]) { diff --git a/ui/packages/core/src/actions/__tests__/ActionRunner.recordRowGuard-13384.test.ts b/ui/packages/core/src/actions/__tests__/ActionRunner.recordRowGuard-13384.test.ts index 1cbd8d3a946..da58b8f7697 100644 --- a/ui/packages/core/src/actions/__tests__/ActionRunner.recordRowGuard-13384.test.ts +++ b/ui/packages/core/src/actions/__tests__/ActionRunner.recordRowGuard-13384.test.ts @@ -46,7 +46,7 @@ const ADD_TO_CAMPAIGN: ActionDef = { type: 'script', name: 'add_to_campaign', objectName: 'crm_lead', - locations: ['list_toolbar', 'list_item'], + locations: ['list', 'record_row'], actionParams: [{ name: 'campaign', label: 'Campaign', type: 'text', required: true }], }; @@ -125,7 +125,7 @@ describe('objectui#13384 — the row-count refusal comes before the param dialog it('control — an object-level toolbar action with 0 rows still opens its dialog and dispatches', async () => { const result = await runnerWithRows([]) - .execute(launch({ ...ADD_TO_CAMPAIGN, locations: ['list_toolbar'] })); + .execute(launch({ ...ADD_TO_CAMPAIGN, locations: ['list'] })); expect(dialog).toHaveBeenCalledTimes(1); expect(result.success).toBe(true); diff --git a/ui/packages/core/src/actions/__tests__/actionKeys.pin.test.ts b/ui/packages/core/src/actions/__tests__/actionKeys.pin.test.ts index 7c560b9c743..3f405281577 100644 --- a/ui/packages/core/src/actions/__tests__/actionKeys.pin.test.ts +++ b/ui/packages/core/src/actions/__tests__/actionKeys.pin.test.ts @@ -203,7 +203,7 @@ describe('unknown-key warning', () => { afterEach(() => warn.mockRestore()); it('says nothing about an action built only from recognized keys', () => { - warnOnUnknownActionKeys({ name: 'save', type: 'api', target: '/api/v1/save', locations: ['record_header'] }); + warnOnUnknownActionKeys({ name: 'save', type: 'api', target: '/api/v1/save', locations: ['record_page'] }); expect(warn).not.toHaveBeenCalled(); }); diff --git a/ui/packages/core/src/actions/__tests__/actionKeys.types.test.ts b/ui/packages/core/src/actions/__tests__/actionKeys.types.test.ts index bf9925b5034..7df461519fd 100644 --- a/ui/packages/core/src/actions/__tests__/actionKeys.types.test.ts +++ b/ui/packages/core/src/actions/__tests__/actionKeys.types.test.ts @@ -88,7 +88,7 @@ const CASES: readonly Case[] = [ { what: 'bulkEnabled is a retired tombstone, so any value is a compile error', rejected: true, code: `{ bulkEnabled: true }` }, // ── Shapes the runner genuinely accepts and must keep accepting ──────────── - { what: 'locations accepts a real spec location', rejected: false, code: `{ locations: ['record_header'] }` }, + { what: 'locations accepts a real spec location', rejected: false, code: `{ locations: ['record_page'] }` }, { what: 'order accepts a number', rejected: false, code: `{ order: 10 }` }, { what: 'variant accepts a spec variant', rejected: false, code: `{ variant: 'primary' }` }, { what: 'component accepts a spec renderer', rejected: false, code: `{ component: 'action:button' }` }, diff --git a/ui/packages/core/src/actions/__tests__/serverActionHandler.test.ts b/ui/packages/core/src/actions/__tests__/serverActionHandler.test.ts index fab700eac4f..255bffb5cf2 100644 --- a/ui/packages/core/src/actions/__tests__/serverActionHandler.test.ts +++ b/ui/packages/core/src/actions/__tests__/serverActionHandler.test.ts @@ -171,13 +171,13 @@ describe('resolveServerActionRecordId — the standard dance', () => { it('blocks a record-scoped action with zero selection (#2210) but lets object-level actions through', () => { const scoped = resolveServerActionRecordId( - { name: 'a', locations: ['list_item', 'list_toolbar'] } as ActionDef, + { name: 'a', locations: ['record_row', 'list'] } as ActionDef, { selectedRecords: [] }, ); expect(scoped.error).toMatch(/select a row first/i); const objectLevel = resolveServerActionRecordId( - { name: 'a', locations: ['list_toolbar'] } as ActionDef, + { name: 'a', locations: ['list'] } as ActionDef, { selectedRecords: [] }, ); expect(objectLevel).toEqual({ recordId: undefined }); @@ -185,7 +185,7 @@ describe('resolveServerActionRecordId — the standard dance', () => { it('an aggregate dispatch (_selectedIds, objectui#3139) bypasses the selection fallback and its guards', () => { const out = resolveServerActionRecordId( - { name: 'a', locations: ['list_item', 'list_toolbar'], params: { _selectedIds: ['x', 'y'] } } as ActionDef, + { name: 'a', locations: ['record_row', 'list'], params: { _selectedIds: ['x', 'y'] } } as ActionDef, { selectedRecords: [{ id: 'x' }, { id: 'y' }] }, ); expect(out).toEqual({ recordId: undefined }); @@ -194,9 +194,9 @@ describe('resolveServerActionRecordId — the standard dance', () => { describe('isRecordScopedAction', () => { it('true for any record location, false for object-level-only or undeclared', () => { - expect(isRecordScopedAction({ locations: ['list_item'] } as ActionDef)).toBe(true); - expect(isRecordScopedAction({ locations: ['record_header'] } as ActionDef)).toBe(true); - expect(isRecordScopedAction({ locations: ['list_toolbar'] } as ActionDef)).toBe(false); + expect(isRecordScopedAction({ locations: ['record_row'] } as ActionDef)).toBe(true); + expect(isRecordScopedAction({ locations: ['record_page'] } as ActionDef)).toBe(true); + expect(isRecordScopedAction({ locations: ['list'] } as ActionDef)).toBe(false); expect(isRecordScopedAction({} as ActionDef)).toBe(false); }); }); @@ -234,7 +234,7 @@ describe('createServerActionHandler — resolution wiring', () => { }); describe('the row-count refusals carry their pack key, and are asked before input (objectui#13384)', () => { - const SCOPED = { name: 'a', locations: ['list_item', 'list_toolbar'] } as ActionDef; + const SCOPED = { name: 'a', locations: ['record_row', 'list'] } as ActionDef; it('each refusal names the locale-pack key its English text is the source of', () => { expect(resolveServerActionRecordId(SCOPED, { selectedRecords: [{ id: 'x' }, { id: 'y' }] })).toEqual({ diff --git a/ui/packages/core/src/utils/__tests__/action-activation.test.ts b/ui/packages/core/src/utils/__tests__/action-activation.test.ts index e1744fb6531..61c0a733571 100644 --- a/ui/packages/core/src/utils/__tests__/action-activation.test.ts +++ b/ui/packages/core/src/utils/__tests__/action-activation.test.ts @@ -27,8 +27,8 @@ import { ActionEngine } from '../../actions/ActionEngine'; const task = () => ({ name: 'showcase_task', actions: [ - { name: 'showcase_mark_done', label: 'Mark Done', locations: ['record_header'] }, - { name: 'showcase_log_time', label: 'Log Time', locations: ['record_header'] }, + { name: 'showcase_mark_done', label: 'Mark Done', locations: ['record_page'] }, + { name: 'showcase_log_time', label: 'Log Time', locations: ['record_page'] }, ], }); diff --git a/ui/packages/core/src/utils/__tests__/predicate-fields.test.ts b/ui/packages/core/src/utils/__tests__/predicate-fields.test.ts index d9c4fe3c43a..72b0f60cd56 100644 --- a/ui/packages/core/src/utils/__tests__/predicate-fields.test.ts +++ b/ui/packages/core/src/utils/__tests__/predicate-fields.test.ts @@ -204,7 +204,7 @@ describe('listViewPredicates — `defaultFromRow` params and `target` tokens (ob const REMOVE_TEAM_MEMBER = { name: 'remove_team_member', type: 'api', - locations: ['list_item'], + locations: ['record_row'], target: '/api/v1/auth/organization/remove-team-member', params: [ { name: 'teamId', field: 'team_id', required: true, defaultFromRow: true }, @@ -323,7 +323,7 @@ describe('listViewPredicates — the fields an `undoable` action writes (objectu name: 'close_task', operation: 'update', undoable: true, - locations: ['list_item'], + locations: ['record_row'], patch: { status: 'closed' }, }; const refs = (view: Parameters[0]) => diff --git a/ui/packages/layout/src/PageHeader.tsx b/ui/packages/layout/src/PageHeader.tsx index 551b49b0f04..f5073a1d28a 100644 --- a/ui/packages/layout/src/PageHeader.tsx +++ b/ui/packages/layout/src/PageHeader.tsx @@ -60,7 +60,7 @@ export interface PageHeaderComponentProps extends React.HTMLAttributes ) diff --git a/ui/packages/plugin-detail/src/DetailView.tsx b/ui/packages/plugin-detail/src/DetailView.tsx index be4f18e5825..fcd18147791 100644 --- a/ui/packages/plugin-detail/src/DetailView.tsx +++ b/ui/packages/plugin-detail/src/DetailView.tsx @@ -1172,7 +1172,7 @@ export const DetailView: React.FC = ({ if (!injected) { mapped.push({ type: 'action:bar', - location: 'record_header', + location: 'record_page', systemActions, } as unknown as SchemaNode); } diff --git a/ui/packages/plugin-detail/src/RecordDetailPanel.tsx b/ui/packages/plugin-detail/src/RecordDetailPanel.tsx index 097eef59a2c..21757a50d8e 100644 --- a/ui/packages/plugin-detail/src/RecordDetailPanel.tsx +++ b/ui/packages/plugin-detail/src/RecordDetailPanel.tsx @@ -325,7 +325,7 @@ export function RecordDetailPanel({ ? [ { type: 'action:bar', - location: 'record_header', + location: 'record_page', systemActions: [ { name: 'sys_open_new_tab', diff --git a/ui/packages/plugin-detail/src/RelatedList.tsx b/ui/packages/plugin-detail/src/RelatedList.tsx index 3c6567a0970..1aa5f5f5801 100644 --- a/ui/packages/plugin-detail/src/RelatedList.tsx +++ b/ui/packages/plugin-detail/src/RelatedList.tsx @@ -206,7 +206,7 @@ export interface RelatedListProps { /** Execute one of {@link rowActions} against the clicked row. */ onRowAction?: (action: RelatedRowActionDef, row: any) => void | Promise; /** - * Child-object list actions (`locations: ['list_toolbar']`), already + * Child-object list actions (`locations: ['list']`), already * localized by the host. Rendered as header buttons next to Add/New — * e.g. `invite_user` on an organization's Invitations list. */ diff --git a/ui/packages/plugin-detail/src/__tests__/RecordRelatedListRenderer.authoredActions-11163.test.tsx b/ui/packages/plugin-detail/src/__tests__/RecordRelatedListRenderer.authoredActions-11163.test.tsx index 7db7fcd84cc..2139964aa9e 100644 --- a/ui/packages/plugin-detail/src/__tests__/RecordRelatedListRenderer.authoredActions-11163.test.tsx +++ b/ui/packages/plugin-detail/src/__tests__/RecordRelatedListRenderer.authoredActions-11163.test.tsx @@ -74,11 +74,11 @@ beforeAll(() => { * echoing the registry. */ const CHILD_ACTIONS = [ - { name: 'send_welcome', label: 'Send Welcome', type: 'api', locations: ['list_item'] }, - { name: 'deactivate', label: 'Deactivate', type: 'api', locations: ['list_item'] }, - { name: 'invite', label: 'Invite', type: 'api', locations: ['list_toolbar'] }, - { name: 'export_csv', label: 'Export CSV', type: 'api', locations: ['list_toolbar'] }, - { name: 'header_only', label: 'Header Only', type: 'api', locations: ['record_header'] }, + { name: 'send_welcome', label: 'Send Welcome', type: 'api', locations: ['record_row'] }, + { name: 'deactivate', label: 'Deactivate', type: 'api', locations: ['record_row'] }, + { name: 'invite', label: 'Invite', type: 'api', locations: ['list'] }, + { name: 'export_csv', label: 'Export CSV', type: 'api', locations: ['list'] }, + { name: 'header_only', label: 'Header Only', type: 'api', locations: ['record_page'] }, ]; const CHILD = { name: 'contact', label: 'Contact', actions: CHILD_ACTIONS }; @@ -326,7 +326,7 @@ describe('record:related_list.actions — an id that cannot be placed is REFUSED }); it('an array that is not all action ids is refused whole, and draws none of its entries', async () => { - mount([{ name: 'invite', label: 'Invite', locations: ['list_toolbar'] }]); + mount([{ name: 'invite', label: 'Invite', locations: ['list'] }]); await waitForRow(); await waitFor(() => expect(refusal()).not.toBeNull()); expect(refusal()).toHaveAttribute('role', 'status'); diff --git a/ui/packages/plugin-detail/src/__tests__/RecordRelatedListRenderer.refusalAudience-11768.test.tsx b/ui/packages/plugin-detail/src/__tests__/RecordRelatedListRenderer.refusalAudience-11768.test.tsx index 9b7f116606d..d3078c0eb9e 100644 --- a/ui/packages/plugin-detail/src/__tests__/RecordRelatedListRenderer.refusalAudience-11768.test.tsx +++ b/ui/packages/plugin-detail/src/__tests__/RecordRelatedListRenderer.refusalAudience-11768.test.tsx @@ -62,8 +62,8 @@ beforeAll(() => { }); const CHILD_ACTIONS = [ - { name: 'invite', label: 'Invite', type: 'api', locations: ['list_toolbar'] }, - { name: 'export_csv', label: 'Export CSV', type: 'api', locations: ['list_toolbar'] }, + { name: 'invite', label: 'Invite', type: 'api', locations: ['list'] }, + { name: 'export_csv', label: 'Export CSV', type: 'api', locations: ['list'] }, ]; const CHILD = { name: 'contact', label: 'Contact', actions: CHILD_ACTIONS }; diff --git a/ui/packages/plugin-detail/src/__tests__/RelatedList.defaultFromRowSelect-10277.test.tsx b/ui/packages/plugin-detail/src/__tests__/RelatedList.defaultFromRowSelect-10277.test.tsx index 1058156a341..a4259591040 100644 --- a/ui/packages/plugin-detail/src/__tests__/RelatedList.defaultFromRowSelect-10277.test.tsx +++ b/ui/packages/plugin-detail/src/__tests__/RelatedList.defaultFromRowSelect-10277.test.tsx @@ -87,7 +87,7 @@ const REMOVE_TEAM_MEMBER = { name: 'remove_team_member', label: 'Remove from Team', type: 'api', - locations: ['list_item'], + locations: ['record_row'], target: '/api/v1/teams/{team_id}/members/{user_id}', params: [ { name: 'teamId', field: 'team_id', required: true, defaultFromRow: true }, diff --git a/ui/packages/plugin-detail/src/__tests__/RelatedList.rowActionDisabled-33215.test.tsx b/ui/packages/plugin-detail/src/__tests__/RelatedList.rowActionDisabled-33215.test.tsx index d7f2d4ef6fe..3a057014217 100644 --- a/ui/packages/plugin-detail/src/__tests__/RelatedList.rowActionDisabled-33215.test.tsx +++ b/ui/packages/plugin-detail/src/__tests__/RelatedList.rowActionDisabled-33215.test.tsx @@ -46,7 +46,7 @@ const REASON = 'Locked plans cannot be allocated'; const ALLOCATE = { name: 'allocate', label: 'Allocate', - locations: ['record_header', 'record_related'], + locations: ['record_page', 'record_related'], disabled: "record.status == 'locked'", disabledReason: REASON, }; diff --git a/ui/packages/plugin-detail/src/__tests__/declaredActionIds.twoRenderers-7182.test.tsx b/ui/packages/plugin-detail/src/__tests__/declaredActionIds.twoRenderers-7182.test.tsx index 201a862f4b3..027d36939da 100644 --- a/ui/packages/plugin-detail/src/__tests__/declaredActionIds.twoRenderers-7182.test.tsx +++ b/ui/packages/plugin-detail/src/__tests__/declaredActionIds.twoRenderers-7182.test.tsx @@ -61,14 +61,14 @@ beforeAll(() => { }); const ACTIONS: Record = { - convert: { name: 'convert', label: 'Convert Lead', type: 'flow', locations: ['record_header'] }, - qualify: { name: 'qualify', label: 'Qualify', type: 'api', locations: ['record_header'] }, - list_only: { name: 'list_only', label: 'List Only', type: 'api', locations: ['list_item'] }, + convert: { name: 'convert', label: 'Convert Lead', type: 'flow', locations: ['record_page'] }, + qualify: { name: 'qualify', label: 'Qualify', type: 'api', locations: ['record_page'] }, + list_only: { name: 'list_only', label: 'List Only', type: 'api', locations: ['record_row'] }, gated: { name: 'gated', label: 'Gated Action', type: 'api', - locations: ['record_header'], + locations: ['record_page'], requiredPermissions: ['nobody_holds_this'], }, }; @@ -109,7 +109,7 @@ function mount(type: 'page:header' | 'record:quick_actions', actions: unknown[]) const schema = type === 'page:header' ? { type, title: 'Lead', actions } - : { type, location: 'record_header', actions }; + : { type, location: 'record_page', actions }; return render( diff --git a/ui/packages/plugin-detail/src/__tests__/recordQuickActionsInputs.actionNamesFallback.test.tsx b/ui/packages/plugin-detail/src/__tests__/recordQuickActionsInputs.actionNamesFallback.test.tsx index 20caf476b03..3381b7130be 100644 --- a/ui/packages/plugin-detail/src/__tests__/recordQuickActionsInputs.actionNamesFallback.test.tsx +++ b/ui/packages/plugin-detail/src/__tests__/recordQuickActionsInputs.actionNamesFallback.test.tsx @@ -49,7 +49,7 @@ const APPROVE = { name: 'approve', label: 'Approve', type: 'script', - locations: ['record_header'], + locations: ['record_page'], }; const OBJECT_META = { name: 'crm_account', actions: [APPROVE] }; diff --git a/ui/packages/plugin-detail/src/renderers/__tests__/record-alert.declared-action-id-7382.test.tsx b/ui/packages/plugin-detail/src/renderers/__tests__/record-alert.declared-action-id-7382.test.tsx index 2f2bec22d9e..7007f92646f 100644 --- a/ui/packages/plugin-detail/src/renderers/__tests__/record-alert.declared-action-id-7382.test.tsx +++ b/ui/packages/plugin-detail/src/renderers/__tests__/record-alert.declared-action-id-7382.test.tsx @@ -184,7 +184,7 @@ describe('record:alert CTA — resolved through resolveDeclaredActionIds (object label: 'Injected Inline', type: 'url', target: 'https://example.invalid/', - locations: ['record_header'], + locations: ['record_page'], }; render( , diff --git a/ui/packages/plugin-detail/src/renderers/__tests__/record-quick-actions.actionText-i18n.test.tsx b/ui/packages/plugin-detail/src/renderers/__tests__/record-quick-actions.actionText-i18n.test.tsx index f2fe29122ae..eb4bc7d407c 100644 --- a/ui/packages/plugin-detail/src/renderers/__tests__/record-quick-actions.actionText-i18n.test.tsx +++ b/ui/packages/plugin-detail/src/renderers/__tests__/record-quick-actions.actionText-i18n.test.tsx @@ -33,7 +33,7 @@ const CONVERT_LEAD = { label: 'Convert Lead', confirmText: 'Are you sure you want to convert this lead?', successMessage: 'Lead converted.', - locations: ['record_header'], + locations: ['record_page'], }; const ZH_BUNDLE = { diff --git a/ui/packages/plugin-detail/src/renderers/__tests__/record-quick-actions.ariaLabel.test.tsx b/ui/packages/plugin-detail/src/renderers/__tests__/record-quick-actions.ariaLabel.test.tsx index 89a9fc14459..b1aaa1fd63e 100644 --- a/ui/packages/plugin-detail/src/renderers/__tests__/record-quick-actions.ariaLabel.test.tsx +++ b/ui/packages/plugin-detail/src/renderers/__tests__/record-quick-actions.ariaLabel.test.tsx @@ -56,7 +56,7 @@ import { RecordQuickActionsRenderer } from '../record-quick-actions'; * all — with no visible action the bar short-circuits to its dashed placeholder, * which carries no toolbar role. */ -const ACT = { name: 'act', label: 'Act', type: 'script', locations: ['record_header'] }; +const ACT = { name: 'act', label: 'Act', type: 'script', locations: ['record_page'] }; function mount(aria?: Record) { return render( diff --git a/ui/packages/plugin-detail/src/renderers/__tests__/record-quick-actions.declared-action-ids-7182.test.tsx b/ui/packages/plugin-detail/src/renderers/__tests__/record-quick-actions.declared-action-ids-7182.test.tsx index 18f4aefcae5..aa7b0fdd9bd 100644 --- a/ui/packages/plugin-detail/src/renderers/__tests__/record-quick-actions.declared-action-ids-7182.test.tsx +++ b/ui/packages/plugin-detail/src/renderers/__tests__/record-quick-actions.declared-action-ids-7182.test.tsx @@ -42,14 +42,14 @@ import type { MetadataContextValue } from '@object-ui/react'; import { RecordQuickActionsRenderer } from '../record-quick-actions'; const ACTIONS: Record = { - convert: { name: 'convert', label: 'Convert Lead', type: 'flow', locations: ['record_header'] }, - qualify: { name: 'qualify', label: 'Qualify', type: 'api', locations: ['record_header'] }, - list_only: { name: 'list_only', label: 'List Only', type: 'api', locations: ['list_item'] }, + convert: { name: 'convert', label: 'Convert Lead', type: 'flow', locations: ['record_page'] }, + qualify: { name: 'qualify', label: 'Qualify', type: 'api', locations: ['record_page'] }, + list_only: { name: 'list_only', label: 'List Only', type: 'api', locations: ['record_row'] }, gated: { name: 'gated', label: 'Gated Action', type: 'api', - locations: ['record_header'], + locations: ['record_page'], requiredPermissions: ['nobody_holds_this'], }, }; diff --git a/ui/packages/plugin-detail/src/renderers/__tests__/record-quick-actions.disabled-declared-gate.test.tsx b/ui/packages/plugin-detail/src/renderers/__tests__/record-quick-actions.disabled-declared-gate.test.tsx index 0f52f5c6d8d..58c2f5b9dfd 100644 --- a/ui/packages/plugin-detail/src/renderers/__tests__/record-quick-actions.disabled-declared-gate.test.tsx +++ b/ui/packages/plugin-detail/src/renderers/__tests__/record-quick-actions.disabled-declared-gate.test.tsx @@ -39,7 +39,7 @@ import { RecordQuickActionsRenderer } from '../record-quick-actions'; const LABEL = 'Act'; /** `locations` is not defaulted — `getActionsForLocation` requires the match. */ -const ACT = { name: 'act', label: LABEL, type: 'script', locations: ['record_header'] }; +const ACT = { name: 'act', label: LABEL, type: 'script', locations: ['record_page'] }; function mount(action: any, record: Record = {}) { return render( diff --git a/ui/packages/plugin-detail/src/renderers/__tests__/record-quick-actions.icon-12772.test.tsx b/ui/packages/plugin-detail/src/renderers/__tests__/record-quick-actions.icon-12772.test.tsx index a86156243b9..11f4b0e9652 100644 --- a/ui/packages/plugin-detail/src/renderers/__tests__/record-quick-actions.icon-12772.test.tsx +++ b/ui/packages/plugin-detail/src/renderers/__tests__/record-quick-actions.icon-12772.test.tsx @@ -31,7 +31,7 @@ import { RecordQuickActionsRenderer } from '../record-quick-actions'; const LABEL = 'Open'; /** `locations` is not defaulted — `getActionsForLocation` requires the match. */ -const OPEN = { name: 'open', label: LABEL, type: 'script', locations: ['record_header'] }; +const OPEN = { name: 'open', label: LABEL, type: 'script', locations: ['record_page'] }; function mount(action: Record) { return render( diff --git a/ui/packages/plugin-detail/src/renderers/__tests__/record-quick-actions.requiredPermissions-gate.test.tsx b/ui/packages/plugin-detail/src/renderers/__tests__/record-quick-actions.requiredPermissions-gate.test.tsx index 679af3c7e1f..3228152c845 100644 --- a/ui/packages/plugin-detail/src/renderers/__tests__/record-quick-actions.requiredPermissions-gate.test.tsx +++ b/ui/packages/plugin-detail/src/renderers/__tests__/record-quick-actions.requiredPermissions-gate.test.tsx @@ -92,7 +92,7 @@ const APPROVE = { name: 'approve', label: 'Approve', type: 'script', - locations: ['record_header'], + locations: ['record_page'], }; const OBJECT_META = { name: 'crm_account', actions: [APPROVE] }; diff --git a/ui/packages/plugin-detail/src/renderers/__tests__/record-quick-actions.template-predicate.test.tsx b/ui/packages/plugin-detail/src/renderers/__tests__/record-quick-actions.template-predicate.test.tsx index cb9d2c10a62..c5ce393aee8 100644 --- a/ui/packages/plugin-detail/src/renderers/__tests__/record-quick-actions.template-predicate.test.tsx +++ b/ui/packages/plugin-detail/src/renderers/__tests__/record-quick-actions.template-predicate.test.tsx @@ -45,7 +45,7 @@ import { RecordQuickActionsRenderer } from '../record-quick-actions'; const LABEL = 'Act'; /** `locations` is not defaulted — `getActionsForLocation` requires the match. */ -const ACT = { name: 'act', label: LABEL, type: 'script', locations: ['record_header'] }; +const ACT = { name: 'act', label: LABEL, type: 'script', locations: ['record_page'] }; function mount(action: any, record: Record = {}) { return render( diff --git a/ui/packages/plugin-detail/src/renderers/__tests__/record-quick-actions.variant-12986.test.tsx b/ui/packages/plugin-detail/src/renderers/__tests__/record-quick-actions.variant-12986.test.tsx index 04f4fbe2417..d77eff307ee 100644 --- a/ui/packages/plugin-detail/src/renderers/__tests__/record-quick-actions.variant-12986.test.tsx +++ b/ui/packages/plugin-detail/src/renderers/__tests__/record-quick-actions.variant-12986.test.tsx @@ -30,7 +30,7 @@ import { RecordQuickActionsRenderer } from '../record-quick-actions'; const LABEL = 'Archive'; /** `locations` is not defaulted — `getActionsForLocation` requires the match. */ -const ARCHIVE = { name: 'archive', label: LABEL, type: 'script', locations: ['record_header'] }; +const ARCHIVE = { name: 'archive', label: LABEL, type: 'script', locations: ['record_page'] }; function mount(action: Record, blockVariant?: string) { return render( diff --git a/ui/packages/plugin-detail/src/renderers/__tests__/record-quick-actions.withheldEmpty-12995.test.tsx b/ui/packages/plugin-detail/src/renderers/__tests__/record-quick-actions.withheldEmpty-12995.test.tsx index 275143b81c0..7cc6e6d23dd 100644 --- a/ui/packages/plugin-detail/src/renderers/__tests__/record-quick-actions.withheldEmpty-12995.test.tsx +++ b/ui/packages/plugin-detail/src/renderers/__tests__/record-quick-actions.withheldEmpty-12995.test.tsx @@ -41,7 +41,7 @@ const action = (name: string, label: string, requiredPermissions?: string[]) => name, label, type: 'api', - locations: ['record_header'], + locations: ['record_page'], ...(requiredPermissions ? { requiredPermissions } : {}), }); diff --git a/ui/packages/plugin-detail/src/renderers/__tests__/record-related-list.unservedActions-12870.test.tsx b/ui/packages/plugin-detail/src/renderers/__tests__/record-related-list.unservedActions-12870.test.tsx index c4ea0139a34..301f632def1 100644 --- a/ui/packages/plugin-detail/src/renderers/__tests__/record-related-list.unservedActions-12870.test.tsx +++ b/ui/packages/plugin-detail/src/renderers/__tests__/record-related-list.unservedActions-12870.test.tsx @@ -46,7 +46,7 @@ afterEach(() => cleanup()); const PARENT = 'sys_organization'; const CHILD_ACTIONS = [ - { name: 'invite_user', label: 'Invite user', type: 'api', locations: ['list_toolbar'] }, + { name: 'invite_user', label: 'Invite user', type: 'api', locations: ['list'] }, { name: 'change_role', label: 'Change role', type: 'api', locations: ['record_related'] }, ]; const CHILD = { name: 'sys_member', label: 'Member', actions: CHILD_ACTIONS }; diff --git a/ui/packages/plugin-detail/src/renderers/__tests__/recordAriaLabelRetired-9945.test.tsx b/ui/packages/plugin-detail/src/renderers/__tests__/recordAriaLabelRetired-9945.test.tsx index 6c06080ac10..0f90d7126ce 100644 --- a/ui/packages/plugin-detail/src/renderers/__tests__/recordAriaLabelRetired-9945.test.tsx +++ b/ui/packages/plugin-detail/src/renderers/__tests__/recordAriaLabelRetired-9945.test.tsx @@ -52,7 +52,7 @@ function wrap(node: React.ReactElement) { ); } -const ACT = { name: 'act', label: 'Act', type: 'script', locations: ['record_header'] }; +const ACT = { name: 'act', label: 'Act', type: 'script', locations: ['record_page'] }; interface Block { /** The registered type, which is what the report must name. */ diff --git a/ui/packages/plugin-detail/src/renderers/__tests__/recordBinding.appPage-12294.test.tsx b/ui/packages/plugin-detail/src/renderers/__tests__/recordBinding.appPage-12294.test.tsx index eea7a3a6a2a..0d01d6bdd19 100644 --- a/ui/packages/plugin-detail/src/renderers/__tests__/recordBinding.appPage-12294.test.tsx +++ b/ui/packages/plugin-detail/src/renderers/__tests__/recordBinding.appPage-12294.test.tsx @@ -64,7 +64,7 @@ const OBJECT_SCHEMA = { }, }; -const APPROVE = { name: 'approve', label: 'Approve environment', type: 'api', locations: ['record_header'] }; +const APPROVE = { name: 'approve', label: 'Approve environment', type: 'api', locations: ['record_page'] }; const OBJECT_META = { name: OBJECT, label: 'Environment', actions: [APPROVE] }; type Row = Record; diff --git a/ui/packages/plugin-detail/src/renderers/__tests__/recordBinding.emptyState-12932.test.tsx b/ui/packages/plugin-detail/src/renderers/__tests__/recordBinding.emptyState-12932.test.tsx index df84d708240..8bfc54863bd 100644 --- a/ui/packages/plugin-detail/src/renderers/__tests__/recordBinding.emptyState-12932.test.tsx +++ b/ui/packages/plugin-detail/src/renderers/__tests__/recordBinding.emptyState-12932.test.tsx @@ -58,7 +58,7 @@ const OBJECT_SCHEMA = { }, }; -const APPROVE = { name: 'approve', label: 'Approve environment', type: 'api', locations: ['record_header'] }; +const APPROVE = { name: 'approve', label: 'Approve environment', type: 'api', locations: ['record_page'] }; const OBJECT_META = { name: OBJECT, label: 'Environment', actions: [APPROVE] }; type Row = Record; diff --git a/ui/packages/plugin-detail/src/renderers/__tests__/recordComponentAria-9556.test.tsx b/ui/packages/plugin-detail/src/renderers/__tests__/recordComponentAria-9556.test.tsx index c5d11e050a4..74b5f0b5445 100644 --- a/ui/packages/plugin-detail/src/renderers/__tests__/recordComponentAria-9556.test.tsx +++ b/ui/packages/plugin-detail/src/renderers/__tests__/recordComponentAria-9556.test.tsx @@ -337,7 +337,7 @@ describe('the contract-refused `aria.label` alias is read on NO block', () => { expect(screen.getAllByRole('list', { name: 'Record path' })).toHaveLength(2); cleanup(); - const ACT = { name: 'act', label: 'Act', type: 'script', locations: ['record_header'] }; + const ACT = { name: 'act', label: 'Act', type: 'script', locations: ['record_page'] }; mount(); expect(screen.queryByRole('toolbar', { name: ALIAS })).toBeNull(); expect(screen.getByRole('toolbar', { name: 'Quick actions' })).toBeInTheDocument(); @@ -421,7 +421,7 @@ describe('record:path honours the CONTRACT spelling, not the refused alias (obje }); describe('record:quick_actions keeps objectui#4663\'s canonical read and built-in default', () => { - const ACT = { name: 'act', label: 'Act', type: 'script', locations: ['record_header'] }; + const ACT = { name: 'act', label: 'Act', type: 'script', locations: ['record_page'] }; const bar = (aria?: unknown) => ( ); diff --git a/ui/packages/plugin-detail/src/renderers/__tests__/relatedListActions.recordRelated-11270.test.ts b/ui/packages/plugin-detail/src/renderers/__tests__/relatedListActions.recordRelated-11270.test.ts index 77c05708800..5fdaf9387e6 100644 --- a/ui/packages/plugin-detail/src/renderers/__tests__/relatedListActions.recordRelated-11270.test.ts +++ b/ui/packages/plugin-detail/src/renderers/__tests__/relatedListActions.recordRelated-11270.test.ts @@ -25,10 +25,10 @@ import { const REGISTERED = [ { name: 'log_time', locations: ['record_related'] }, - { name: 'send_reminder', locations: ['list_item'] }, - { name: 'archive', locations: ['list_item', 'record_related'] }, - { name: 'invite', locations: ['list_toolbar'] }, - { name: 'header_only', locations: ['record_header'] }, + { name: 'send_reminder', locations: ['record_row'] }, + { name: 'archive', locations: ['record_row', 'record_related'] }, + { name: 'invite', locations: ['list'] }, + { name: 'header_only', locations: ['record_page'] }, ]; const names = (actions: ReadonlyArray<{ name?: unknown }>) => actions.map((a) => a.name); diff --git a/ui/packages/plugin-detail/src/synth/__tests__/buildDefaultPageSchema.strictPayload.test.ts b/ui/packages/plugin-detail/src/synth/__tests__/buildDefaultPageSchema.strictPayload.test.ts index 98a2226dda8..82bedc3385d 100644 --- a/ui/packages/plugin-detail/src/synth/__tests__/buildDefaultPageSchema.strictPayload.test.ts +++ b/ui/packages/plugin-detail/src/synth/__tests__/buildDefaultPageSchema.strictPayload.test.ts @@ -105,7 +105,7 @@ describe('ADR-0089 D3a — the Studio create payload parses server-side (objectu it('is accepted with every optional surface the synthesizer can emit', () => { const body = createBody({ ...leadDef, enable: { files: true } }, { - headerActions: [{ name: 'convert', label: 'Convert', locations: ['record_header'] }], + headerActions: [{ name: 'convert', label: 'Convert', locations: ['record_page'] }], related: [ { objectName: 'task', relationshipField: 'lead_id', title: 'Tasks', limit: 10, icon: 'check' }, { objectName: 'note', relationshipField: 'parent_id', isPrimary: true }, @@ -131,7 +131,7 @@ describe('ADR-0089 D3a — the Studio create payload parses server-side (objectu */ it('every synthesized component node parses as a PageComponentSchema', () => { const common = { - headerActions: [{ name: 'convert', label: 'Convert', locations: ['record_header'] }], + headerActions: [{ name: 'convert', label: 'Convert', locations: ['record_page'] }], related: [ { objectName: 'task', relationshipField: 'lead_id', title: 'Tasks' }, { objectName: 'note', relationshipField: 'parent_id', isBody: true }, diff --git a/ui/packages/plugin-detail/src/synth/__tests__/buildDefaultPageSchema.test.ts b/ui/packages/plugin-detail/src/synth/__tests__/buildDefaultPageSchema.test.ts index 78e0f4bcd7c..f7088c809cf 100644 --- a/ui/packages/plugin-detail/src/synth/__tests__/buildDefaultPageSchema.test.ts +++ b/ui/packages/plugin-detail/src/synth/__tests__/buildDefaultPageSchema.test.ts @@ -277,7 +277,7 @@ describe('buildDefaultPageSchema', () => { it('embeds headerActions into page:header.actions instead of a separate quick_actions node', () => { const page = buildDefaultPageSchema(leadDef, { headerActions: [ - { name: 'edit', label: 'Edit', locations: ['record_header'] }, + { name: 'edit', label: 'Edit', locations: ['record_page'] }, ], }); const types = page.regions[0].components.map((c: any) => c.type); diff --git a/ui/packages/plugin-detail/src/synth/buildDefaultPageSchema.ts b/ui/packages/plugin-detail/src/synth/buildDefaultPageSchema.ts index d07d084700a..891afc4b11f 100644 --- a/ui/packages/plugin-detail/src/synth/buildDefaultPageSchema.ts +++ b/ui/packages/plugin-detail/src/synth/buildDefaultPageSchema.ts @@ -204,7 +204,7 @@ export interface BuildPageOptions { * Action definitions to surface in the header. When provided and * non-empty, the synthesizer emits a `record:quick_actions` node * immediately after `page:header`. Use ActionDef shape from the spec - * (must include `locations: ['record_header']` to render). + * (must include `locations: ['record_page']` to render). */ headerActions?: any[]; /** @@ -573,7 +573,7 @@ export function buildDefaultActions( if (!Array.isArray(headerActions) || headerActions.length === 0) return null; return componentNode('record:quick_actions', { actions: headerActions, - location: 'record_header', + location: 'record_page', }); } diff --git a/ui/packages/plugin-grid/demo/bulk-actions.tsx b/ui/packages/plugin-grid/demo/bulk-actions.tsx index e48c917b8dc..8ab3b7a7737 100644 --- a/ui/packages/plugin-grid/demo/bulk-actions.tsx +++ b/ui/packages/plugin-grid/demo/bulk-actions.tsx @@ -62,7 +62,7 @@ const ROWS = [ ]; /** - * Also carries `locations: ['list_item']`, so naming it in the view's + * Also carries `locations: ['record_row']`, so naming it in the view's * `bulkActions` makes the same action a row entry AND a bulk entry. */ const MARK_DONE = { @@ -72,7 +72,7 @@ const MARK_DONE = { type: 'api', target: '/api/demo/mark-done', recordIdParam: 'taskId', - locations: ['list_item'], + locations: ['record_row'], }; /** Surfaces only on the record overflow menu — until the view names it. */ @@ -83,7 +83,7 @@ const RECALC = { type: 'api', target: '/api/demo/recalc', recordIdParam: 'taskId', - locations: ['record_more'], + locations: ['record_page'], component: 'action:menu', // Collected ONCE by the bulk dialog, then handed to every per-record dispatch. params: [ { diff --git a/ui/packages/plugin-grid/src/ObjectGrid.tsx b/ui/packages/plugin-grid/src/ObjectGrid.tsx index e6609742af5..7e252165920 100644 --- a/ui/packages/plugin-grid/src/ObjectGrid.tsx +++ b/ui/packages/plugin-grid/src/ObjectGrid.tsx @@ -1382,7 +1382,7 @@ export const ObjectGrid: React.FC = ({ * `rowActionDefs` — which is why this read is a cast in the first place. * * The AUTHORED way to put an action on a row is unchanged and stays declared: - * `locations: ['list_item']` on the object's own action, plus the legacy + * `locations: ['record_row']` on the object's own action, plus the legacy * `rowActions` name list (`GRID_QUERY_INPUTS`, `index.tsx:190`) that the fold * below resolves against the object. Both halves — unlisted here, rejected * there — are pinned by `__tests__/gridNonAuthorKeys.test.tsx`, together with diff --git a/ui/packages/plugin-grid/src/__tests__/bulkResultPerRecord-27380.test.tsx b/ui/packages/plugin-grid/src/__tests__/bulkResultPerRecord-27380.test.tsx index b8097db2b89..0fe775daab8 100644 --- a/ui/packages/plugin-grid/src/__tests__/bulkResultPerRecord-27380.test.tsx +++ b/ui/packages/plugin-grid/src/__tests__/bulkResultPerRecord-27380.test.tsx @@ -62,7 +62,7 @@ const ADD_TO_CAMPAIGN = { label: 'Add to Campaign', type: 'script', objectName: OBJECT, - locations: ['list_toolbar', 'list_item'], + locations: ['list', 'record_row'], }; /** A transport that answers each record from `refusals` (record id → message), 200 otherwise. */ diff --git a/ui/packages/plugin-grid/src/__tests__/defaultFromRowProjection-10277.test.tsx b/ui/packages/plugin-grid/src/__tests__/defaultFromRowProjection-10277.test.tsx index 723bb544858..2ac0b95b825 100644 --- a/ui/packages/plugin-grid/src/__tests__/defaultFromRowProjection-10277.test.tsx +++ b/ui/packages/plugin-grid/src/__tests__/defaultFromRowProjection-10277.test.tsx @@ -54,7 +54,7 @@ const REMOVE_TEAM_MEMBER = { name: 'remove_team_member', label: 'Remove from Team', type: 'api', - locations: ['list_item'], + locations: ['record_row'], target: '/api/v1/auth/organization/remove-team-member', params: [ { name: 'teamId', field: 'team_id', required: true, defaultFromRow: true }, @@ -121,7 +121,7 @@ describe('ObjectGrid — `$select` carries what a row action READS off the row ( ); cleanup(); expect( - await selectFor({ bulkActionDefs: [{ ...REMOVE_TEAM_MEMBER, locations: ['list_toolbar'] }] }), + await selectFor({ bulkActionDefs: [{ ...REMOVE_TEAM_MEMBER, locations: ['list'] }] }), ).toEqual(expect.arrayContaining(['team_id', 'user_id'])); }); @@ -131,7 +131,7 @@ describe('ObjectGrid — `$select` carries what a row action READS off the row ( name: 'remove_member', label: 'Remove', type: 'api', - locations: ['list_item'], + locations: ['record_row'], target: '/api/v1/teams/{team_id}/members/{user_id}', }], }); diff --git a/ui/packages/plugin-grid/src/__tests__/gridNonAuthorKeys.test.tsx b/ui/packages/plugin-grid/src/__tests__/gridNonAuthorKeys.test.tsx index 0e2ce7f8418..0b85b4e8f85 100644 --- a/ui/packages/plugin-grid/src/__tests__/gridNonAuthorKeys.test.tsx +++ b/ui/packages/plugin-grid/src/__tests__/gridNonAuthorKeys.test.tsx @@ -36,7 +36,7 @@ * * - `app-shell/src/views/ObjectView.tsx:1968` DERIVES the grid's * `rowActionDefs` from `objectDef.actions` filtered by - * `locations: ['list_item']`, while passing `bulkActionDefs` straight + * `locations: ['record_row']`, while passing `bulkActionDefs` straight * through from the view author twenty lines below. Asymmetric by * construction — one is computed, the other authored. * - The spec's `ObjectGridPropsSchema` is a `strictObject` that accepts @@ -46,7 +46,7 @@ * `rowActionDefs` — which is why the read is a cast at all. * * So the authored way to put an action on a row stays what it already was: the - * object's own action with `locations: ['list_item']`, plus the declared legacy + * object's own action with `locations: ['record_row']`, plus the declared legacy * `rowActions` name list. `bulkActionDefs` keeps its job here as the DECLARED * CONTROL below — the one key of the pair that IS authoring surface, which is * what makes every "not published" assertion mean something. @@ -178,7 +178,7 @@ const NON_AUTHOR_KEYS = [ // key into the manifest as `bulkActionDefs`'s symmetric partner. ruled: '2026-08-19 (reversing 2026-08-18)', producer: - "app-shell ObjectView: the list schema's `rowActionDefs` — DERIVED from objectDef.actions filtered by locations:['list_item'], " + "app-shell ObjectView: the list schema's `rowActionDefs` — DERIVED from objectDef.actions filtered by locations:['record_row'], " + 'whereas bulkActionDefs beside it is passed through from the author', sample: [{ name: 'approve', label: 'Approve' }], }, diff --git a/ui/packages/plugin-grid/src/__tests__/legacyRowActionDispatch.test.tsx b/ui/packages/plugin-grid/src/__tests__/legacyRowActionDispatch.test.tsx index 4b55cc33a28..9e38df398cc 100644 --- a/ui/packages/plugin-grid/src/__tests__/legacyRowActionDispatch.test.tsx +++ b/ui/packages/plugin-grid/src/__tests__/legacyRowActionDispatch.test.tsx @@ -14,7 +14,7 @@ * NAME in the runner's `type` slot — `{ type: 'convert_lead' }`. That matches * no built-in type and no registered handler, so it fell through the runner's * schema fallback: zero requests, then a green "Action completed successfully" - * toast. And because an object action declaring `locations: ['list_item']` + * toast. And because an object action declaring `locations: ['record_row']` * also injects its own (working) entry, the same action could render twice — * one live, one dead. * @@ -58,7 +58,7 @@ const CONVERT_LEAD = { label: 'Convert to Account', type: 'api', target: '/api/v1/leads/convert', - locations: ['record_header'], + locations: ['record_page'], }; let fetchMock: ReturnType; @@ -150,10 +150,10 @@ describe('legacy string rowActions dispatch (objectui#2960)', () => { }); it('does not render a dead duplicate of a list_item action', async () => { - const listItemDef = { ...CONVERT_LEAD, locations: ['list_item'], label: 'Convert' }; + const listItemDef = { ...CONVERT_LEAD, locations: ['record_row'], label: 'Convert' }; await openRowMenu({ objectActions: [listItemDef], - // The app-shell derives `rowActionDefs` from `locations: ['list_item']`; + // The app-shell derives `rowActionDefs` from `locations: ['record_row']`; // a view that ALSO names the action in legacy `rowActions` used to get // both a working entry and a dead twin. schema: { rowActions: ['convert_lead'], rowActionDefs: [listItemDef] }, diff --git a/ui/packages/plugin-grid/src/__tests__/phoneCardRowActions-29150.test.tsx b/ui/packages/plugin-grid/src/__tests__/phoneCardRowActions-29150.test.tsx index cb970b201fd..a691496154d 100644 --- a/ui/packages/plugin-grid/src/__tests__/phoneCardRowActions-29150.test.tsx +++ b/ui/packages/plugin-grid/src/__tests__/phoneCardRowActions-29150.test.tsx @@ -60,9 +60,9 @@ const ROWS = [ /** The object's `list_item` actions: one gated per row, one ungated, one primary. */ const ROW_ACTIONS = [ - { name: 'submit_review', label: 'Submit for review', type: 'api', target: '/api/submit', locations: ['list_item'], visible: "record.status == 'draft'" }, - { name: 'archive', label: 'Archive', type: 'api', target: '/api/archive', locations: ['list_item'] }, - { name: 'promote', label: 'Promote', type: 'api', target: '/api/promote', locations: ['list_item'], variant: 'primary' }, + { name: 'submit_review', label: 'Submit for review', type: 'api', target: '/api/submit', locations: ['record_row'], visible: "record.status == 'draft'" }, + { name: 'archive', label: 'Archive', type: 'api', target: '/api/archive', locations: ['record_row'] }, + { name: 'promote', label: 'Promote', type: 'api', target: '/api/promote', locations: ['record_row'], variant: 'primary' }, ]; function renderGrid(opts: { diff --git a/ui/packages/plugin-grid/src/__tests__/predicate-surface-parity.test.tsx b/ui/packages/plugin-grid/src/__tests__/predicate-surface-parity.test.tsx index 512267156c2..399cbe7e835 100644 --- a/ui/packages/plugin-grid/src/__tests__/predicate-surface-parity.test.tsx +++ b/ui/packages/plugin-grid/src/__tests__/predicate-surface-parity.test.tsx @@ -92,7 +92,7 @@ function headerVerdict(name: string, visible: unknown, record: any): boolean { type: 'page:header', title: 'Specimen', actions: [ - { name, locations: ['record_header'], label: 'Parity Action', type: 'api', visible }, + { name, locations: ['record_page'], label: 'Parity Action', type: 'api', visible }, ], }} /> diff --git a/ui/packages/plugin-grid/src/__tests__/projectionFls-6898.test.tsx b/ui/packages/plugin-grid/src/__tests__/projectionFls-6898.test.tsx index 0fce8a52b7d..8fea194f1fa 100644 --- a/ui/packages/plugin-grid/src/__tests__/projectionFls-6898.test.tsx +++ b/ui/packages/plugin-grid/src/__tests__/projectionFls-6898.test.tsx @@ -214,7 +214,7 @@ describe('ObjectGrid — `$select` is FLS-gated (objectui#6898)', () => { const select = await selectFor({ columns: ['name'], rowActionDefs: [{ - name: 'raise', label: 'Raise', type: 'api', locations: ['list_item'], + name: 'raise', label: 'Raise', type: 'api', locations: ['record_row'], target: '/x', visible: 'record.salary > 0', }], }); @@ -231,7 +231,7 @@ describe('ObjectGrid — `$select` is FLS-gated (objectui#6898)', () => { const select = await selectFor({ columns: ['name'], rowActionDefs: [{ - name: 'advance', label: 'Advance', type: 'api', locations: ['list_item'], + name: 'advance', label: 'Advance', type: 'api', locations: ['record_row'], target: '/x', visible: 'record.stage == "open"', }], }); diff --git a/ui/packages/plugin-grid/src/__tests__/recordIdFieldProjection.test.tsx b/ui/packages/plugin-grid/src/__tests__/recordIdFieldProjection.test.tsx index 2f7020d1932..6c5c6e78f8e 100644 --- a/ui/packages/plugin-grid/src/__tests__/recordIdFieldProjection.test.tsx +++ b/ui/packages/plugin-grid/src/__tests__/recordIdFieldProjection.test.tsx @@ -88,7 +88,7 @@ const REVOKE = { name: 'revoke_session', label: 'Revoke Session', type: 'api', - locations: ['list_item'], + locations: ['record_row'], target: '/api/v1/auth/revoke-session', recordIdParam: 'token', recordIdField: 'token', @@ -112,7 +112,7 @@ describe('ObjectGrid — $select harvests every declared `recordIdField` (object it("projects a view `bulkActionDefs` entry's `recordIdField`", async () => { const select = await selectFor({ - bulkActionDefs: [{ ...REVOKE, locations: ['list_toolbar'] }], + bulkActionDefs: [{ ...REVOKE, locations: ['list'] }], }); expect(select).toContain('token'); }); diff --git a/ui/packages/plugin-grid/src/__tests__/relatedListRowActionDisabled-33215.test.tsx b/ui/packages/plugin-grid/src/__tests__/relatedListRowActionDisabled-33215.test.tsx index 56634f0fa7f..acf8fa3ff10 100644 --- a/ui/packages/plugin-grid/src/__tests__/relatedListRowActionDisabled-33215.test.tsx +++ b/ui/packages/plugin-grid/src/__tests__/relatedListRowActionDisabled-33215.test.tsx @@ -98,7 +98,7 @@ describe('enlarged related list — inline primary row action honours `disabled` name: 'allocate', label: 'Allocate', variant: 'primary', - locations: ['record_header', 'record_related'], + locations: ['record_page', 'record_related'], disabled: "record.status == 'locked'", disabledReason: REASON, }; diff --git a/ui/packages/plugin-grid/src/__tests__/resolveBulkActions.test.ts b/ui/packages/plugin-grid/src/__tests__/resolveBulkActions.test.ts index 15b08cc816c..4797bb65d69 100644 --- a/ui/packages/plugin-grid/src/__tests__/resolveBulkActions.test.ts +++ b/ui/packages/plugin-grid/src/__tests__/resolveBulkActions.test.ts @@ -46,7 +46,7 @@ describe('resolveBulkActions', () => { }); it('surfaces nothing for an object action the view never names', () => { - const rowOnly = { name: 'convert_lead', label: 'Convert', locations: ['list_item'] }; + const rowOnly = { name: 'convert_lead', label: 'Convert', locations: ['record_row'] }; const { defs, undeclared } = resolveBulkActions({ objectActions: [rowOnly, PUSH_DOWN] }); expect(defs).toEqual([]); diff --git a/ui/packages/plugin-grid/src/__tests__/resolveLegacyRowActions.test.ts b/ui/packages/plugin-grid/src/__tests__/resolveLegacyRowActions.test.ts index a08e6507fc2..ee92bb6547f 100644 --- a/ui/packages/plugin-grid/src/__tests__/resolveLegacyRowActions.test.ts +++ b/ui/packages/plugin-grid/src/__tests__/resolveLegacyRowActions.test.ts @@ -14,7 +14,7 @@ const CONVERT_LEAD = { label: 'Convert Lead', type: 'api', target: '/leads/convert', - locations: ['record_header'], + locations: ['record_page'], }; describe('resolveLegacyRowActions', () => { @@ -32,7 +32,7 @@ describe('resolveLegacyRowActions', () => { }); it('drops a legacy name that duplicates an existing list_item def', () => { - const listItemDef = { ...CONVERT_LEAD, locations: ['list_item'], label: '转换线索' }; + const listItemDef = { ...CONVERT_LEAD, locations: ['record_row'], label: '转换线索' }; const { defs, undeclared } = resolveLegacyRowActions({ rowActions: ['convert_lead'], rowActionDefs: [listItemDef], @@ -72,8 +72,8 @@ describe('resolveLegacyRowActions', () => { }); it('appends promotions after the declared defs and preserves order', () => { - const archive = { name: 'archive', locations: ['list_item'] }; - const merge = { name: 'merge', locations: ['record_header'] }; + const archive = { name: 'archive', locations: ['record_row'] }; + const merge = { name: 'merge', locations: ['record_page'] }; const { defs, undeclared } = resolveLegacyRowActions({ rowActions: ['merge', 'unknown_one', 'convert_lead'], rowActionDefs: [archive], diff --git a/ui/packages/plugin-grid/src/__tests__/rowActionRecordHole-12967.test.tsx b/ui/packages/plugin-grid/src/__tests__/rowActionRecordHole-12967.test.tsx index b63c39a8aef..5c77e5e9c4a 100644 --- a/ui/packages/plugin-grid/src/__tests__/rowActionRecordHole-12967.test.tsx +++ b/ui/packages/plugin-grid/src/__tests__/rowActionRecordHole-12967.test.tsx @@ -37,7 +37,7 @@ const pauseAction = (confirmText: string) => ({ name: 'pause_environment', label: 'Pause', type: 'api', - locations: ['list_item', 'record_header'], + locations: ['record'], target: '/api/v1/environments/pause', confirmText, }); diff --git a/ui/packages/plugin-grid/src/__tests__/rowContextMenu-28434.test.tsx b/ui/packages/plugin-grid/src/__tests__/rowContextMenu-28434.test.tsx index edf0eb7efbe..916a8973064 100644 --- a/ui/packages/plugin-grid/src/__tests__/rowContextMenu-28434.test.tsx +++ b/ui/packages/plugin-grid/src/__tests__/rowContextMenu-28434.test.tsx @@ -54,11 +54,11 @@ const ROWS = [ /** The object's `list_item` actions: one gated per row, one ungated. */ const SECONDARY_ACTIONS = [ - { name: 'submit_review', label: 'Submit for review', type: 'api', target: '/api/submit', locations: ['list_item'], visible: "record.status == 'draft'" }, - { name: 'archive', label: 'Archive', type: 'api', target: '/api/archive', locations: ['list_item'] }, + { name: 'submit_review', label: 'Submit for review', type: 'api', target: '/api/submit', locations: ['record_row'], visible: "record.status == 'draft'" }, + { name: 'archive', label: 'Archive', type: 'api', target: '/api/archive', locations: ['record_row'] }, ]; /** A primary: the cell draws it inline, outside the "⋮". */ -const PRIMARY_ACTION = { name: 'promote', label: 'Promote', type: 'api', target: '/api/promote', locations: ['list_item'], variant: 'primary' }; +const PRIMARY_ACTION = { name: 'promote', label: 'Promote', type: 'api', target: '/api/promote', locations: ['record_row'], variant: 'primary' }; function makeHost() { return { @@ -412,11 +412,11 @@ describe('objectstack#28434 · the keyboard opens the same menu, Esc returns foc describe('objectstack#36494 · both row menus follow the object\'s `actionLayout.record` order', () => { /** Two primaries and three secondaries, declared in this order. */ const ACTIONS = [ - { name: 'promote', label: 'Promote', type: 'api', target: '/api/promote', locations: ['list_item'], variant: 'primary' }, - { name: 'submit_review', label: 'Submit', type: 'api', target: '/api/submit', locations: ['list_item'] }, - { name: 'archive', label: 'Archive', type: 'api', target: '/api/archive', locations: ['list_item'] }, - { name: 'escalate', label: 'Escalate', type: 'api', target: '/api/escalate', locations: ['list_item'], variant: 'primary' }, - { name: 'clone_row', label: 'Clone', type: 'api', target: '/api/clone', locations: ['list_item'] }, + { name: 'promote', label: 'Promote', type: 'api', target: '/api/promote', locations: ['record_row'], variant: 'primary' }, + { name: 'submit_review', label: 'Submit', type: 'api', target: '/api/submit', locations: ['record_row'] }, + { name: 'archive', label: 'Archive', type: 'api', target: '/api/archive', locations: ['record_row'] }, + { name: 'escalate', label: 'Escalate', type: 'api', target: '/api/escalate', locations: ['record_row'], variant: 'primary' }, + { name: 'clone_row', label: 'Clone', type: 'api', target: '/api/clone', locations: ['record_row'] }, ]; const customOf = (ids: (string | null)[]) => ids.filter((id) => id?.startsWith('row-action-') && !id.startsWith('row-action-builtin-')); diff --git a/ui/packages/plugin-grid/src/__tests__/undoProjectedRow-10404.test.tsx b/ui/packages/plugin-grid/src/__tests__/undoProjectedRow-10404.test.tsx index 34ea5a1b121..830a5fe9b6b 100644 --- a/ui/packages/plugin-grid/src/__tests__/undoProjectedRow-10404.test.tsx +++ b/ui/packages/plugin-grid/src/__tests__/undoProjectedRow-10404.test.tsx @@ -86,7 +86,7 @@ const CLOSE_TASK = { type: 'script', operation: 'update', undoable: true, - locations: ['list_item'], + locations: ['record_row'], patch: { status: 'closed' }, }; diff --git a/ui/packages/plugin-grid/src/resolveBulkActions.ts b/ui/packages/plugin-grid/src/resolveBulkActions.ts index 563496e5576..c5e91d4dcc6 100644 --- a/ui/packages/plugin-grid/src/resolveBulkActions.ts +++ b/ui/packages/plugin-grid/src/resolveBulkActions.ts @@ -32,7 +32,7 @@ * * `locations` stays orthogonal — it places an action's SINGLE-record entry * (toolbar / row kebab / record header). One action can be both: declared - * `locations: ['list_item']` AND named in `bulkActions`, it runs on one row + * `locations: ['record_row']` AND named in `bulkActions`, it runs on one row * from the kebab and on N rows from the selection bar. * * ## Two vocabularies reach the selection bar diff --git a/ui/packages/plugin-grid/src/resolveLegacyRowActions.ts b/ui/packages/plugin-grid/src/resolveLegacyRowActions.ts index 80909f21e63..822b5558f33 100644 --- a/ui/packages/plugin-grid/src/resolveLegacyRowActions.ts +++ b/ui/packages/plugin-grid/src/resolveLegacyRowActions.ts @@ -23,7 +23,7 @@ * registered under that name) fell through to the runner's schema fallback * — zero requests, then a green "Action completed successfully" toast * (objectui#2960). Worse, when the same action ALSO declared - * `locations: ['list_item']`, the menu showed a working entry and a dead + * `locations: ['record_row']`, the menu showed a working entry and a dead * duplicate of it side by side. * * Resolving each legacy name against the object's declared actions collapses @@ -56,7 +56,7 @@ export function resolveLegacyRowActions(opts: { * `'delete'` entries (those route to `onEdit` / `onDelete`, not the runner). */ rowActions?: readonly string[] | null; - /** Row-context defs the view resolved from `locations: ['list_item']`. */ + /** Row-context defs the view resolved from `locations: ['record_row']`. */ rowActionDefs?: readonly NamedActionDef[] | null; /** Every action declared on the object (`objectDef.actions`). */ objectActions?: readonly NamedActionDef[] | null; diff --git a/ui/packages/plugin-list/src/__tests__/ListView.allDeniedSelect-10275.test.tsx b/ui/packages/plugin-list/src/__tests__/ListView.allDeniedSelect-10275.test.tsx index 68fbdd07744..b3ac4d4b1f2 100644 --- a/ui/packages/plugin-list/src/__tests__/ListView.allDeniedSelect-10275.test.tsx +++ b/ui/packages/plugin-list/src/__tests__/ListView.allDeniedSelect-10275.test.tsx @@ -92,7 +92,7 @@ const objectDefWithActions = { { name: 'escalate', label: 'Escalate', - locations: ['list_item'], + locations: ['record_row'], visible: "record.region == 'EU'", disabled: "record.priority == 'low'", }, diff --git a/ui/packages/react/src/__tests__/useActionEngine.capabilityGate.test.tsx b/ui/packages/react/src/__tests__/useActionEngine.capabilityGate.test.tsx index 2ce024da5b4..df536d09f37 100644 --- a/ui/packages/react/src/__tests__/useActionEngine.capabilityGate.test.tsx +++ b/ui/packages/react/src/__tests__/useActionEngine.capabilityGate.test.tsx @@ -32,10 +32,10 @@ const gated = { name: 'set_parallel_positions', label: 'Set parallel reviewers', type: 'api' as const, - locations: ['record_header'], + locations: ['record_page'], requiredPermissions: ['ehr_probe_capability'], }; -const ungated = { name: 'print', label: 'Print', type: 'api' as const, locations: ['record_header'] }; +const ungated = { name: 'print', label: 'Print', type: 'api' as const, locations: ['record_page'] }; /** The shape a record surface really mounts: provider seeds the user, the * renderer passes only record-scoped keys. */ diff --git a/ui/packages/react/src/context/RelatedRecordActionsContext.tsx b/ui/packages/react/src/context/RelatedRecordActionsContext.tsx index 22610987703..e14881304b7 100644 --- a/ui/packages/react/src/context/RelatedRecordActionsContext.tsx +++ b/ui/packages/react/src/context/RelatedRecordActionsContext.tsx @@ -106,7 +106,7 @@ export interface RelatedRecordHandlers { /** Execute one of {@link rowActions} against a specific child row. */ onRowAction?: (action: RelatedRowActionDef, record: unknown) => void | Promise; /** - * Child object list-level actions (`locations: ['list_toolbar']`), + * Child object list-level actions (`locations: ['list']`), * localized — rendered as header buttons on the related list (e.g. * `invite_user` on an organization's Invitations list). Same bridge * contract as {@link rowActions}, minus the row context. diff --git a/ui/packages/react/src/hooks/__tests__/useActionEngine.test.ts b/ui/packages/react/src/hooks/__tests__/useActionEngine.test.ts index 8a1bef58501..da8a3844119 100644 --- a/ui/packages/react/src/hooks/__tests__/useActionEngine.test.ts +++ b/ui/packages/react/src/hooks/__tests__/useActionEngine.test.ts @@ -19,7 +19,7 @@ describe('useActionEngine', () => { name: 'mark_complete', type: 'script', target: 'true', - locations: ['list_toolbar', 'record_header'], + locations: ['list', 'record_page'], // @ts-expect-error `bulkEnabled` is a retired key on `ActionDef`, kept // here as the only input that can prove `getBulkActions()` does not // harvest it (see the inverse test below). The directive is @@ -30,13 +30,13 @@ describe('useActionEngine', () => { name: 'delete_record', type: 'api', endpoint: '/api/delete', - locations: ['record_more'], + locations: ['record_page'], component: 'action:menu', }, { name: 'view_details', type: 'url', target: '/details', - locations: ['list_item'], + locations: ['record_row'], // @ts-expect-error `shortcut` is retired on `ActionDef` too, and for the // same reason as `bulkEnabled` above: the inverse test needs metadata // that still declares one. On its OWN entry rather than beside diff --git a/ui/packages/react/src/hooks/__tests__/useActionTextLocalizer.keyObject-11439.test.tsx b/ui/packages/react/src/hooks/__tests__/useActionTextLocalizer.keyObject-11439.test.tsx index dd80c484a82..caf91319c82 100644 --- a/ui/packages/react/src/hooks/__tests__/useActionTextLocalizer.keyObject-11439.test.tsx +++ b/ui/packages/react/src/hooks/__tests__/useActionTextLocalizer.keyObject-11439.test.tsx @@ -41,7 +41,7 @@ const CLOSE_ORDER = { objectName: 'sales_order', confirmText: 'Close this order? This cannot be undone.', successMessage: 'Order closed.', - locations: ['record_header'], + locations: ['record_page'], }; function setup(bundle: Record) { diff --git a/ui/packages/react/src/hooks/__tests__/useActionTextLocalizer.outcomeMessages-11344.test.tsx b/ui/packages/react/src/hooks/__tests__/useActionTextLocalizer.outcomeMessages-11344.test.tsx index 28ccbcc4e85..eb8405664c3 100644 --- a/ui/packages/react/src/hooks/__tests__/useActionTextLocalizer.outcomeMessages-11344.test.tsx +++ b/ui/packages/react/src/hooks/__tests__/useActionTextLocalizer.outcomeMessages-11344.test.tsx @@ -44,7 +44,7 @@ const DELETE_ENVIRONMENT = { name: 'delete_environment', type: 'script', label: 'Delete environment', - locations: ['record_header'], + locations: ['record_page'], outcomeMessages: { archived: { en: 'Environment ${result.name} archived', diff --git a/ui/packages/react/src/hooks/__tests__/useActionTextLocalizer.test.tsx b/ui/packages/react/src/hooks/__tests__/useActionTextLocalizer.test.tsx index 7696e8178ed..989fd8cf10f 100644 --- a/ui/packages/react/src/hooks/__tests__/useActionTextLocalizer.test.tsx +++ b/ui/packages/react/src/hooks/__tests__/useActionTextLocalizer.test.tsx @@ -35,7 +35,7 @@ const CONVERT_LEAD = { label: 'Convert Lead', confirmText: 'Are you sure you want to convert this lead?', successMessage: 'Lead converted.', - locations: ['record_header'], + locations: ['record_page'], }; function setup() { diff --git a/ui/packages/types/src/__tests__/action-bar-chart-flag-11355.test.ts b/ui/packages/types/src/__tests__/action-bar-chart-flag-11355.test.ts index 4b041ec2bac..51b0b762e31 100644 --- a/ui/packages/types/src/__tests__/action-bar-chart-flag-11355.test.ts +++ b/ui/packages/types/src/__tests__/action-bar-chart-flag-11355.test.ts @@ -51,7 +51,7 @@ export type _ActionBarSystemActionsAreUIActions = Expect>; /** CONTROL — the declared spelling compiles. */ -export const _actionBarAccepted: ActionBarSchema = { type: 'action:bar', location: 'list_toolbar', actions: [] }; +export const _actionBarAccepted: ActionBarSchema = { type: 'action:bar', location: 'list', actions: [] }; /** The same literal with the key misspelt is refused, which is what the missing signature buys. */ // @ts-expect-error -- `locaton` is not a member of `ActionBarSchema` export const _actionBarRefused: ActionBarSchema = { type: 'action:bar', locaton: 'list_toolbar', actions: [] }; diff --git a/ui/packages/types/src/__tests__/arranged-header-actions-36366.test.ts b/ui/packages/types/src/__tests__/arranged-header-actions-36366.test.ts index ab2bf58c508..16521af7a25 100644 --- a/ui/packages/types/src/__tests__/arranged-header-actions-36366.test.ts +++ b/ui/packages/types/src/__tests__/arranged-header-actions-36366.test.ts @@ -13,16 +13,16 @@ import { describe, expect, it } from 'vitest'; import { arrangedHeaderActions } from '../ui-action'; const RECORD = [ - { name: 'edit', locations: ['record_header'], order: 1 }, - { name: 'clone', locations: ['record_more'] }, - { name: 'mark_won', locations: ['record_header'], order: 5 }, - { name: 'archive', locations: ['record_header', 'record_more'], component: 'action:menu' }, + { name: 'edit', locations: ['record_page'], order: 1 }, + { name: 'clone', locations: ['record_page'], component: 'action:menu' }, + { name: 'mark_won', locations: ['record_page'], order: 5 }, + { name: 'archive', locations: ['record_page'], component: 'action:menu' }, ]; const LIST = [ - { name: 'new_lead', locations: ['list_toolbar'] }, - { name: 'mass_assign', locations: ['list_toolbar'], order: 3 }, - { name: 'import_csv', locations: ['list_toolbar'], component: 'action:menu' }, + { name: 'new_lead', locations: ['list'] }, + { name: 'mass_assign', locations: ['list'], order: 3 }, + { name: 'import_csv', locations: ['list'], component: 'action:menu' }, ]; const names = (actions: readonly { name?: unknown }[]) => actions.map((a) => a.name); diff --git a/ui/packages/types/src/__tests__/declared-action-ids-7182.test.ts b/ui/packages/types/src/__tests__/declared-action-ids-7182.test.ts index 800466d2bf1..9f2fb55c458 100644 --- a/ui/packages/types/src/__tests__/declared-action-ids-7182.test.ts +++ b/ui/packages/types/src/__tests__/declared-action-ids-7182.test.ts @@ -28,8 +28,8 @@ import { describe, it, expect } from 'vitest'; import { actionRendersAt, resolveDeclaredActionIds } from '../ui-action'; import * as barrel from '../index'; -const CONVERT = { name: 'convert', label: 'Convert Lead', locations: ['record_header'] }; -const QUALIFY = { name: 'qualify', label: 'Qualify', locations: ['record_header'] }; +const CONVERT = { name: 'convert', label: 'Convert Lead', locations: ['record_page'] }; +const QUALIFY = { name: 'qualify', label: 'Qualify', locations: ['record_page'] }; /** A second registration under an already-taken name — registration order must win. */ const CONVERT_AGAIN = { name: 'convert', label: 'Convert (duplicate)' }; /** Registrations the resolver must skip without choking: no name, or not a string. */ From c50e366a3ff5a5d55d955d0b27e7529d38a46659 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 27 Nov 2026 09:34:36 +0000 Subject: [PATCH 2/8] =?UTF-8?q?wip(ui):=20read=20the=20acted-on=20location?= =?UTF-8?q?s=20=E2=80=94=20header=20fold,=20quick=20actions,=20examples,?= =?UTF-8?q?=20docs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Claude-Session: https://claude.ai/code/session_01L9qic11optJUat6U8X67jY Co-authored-by: Claude --- content/docs/protocol/objectui/actions.mdx | 30 ++++---- content/docs/protocol/objectui/concept.mdx | 2 +- content/docs/protocol/objectui/layout-dsl.mdx | 9 ++- content/docs/ui/actions.mdx | 36 ++++++---- content/docs/ui/components/action.mdx | 6 +- content/docs/ui/components/page.mdx | 6 +- content/docs/ui/components/record.mdx | 2 +- content/docs/ui/pages.mdx | 15 ++-- .../src/actions/convert-lead.action.ts | 2 +- .../test/action-predicate-sparse-face.test.ts | 6 +- examples/app-showcase/src/ui/actions/index.ts | 19 ++--- .../src/ui/actions/predicate-matrix.action.ts | 20 +++--- .../src/ui/pages/project-detail.page.ts | 4 +- .../src/ui/pages/review-queue.page.ts | 4 +- .../src/ui/pages/task-detail.page.ts | 26 +++---- .../app-showcase/src/ui/views/task.view.ts | 8 +-- .../test/action-predicate-sparse-face.test.ts | 2 +- .../test/record-action-location-hosts.test.ts | 50 +++++++------ packages/cli/src/commands/generate.ts | 12 ++-- packages/lint/src/rule-explanations.ts | 12 ++-- .../lint/src/validate-action-locations.ts | 2 +- .../lint/src/validate-action-name-refs.ts | 21 +++--- packages/lint/src/validate-null-guards.ts | 4 +- .../lint/src/validate-object-action-layout.ts | 8 +-- .../lint/src/validate-record-page-header.ts | 15 ++-- ...otocol.stored-action-gate-lowering.test.ts | 6 +- .../src/bound-action-foreign-object.test.ts | 2 +- .../object-own-action-schema-parse.test.ts | 2 +- .../apps/setup-nav-per-user-stores.test.ts | 4 +- .../identity/invitation-delivery-copy.test.ts | 2 +- .../src/identity/invite-entry-toolbar.test.ts | 12 ++-- ...remove-pending-sso-user-visibility.test.ts | 2 +- .../identity/setup-list-empty-states.test.ts | 2 +- .../sys-account-link-social-retired.test.ts | 2 +- .../identity/sys-api-key-action-copy.test.ts | 2 +- .../src/identity/sys-invitation.object.ts | 4 +- .../src/identity/sys-member.object.ts | 4 +- .../identity/sys-oauth-application.object.ts | 2 +- .../sys-organization-invite-action.test.ts | 10 +-- .../sys-organization-rename-action.test.ts | 20 +++--- .../src/identity/sys-organization.object.ts | 6 +- .../sys-team-add-member-action.test.ts | 4 +- .../sys-team-derived-related-lists.test.ts | 4 +- .../sys-user-set-manager-action.test.ts | 4 +- .../src/identity/sys-user.object.ts | 2 +- .../pages/record-page-header-actions.test.ts | 4 +- .../src/pages/sys-organization.page.ts | 4 +- .../src/pages/sys-user.page.ts | 4 +- .../src/platform-objects.test.ts | 14 ++-- .../src/sys-approval-request-page.test.ts | 2 +- .../src/sys-approval-request.page.ts | 4 +- ...g-change-slug-bound-action.dogfood.test.ts | 4 +- .../scenarios/src/runner/door-rules-corpus.ts | 2 +- packages/runtime/src/action-execution.ts | 2 +- .../src/in-app-message-action.test.ts | 2 +- packages/spec/liveness/action.json | 2 +- packages/spec/liveness/object.json | 4 +- packages/spec/liveness/page.json | 2 +- packages/spec/src/compose-stacks.test.ts | 2 +- .../stack-bound-action-foreign-object.test.ts | 2 +- .../studio/action-location-retirement.test.ts | 10 +-- .../spec/src/ui/action-row-update.test.ts | 6 +- packages/spec/src/ui/action.test.ts | 38 +++++++--- ...nent-action-row-declarative-update.test.ts | 2 +- .../src/ui/component-record-blocks.test.ts | 4 +- packages/spec/src/ui/component.test.ts | 4 +- .../record-block-record-reach.test.tsx | 2 +- .../registry-inputs-spec-parity.test.ts | 4 +- ui/apps/console/src/record-header-preview.tsx | 2 +- ui/e2e/live/record-topbar-35853.spec.ts | 6 +- ui/e2e/record-header-title-width.spec.ts | 4 +- ui/e2e/toast-under-modal.spec.ts | 4 +- .../environment/EnvironmentListToolbar.tsx | 4 +- .../useConsoleActionRuntime.test.tsx | 10 +-- ...eActionRuntime.undoLookupId-11122.test.tsx | 2 +- .../__tests__/useOfferedNavRunAction.test.tsx | 2 +- .../src/hooks/useConsoleActionRuntime.tsx | 4 +- .../src/layout/InboxApprovalItem.tsx | 4 +- .../InboxPopover.rightPanel-34589.test.tsx | 6 +- .../designModeHeaderPinsModel-36366.test.ts | 2 +- .../src/layout/designModeHeaderPinsModel.ts | 14 ++-- .../__tests__/managedByEmptyState.test.ts | 2 +- .../src/utils/managedByEmptyState.ts | 8 +-- .../app-shell/src/utils/recordReadServed.ts | 2 +- .../src/views/DeclaredActionsBar.tsx | 8 ++- ...ew.bulkWiredHeaderDuplicate-12462.test.tsx | 6 +- ...tView.emptyStateMatchesPage-11687.test.tsx | 2 +- ...ectView.headerSelectionGate-27831.test.tsx | 6 +- ...jectView.listOnlyRecordPage-33219.test.tsx | 4 +- ...bjectView.objectBoundActions-7234.test.tsx | 8 +-- ...w.recordRelatedNotOnOwnList-11270.test.tsx | 10 +-- .../ObjectView.rowOpensNothing-33317.test.tsx | 2 +- ...View.toolbarScriptSelection-12331.test.tsx | 24 +++---- ...dDetailView.accessibleNames-12625.test.tsx | 2 +- ...cordDetailView.actionLayout-36366.test.tsx | 4 +- .../RecordDetailView.actionUser.test.tsx | 4 +- ...iew.authoredPageDesktopOnly-36150.test.tsx | 4 +- ...builtinActionSessionUserPredicate.test.tsx | 2 +- ...lView.headerActionLookupPredicate.test.tsx | 4 +- ...DetailView.headerApiInterpolation.test.tsx | 4 +- ...tailView.headerRecordIdLoadWindow.test.tsx | 8 +-- ...ailView.placedHeaderActions-29951.test.tsx | 6 +- ...View.printPageHeaderActions-12906.test.tsx | 6 +- ...ecordDetailView.recordIdParamSeed.test.tsx | 6 +- .../app-shell/src/views/RecordDetailView.tsx | 28 ++++---- .../src/views/RelatedRecordActionsBridge.tsx | 14 ++-- .../__tests__/DeclaredActionsBar.test.tsx | 6 +- ...PageView.relatedListActions-12870.test.tsx | 2 +- ...dActionsBridge.blankVisible-11294.test.tsx | 16 ++--- ...ActionsBridge.recordRelated-11270.test.tsx | 16 ++--- ...taTypeActions.confirmDialog-13333.test.tsx | 6 +- ...TypeActions.paramDialogClose-6473.test.tsx | 2 +- .../MetadataTypeActions.test.tsx | 16 ++--- .../metadata-admin/MetadataTypeActions.tsx | 4 +- .../views/metadata-admin/ResourceEditPage.tsx | 4 +- .../views/metadata-admin/ResourceListPage.tsx | 4 +- .../capabilityGateChannel-7234.test.tsx | 2 +- .../inspectors/ActionDefaultInspector.tsx | 14 ++-- ...ctorStrings.hookAction.i18n-10586.test.tsx | 2 +- .../metadata-admin/previews/ActionPreview.tsx | 28 +++++--- .../ActionPreview.locations.test.tsx | 10 +-- ...ionPreview.recordRelatedRow-11270.test.tsx | 8 +-- .../__tests__/block-config-i18n.test.ts | 2 +- .../automationPreviews.i18n-10862.test.tsx | 4 +- .../metadata-admin/previews/block-config.ts | 8 +-- .../src/views/metadata-admin/useMetadata.ts | 2 +- .../src/views/objectViewHeaderChrome.tsx | 6 +- .../src/views/objectViewHeaderToolbar.ts | 10 +-- .../app-shell/src/views/objectViewHelpers.ts | 2 +- .../src/views/objectViewListRenderer.tsx | 9 +-- .../src/views/objectViewPageHeader.tsx | 2 +- .../src/views/objectViewRecordNavigation.ts | 2 +- .../src/views/objectViewToolbarAffordances.ts | 4 +- .../src/views/recordApprovalActions.ts | 4 +- .../app-shell/src/views/recordPageSurface.ts | 4 +- .../studio-design/ObjectActionsPanel.tsx | 4 +- .../src/views/studio-design/actionPresets.ts | 2 +- .../src/__tests__/action-bar.test.tsx | 2 +- .../__tests__/page-header-action-ids.test.tsx | 12 ++-- .../__tests__/page-header-actions.test.tsx | 16 ++--- .../page-header-capability-gate.test.tsx | 2 +- .../page-header-disabledReason-11811.test.tsx | 2 +- .../page-header-primary-12617.test.tsx | 4 +- .../__tests__/page-header-refresh.test.tsx | 2 +- .../page-header-title-width.test.tsx | 2 +- ui/packages/components/src/index.ts | 6 +- ...action-bar-member-placement-10345.test.tsx | 2 +- .../action-icon-autotrigger.test.tsx | 2 +- .../src/renderers/action/action-bar.tsx | 4 +- .../src/renderers/action/action-button.tsx | 2 +- .../src/renderers/action/action-icon.tsx | 2 +- ...-table-row-action-capability-9623.test.tsx | 4 +- .../data-table-row-action-visible.test.tsx | 2 +- .../src/renderers/complex/data-table.tsx | 6 +- .../src/renderers/layout/containers.tsx | 72 ++++++++----------- ui/packages/core/src/actions/ActionEngine.ts | 6 +- ui/packages/core/src/actions/ActionRunner.ts | 6 +- .../actions/__tests__/ActionEngine.test.ts | 6 +- .../__tests__/ActionEngine.visibility.test.ts | 2 +- .../ActionRunner.askAi-37142.test.ts | 4 +- .../ActionRunner.recordRowGuard-13384.test.ts | 2 +- .../ActionRunner.rowTargetContext.test.ts | 2 +- .../core/src/actions/serverActionHandler.ts | 12 ++-- ui/packages/fields/src/resolveActionParams.ts | 2 +- ui/packages/i18n/src/namespaces/studio/en.ts | 16 ++--- ui/packages/i18n/src/namespaces/studio/zh.ts | 16 ++--- ui/packages/plugin-detail/src/DetailView.tsx | 2 +- ui/packages/plugin-detail/src/RelatedList.tsx | 18 ++--- ...istRenderer.authoredActions-11163.test.tsx | 20 +++--- .../RelatedList.toolbarAskAi-37142.test.tsx | 2 +- ...edList.toolbarCapabilityGate-9782.test.tsx | 6 +- ...claredActionIds.twoRenderers-7182.test.tsx | 4 +- .../related-toolbar-visible.test.tsx | 14 ++-- .../record-quick-actions.icon-12772.test.tsx | 2 +- ...tedListActions.recordRelated-11270.test.ts | 10 +-- .../src/renderers/record-quick-actions.tsx | 20 ++++-- .../src/renderers/record-related-list.tsx | 4 +- .../src/renderers/relatedListActions.ts | 12 ++-- .../__tests__/buildDefaultPageSchema.test.ts | 2 +- ui/packages/plugin-grid/src/ObjectGrid.tsx | 8 +-- .../legacyRowActionDispatch.test.tsx | 2 +- .../objectBulkActionDispatch.test.tsx | 2 +- .../phoneCardRowActions-29150.test.tsx | 2 +- .../__tests__/resolveLegacyRowActions.test.ts | 2 +- .../__tests__/rowContextMenu-28434.test.tsx | 4 +- .../src/components/RowActionMenu.tsx | 8 +-- .../src/components/SelectionBar.tsx | 2 +- .../RowActionMenu.capabilityGate.test.tsx | 2 +- .../RowActionMenu.emptyGuard.test.tsx | 4 +- .../src/resolveLegacyRowActions.ts | 4 +- ui/packages/plugin-list/src/ListView.tsx | 2 +- .../listViewNonAuthorKeys-8653.test.tsx | 2 +- .../useActionEngine.capabilityGate.test.tsx | 2 +- .../context/RelatedRecordActionsContext.tsx | 2 +- .../hooks/__tests__/useActionEngine.test.ts | 35 +++++---- .../react/src/hooks/useActionEngine.ts | 2 +- .../react/src/hooks/useCapabilityGate.ts | 4 +- .../action-bar-chart-flag-11355.test.ts | 2 +- .../arranged-header-actions-36366.test.ts | 16 +++-- .../src/__tests__/spec-derived-unions.test.ts | 2 +- ui/packages/types/src/data-display.ts | 2 +- ui/packages/types/src/index.ts | 1 + ui/packages/types/src/objectql.ts | 2 +- ui/packages/types/src/ui-action.ts | 64 ++++++++++------- 204 files changed, 782 insertions(+), 714 deletions(-) diff --git a/content/docs/protocol/objectui/actions.mdx b/content/docs/protocol/objectui/actions.mdx index a0d2b05524a..bcbe09f45a3 100644 --- a/content/docs/protocol/objectui/actions.mdx +++ b/content/docs/protocol/objectui/actions.mdx @@ -162,7 +162,7 @@ refreshAfter: true **Request body shaping:** - `bodyShape` — `'flat'` (default) sends collected params at the top level; `{ wrap: 'data' }` nests user params under that key. - `bodyExtra` — constant fields merged into the request, applied last so they always win (e.g. `bodyExtra: { resend: true }`). -- `recordIdParam` / `recordIdField` — inject the current row id (or another row field) into a body key when the action runs from a `list_item` location. +- `recordIdParam` / `recordIdField` — inject the current row id (or another row field) into a body key when the action runs from a `record_row` location. ### Form Actions @@ -273,15 +273,15 @@ Action `name` is the configuration ID and **must** be lowercase `snake_case` (`a ### Action Locations -The `locations` array declares where an action surfaces. The canonical enum (`ACTION_LOCATIONS`) is: +The `locations` array declares what an action acts on, and so where it surfaces. The canonical enum (`ACTION_LOCATIONS`) is: | Location | Where it renders | | --- | --- | -| `list_toolbar` | Header/toolbar of a list view (bulk actions, "New", export) | -| `list_item` | Per-row action on a list/grid row | -| `record_header` | Primary actions in the record-detail title bar | -| `record_more` | Overflow ("More" / ⋯) menu on a record | -| `record_related` | Per-row action on each row of a related-list section inside a parent record, in that parent's context only — unlike `list_item`, never on the object's own list views. Declared, not yet placed: the console does not render it on those rows yet | +| `list` | Header/toolbar of a list view (bulk actions, "New", export) — acts on no record | +| `record` | Both record surfaces: the record-detail title bar and each list/grid row | +| `record_page` | Actions in the record-detail title bar; with `component: 'action:menu'`, straight into its overflow ("More" / ⋯) menu | +| `record_row` | Per-row action on a list/grid row | +| `record_related` | Per-row action on each row of a related-list section inside a parent record, in that parent's context only — unlike `record_row`, never on the object's own list views. Declared, not yet placed: the console does not render it on those rows yet | | `record_section` | Actions inside a body section/tab of a record | ```yaml @@ -290,18 +290,18 @@ label: Export icon: download type: api target: /api/customers/export -locations: [list_toolbar] +locations: [list] ``` ### Ordering & the Primary Button -Within each location group, actions render in **`order`** sequence — **lower comes first / more prominent**. In `record_header` the first visible action becomes the **primary button** and the rest fall into the `⋯` overflow menu, so `order` is how you decide which action holds the primary slot. +Within each location group, actions render in **`order`** sequence — **lower comes first / more prominent**. In `record_page` the first visible action becomes the **primary button** and the rest fall into the `⋯` overflow menu, so `order` is how you decide which action holds the primary slot. ```yaml # Approve holds the primary button even though the app action registered first. name: approve_request label: Approve -locations: [record_header] +locations: [record_page] variant: primary order: -10 # negative → floats ahead of app actions (order defaults to 0) ``` @@ -364,7 +364,7 @@ An action the reader toggles, such as a "Helpful" vote on a knowledge article, s name: mark_article_helpful label: Helpful type: script -locations: [record_header] +locations: [record_page] pressed: "has(record.viewer) && record.viewer.vote == 'helpful'" ``` @@ -382,14 +382,14 @@ disabled: "record.status == 'converted'" # preferred — works on every surfac disabled: "status == 'converted'" # bare field — also resolves to the record ``` -Prefer the `record.` form: it reads unambiguously and resolves identically on **every** surface an action renders (`record_header`, `record_more`, `list_item`, related lists). The bare-field form is supported for brevity but is easy to confuse with a local variable. +Prefer the `record.` form: it reads unambiguously and resolves identically on **every** surface an action renders (`record`, `record_page`, `record_row`, related lists). The bare-field form is supported for brevity but is easy to confuse with a local variable. Beyond `record`, action predicates also expose the authenticated user as `ctx.user` (e.g. `record.id == ctx.user.id`) and public feature flags as `features.*` (see [Capability gates](#capability-gates-requiresfeature)) — they are not limited to the record. [record-alert](/docs/protocol/objectui/record-alert) conditions surface the analogous identity values under the `os.*` namespace (`os.user` / `os.org` / `os.env`) instead. **The bound record is SPARSE — guard every read with `has()`.** Unlike a validation or hook predicate, an action predicate is evaluated against whatever -record the client already fetched. On `list_item` that is the row the view's +record the client already fetched. On `record_row` that is the row the view's `$select` projected, so a column the view did not ask for is **absent**, not `null` — and CEL aborts the whole expression at key resolution (`No such key: status`). The abort is fail-closed, so the button simply is not offered, which @@ -630,7 +630,7 @@ ai: icon: pause-circle variant: secondary mode: custom - locations: [list_item, record_header] + locations: [record_row, record_page] type: api method: POST target: /api/v1/auth/admin/oauth2/toggle-disabled @@ -650,7 +650,7 @@ ai: icon: refresh-cw variant: secondary mode: custom - locations: [record_header, record_more] + locations: [record, record_page] type: api method: POST target: /api/v1/auth/sys-oauth-application/rotate-secret diff --git a/content/docs/protocol/objectui/concept.mdx b/content/docs/protocol/objectui/concept.mdx index 0789d4b2ea0..f115ea265f4 100644 --- a/content/docs/protocol/objectui/concept.mdx +++ b/content/docs/protocol/objectui/concept.mdx @@ -611,7 +611,7 @@ actions: **1. The predicate is bare CEL, and the bound record is sparse — guard every read with** **`has()`.** A filter object (`{ status: { $ne: 'locked' } }` — Mongo query syntax) is in none of the three arms `visible`/`disabled` declare, so it is a parse error. And the - record an action predicate sees is whatever the client already fetched: on `list_item` + record an action predicate sees is whatever the client already fetched: on `record_row` that is only what the view's `$select` projected, so an unprojected column is *absent*, not `null`, and CEL aborts the whole expression at key resolution. Here the abort is **fail-closed** — the button is simply not offered, which looks exactly like the diff --git a/content/docs/protocol/objectui/layout-dsl.mdx b/content/docs/protocol/objectui/layout-dsl.mdx index 1df028612d4..5edd4428939 100644 --- a/content/docs/protocol/objectui/layout-dsl.mdx +++ b/content/docs/protocol/objectui/layout-dsl.mdx @@ -90,12 +90,11 @@ each holding typed `components`. There is no `context:` key — the binding is of actions declared on that object — there is no built-in id registry, so `edit` / `delete` / `share` resolve nowhere (the host draws its own Edit / Delete chrome). The list is the whole set the header draws: an action that -declares `record_header` but is not named is not drawn there, and a header with +declares `record_page` but is not named is not drawn there, and a header with no `actions` draws none of the object's own actions. `placedActions: true` in -place of the list asks for every action placed at `record_header` / -`record_more`, read live, so an action another package places on the object is +place of the list asks for every action placed at `record` / `record_page`, read live, so an action another package places on the object is drawn without editing the page; it is refused beside a list. Declare the action, -placed at `record_header`, then name it: +placed at `record_page`, then name it: {/* os:check-yaml action */} ```yaml @@ -104,7 +103,7 @@ label: Send Statement objectName: account type: flow target: account_statement -locations: [record_header] +locations: [record_page] ``` {/* os:check-yaml page */} diff --git a/content/docs/ui/actions.mdx b/content/docs/ui/actions.mdx index 4d1f43b4959..047b1889192 100644 --- a/content/docs/ui/actions.mdx +++ b/content/docs/ui/actions.mdx @@ -365,16 +365,28 @@ is collected, then the body runs with those values as its `input`. ## Bind it to the UI -`locations` is the primary binding — the action appears wherever it declares: +`locations` is the primary binding. Each word says what the action acts on, and the action +appears on every surface that word covers: -| Location | Where the button renders | -|:---|:---| -| `list_toolbar` | List view toolbar (no record context) | -| `list_item` | Per-row menu in list views | -| `record_header` | Record page header | -| `record_more` | Record page overflow ("…") menu | -| `record_related` | Each row of a related list inside a parent record — there only, never on the object's own list views (unlike `list_item`). Declared, not yet placed: the console does not draw it on those rows yet | -| `record_section` | Named action bars on record pages | +| Location | Acts on | Where the button renders | +|:---|:---|:---| +| `list` | No record | List view toolbar | +| `record` | One record | Record page header **and** the per-row menu in list views | +| `record_page` | One record, opened | Record page header | +| `record_row` | One record, in a list | Per-row menu in list views | +| `record_related` | One record, in its parent | Each row of a related list inside a parent record — there only, never on the object's own list views (unlike `record_row`). Declared, not yet placed: the console does not draw it on those rows yet | +| `record_section` | One record | Named action bars on record pages | + +`record_related` takes the "One record" cell too. To keep a record page action out of the +header's buttons and put it straight into the header's 「More」 (`⋯`) menu, set +`component: 'action:menu'` on it. + + +Protocol 19 replaced the page-part words: `list_toolbar` is `list`, `list_item` is +`record_row`, `record_header` and `record_more` are `record_page` (`record` when the action +was on list rows as well), and an action that was only in the `⋯` menu keeps that place with +`component: 'action:menu'`. `os migrate meta --from 18` rewrites them for you. + ### Choose the header's buttons @@ -388,9 +400,9 @@ ObjectSchema.create({ name: 'crm_opportunity', // ... actionLayout: { - // the list scope: actions placed at list_toolbar, drawn on the list page toolbar + // the list scope: actions placed at list, drawn on the list page toolbar list: { pinned: ['mass_assign', '$export'], more: ['send_digest'] }, - // the record scope: actions placed at record_header or record_more + // the record scope: actions placed at record or record_page record: { pinned: ['mark_won', 'mark_lost'], more: ['clone', 'share'] }, }, }); @@ -611,7 +623,7 @@ is a spec proposal for a properly named key, not a values map under this one. 1. **Always prefix record fields** — `record.status != "closed"`, never a bare `status`, which faults as an undeclared identifier. - 2. **Guard with `has()`** — a record-scoped predicate on `list_item` binds a + 2. **Guard with `has()`** — a record-scoped predicate on `record_row` binds a LIST ROW, which carries only the columns that view projects. Reading a field the list does not show aborts the expression with `No such key`, and fail-closed means the button simply is not offered — indistinguishable from diff --git a/content/docs/ui/components/action.mdx b/content/docs/ui/components/action.mdx index ec4725f10e7..0ae13da6e9e 100644 --- a/content/docs/ui/components/action.mdx +++ b/content/docs/ui/components/action.mdx @@ -41,7 +41,7 @@ Namespace `action`. | `successMessage` | `string` | | Toast text when the action succeeds; a `${result.*}` token reads the handler's answer (e.g. `${result.id}`) | | `errorMessage` | `string` | | Toast text when the action fails, in place of the raw error | | `refreshAfter` | `boolean` | | Refresh the surrounding data after the action succeeds | -| `locations` | `array` of `string` | | The placements the action declares (`list_toolbar`, `list_item`, `record_header`, …). A `script` or `flow` action declared record-scoped (`list_item`, `record_header`, `record_more` or `record_section`) refuses to run when no record or single selection is in scope, instead of running without one | +| `locations` | `array` of `string` | | The placements the action declares (`list`, `record_row`, `record_page`, …). A `script` or `flow` action declared record-scoped (`record_row`, `record`, `record_page` or `record_section`) refuses to run when no record or single selection is in scope, instead of running without one | | `toast` | `object` | | Toast behaviour: `{ showOnSuccess?, showOnError?, duration? }` — `false` suppresses that toast, `duration` is handed to the toast | | `resultDialog` | `object` | | One-shot result dialog for a value the response shows exactly once (a 2FA code, a fresh secret); it replaces the success toast | | `onSuccess` | `object` | | Post-success navigation `{ navigate, openIn? }`: `navigate` is a route template that can read `${result.*}`, `openIn` is `self` (the default) or `newTab` | @@ -59,7 +59,7 @@ Namespace `action`. | `icon` | `string` | | — | | `actions` | `array` of `object` | | The actions in this group, in order. Each member is an action object the group draws and runs itself (`name`, `label`, `icon`, `type`, `target`, `locations`, `visible`, `disabled`, …); a member's executor is its own `type` | | `display` | `enum`: `inline`, `dropdown` | | — | -| `location` | `enum`: `list_toolbar`, `list_item`, `record_header`, `record_more`, `record_related`, `record_section` | | Render only the members whose `locations` include this location. Omit to render every member | +| `location` | `enum`: `list`, `record_row`, `record`, `record_page`, `record_related`, `record_section` | | Render only the members whose `locations` include this location. Omit to render every member | | `variant` | `enum`: `default`, `secondary`, `outline`, `ghost` | | — | | `size` | `enum`: `default`, `sm`, `lg`, `icon` | | Button size for the dropdown trigger and for every inline member that sets none | | `visible` | `boolean` \| `string` \| `object` | | Visibility predicate for the whole group: `true`/`false`, a bare CEL expression, or the `{ dialect: 'cel', source }` envelope, evaluated against the row the host binds. Omit for always-visible | @@ -91,7 +91,7 @@ Namespace `action`. | `successMessage` | `string` | | Toast text when the action succeeds; a `${result.*}` token reads the handler's answer (e.g. `${result.id}`) | | `errorMessage` | `string` | | Toast text when the action fails, in place of the raw error | | `refreshAfter` | `boolean` | | Refresh the surrounding data after the action succeeds | -| `locations` | `array` of `string` | | The placements the action declares (`list_toolbar`, `list_item`, `record_header`, …). A `script` or `flow` action declared record-scoped (`list_item`, `record_header`, `record_more` or `record_section`) refuses to run when no record or single selection is in scope, instead of running without one | +| `locations` | `array` of `string` | | The placements the action declares (`list`, `record_row`, `record_page`, …). A `script` or `flow` action declared record-scoped (`record_row`, `record`, `record_page` or `record_section`) refuses to run when no record or single selection is in scope, instead of running without one | | `toast` | `object` | | Toast behaviour: `{ showOnSuccess?, showOnError?, duration? }` — `false` suppresses that toast, `duration` is handed to the toast | | `resultDialog` | `object` | | One-shot result dialog for a value the response shows exactly once (a 2FA code, a fresh secret); it replaces the success toast | | `onSuccess` | `object` | | Post-success navigation `{ navigate, openIn? }`: `navigate` is a route template that can read `${result.*}`, `openIn` is `self` (the default) or `newTab` | diff --git a/content/docs/ui/components/page.mdx b/content/docs/ui/components/page.mdx index 9402eeefbaf..9d13a9c2fc7 100644 --- a/content/docs/ui/components/page.mdx +++ b/content/docs/ui/components/page.mdx @@ -51,11 +51,11 @@ Namespace `page`. | :--- | :--- | :--- | :--- | | `title` | `string` \| `object` | | Supports \{field\} interpolation and inline translation maps; falls back to the record title | | `subtitle` | `string` \| `object` | | Same interpolation as Title | -| `actions` | `array` of `string` | | Action IDS — the names of actions declared on the object's own metadata — rendered in the header before any host-injected system actions. An id whose action declares neither record_header nor record_more in its locations renders nowhere. | -| `placedActions` | `boolean` | | Set true to draw every action of the object placed at record_header or record_more, read live from the object's metadata, in place of an Actions list: an action another package adds to the object is drawn without editing the page. Refused beside an authored Actions list: keep one. | +| `actions` | `array` of `string` | | Action IDS — the names of actions declared on the object's own metadata — rendered in the header before any host-injected system actions. An id whose action declares neither record_page nor record_more in its locations renders nowhere. | +| `placedActions` | `boolean` | | Set true to draw every action of the object placed at record or record_page, read live from the object's metadata, in place of an Actions list: an action another package adds to the object is drawn without editing the page. Refused beside an authored Actions list: keep one. | | `recordChrome` | `boolean` | | Set false for the bare h1 header on non-record pages | | `showCopyId` | `boolean` | | — | -| `maxVisible` | `number` | | How many header actions render as inline buttons on desktop before the rest fold into the overflow menu. A positive integer, defaulting to 3 — the contract rejects 0 and fractional values. In a record page's header bar, actions that do not fit its width fold too, so a narrow drawer shows fewer. Two kinds of action are routed to the overflow menu regardless of this budget and never occupy an inline slot: an action whose locations declare record_more without record_header, and any action with component action:menu. The host's own buttons (the record page's Edit) take no slot and never fold. The first inline action, or the one declaring variant primary, is the one filled primary button; the others are outline buttons. The host's Edit is always an outline button: on a record with no header action of its own the row has no filled button. An action declaring variant danger is never the primary: inline it is a destructive button, and in the overflow menu it is a red row below a separator. | +| `maxVisible` | `number` | | How many header actions render as inline buttons on desktop before the rest fold into the overflow menu. A positive integer, defaulting to 3 — the contract rejects 0 and fractional values. In a record page's header bar, actions that do not fit its width fold too, so a narrow drawer shows fewer. Two kinds of action are routed to the overflow menu regardless of this budget and never occupy an inline slot: an action whose locations declare record_more without record_page, and any action with component action:menu. The host's own buttons (the record page's Edit) take no slot and never fold. The first inline action, or the one declaring variant primary, is the one filled primary button; the others are outline buttons. The host's Edit is always an outline button: on a record with no header action of its own the row has no filled button. An action declaring variant danger is never the primary: inline it is a destructive button, and in the overflow menu it is a red row below a separator. | | `mobileMaxVisible` | `number` | | The same inline-button budget on mobile viewports, where horizontal room is scarce. A positive integer, defaulting to 1, or 2 in a record page's bottom action bar on a phone, which holds the page's actions (the record's Edit is in the top bar's overflow menu there); the desktop half is Max Inline Actions, and the overflow routing rules stated there apply unchanged. | ## `page:section` [#page-section] diff --git a/content/docs/ui/components/record.mdx b/content/docs/ui/components/record.mdx index 67203f82fdd..821456fa1f7 100644 --- a/content/docs/ui/components/record.mdx +++ b/content/docs/ui/components/record.mdx @@ -142,7 +142,7 @@ Namespace `record`. | :--- | :--- | :--- | :--- | | `actionNames` | `array` of `string` | | Action names to expose, in order — resolved from the actions declared on the object. With no names (and no host-supplied actions) nothing is looked up: the bar renders its empty placeholder on a design / preview surface and nothing at runtime | | `requiredPermissions` | `array` of `string` | | [ADR-0066] Capabilities the user must ALL hold — names that permission sets grant through `systemPermissions`, not object actions: `read` or `update` here is an ordinary capability name, not the object's read or edit permission. When the client has resolved the user's capabilities and any of these is missing, this block does not render its content; wherever it would otherwise render, an insufficient-permissions notice takes its place. Presentation only: it authorises nothing, and the data API still serves the same data to the same user. A client that cannot resolve the user's capabilities (no permission provider, or one that does not report `systemPermissions`) renders this block as if they were held — it fails open. | -| `location` | `enum`: `list_toolbar`, `list_item`, `record_header`, `record_more`, `record_related`, `record_section` | | Which declared action location this bar renders | +| `location` | `enum`: `list`, `record_row`, `record`, `record_page`, `record_related`, `record_section` | | Which declared action location this bar renders | | `align` | `enum`: `start`, `center`, `end` | | — | | `inline` | `boolean` | | Render in the flow instead of folding into the record header | | `variant` | `string` | | Passed to the Button primitive; a per-action variant overrides it | diff --git a/content/docs/ui/pages.mdx b/content/docs/ui/pages.mdx index c20b4f45264..39a5436e4d4 100644 --- a/content/docs/ui/pages.mdx +++ b/content/docs/ui/pages.mdx @@ -358,11 +358,12 @@ drawer lands on the authored one. There is no setting that keeps an authored pag or in the drawer. What carries over is what the object declares: its field groups and their order, field -permissions and visibility, the actions placed at `record_header` and `record_more`, one tab per +permissions and visibility, the actions placed at `record` and `record_page`, one tab per child table, the stage and the approval state. What does not is the page's own layout and anything that lives only on it: its tabs and sections, a related list or block placed only on the page, a banner, and `record_section` actions, which the standard page does not draw. To keep -such an action reachable off the full page, add `record_more` to its `locations`, and leave it +such an action reachable off the full page, add `record_page` to its `locations` with +`component: 'action:menu'` (so it sits in the header's `⋯` menu), and leave it out of the page header's `actions` list so the full page still draws it once. So the record's title and its main button should come from the object, which both pages read. @@ -401,7 +402,7 @@ such an object (`403 FEEDS_DISABLED`). a user's column sort is sent to the server. A list that declares `columns` fetches only the declared columns the user can read. - **Actions are ids.** By default a related list draws the child object's own actions: those - placed at `list_toolbar` as header buttons, and those at `list_item` or `record_related` in + placed at `list` as header buttons, and those at `record_row` or `record_related` in each row's menu (`record_related` shows only inside a parent record). Declaring `actions: ['export_contacts', 'send_welcome']` in the block's `properties` replaces that set, in that order; each action is still placed by its own `locations`, and `[]` shows @@ -418,15 +419,15 @@ unknown or retired key (`description`, `icon`, `breadcrumb`, `showStar`) is refu | :--- | :--- | :--- | | `title` | Derived from the record on a record page | Heading; `{field}` tokens interpolate against the record, and a token that resolves to nothing renders empty. Set it on a non-record page | | `subtitle` | — | The line under the title, interpolated the same way | -| `actions` | — | Ids of actions declared on the page's object. An authored list is the whole set: an action that declares `record_header` but is not named is not drawn, and omitting the key draws none of the object's actions. `placedActions` is the other way to say which actions | -| `placedActions` | — | `true` asks for every action of the object placed at `record_header` / `record_more`, read live, in place of an `actions` list, so an action another package adds is drawn without editing the page. Refused beside an authored `actions` list: keep one. The platform's user, organization and approval request pages set it | +| `actions` | — | Ids of actions declared on the page's object. An authored list is the whole set: an action that declares `record_page` but is not named is not drawn, and omitting the key draws none of the object's actions. `placedActions` is the other way to say which actions | +| `placedActions` | — | `true` asks for every action of the object placed at `record` / `record_page`, read live, in place of an `actions` list, so an action another package adds is drawn without editing the page. Refused beside an authored `actions` list: keep one. The platform's user, organization and approval request pages set it | | `recordChrome` | `true` | Draw the title as the record chip (object label, copy-id button, the record's picture when the object names an `imageField`); `false` keeps a bare heading | | `showCopyId` | `true` | The copy-record-id button in the chip | | `maxVisible` / `mobileMaxVisible` | 3 on every header (in a record page's header bar the number, authored or not, is an upper bound: actions that do not fit the bar's width fold as well) / 2 in a phone record page's bottom bar (the page's own actions; Edit is in the top bar's `⋯` there), 1 elsewhere | How many actions render inline before the rest fold into the `⋯` menu | | `aria` | — | ARIA attributes (`ariaLabel`, `ariaDescribedBy`, …) for the `
` element | -A named action renders only if its `locations` include `record_header` (inline) or -`record_more` (straight into `⋯`); an id that names no action renders nothing and is reported +A named action renders only if its `locations` include `record` or `record_page` (inline, +or straight into `⋯` when it sets `component: 'action:menu'`); an id that names no action renders nothing and is reported once in the browser console. Which actions take the inline slots is metadata too: actions are sorted by `order` (lower first; the host's Edit / Share / Delete use 100 and above, so authored actions outrank them), `variant: 'primary'` breaks ties, `variant: 'danger'` draws a diff --git a/examples/app-crm/src/actions/convert-lead.action.ts b/examples/app-crm/src/actions/convert-lead.action.ts index 3aa0953dba2..f2cd9e46847 100644 --- a/examples/app-crm/src/actions/convert-lead.action.ts +++ b/examples/app-crm/src/actions/convert-lead.action.ts @@ -21,7 +21,7 @@ export const ConvertLeadAction = defineAction({ // guard as a server-side backstop. // // The `has()` half guards the SPARSE action face (#8990): this action reaches - // `list_item`, where the bound record is the row the view's `$select` + // `record_row`, where the bound record is the row the view's `$select` // projected. Without it, a lead list that does not project `status` aborts // the predicate at key resolution (`No such key: status`) and the button // silently vanishes for every row. `has()` alone is the guard because the diff --git a/examples/app-crm/test/action-predicate-sparse-face.test.ts b/examples/app-crm/test/action-predicate-sparse-face.test.ts index 361b530b946..5c494dfd5dd 100644 --- a/examples/app-crm/test/action-predicate-sparse-face.test.ts +++ b/examples/app-crm/test/action-predicate-sparse-face.test.ts @@ -3,7 +3,7 @@ /** * #8990 — the CRM example's row action survives the SPARSE action face. * - * `crm_convert_lead` reaches `list_item`, so its `visible` predicate binds a + * `crm_convert_lead` reaches `record_row`, so its `visible` predicate binds a * LIST ROW carrying only the view's `$select` projection — not a total record. * Unguarded, `record.status != "converted"` aborts at key resolution on any * lead list that does not project `status`, and CEL's fault is fail-closed: the @@ -39,8 +39,8 @@ const source = describe('#8990 — crm_convert_lead visible on a sparse list row', () => { - it('reaches list_item, so the sparse binding is the real one', () => { - expect(ConvertLeadAction.locations).toContain('list_item'); + it('reaches record_row, so the sparse binding is the real one', () => { + expect(ConvertLeadAction.locations).toContain('record_row'); }); it('is has()-guarded on the column it reads', () => { diff --git a/examples/app-showcase/src/ui/actions/index.ts b/examples/app-showcase/src/ui/actions/index.ts index 0af99e7532b..e30d89a8557 100644 --- a/examples/app-showcase/src/ui/actions/index.ts +++ b/examples/app-showcase/src/ui/actions/index.ts @@ -81,7 +81,7 @@ export const MarkDoneAction = defineAction({ // the action. // // #8990 — `has()` guards the SPARSE action face: this action reaches - // `list_item`, so its predicate binds a list row carrying only the view's + // `record_row`, so its predicate binds a list row carrying only the view's // `$select` projection, and CEL aborts with `No such key: done` on any task // list that does not project the column (fail-closed, the button silently // is not offered). The comparison is `!= true` rather than the older @@ -118,12 +118,12 @@ export const ReopenTaskAction = defineAction({ operation: 'update', patch: { done: false }, execution: 'perRecord', - // #8990 — `has()` guards the sparse `list_item` face, as on Mark Done. + // #8990 — `has()` guards the sparse `record_row` face, as on Mark Done. visible: 'has(record.done) && record.done == true', // The task list's row menu only. The Task Detail page's header lists its // action ids explicitly (`showcase_task_detail`, `kind: 'full'`), and // `test/record-action-location-hosts.test.ts` holds that list equal to the - // task's `record_header` / `record_more` set, so adding `record_header` here + // task's `record` / `record_page` set, so adding `record_page` here // means adding the id to that header too. locations: ['record_row'], refreshAfter: true, @@ -142,7 +142,7 @@ export const OpenDocsAction = defineAction({ }); /** - * flow — launch the Reassign screen-flow wizard. Row-level (`list_item`) so the + * flow — launch the Reassign screen-flow wizard. Row-level (`record_row`) so the * row's `recordId` flows into the flow, which collects `new_assignee` via a * `screen` node and writes it back with `update_record`. The objectui * FlowRunner renders the screen and resumes the run. @@ -191,7 +191,8 @@ export const RecalcEstimateAction = defineAction({ successMessage: "Estimate recalculated for {{ record.title | default:'the task' }}.", // `record_section`: the Task Detail page's `record:quick_actions` bar names // it, and the engine location-filters even explicitly-named actions. And - // `record_more` (objectstack#36150): the authored page is drawn on the + // `record_page` folded into the header's ⋯ (`component: 'action:menu'`, + // formerly `record_more`; objectstack#36150): the authored page is drawn on the // desktop full page only, and on a phone or in the side drawer the task // takes the standard page, which draws no `record_section` action — the // ⋯ overflow is where the action is found there. The authored header lists @@ -230,7 +231,7 @@ export const RecalcEstimateAction = defineAction({ * warns about (`packages/lint/src/validate-action-locations.ts`), and `[]` is * that same nowhere said deliberately (see NewTaskAction). * - * So `record_more` here is an explicit SINGLE-RECORD placement, not a way of + * So `record_page` folded into the ⋯ here is an explicit SINGLE-RECORD placement, not a way of * dodging an everywhere-default: it puts the action in the record overflow * menu, where the dispatch carries exactly one id and the recalc endpoint's * flow reads it as a list of one (via `recordIdParam`). Placement being @@ -365,7 +366,7 @@ export const SubmitForSignoffAction = defineAction({ successMessage: "{{ record.name | default:'Invoice' }} submitted for finance + legal sign-off.", // Only on invoices not yet sent. `record.`-prefixed comparison, per the // ActionEngine's fail-closed CEL evaluation (see MarkDoneAction's note). - // #8990 — `has()` guards the sparse face this reaches via `list_item`; the + // #8990 — `has()` guards the sparse face this reaches via `record_row`; the // `!=` against a literal never faults on a projected NULL, so `has()` alone // is the whole guard. visible: "has(record.status) && record.status != 'sent'", @@ -394,8 +395,8 @@ export const SubmitForSignoffAction = defineAction({ * `OS_PRINT_BROWSER_ENDPOINT`, and `OS_PRINT_CONSOLE_URL`), a record they may * not edit (attaching needs it), an impersonation session. * - * `list_item` puts it in the invoice list's row menu, where the console draws - * it. `record_header` is its record-page placement, beside Submit for Sign-off. + * `record_row` puts it in the invoice list's row menu, where the console draws + * it. `record_page` is its record-page placement, beside Submit for Sign-off. * ⚠️ The console draws record-header actions in a page's `page:header`, and a * print page may not hold one, so on the invoice's record page (a print page) * neither action is drawn until the console gives a print page a header host. diff --git a/examples/app-showcase/src/ui/actions/predicate-matrix.action.ts b/examples/app-showcase/src/ui/actions/predicate-matrix.action.ts index 9ccb4af0112..746a4debd12 100644 --- a/examples/app-showcase/src/ui/actions/predicate-matrix.action.ts +++ b/examples/app-showcase/src/ui/actions/predicate-matrix.action.ts @@ -21,8 +21,8 @@ * | surface | where it renders | * |---|---| * | list toolbar | above the list — no record in scope | - * | row kebab (`list_item`) | the `⋮` menu on each row | - * | record header (`record_header` / `record_more`) | the detail page | + * | row kebab (`record_row`) | the `⋮` menu on each row | + * | record header (`record` / `record_page`) | the detail page | * | selection bar | after ticking rows, from the view's `bulkActions` | * * They have drifted before, in both directions: the selection bar ignored @@ -96,7 +96,7 @@ * all evaluate on the record header and in its `⋯` overflow. Where the same * action is also declared elsewhere it agrees: the row `⋮` menu matches the * header on both specimens, and so does the selection bar for the six - * specimens the view names in `bulkActions`. `record_header` / `record_more` + * specimens the view names in `bulkActions`. `record` / `record_page` * hand the predicate to `evalRowPredicate` WHOLE, so the * `{ dialect: 'cel' }` envelope `defineAction` normalizes to is routed to * the canonical engine rather than flattened onto a dialect guess. @@ -146,8 +146,12 @@ const echo = { capabilities: [], }; -/** The four record-scoped surfaces, so one action can be compared across them. */ -const RECORD_SURFACES = ['list_item', 'record_header', 'record_more'] as const; +/** + * The record-scoped surfaces, so one action can be compared across them: + * `record` is the record page's header and each list row's menu + * (objectstack#36495 — formerly `record_row` + `record_page` + `record_more`). + */ +const RECORD_SURFACES = ['record'] as const; // ─────────────────────────────────────────────────────────────────────────── // 1 — Surface parity: ONE predicate over a relation field, on every surface @@ -251,8 +255,8 @@ export const ZooUserIdentityGateAction = defineAction({ * * | surface | Specimen — Full | Specimen — Minimal | * |---|---|---| - * | record header `⋯` (`record_more`) | OFFERED | absent | - * | row `⋮` menu (`list_item`) | OFFERED | absent | + * | record header `⋯` (`record`) | OFFERED | absent | + * | row `⋮` menu (`record`) | OFFERED | absent | * * ⚠️ The selection bar is deliberately NOT a row of that table: this action is * not named in either view's `bulkActions` (`field-zoo.view.ts`), so it never @@ -298,7 +302,7 @@ export const ZooDialectSplitAction = defineAction({ }); /** - * The toolbar twin. A `list_toolbar` action is evaluated with NO record in + * The toolbar twin. A `list` action is evaluated with NO record in * scope — there is no row it belongs to — so a record-scoped predicate here * would be an authoring error, not a demo. This one gates on identity alone, * which is the only kind of predicate the toolbar can honestly answer. diff --git a/examples/app-showcase/src/ui/pages/project-detail.page.ts b/examples/app-showcase/src/ui/pages/project-detail.page.ts index 50088df66f4..7fd5ba3cb76 100644 --- a/examples/app-showcase/src/ui/pages/project-detail.page.ts +++ b/examples/app-showcase/src/ui/pages/project-detail.page.ts @@ -34,7 +34,7 @@ export const ProjectDetailPage = definePage({ width: 'full', components: [ // The title bar. A full page renders exactly the nodes it declares; - // `showcase_project` declares no `record_header` / `record_more` + // `showcase_project` declares no `record` / `record_page` // action, so the header carries none, as the synthesized one did. { type: 'page:header' }, // Explicit highlights strip — exercises the page editor's field-list picker @@ -130,7 +130,7 @@ export const ProjectDetailPage = definePage({ // // It is the same `record:related_list` node the synthesizer emits, // under the same record page, so its rows carry what a synthesized - // list's rows carry: the task's `list_item` actions, plus its + // list's rows carry: the task's `record_row` actions, plus its // `record_related` ones, which only render on a related list // inside a parent record. No `actions` key on purpose — authoring // one would replace those host-supplied actions with the list diff --git a/examples/app-showcase/src/ui/pages/review-queue.page.ts b/examples/app-showcase/src/ui/pages/review-queue.page.ts index 707960b3285..d82aef8fa14 100644 --- a/examples/app-showcase/src/ui/pages/review-queue.page.ts +++ b/examples/app-showcase/src/ui/pages/review-queue.page.ts @@ -14,7 +14,7 @@ import { definePage } from '@objectstack/spec/ui'; * (`has(record.done) && record.done != true`, #8990) has nothing to evaluate * against and the button would render * regardless of state. `MarkDoneAction.locations` already includes - * `list_item`, so it correctly appears per-row (with that row's record bound) + * `record_row`, so it correctly appears per-row (with that row's record bound) * instead. Tabs let the reviewer pivot to urgent or blocked work. */ export const ReviewQueuePage = definePage({ @@ -35,7 +35,7 @@ export const ReviewQueuePage = definePage({ appearance: { showDescription: true, allowedVisualizations: ['grid'] }, userActions: { sort: true, search: true, filter: false, rowHeight: false, addRecordForm: false }, // No `buttons:` entry here — see file header comment: "Mark Done" is a - // record-scoped action and belongs per-row (`list_item`), not as an + // record-scoped action and belongs per-row (`record_row`), not as an // unbound page-toolbar button. // Click a row → drawer with the full record to review before deciding. recordAction: 'drawer', diff --git a/examples/app-showcase/src/ui/pages/task-detail.page.ts b/examples/app-showcase/src/ui/pages/task-detail.page.ts index ea25cbcc485..537bb2e4e78 100644 --- a/examples/app-showcase/src/ui/pages/task-detail.page.ts +++ b/examples/app-showcase/src/ui/pages/task-detail.page.ts @@ -5,9 +5,9 @@ import { definePage } from '@objectstack/spec/ui'; /** * Task Detail — a record page that exercises the record-layout component set * beyond the basics: - * • `page:header` — the record title bar: the task's `record_header` - * actions inline and its `record_more` actions - * under the ⋯ overflow (see the node below). + * • `page:header` — the record title bar: the task's `record_page` + * actions inline and its folded ones + * (`component: 'action:menu'`) under the ⋯ overflow (see the node below). * • `record:path` — Salesforce-style status stepper across the task * lifecycle (Backlog → … → Done). * • `record:alert` — a conditional banner shown only while the task is @@ -38,20 +38,20 @@ export const TaskDetailPage = definePage({ components: [ // The title bar, composed explicitly. A `kind: 'full'` page renders // exactly the nodes it declares, and the header is one of them: with - // no `page:header` node the page has no title bar, so neither the - // `record_header` nor the `record_more` location has a surface here. + // no `page:header` node the page has no title bar, so the + // `record_page` location, inline or folded, has no surface here. // The synthesized default page (and a `kind: 'slotted'` page that // leaves the `header` slot alone) gets one automatically; this page // does not. // // `actions` are action IDS, resolved against `showcase_task`'s own // metadata, and the header still places each by its `locations`: - // `record_header` actions render as inline buttons, and an action - // declaring `record_more` without `record_header` always goes under - // the ⋯ overflow. The list is the object's whole `record_header` / - // `record_more` set, which is what the synthesized header would carry, - // less the actions the section bar below draws (they declare - // `record_more` only for the standard page a phone or the side drawer + // `record_page` actions render as inline buttons, and one folded with + // `component: 'action:menu'` (formerly `record_more`) always goes + // under the ⋯ overflow. The list is the object's whole `record_page` + // set, which is what the synthesized header would carry, less the + // actions the section bar below draws (they declare a folded + // `record_page` only for the standard page a phone or the side drawer // shows, objectstack#36150); `test/record-action-location-hosts.test.ts` // holds the two equal. // The host still appends its own Edit / Share / Delete after these. @@ -60,13 +60,13 @@ export const TaskDetailPage = definePage({ type: 'page:header', properties: { actions: [ - // record_header — inline buttons. + // record_page — inline buttons. 'showcase_mark_done', 'showcase_log_time', // ask_ai — opens the in-app assistant on this task (ADR-0160 D7). 'showcase_ask_about_task', 'showcase_archive_task', - // record_more only — the ⋯ overflow (url, api). + // record_page folded (action:menu) — the ⋯ overflow (url, api). 'showcase_open_docs', 'showcase_recalc_selection', ], diff --git a/examples/app-showcase/src/ui/views/task.view.ts b/examples/app-showcase/src/ui/views/task.view.ts index 6c7bb76e758..9690d9bad2f 100644 --- a/examples/app-showcase/src/ui/views/task.view.ts +++ b/examples/app-showcase/src/ui/views/task.view.ts @@ -131,12 +131,12 @@ export const TaskViews = defineView({ // action NAMES rather than defs. Both cases the client has to handle are // present here on purpose: // - // `showcase_recalc_estimate` — declared on the object at `record_more` / - // `record_section`, i.e. NOT a `list_item` action, so nothing derives a + // `showcase_recalc_estimate` — declared on the object at `record_page` (folded) / + // `record_section`, i.e. NOT a `record_row` action, so nothing derives a // def for it. The client must resolve the name against the object's // actions or the entry is a dead menu item. // - // `showcase_quick_view` — already a `list_item` action, so the client + // `showcase_quick_view` — already a `record_row` action, so the client // derives a def for it independently. Naming it here too must NOT // produce a second, dead copy alongside the working one. // @@ -179,7 +179,7 @@ export const TaskViews = defineView({ // (its flow runs the per-task recalculation for each). This is the "one zip for N devices" // dispatch shape; results are all-or-nothing, no per-row retry. // - // None declares `list_toolbar`: a bulk action is not a toolbar action, + // None declares `list`: a bulk action is not a toolbar action, // it needs a selection. Naming it here is the whole declaration. bulk_actions: { label: 'Bulk Actions', diff --git a/examples/app-showcase/test/action-predicate-sparse-face.test.ts b/examples/app-showcase/test/action-predicate-sparse-face.test.ts index 5ce35419851..8d5332639fe 100644 --- a/examples/app-showcase/test/action-predicate-sparse-face.test.ts +++ b/examples/app-showcase/test/action-predicate-sparse-face.test.ts @@ -4,7 +4,7 @@ * #8990 — the showcase's authored predicates survive the SPARSE action face. * * `predicate-matrix.action.ts` is a LIVE browser specimen: every gate in it is - * declared on `list_item` / `record_more`, so its `visible` binds a LIST ROW + * declared on `record` (the row and the record page), so its `visible` binds a LIST ROW * carrying only the view's `$select` projection — not a total record. Unguarded, * a predicate reading a column the list does not show aborts at key resolution, * and CEL's fault is fail-closed: the button silently is not offered, which diff --git a/examples/app-showcase/test/record-action-location-hosts.test.ts b/examples/app-showcase/test/record-action-location-hosts.test.ts index 3c27e000983..9d6bb130bf4 100644 --- a/examples/app-showcase/test/record-action-location-hosts.test.ts +++ b/examples/app-showcase/test/record-action-location-hosts.test.ts @@ -10,13 +10,14 @@ import { Task } from '../src/data/objects/task.object.js'; * Fixture gate: the showcase hosts the three record action locations for * `showcase_task` (objectstack#22030). * - * `records-forms.action-location-matrix` reads actions at `record_header`, - * `record_more` and `record_related` on `showcase_task`. A location needs a + * `records-forms.action-location-matrix` reads actions at `record_page` + * (inline and folded into the ⋯, `component: 'action:menu'`) and + * `record_related` on `showcase_task`. A location needs a * surface on a page the console actually renders, and the showcase had none: * * - Task Detail is `kind: 'full'`. Such a page renders exactly the nodes it * declares, and it declared no `page:header`, so there was no title bar for - * `record_header` actions and no ⋯ overflow for `record_more` ones. + * `record_page` actions and no ⋯ overflow for folded ones. * - Project Detail authors its own tab strip with a `record:line_items` grid * (a `kind: 'full'` page; until #27053 a slotted page's `tabs` slot). An * authored strip replaces the synthesized one, so the synthesized Tasks @@ -34,7 +35,7 @@ type AnyComponent = { [k: string]: unknown; }; type AnyPage = Record & { name?: unknown; type?: unknown; object?: unknown }; -type AnyAction = { name?: unknown; type?: unknown; objectName?: unknown; locations?: unknown }; +type AnyAction = { name?: unknown; type?: unknown; objectName?: unknown; locations?: unknown; component?: unknown }; /** Every component on a page — regions and slots alike, tab panels and children included. */ function allComponents(page: AnyPage): AnyComponent[] { @@ -75,6 +76,11 @@ const taskActions = ((stack.actions ?? []) as AnyAction[]).filter((a) => a.objec const locationsOf = (a: AnyAction): string[] => Array.isArray(a.locations) ? (a.locations as string[]) : []; const declares = (location: string) => (a: AnyAction): boolean => locationsOf(a).includes(location); +/** `declares`, plus `record` covering `record_page` and `record_row` (objectstack#36495, `actionRendersAt`). */ +const places = (location: string) => (a: AnyAction): boolean => + declares(location)(a) || ((location === 'record_page' || location === 'record_row') && declares('record')(a)); +/** Folded into the record header's ⋯ (`component: 'action:menu'`, formerly `record_more`). */ +const folded = (a: AnyAction): boolean => a.component === 'action:menu'; const actionNamed = (name: string): AnyAction | undefined => taskActions.find((a) => a.name === name); describe('showcase_task record action locations have a stock host (#22030)', () => { @@ -86,7 +92,7 @@ describe('showcase_task record action locations have a stock host (#22030)', () expect(projectPage?.name).toBe('showcase_project_detail'); }); - describe('record_header / record_more — the Task Detail title bar', () => { + describe('record / record_page — the Task Detail title bar', () => { const headers = taskPage ? allComponents(taskPage).filter((c) => c.type === 'page:header') : []; const ids = (headers[0]?.properties?.actions ?? []) as unknown[]; @@ -102,15 +108,16 @@ describe('showcase_task record action locations have a stock host (#22030)', () expect(result.data?.actions).toEqual(ids); }); - it('lists the task\'s whole record_header / record_more set — what the synthesized header carries — less the actions its section bar draws', () => { + it('lists the task\'s whole record / record_page set — what the synthesized header carries — less the actions its section bar draws', () => { expect(ids.every((id) => typeof id === 'string')).toBe(true); expect(new Set(ids).size, 'no id is listed twice').toBe(ids.length); - // An action placed at record_section AND record_more is drawn on this - // page by the quick-actions bar; `record_more` is its place on the - // standard page a phone or the drawer draws (objectstack#36150), so the - // authored header leaves it out (see the record_section block below). + // An action placed at record_section AND a folded record_page is drawn + // on this page by the quick-actions bar; the folded `record_page` is its + // place on the standard page a phone or the drawer draws + // (objectstack#36150), so the authored header leaves it out (see the + // record_section block below). const headerSet = taskActions - .filter((a) => declares('record_header')(a) || declares('record_more')(a)) + .filter(places('record_page')) .filter((a) => !declares('record_section')(a)) .map((a) => a.name as string); expect([...ids].sort()).toEqual([...headerSet].sort()); @@ -119,10 +126,10 @@ describe('showcase_task record action locations have a stock host (#22030)', () it('hosts at least one action at each location, and a url and an api action under the ⋯ overflow', () => { const listed = ids.map((id) => actionNamed(id as string)).filter((a): a is AnyAction => !!a); expect(listed).toHaveLength(ids.length); - expect(listed.filter(declares('record_header')).length).toBeGreaterThan(0); - // The overflow takes every action declaring record_more WITHOUT - // record_header, whatever the inline budget. - const overflowOnly = listed.filter((a) => declares('record_more')(a) && !declares('record_header')(a)); + expect(listed.filter((a) => places('record_page')(a) && !folded(a)).length).toBeGreaterThan(0); + // The overflow takes every record_page action folded with + // `component: 'action:menu'`, whatever the inline budget. + const overflowOnly = listed.filter((a) => places('record_page')(a) && folded(a)); expect(overflowOnly.map((a) => a.type)).toEqual(expect.arrayContaining(['url', 'api'])); }); }); @@ -143,7 +150,7 @@ describe('showcase_task record action locations have a stock host (#22030)', () expect(fk?.reference).toBe('showcase_project'); }); - it('authors no `actions`, so its rows carry the host\'s list_item + record_related actions', () => { + it('authors no `actions`, so its rows carry the host\'s record_row + record_related actions', () => { expect(relatedLists).toHaveLength(1); expect(props).not.toHaveProperty('actions'); expect(taskActions.filter(declares('record_related')).length).toBeGreaterThan(0); @@ -192,7 +199,7 @@ describe('showcase_task record action locations have a stock host (#22030)', () // INLINE in a header, so neither page draws one twice in view. const inlineToo = taskActions .filter(declares('record_section')) - .filter(declares('record_header')) + .filter((a) => places('record_page')(a) && !folded(a)) .map((a) => a.name); expect(inlineToo).toEqual([]); }); @@ -200,16 +207,17 @@ describe('showcase_task record action locations have a stock host (#22030)', () it('reaches every record_section action on the standard page too, under the ⋯ overflow (objectstack#36150)', () => { // A phone and the side drawer draw the standard page, which has no // section bar: an action the bar hosts is found there through its - // `record_more` location, which the synthesized header reads. + // folded `record_page` location, which the synthesized header reads. const sectionSet = taskActions.filter(declares('record_section')); expect(sectionSet.length).toBeGreaterThan(0); - expect(sectionSet.filter((a) => !declares('record_more')(a)).map((a) => a.name)).toEqual([]); + expect(sectionSet.filter((a) => !(places('record_page')(a) && folded(a))).map((a) => a.name)).toEqual([]); }); }); it('every record location keeps a stock host for a task action', () => { - for (const location of ['record_header', 'record_more', 'record_related', 'record_section']) { - expect(taskActions.filter(declares(location)).length, location).toBeGreaterThan(0); + for (const location of ['record_page', 'record_related', 'record_section']) { + expect(taskActions.filter(places(location)).length, location).toBeGreaterThan(0); } + expect(taskActions.filter((a) => places('record_page')(a) && folded(a)).length, 'record_page folded').toBeGreaterThan(0); }); }); diff --git a/packages/cli/src/commands/generate.ts b/packages/cli/src/commands/generate.ts index 2e9dd199f65..4fa61374e37 100644 --- a/packages/cli/src/commands/generate.ts +++ b/packages/cli/src/commands/generate.ts @@ -503,7 +503,7 @@ export default ${toCamelCase(name)}Views; * * `locations` places it (#21325): an action with none, that no view * places by name, renders on no surface, and `os validate` says so - * (`action-no-placement`). `record_header` is the button on the record it + * (`action-no-placement`). `record_page` is the button on the record it * acts on; the emitted comment names the rest of the vocabulary and the * explicit headless `[]`. * @@ -519,7 +519,7 @@ export default ${toCamelCase(name)}Views; * field the object declares, so the click opens a dialog for that value and * writes it to the record as the signed-in user. `type` is left at its * default (`'script'`, the route the write is posted to; any other type is - * refused beside the operation), and `locations` leaves out `list_toolbar`, + * refused beside the operation), and `locations` leaves out `list`, * which `ActionSchema` refuses for an update (no current record there). */ namesObject: true, @@ -556,8 +556,8 @@ export default ${toCamelCase(name)}Action; // runs it. operation: 'update', params: [{ field: ${tsString(field)} }], - // Where the button is drawn: the record's header. Others: 'record_more', - // 'record_section', 'list_item' (not 'list_toolbar': an update needs the + // Where the button is drawn: the record's header. Others: 'record' (the + // header and each list row), 'record_section', 'record_row' (not 'list': an update needs the // record it writes). An action meant only for REST / MCP / AI callers says // so with an empty list. locations: ['record_page'], @@ -567,8 +567,8 @@ ${footer}`; // Runs the flow named in \`target\` against the record it is invoked on. type: 'flow', target: ${tsString(bindings.flow)}, - // Where the button is drawn: the record's header. Others: 'record_more', - // 'record_section', 'list_item', 'list_toolbar'. An action meant only for + // Where the button is drawn: the record's header. Others: 'record' (the + // header and each list row), 'record_section', 'record_row', 'list'. An action meant only for // REST / MCP / AI callers says so with an empty list. locations: ['record_page'], ${footer}`; diff --git a/packages/lint/src/rule-explanations.ts b/packages/lint/src/rule-explanations.ts index ab83db8b28c..4f8ebe580ab 100644 --- a/packages/lint/src/rule-explanations.ts +++ b/packages/lint/src/rule-explanations.ts @@ -3695,7 +3695,7 @@ const RECORD_PAGE_HEADER_ACTIONS_DIFFER_EXPLANATION: RuleExplanation = { '`variant: \'primary\'`, else the first button. The incoming order is where the two pages differ: the ' + 'full page takes it from the header\'s `actions` list, the standard page (phone, drawer, preview) from ' + 'the object\'s action declaration order, and the standard page draws every action placed at ' + - '`record_header` or `record_more`, listed or not. This finding means the two give a different primary ' + + '`record` or `record_page`, listed or not. This finding means the two give a different primary ' + 'button, or the listed actions in a different order.', 'The order has one declaration point, the actions. Give each an `order` (lower first) and the main one ' + '`variant: \'primary\'`, and both pages sort alike; the header\'s list then only chooses which actions ' + @@ -5591,22 +5591,22 @@ const ACTION_NAME_UNDEFINED_EXPLANATION: RuleExplanation = { '`actions`; a `record:related_list`\'s `actions`; an `action` nav entry\'s ' + '`actionDef.actionName`; and an `object` nav entry\'s deep-link `runAction`.', 'A name resolves when any action in the stack carries it: a `stack.actions` entry or an entry ' + - 'of any object\'s `actions`. The runtime ships no built-in action names (`list_toolbar` and ' + - '`list_item` are locations, not actions), so a name that resolves nowhere is dead: most ' + + 'of any object\'s `actions`. The runtime ships no built-in action names (`list` and ' + + '`record_row` are locations, not actions), so a name that resolves nowhere is dead: most ' + 'surfaces draw a button that does nothing when clicked, the alert drops its call-to-action ' + 'without a word, and the header draws no button, with only a browser-console warning. An ' + 'error: there is no cross-package escape to soften it with, and an action another installed ' + 'package contributes is the one legitimate miss.', 'To fix a miss, define the action — a `stack.actions` entry or an entry of the object\'s `actions` — ' + 'placed where the surface looks for it, or remove the reference. A `page:header` draws only actions ' + - 'placed at `record_header` or `record_more`, so a header action needs one of the two in its ' + + 'placed at `record` or `record_page`, so a header action needs one of the two in its ' + '`locations`; the selection bar and an alert\'s call-to-action place an action by name, with no ' + '`locations` entry.', // The drawn locations are held to the rule by its test, over every location. 'A `record:related_list` is the exception, and resolves the way its renderer does: against the ' + 'RELATED object\'s own actions (written on it, or a `stack.actions` entry bound to it by ' + '`objectName`), never the page\'s object or a global action, and only an action placed at a ' + - 'location the list draws (`list_toolbar` as a header button, `list_item` and `record_related` ' + + 'location the list draws (`list` as a header button, `record`, `record_row` and `record_related` ' + 'as a row-menu item): naming it in `actions` is not a placement. An id that misses either test ' + 'draws no button, only a refusal notice above the list. So define the action on the related ' + 'object (in its `actions`, or in `stack.actions` with `objectName` naming it) with one of those ' + @@ -6222,7 +6222,7 @@ const ACTION_NO_PLACEMENT_EXPLANATION: RuleExplanation = { 'publishes and is listed in Setup, and no user can ever click it — the ADR-0078 shape of a ' + 'declaration that renders nothing.', // Held equal to `ACTION_LOCATIONS` (`@objectstack/spec/ui`) by the rule's test. - 'The locations an action can declare: `list_toolbar`, `list_item`, `record_header`, `record_more`, ' + + 'The locations an action can declare: `list`, `record`, `record_page`, `record_row`, ' + '`record_related`, `record_section`. A list view places an action by NAME instead: naming it in ' + '`bulkActions` or `bulkActionDefs` puts it on the selection bar, which the view drives, never ' + '`locations` (an action that only makes sense over a selection has no single-record location). ' + diff --git a/packages/lint/src/validate-action-locations.ts b/packages/lint/src/validate-action-locations.ts index 4d241e752a5..affb27189fd 100644 --- a/packages/lint/src/validate-action-locations.ts +++ b/packages/lint/src/validate-action-locations.ts @@ -156,7 +156,7 @@ export function validateActionLocations(stack: AnyRec): ActionLocationsFinding[] // vocabulary, name placement and the headless shape are // `os explain action-no-placement`. hint: - 'Declare where it renders, e.g. `locations: [\'record_header\']`, place it from a list view\'s ' + + 'Declare where it renders, e.g. `locations: [\'record_page\']`, place it from a list view\'s ' + '`bulkActions`, or write `locations: []` if it is headless (REST / MCP / AI only)', }); }; diff --git a/packages/lint/src/validate-action-name-refs.ts b/packages/lint/src/validate-action-name-refs.ts index b1183f51b13..c5c62ee71a2 100644 --- a/packages/lint/src/validate-action-name-refs.ts +++ b/packages/lint/src/validate-action-name-refs.ts @@ -47,7 +47,7 @@ * carries the same severity: **error**. It is a genuine dead reference, and — * unlike an object name — there is no cross-package escape hatch to soften it * with. The runtime ships NO built-in action names (there is no - * `BUILTIN_ACTIONS` registry; `list_toolbar`/`list_item` are *locations*, not + * `BUILTIN_ACTIONS` registry; `list`/`record_row` are *locations*, not * actions), so a name resolving nowhere is dead, full stop. * * Scope note: this rule asks only "is this action defined ANYWHERE in the @@ -124,8 +124,9 @@ function collectActionNames(stack: AnyRec): Set { * What a `record:related_list` draws for an authored action placed at each * location of the spec's vocabulary (`ACTION_LOCATIONS`), or `null` where it * draws nothing. Read at objectui's `relatedListActions.ts` - * (`placeAuthoredRelatedListActions`): `list_toolbar` is a header button; - * `list_item` and `record_related` are a row-menu item. The list renders only + * (`placeAuthoredRelatedListActions`): `list` is a header button; + * `record`, `record_row` and `record_related` are a row-menu item (`record` + * covers each list row). The list renders only * inside a parent record, which is the one scope `record_related` names. * * Keyed by `ActionLocation`, so the vocabulary is read from the spec and never @@ -133,10 +134,10 @@ function collectActionNames(stack: AnyRec): Set { * classified here, instead of leaving a stale pair that silently refuses it. */ const RELATED_LIST_DRAWS: Readonly> = { - list_toolbar: 'a header button', - list_item: 'a row-menu item', - record_header: null, - record_more: null, + list: 'a header button', + record: 'a row-menu item', + record_page: null, + record_row: 'a row-menu item', record_related: 'a row-menu item', record_section: null, }; @@ -146,7 +147,7 @@ const RELATED_LIST_LOCATIONS: readonly ActionLocation[] = ACTION_LOCATIONS.filte (location) => RELATED_LIST_DRAWS[location] !== null, ); -/** `` `list_toolbar` (a header button), … `` — for a hint. */ +/** `` `list` (a header button), … `` — for a hint. */ const RELATED_LIST_PLACEMENTS = RELATED_LIST_LOCATIONS.map( (location) => `\`${location}\` (${RELATED_LIST_DRAWS[location]})`, ).join(', '); @@ -491,7 +492,7 @@ export function validateActionNameRefs(stack: AnyRec): ActionNameRefFinding[] { // refused by the spec on its own, not a reference for this rule to // resolve — so only the string elements are checked, each at its // AUTHORED index. The header draws an authored action only when it is - // placed at `record_header` or `record_more`. + // placed at `record` or `record_page`. if (type === 'page:header' && Array.isArray(props.actions)) { const ids = props.actions as unknown[]; for (let hi = 0; hi < ids.length; hi++) { @@ -502,7 +503,7 @@ export function validateActionNameRefs(stack: AnyRec): ActionNameRefFinding[] { where, `${path}.properties.actions[${hi}]`, 'Page-header actions', - 'with `record_header` or `record_more` in its `locations`', + 'with `record` or `record_page` in its `locations`', 'the header draws no button for it', ); } diff --git a/packages/lint/src/validate-null-guards.ts b/packages/lint/src/validate-null-guards.ts index 2bc1ae6bf53..042269fe0ec 100644 --- a/packages/lint/src/validate-null-guards.ts +++ b/packages/lint/src/validate-null-guards.ts @@ -189,13 +189,13 @@ * or the object's field list — and the two hits in (2) prove it from one * file: identical `record. != null` guards on identical `locations`, * where `f_lookup`/`f_lookups` are NOT default-list columns (so the - * predicate faults on `list_item`) while `f_textarea` IS one (so it does + * predicate faults on `record_row`) while `f_textarea` IS one (so it does * not). Nothing in the action's own metadata distinguishes them. `&&` * short-circuiting makes it worse: `record.id == ctx.user.id && * record.two_factor_enabled != true` never reaches the absent key on a * row whose first conjunct is false, so whether a given predicate faults * depends on row DATA. A sound static rule would have to flag every - * `record.*` read on any action reaching `list_item` — 34 of 34, which + * `record.*` read on any action reaching `record_row` — 34 of 34, which * is a platform-contract finding, not a lint rule. * 4. **The prescription would be wrong.** `has()` guards absence, not * nullness: measured, `has(record.a) && record.a > 1` FAULTS on a diff --git a/packages/lint/src/validate-object-action-layout.ts b/packages/lint/src/validate-object-action-layout.ts index d9ffc7e36f6..29c3b660b04 100644 --- a/packages/lint/src/validate-object-action-layout.ts +++ b/packages/lint/src/validate-object-action-layout.ts @@ -18,8 +18,8 @@ import { recordsOf } from './object-graph.js'; * - `object-action-layout-unknown`: no action of that name is declared on the * object (its own `actions`, or a stack action whose `objectName` is it); * - `object-action-layout-not-placed`: the action is declared but not placed - * in that scope: `list_toolbar` for the `list` arm, `record_header` or - * `record_more` for the `record` arm (the record header draws both). A + * in that scope: `list` for the `list` arm, `record` or `record_page` + * for the `record` arm (the record header draws both). A * record action named in the `list` arm, or the reverse, is this. * * Both object positions are judged: an object's own `actionLayout`, and an @@ -59,8 +59,8 @@ type AnyRec = Record; /** The locations an arm's actions are placed at: the page's header draws an action placed at one of them. */ const ARM_LOCATIONS: Readonly> = { - list: ['list_toolbar'], - record: ['record_header', 'record_more'], + list: ['list'], + record: ['record', 'record_page'], }; function strName(v: unknown): string | undefined { diff --git a/packages/lint/src/validate-record-page-header.ts b/packages/lint/src/validate-record-page-header.ts index e8397d437c2..7803ba5fd7d 100644 --- a/packages/lint/src/validate-record-page-header.ts +++ b/packages/lint/src/validate-record-page-header.ts @@ -29,7 +29,7 @@ import { walkPageComponents } from './page-walk.js'; * buttons. The incoming order is where the two differ: the full page's is * the header's `actions` list, the standard page's is the object's own * action declaration order, and the standard page draws every action the - * object places at `record_header` / `record_more`, listed or not. When that + * object places at `record` / `record_page`, listed or not. When that * gives a different primary button, or the listed actions in a different * order within the row of buttons or within the `⋯` (the two are drawn * apart), the header lists them in an order the actions do not declare: @@ -126,8 +126,11 @@ function objectActions(stack: AnyRec, object: AnyRec, objectName: string): AnyRe return out; } +/** objectui's `actionRendersAt`: `record` is drawn at `record_page` and at `record_row` (protocol 19). */ function placedIn(action: AnyRec, location: string): boolean { - return Array.isArray(action.locations) && action.locations.includes(location); + if (!Array.isArray(action.locations)) return false; + return action.locations.includes(location) + || ((location === 'record_page' || location === 'record_row') && action.locations.includes('record')); } /** The header renderer's sort: `order` ascending, `variant: 'primary'` first among equals, then incoming order. */ @@ -142,11 +145,11 @@ function headerSort(actions: readonly AnyRec[]): AnyRec[] { /** * An action the header draws as a button in its row: placed at - * `record_header`, and not pinned into the `⋯` by `component: 'action:menu'`. - * The rest (`record_more`-only, menu-pinned) are drawn in the `⋯` only. + * `record` or `record_page`, and not folded into the `⋯` by `component: + * 'action:menu'`. The rest (folded) are drawn in the `⋯` only. */ function isButton(action: AnyRec): boolean { - return placedIn(action, 'record_header') && action.component !== 'action:menu'; + return placedIn(action, 'record_page') && action.component !== 'action:menu'; } /** @@ -231,7 +234,7 @@ export function validateRecordPageHeader(stack: AnyRec): RecordPageHeaderFinding const universe = objectActions(stack, object, objectName); const byName = new Map(universe.map((a) => [a.name as string, a])); if (!listed.every((n) => byName.has(n))) continue; - const isPlaced = (a: AnyRec): boolean => placedIn(a, 'record_header') || placedIn(a, 'record_more'); + const isPlaced = (a: AnyRec): boolean => placedIn(a, 'record_page'); const fullPage = headerSort([...new Set(listed)].map((n) => byName.get(n)!).filter(isPlaced)); if (fullPage.length === 0) continue; diff --git a/packages/metadata-protocol/src/protocol.stored-action-gate-lowering.test.ts b/packages/metadata-protocol/src/protocol.stored-action-gate-lowering.test.ts index 7ad738fb125..7081ac27085 100644 --- a/packages/metadata-protocol/src/protocol.stored-action-gate-lowering.test.ts +++ b/packages/metadata-protocol/src/protocol.stored-action-gate-lowering.test.ts @@ -56,16 +56,16 @@ function storedBody(rows: Record[], type: string, name: string) const SSO_ONLY = { name: 'sso_only', label: 'SSO only', type: 'url' as const, target: 'https://example.com/sso', - locations: ['record_header' as const], requiresFeature: 'ssoEnforced' as const, + locations: ['record_page' as const], requiresFeature: 'ssoEnforced' as const, }; const OWNER_ONLY = { name: 'owner_only', label: 'Owner only', type: 'url' as const, target: 'https://example.com/owner', - locations: ['record_header' as const], visible: "record.name != ''", + locations: ['record_page' as const], visible: "record.name != ''", requiresMembershipReach: 'delete_organization' as const, }; const PLAIN = { name: 'plain', label: 'Plain', type: 'url' as const, target: 'https://example.com/plain', - locations: ['record_header' as const], + locations: ['record_page' as const], }; const order = (actions: unknown[]) => ({ diff --git a/packages/objectql/src/bound-action-foreign-object.test.ts b/packages/objectql/src/bound-action-foreign-object.test.ts index b881290ccb7..5a468440a7e 100644 --- a/packages/objectql/src/bound-action-foreign-object.test.ts +++ b/packages/objectql/src/bound-action-foreign-object.test.ts @@ -367,7 +367,7 @@ describe('a bound action is served as its ActionSchema parse', () => { /** One declaration, carried both by the owner's object and by a binder package. */ const GATED = { label: 'Change slug', type: 'url' as const, target: 'https://example.com/slug', - locations: ['record_header' as const], visible: "record.name != ''", + locations: ['record_page' as const], visible: "record.name != ''", requiresFeature: 'multiOrgEnabled' as const, }; const LOWERED = { dialect: 'cel', source: "(record.name != '') && features.multiOrgEnabled != false" }; diff --git a/packages/objectql/src/object-own-action-schema-parse.test.ts b/packages/objectql/src/object-own-action-schema-parse.test.ts index c6017f37648..f139c7297f9 100644 --- a/packages/objectql/src/object-own-action-schema-parse.test.ts +++ b/packages/objectql/src/object-own-action-schema-parse.test.ts @@ -26,7 +26,7 @@ import { ObjectQL } from './engine.js'; /** One gated declaration, authored on an object's own action. */ const GATED = { name: 'gated', label: 'Gated', type: 'url' as const, target: 'https://example.com/gated', - locations: ['record_header' as const], visible: "record.name != ''", + locations: ['record_page' as const], visible: "record.name != ''", requiresFeature: 'multiOrgEnabled' as const, }; const LOWERED = { dialect: 'cel', source: "(record.name != '') && features.multiOrgEnabled != false" }; diff --git a/packages/platform-objects/src/apps/setup-nav-per-user-stores.test.ts b/packages/platform-objects/src/apps/setup-nav-per-user-stores.test.ts index 804702b76f6..175eedde1d1 100644 --- a/packages/platform-objects/src/apps/setup-nav-per-user-stores.test.ts +++ b/packages/platform-objects/src/apps/setup-nav-per-user-stores.test.ts @@ -16,7 +16,7 @@ // view (the grid the menu entry opened) did not show, and authors no // `add` picker and no `actions` — so it exposes nothing new; // (4) the Linked Accounts list already served "Identity links", and the one -// row action that grid offered, `unlink_account`, is a `list_item` +// row action that grid offered, `unlink_account`, is a `record_row` // action, which a related list's host offers on its rows. // // Reach, stated so a green run is not read wider than it is: (1) reads @@ -147,6 +147,6 @@ describe('(4) Linked Accounts already serves "Identity links" (#23803)', () => { it('the grid\'s one row action, unlink_account, is offered on list rows', () => { const unlink = (SysAccount.actions ?? []).find((a) => a.name === 'unlink_account'); expect(unlink, 'sys_account lost unlink_account').toBeDefined(); - expect(unlink?.locations).toContain('list_item'); + expect(unlink?.locations).toContain('record_row'); }); }); diff --git a/packages/platform-objects/src/identity/invitation-delivery-copy.test.ts b/packages/platform-objects/src/identity/invitation-delivery-copy.test.ts index 13e9c3c8bff..5a439380fb5 100644 --- a/packages/platform-objects/src/identity/invitation-delivery-copy.test.ts +++ b/packages/platform-objects/src/identity/invitation-delivery-copy.test.ts @@ -153,7 +153,7 @@ describe('sys_invitation.copy_invitation_link — the declaration', () => { it('is a script action bound to its handler by target, on the row menu and the record header', () => { expect(copy.type).toBe('script'); expect(copy.target).toBe('copy_invitation_link'); - expect(copy.locations).toEqual(['list_item', 'record_header']); + expect(copy.locations).toEqual(['record_row', 'record_page']); }); it('shows the answer in a copyable text dialog, the acceptUrl field', () => { diff --git a/packages/platform-objects/src/identity/invite-entry-toolbar.test.ts b/packages/platform-objects/src/identity/invite-entry-toolbar.test.ts index f9eae81e44b..3c0dcc1f0e7 100644 --- a/packages/platform-objects/src/identity/invite-entry-toolbar.test.ts +++ b/packages/platform-objects/src/identity/invite-entry-toolbar.test.ts @@ -71,10 +71,10 @@ function action(object: unknown, name: string): AnyAction { return found as AnyAction; } -/** Declared `list_toolbar` actions, in declaration order. */ +/** Declared `list` actions, in declaration order. */ function toolbarActions(object: unknown): AnyAction[] { return (((object as { actions?: AnyAction[] }).actions) ?? []) - .filter((a) => (a.locations ?? []).includes('list_toolbar')); + .filter((a) => (a.locations ?? []).includes('list')); } /** The three declaration sites of `invite_user`, as [label, object] rows. */ @@ -86,7 +86,7 @@ const MIRRORS: Array<[string, unknown]> = [ /** * Every declaration site: the three toolbar mirrors plus sys_organization's - * `record_header` copy (ruling 6228318638, B′ on #24034), which a + * `record_page` copy (ruling 6228318638, B′ on #24034), which a * `page:header` can name because it lives on the page's own object. Its * placement is pinned in `sys-organization-invite-action.test.ts`; what the * four must share — endpoint, gates, inputs — is pinned here. @@ -99,11 +99,11 @@ const ALL_MIRRORS: Array<[string, unknown]> = [ describe('invite_user — reachable from the default Members tab (#11544)', () => { it('is declared on sys_member, in the toolbar the Members tab renders', () => { // The regression itself: the whole defect was this action's ABSENCE from - // this one object. `list_toolbar` is what the org record page's + // this one object. `list` is what the org record page's // `record:related_list` over sys_member surfaces as header buttons // (objectui `RelatedRecordActionsBridge.deriveActions` → `RelatedList`). const invite = action(SysMember, 'invite_user'); - expect(invite.locations).toContain('list_toolbar'); + expect(invite.locations).toContain('list'); expect(invite.type).toBe('api'); expect(invite.target).toBe(INVITE_ENDPOINT); }); @@ -159,7 +159,7 @@ describe('invite_user — the mirrors agree (#11544)', () => { }); it.each(MIRRORS)('%s offers it from the list toolbar', (_name, object) => { - expect(action(object, 'invite_user').locations).toContain('list_toolbar'); + expect(action(object, 'invite_user').locations).toContain('list'); }); it.each(ALL_MIRRORS)('%s carries the same lowered `organization` capability gate', (_name, object) => { diff --git a/packages/platform-objects/src/identity/remove-pending-sso-user-visibility.test.ts b/packages/platform-objects/src/identity/remove-pending-sso-user-visibility.test.ts index 8e59b8d2d9a..2d5cce3d86a 100644 --- a/packages/platform-objects/src/identity/remove-pending-sso-user-visibility.test.ts +++ b/packages/platform-objects/src/identity/remove-pending-sso-user-visibility.test.ts @@ -55,7 +55,7 @@ describe('Setup → Users offers Remove Pending User on a pending row, managed, expect(action.type).toBe('api'); expect(action.target).toBe('/api/v1/auth/admin/remove-sso-user'); expect(action.recordIdParam).toBe('userId'); - expect(action.locations).toEqual(['list_item', 'record_header']); + expect(action.locations).toEqual(['record_row', 'record_page']); // A confirmation is asked first (the parsed template, whatever its words). expect((action.confirmText as { source?: unknown } | undefined)?.source).toEqual(expect.any(String)); // The door mounts with or without the better-auth admin plugin, as Add / Import do. diff --git a/packages/platform-objects/src/identity/setup-list-empty-states.test.ts b/packages/platform-objects/src/identity/setup-list-empty-states.test.ts index 76a4b2e3320..8ccdd4b7f2f 100644 --- a/packages/platform-objects/src/identity/setup-list-empty-states.test.ts +++ b/packages/platform-objects/src/identity/setup-list-empty-states.test.ts @@ -131,7 +131,7 @@ describe('API Keys: Create Key through the existing mint route', () => { it('is declared as a primary list-toolbar action', () => { expect(create, 'sys_api_key declares no create_api_key action').toBeDefined(); - expect(create?.locations).toEqual(['list_toolbar']); + expect(create?.locations).toEqual(['list']); expect(create?.variant).toBe('primary'); expect(nonEmptyString(create?.label)).toBe(true); }); diff --git a/packages/platform-objects/src/identity/sys-account-link-social-retired.test.ts b/packages/platform-objects/src/identity/sys-account-link-social-retired.test.ts index c57f04d182a..f06f0e92148 100644 --- a/packages/platform-objects/src/identity/sys-account-link-social-retired.test.ts +++ b/packages/platform-objects/src/identity/sys-account-link-social-retired.test.ts @@ -71,7 +71,7 @@ describe('#21849 — unlink_account is unchanged by the retirement', () => { expect(unlink?.type).toBe('api'); expect(unlink?.target).toBe('/api/v1/auth/unlink-account'); expect(unlink?.mode).toBe('delete'); - expect(unlink?.locations).toEqual(['list_item', 'record_header']); + expect(unlink?.locations).toEqual(['record_row', 'record_page']); expect(unlink?.params).toEqual([ { name: 'accountId', field: 'id', defaultFromRow: true, required: true }, ]); diff --git a/packages/platform-objects/src/identity/sys-api-key-action-copy.test.ts b/packages/platform-objects/src/identity/sys-api-key-action-copy.test.ts index 72150858c61..bf4d470e95f 100644 --- a/packages/platform-objects/src/identity/sys-api-key-action-copy.test.ts +++ b/packages/platform-objects/src/identity/sys-api-key-action-copy.test.ts @@ -4,7 +4,7 @@ // record-level success message names the record (the write-feedback // convention). // -// Both are `list_item` row actions. The console's runner fills a +// Both are `record_row` row actions. The console's runner fills a // `successMessage` `{{ record.* }}` hole from the row the dispatch carries // (ActionRunner `composeSuccessMessage`, pinned in objectui's // `ActionRunner.copyTemplate-13367.test.ts`, "the row a dispatch carries is diff --git a/packages/platform-objects/src/identity/sys-invitation.object.ts b/packages/platform-objects/src/identity/sys-invitation.object.ts index bfcfd636bfe..5d82e9cd294 100644 --- a/packages/platform-objects/src/identity/sys-invitation.object.ts +++ b/packages/platform-objects/src/identity/sys-invitation.object.ts @@ -221,7 +221,7 @@ export const SysInvitation = ObjectSchema.create({ // invite mirrors are, and offered on a pending row only, before its // `expires_at`: a row can still read `pending` after it expires, and // its link admits no one (the handler refuses it too). `has()` opens - // each operand for the sparse `list_item` face (#8990), as on the + // each operand for the sparse `record_row` face (#8990), as on the // recipient-side actions below; `expires_at` is compared by ordering, // so it also needs its `!= null` half (`materializeDeclaredFields`). visible: "features.cloudManaged != true && has(record.status) && record.status == 'pending' && has(record.expires_at) && record.expires_at != null && datetime(record.expires_at) > now()", @@ -249,7 +249,7 @@ export const SysInvitation = ObjectSchema.create({ // them out of the admin org-management view. // // Both predicates open each operand with `has()` for the SPARSE action - // face (#8990): they reach `list_item`, so the bound record is the row the + // face (#8990): they reach `record_row`, so the bound record is the row the // inbox view projected, and an unprojected `email` / `status` aborts the // whole predicate at key resolution instead of reading null — fail-closed, // so the Accept/Decline pair vanishes with no way to tell that from the diff --git a/packages/platform-objects/src/identity/sys-member.object.ts b/packages/platform-objects/src/identity/sys-member.object.ts index 4e9a2f3f07d..6b746276f30 100644 --- a/packages/platform-objects/src/identity/sys-member.object.ts +++ b/packages/platform-objects/src/identity/sys-member.object.ts @@ -79,7 +79,7 @@ export const SysMember = ObjectSchema.create({ // move this page if it did. Looking for the tab order in // this directory finds nothing; it lives one directory over (#16270). // Declaration order is render order — the related-list toolbar bridge - // maps the child object's `list_toolbar` actions in array order + // maps the child object's `list` actions in array order // (objectui `RelatedRecordActionsBridge.deriveActions` → // `RelatedList`), so this sits left of `add_member`. // @@ -302,7 +302,7 @@ export const SysMember = ObjectSchema.create({ // then the feature gate are AND-composed onto it by the lowerings. // Owner only: better-auth refuses to SET the creator role unless the // caller holds it, whatever an admin's statements say. - // `has()` guards the SPARSE action face (#8990): this is a `list_item` + // `has()` guards the SPARSE action face (#8990): this is a `record_row` // action, so a member list that does not project `role` would abort the // predicate at key resolution and drop the button silently. `has()` // alone — the operand is a bare equality against a literal (see diff --git a/packages/platform-objects/src/identity/sys-oauth-application.object.ts b/packages/platform-objects/src/identity/sys-oauth-application.object.ts index 6c7c3be0f07..49514c61dd3 100644 --- a/packages/platform-objects/src/identity/sys-oauth-application.object.ts +++ b/packages/platform-objects/src/identity/sys-oauth-application.object.ts @@ -63,7 +63,7 @@ export const SysOauthApplication = ObjectSchema.create({ // // The two toggle predicates are guarded for the SPARSE action face (#8990), // and this pair is where the guard actually changes what a user sees. Both - // reach `list_item`, and `disabled` is nullable upstream (better-auth writes + // reach `record_row`, and `disabled` is nullable upstream (better-auth writes // the column only when it is set), so a list row can carry it PROJECTED AND // NULL. Measured against the `@objectstack/formula` CEL engine, the old // spellings both broke on exactly that row: `!record.disabled` FAULTED diff --git a/packages/platform-objects/src/identity/sys-organization-invite-action.test.ts b/packages/platform-objects/src/identity/sys-organization-invite-action.test.ts index b35d7efa765..542f9636f73 100644 --- a/packages/platform-objects/src/identity/sys-organization-invite-action.test.ts +++ b/packages/platform-objects/src/identity/sys-organization-invite-action.test.ts @@ -40,10 +40,10 @@ function action(name: string): HeaderAction { return found as HeaderAction; } -/** The object's `record_header` actions, in the order the stable `order` sort gives them. */ +/** The object's `record_page` actions, in the order the stable `order` sort gives them. */ function headerOrder(): string[] { return actions() - .filter((a) => (a.locations ?? []).includes('record_header')) + .filter((a) => (a.locations ?? []).includes('record_page')) .map((a, i) => ({ a, i })) .sort((x, y) => (x.a.order ?? 0) - (y.a.order ?? 0) || x.i - y.i) .map(({ a }) => a.name as string); @@ -53,9 +53,9 @@ function headerOrder(): string[] { const MAX_VISIBLE = 3; describe('sys_organization.invite_user — the record header (#24016)', () => { - it('is a record_header api action on the invite endpoint, bound to THIS organization', () => { + it('is a record_page api action on the invite endpoint, bound to THIS organization', () => { const invite = action('invite_user'); - expect(invite.locations).toContain('record_header'); + expect(invite.locations).toContain('record_page'); expect(invite.type).toBe('api'); expect(invite.target).toBe('/api/v1/auth/organization/invite-member'); // The row id rides as `organizationId`: without it better-auth falls back @@ -66,7 +66,7 @@ describe('sys_organization.invite_user — the record header (#24016)', () => { it('is the one primary action in the header', () => { const primaries = actions() - .filter((a) => (a.locations ?? []).includes('record_header')) + .filter((a) => (a.locations ?? []).includes('record_page')) .filter((a) => a.variant === 'primary') .map((a) => a.name); expect(primaries).toEqual(['invite_user']); diff --git a/packages/platform-objects/src/identity/sys-organization-rename-action.test.ts b/packages/platform-objects/src/identity/sys-organization-rename-action.test.ts index 257caf13e54..e837dcaafed 100644 --- a/packages/platform-objects/src/identity/sys-organization-rename-action.test.ts +++ b/packages/platform-objects/src/identity/sys-organization-rename-action.test.ts @@ -3,7 +3,7 @@ // sys_organization's rename door: a name/logo-only action a record page can // offer. // -// `update_organization` renames too, but it is declared at `list_item` only (a +// `update_organization` renames too, but it is declared at `record_row` only (a // record page's header never offers it) and it bundles `slug`, which the cloud // orchestrator's slug action governs where it exists — an action the // composition serving that route declares itself, never this object. So the @@ -11,12 +11,12 @@ // // What this file pins, from source: // - the new action's declaration: its params are exactly `name` and `logo`, -// it sits at `record_header` and `list_item`, it targets better-auth's +// it sits at `record_page` and `record_row`, it targets better-auth's // `organization/update` exactly as `update_organization` does, and it is // gated on the grades that reach `organization/update` (owner, admin) like // it, but on the organization capability rather than `multiOrgEnabled`, so // a `single` deployment can rename its one organization (#25347); -// - one door per field on the record header: no `record_header` action that +// - one door per field on the record header: no `record_page` action that // targets `organization/update` carries a `slug` param; // - the header order: the rename takes an inline slot and leave folds into // the overflow (the ordering model is described in @@ -69,10 +69,10 @@ function action(name: string): DeclaredAction { const paramKeys = (a: DeclaredAction): string[] => (a.params ?? []).map((p) => (p.field ?? p.name) as string); -/** The object's `record_header` actions, in the order the stable `order` sort gives them. */ +/** The object's `record_page` actions, in the order the stable `order` sort gives them. */ function headerOrder(): string[] { return actions() - .filter((a) => (a.locations ?? []).includes('record_header')) + .filter((a) => (a.locations ?? []).includes('record_page')) .map((a, i) => ({ a, i })) .sort((x, y) => (x.a.order ?? 0) - (y.a.order ?? 0) || x.i - y.i) .map(({ a }) => a.name as string); @@ -89,7 +89,7 @@ describe('sys_organization.rename_organization: the declaration', () => { }); it('is offered at the record header and on the list row', () => { - expect(action('rename_organization').locations).toEqual(['record_header', 'list_item']); + expect(action('rename_organization').locations).toEqual(['record_page', 'record_row']); }); it("targets better-auth's organization/update exactly as update_organization does", () => { @@ -112,9 +112,9 @@ describe('sys_organization.rename_organization: the declaration', () => { }); describe('sys_organization: one door per field on the record header', () => { - it('no record_header action that writes through organization/update collects a slug', () => { + it('no record_page action that writes through organization/update collects a slug', () => { const headerWriters = actions() - .filter((a) => (a.locations ?? []).includes('record_header')) + .filter((a) => (a.locations ?? []).includes('record_page')) .filter((a) => a.target === UPDATE_TARGET); expect(headerWriters.map((a) => a.name)).toEqual(['rename_organization']); for (const a of headerWriters) { @@ -147,9 +147,9 @@ describe('sys_organization: every door it declares is one an open-source composi }); describe('sys_organization: the open-source slug door is unchanged (control)', () => { - it('update_organization keeps name / slug / logo, its target and list_item alone', () => { + it('update_organization keeps name / slug / logo, its target and record_row alone', () => { const update = action('update_organization'); - expect(update.locations).toEqual(['list_item']); + expect(update.locations).toEqual(['record_row']); expect(update.target).toBe(UPDATE_TARGET); expect(paramKeys(update)).toEqual(['name', 'slug', 'logo']); }); diff --git a/packages/platform-objects/src/identity/sys-organization.object.ts b/packages/platform-objects/src/identity/sys-organization.object.ts index d1fb7b5d3c4..30cbd93033b 100644 --- a/packages/platform-objects/src/identity/sys-organization.object.ts +++ b/packages/platform-objects/src/identity/sys-organization.object.ts @@ -178,7 +178,7 @@ export const SysOrganization = ObjectSchema.create({ // OWN actions only (spec `component.zod.ts`, page:header), so the // organization record page cannot offer an invite from a mirror on // another object. Ruling 6228318638 (B′ on #24034): declared at - // `record_header`, primary, first by `order`. + // `record_page`, primary, first by `order`. // // The record IS the organization, so its id rides as `organizationId` // instead of better-auth's active-org fallback — an admin on another @@ -275,8 +275,8 @@ export const SysOrganization = ObjectSchema.create({ // better-auth's slug-taken check and plugin-auth's // `beforeUpdateOrganization` slug guard both run only on a sent slug. // - // One door per field. A record page reaches no `list_item` action, so - // this one is declared at `record_header` too, and nothing on that page + // One door per field. A record page reaches no `record_row` action, so + // this one is declared at `record_page` too, and nothing on that page // sends a slug to better-auth. `update_organization` is the slug door of // a composition without the cloud orchestrator. Where the orchestrator // governs the slug, the composition that serves its route declares the diff --git a/packages/platform-objects/src/identity/sys-team-add-member-action.test.ts b/packages/platform-objects/src/identity/sys-team-add-member-action.test.ts index 2b265b15a9e..9ccab7d47ee 100644 --- a/packages/platform-objects/src/identity/sys-team-add-member-action.test.ts +++ b/packages/platform-objects/src/identity/sys-team-add-member-action.test.ts @@ -41,7 +41,7 @@ describe('sys_team.add_team_member — Add Member opened from a team', () => { const fromList = action(SysTeamMember, 'add_team_member'); it('is offered on the team row and the team record header', () => { - expect(fromTeam.locations).toEqual(['list_item', 'record_header']); + expect(fromTeam.locations).toEqual(['record_row', 'record_page']); }); it('binds the team from the row it is opened on, as teamId', () => { @@ -65,7 +65,7 @@ describe('sys_team.add_team_member — Add Member opened from a team', () => { }); it('leaves the membership-list copy asking for the team, where none is in hand', () => { - expect(fromList.locations).toEqual(['list_toolbar']); + expect(fromList.locations).toEqual(['list']); expect(fromList.recordIdParam).toBeUndefined(); expect((fromList.params ?? []).map((p) => p.name)).toEqual(['teamId', 'userId']); }); diff --git a/packages/platform-objects/src/identity/sys-team-derived-related-lists.test.ts b/packages/platform-objects/src/identity/sys-team-derived-related-lists.test.ts index 935210c33b3..a01a4c1a71f 100644 --- a/packages/platform-objects/src/identity/sys-team-derived-related-lists.test.ts +++ b/packages/platform-objects/src/identity/sys-team-derived-related-lists.test.ts @@ -10,7 +10,7 @@ * `deriveRelatedLists`, cited in `packages/spec/liveness/field.json`). * * `sys_session.active_team_id` used to derive one. That list carried the - * session object's only `list_toolbar` action, "Sign out other devices", + * session object's only `list` action, "Sign out other devices", * which revokes the CALLER's own other sessions — on a team record it read as * a team action and was not one. The field, its lookup and its label stay * (better-auth writes `activeTeamId` into it); only the derived list goes. @@ -134,6 +134,6 @@ describe("the user's own Sessions related list is unchanged", () => { it('"Sign out other devices" stays the session list toolbar action', () => { const action = (SysSession.actions as ActionDef[]).find((a) => a.name === 'revoke_my_other_sessions'); - expect(action?.locations).toEqual(['list_toolbar']); + expect(action?.locations).toEqual(['list']); }); }); diff --git a/packages/platform-objects/src/identity/sys-user-set-manager-action.test.ts b/packages/platform-objects/src/identity/sys-user-set-manager-action.test.ts index ddc4e7f4e33..7dc5007746c 100644 --- a/packages/platform-objects/src/identity/sys-user-set-manager-action.test.ts +++ b/packages/platform-objects/src/identity/sys-user-set-manager-action.test.ts @@ -109,8 +109,8 @@ describe('#19249 — sys_user.set_user_manager posts the admin endpoint', () => }); it('surfaces on the row menu AND the record-detail header', () => { - expect(ACTION.locations).toContain('list_item'); - expect(ACTION.locations).toContain('record_header'); + expect(ACTION.locations).toContain('record_row'); + expect(ACTION.locations).toContain('record_page'); }); it('collects the manager on `manager_id`, seeded from the row, under the body key the endpoint reads', () => { diff --git a/packages/platform-objects/src/identity/sys-user.object.ts b/packages/platform-objects/src/identity/sys-user.object.ts index a3e7b760674..2700d953faa 100644 --- a/packages/platform-objects/src/identity/sys-user.object.ts +++ b/packages/platform-objects/src/identity/sys-user.object.ts @@ -211,7 +211,7 @@ export const SysUser = ObjectSchema.create({ // `pending-sso-users.test.ts` (the declared targets, driven live). // // UI surfaces them under the row menu AND the - // record-detail header (`record_header`, overflowing into the ⋯ + // record-detail header (`record_page`, overflowing into the ⋯ // "More" menu) so platform admins can manage an account from either // the Users list or an open user record — without dropping to SQL or // a custom Setup wizard. diff --git a/packages/platform-objects/src/pages/record-page-header-actions.test.ts b/packages/platform-objects/src/pages/record-page-header-actions.test.ts index 4cdb7ec915e..6027fed01cb 100644 --- a/packages/platform-objects/src/pages/record-page-header-actions.test.ts +++ b/packages/platform-objects/src/pages/record-page-header-actions.test.ts @@ -7,7 +7,7 @@ * * Both pages were `kind: 'slotted'` until the `tabs` slot retired (#27053); * the synthesized header they rendered read every object action placed at - * `record_header` or `record_more` at render time, an action another package + * `record` or `record_page` at render time, an action another package * places on the object included. Rebuilt as `kind: 'full'` pages they named * the platform's own ids instead, and an authored id list is the whole set * (#11592), so an installed package's header action on `sys_user` stopped @@ -34,7 +34,7 @@ function headerPlacedIds(object: { actions?: unknown }): string[] { for (const action of (object.actions ?? []) as Rec[]) { const locations = (action.locations ?? []) as string[]; const name = action.name as string; - if (!locations.includes('record_header') && !locations.includes('record_more')) continue; + if (!locations.includes('record_page') && !locations.includes('record')) continue; if (!ids.includes(name)) ids.push(name); } return ids; diff --git a/packages/platform-objects/src/pages/sys-organization.page.ts b/packages/platform-objects/src/pages/sys-organization.page.ts index 402f4708ed7..de94682d697 100644 --- a/packages/platform-objects/src/pages/sys-organization.page.ts +++ b/packages/platform-objects/src/pages/sys-organization.page.ts @@ -18,7 +18,7 @@ import type { Page } from '@objectstack/spec/ui'; * swapped in — node for node: * * - `page:header` with `placedActions: true` (#29951): every action placed on - * `sys_organization` at `record_header` / `record_more`, read live (Set + * `sys_organization` at `record` / `record_page`, read live (Set * Active, Invite User, Leave Organization, Rename Organization — Edit and * Delete are row actions only — and any an installed package places * there), the set the synthesized header carried. A full page renders @@ -59,7 +59,7 @@ export const SysOrganizationDetailPage: Page = { width: 'full', components: [ // The synthesized header's action set, read live: every action placed - // on `sys_organization` at `record_header` or `record_more`, in + // on `sys_organization` at `record` or `record_page`, in // declaration order, including one another package places there (a // frozen id list dropped those, #29951). The host appends its own // system actions after these. diff --git a/packages/platform-objects/src/pages/sys-user.page.ts b/packages/platform-objects/src/pages/sys-user.page.ts index e792e84970b..e2bccd68776 100644 --- a/packages/platform-objects/src/pages/sys-user.page.ts +++ b/packages/platform-objects/src/pages/sys-user.page.ts @@ -42,7 +42,7 @@ const TWO_FACTOR_OFFERED = P`has(features.twoFactor) && features.twoFactor == tr * `tabs` slot retired (#27053); the rebuild renders the same nodes in the * same order. The header the synthesizer used to supply is a `page:header` * with `placedActions: true` (#29951): it draws every `sys_user` action - * placed at `record_header` / `record_more`, read live, so the platform's + * placed at `record` / `record_page`, read live, so the platform's * own (`ban_user / impersonate_user / … / update_my_profile / * change_my_password / …`) and any an installed package places on * `sys_user` appear in the header and its overflow menu, as they did on @@ -88,7 +88,7 @@ export const SysUserDetailPage: Page = { components: [ // ── The record header ───────────────────────────────────────── // The synthesized header's action set, read live: every action placed - // on `sys_user` at `record_header` or `record_more`, in declaration + // on `sys_user` at `record` or `record_page`, in declaration // order (admin actions, then the self-service ones), then any action // another package places there. A frozen id list dropped those // (#29951). The host appends its own system actions after these. diff --git a/packages/platform-objects/src/platform-objects.test.ts b/packages/platform-objects/src/platform-objects.test.ts index 56fcad9f5bf..4106861053d 100644 --- a/packages/platform-objects/src/platform-objects.test.ts +++ b/packages/platform-objects/src/platform-objects.test.ts @@ -334,16 +334,16 @@ describe('@objectstack/platform-objects', () => { // An admin viewing an open user record must be able to run the same // account-management actions available from the Users list row menu — // otherwise they have to navigate back to the list. Each admin action is - // therefore declared on BOTH `list_item` and `record_header` (the detail - // header overflows extras into the ⋯ "More" menu). `record_header` is the - // only detail-surface location objectui consumes (it does NOT read - // `record_more`), so these must use `record_header` specifically. + // therefore declared on `record` — the row menu AND the detail header + // (objectstack#36495; the header overflows extras into the ⋯ "More" + // menu) — and NOT folded (`component: 'action:menu'`), which would send + // each straight into the ⋯. const adminActions = ['ban_user', 'unban_user', 'unlock_user', 'set_user_password', 'impersonate_user']; for (const name of adminActions) { const a = (SysUser.actions ?? []).find((x) => x.name === name); expect(a, `${name} action must exist`).toBeTruthy(); - expect(a?.locations, `${name} locations`).toContain('list_item'); - expect(a?.locations, `${name} must also surface on the detail header`).toContain('record_header'); + expect(a?.locations, `${name} must surface on the row menu and the detail header`).toContain('record'); + expect((a as { component?: string } | undefined)?.component, `${name} is not folded`).not.toBe('action:menu'); } }); @@ -436,7 +436,7 @@ describe('@objectstack/platform-objects', () => { const revoke = (SysSession.actions ?? []).find((a) => a.name === 'revoke_session'); expect(revoke).toBeDefined(); expect(revoke?.type).toBe('api'); - expect(revoke?.locations).toEqual(['list_item']); + expect(revoke?.locations).toEqual(['record_row']); expect(revoke?.target).toBe('/api/v1/auth/sys-session/revoke'); expect(revoke?.recordIdParam).toBe('sessionId'); // The row field that seeds `recordIdParam` defaults to `id` — the one diff --git a/packages/plugins/plugin-approvals/src/sys-approval-request-page.test.ts b/packages/plugins/plugin-approvals/src/sys-approval-request-page.test.ts index 484213bd647..779d2b765db 100644 --- a/packages/plugins/plugin-approvals/src/sys-approval-request-page.test.ts +++ b/packages/plugins/plugin-approvals/src/sys-approval-request-page.test.ts @@ -136,7 +136,7 @@ describe('sys_approval_request detail page — the page body', () => { // whole, and the rail of progress, attachments and activity, the activity // last (maintainer 2026-11-17). The header reads the object's placed // header actions live: a bare `page:header` drew none, so an action - // another package places on the object at `record_header` was dropped + // another package places on the object at `record_page` was dropped // (#29951). expect(COMPONENTS.map((c) => c.type)).toEqual(['page:header', 'record:highlights', 'record:approval_decision']); expect(DECISION_AT).toBe(COMPONENTS.length - 1); diff --git a/packages/plugins/plugin-approvals/src/sys-approval-request.page.ts b/packages/plugins/plugin-approvals/src/sys-approval-request.page.ts index 577be3fa786..50279ac6811 100644 --- a/packages/plugins/plugin-approvals/src/sys-approval-request.page.ts +++ b/packages/plugins/plugin-approvals/src/sys-approval-request.page.ts @@ -24,7 +24,7 @@ import type { Page } from '@objectstack/spec/ui'; * (`placedActions: true`, #29951). The object places none of its own (its * decision actions are `record_section` ones, drawn by the panel below), so * the header draws only what an installed package places on - * `sys_approval_request` at `record_header` / `record_more`. + * `sys_approval_request` at `record` / `record_page`. * - Then the highlight strip: the object's `highlightFields` WITHOUT * `record_id`. `record_id` / `object_name` is a declared `referenceVia` * pointer pair, and the page reaches the record it points at through the @@ -89,7 +89,7 @@ export const SysApprovalRequestDetailPage: Page = { // request by the business record it is about, linked to it, wherever // the approvals get serves that record's title, objectstack#35415; // else by the flow's label, the object's `nameField`), and every action placed - // on the object at `record_header` / `record_more`, read live, as the + // on the object at `record` / `record_page`, read live, as the // synthesized header drew them. The object places none of its own, so // only an action another package places there shows (a bare header // dropped it, #29951); the host appends its system actions. diff --git a/packages/qa/dogfood/test/org-change-slug-bound-action.dogfood.test.ts b/packages/qa/dogfood/test/org-change-slug-bound-action.dogfood.test.ts index 848216088cc..45ce541bea3 100644 --- a/packages/qa/dogfood/test/org-change-slug-bound-action.dogfood.test.ts +++ b/packages/qa/dogfood/test/org-change-slug-bound-action.dogfood.test.ts @@ -21,7 +21,7 @@ * the declaration the platform object carried — is mounted beside the * showcase. Then: * - `GET /meta/object/sys_organization` serves `change_slug` once, with the - * orchestrator's target, method, `record_header` location and one `slug` + * orchestrator's target, method, `record_page` location and one `slug` * param, and the `multiOrgEnabled` gate lowered exactly as the platform's * own `requiresFeature` actions are; * - the gate admits it with multi-org on and hides it with multi-org off, @@ -143,7 +143,7 @@ describe('a cloud-shaped composition binds change_slug to sys_organization, and it('sorts after the rename and before leave in the record header, so it sits in the overflow', () => { const header = actions - .filter((a) => (a.locations ?? []).includes('record_header')) + .filter((a) => (a.locations ?? []).includes('record_page')) .map((a, i) => ({ a, i })) .sort((x, y) => (x.a.order ?? 0) - (y.a.order ?? 0) || x.i - y.i) .map(({ a }) => a.name); diff --git a/packages/qa/scenarios/src/runner/door-rules-corpus.ts b/packages/qa/scenarios/src/runner/door-rules-corpus.ts index 41ff01e4957..3e4f40b09b1 100644 --- a/packages/qa/scenarios/src/runner/door-rules-corpus.ts +++ b/packages/qa/scenarios/src/runner/door-rules-corpus.ts @@ -163,7 +163,7 @@ export const DOOR_RULES_CORPUS: DoorRulesCorpus = { }, { id: '13-tier', - text: "13. ACTIONS / BUTTONS are `action` metadata, NOT views — and this version offers only these action types: `flow` / `form` / `modal` / `url`. When the user asks for a \"button\", \"action\", \"动作\", \"按钮\", or an operation that DOES something to a record (\"mark as done / 标记为已完成\", \"approve\", \"submit\", \"set status to X\", \"send\"), create an `action` — a view only DISPLAYS data, an action is the clickable control that performs the operation. FIRST call get_metadata_schema('action'), then create_metadata(type:'action', …) with `type` set to one of `flow` / `form` / `modal` / `url` and `target` naming what it opens (the schema says what each type's target is). Any other action type is refused by the tool (status:'unsupported_in_this_version' — relay its `summary`), so never author one and never promise one:\n - BIND IT TO THE OBJECT: set `objectName:''`. That is what folds the action into the object's record header (so the button renders) AND wires its handler (so clicking it works). An action with no objectName is a dead global button (lint: `action_missing_object_binding`). Give it `label`, optional `icon`, and `locations` (e.g. ['record_header'] or ['list_item']).\n - A button that must CHANGE the record is `type:'flow'` with `target:''`: author that flow too, in the same build (rule 14 has its shapes), and do not say the button works: on this MCP connection that flow is a staged draft until a person publishes and tests it in Studio > Changes. This version offers no inline code body on an action, so the write lives in the flow, never in the action — an action that only RETURNS the new values changes NOTHING.\n Do NOT make a view \"for\" the button and defer the real logic — author the action itself THIS turn, bound to the object's app package (not the default workspace). After staging, verify_build lints actions — FIX every `action_*` error (e.g. action_missing_object_binding) before telling the user the button works; an action you cannot get past the lint is NOT done.", + text: "13. ACTIONS / BUTTONS are `action` metadata, NOT views — and this version offers only these action types: `flow` / `form` / `modal` / `url`. When the user asks for a \"button\", \"action\", \"动作\", \"按钮\", or an operation that DOES something to a record (\"mark as done / 标记为已完成\", \"approve\", \"submit\", \"set status to X\", \"send\"), create an `action` — a view only DISPLAYS data, an action is the clickable control that performs the operation. FIRST call get_metadata_schema('action'), then create_metadata(type:'action', …) with `type` set to one of `flow` / `form` / `modal` / `url` and `target` naming what it opens (the schema says what each type's target is). Any other action type is refused by the tool (status:'unsupported_in_this_version' — relay its `summary`), so never author one and never promise one:\n - BIND IT TO THE OBJECT: set `objectName:''`. That is what folds the action into the object's record header (so the button renders) AND wires its handler (so clicking it works). An action with no objectName is a dead global button (lint: `action_missing_object_binding`). Give it `label`, optional `icon`, and `locations` (e.g. ['record_page'] or ['record_row']).\n - A button that must CHANGE the record is `type:'flow'` with `target:''`: author that flow too, in the same build (rule 14 has its shapes), and do not say the button works: on this MCP connection that flow is a staged draft until a person publishes and tests it in Studio > Changes. This version offers no inline code body on an action, so the write lives in the flow, never in the action — an action that only RETURNS the new values changes NOTHING.\n Do NOT make a view \"for\" the button and defer the real logic — author the action itself THIS turn, bound to the object's app package (not the default workspace). After staging, verify_build lints actions — FIX every `action_*` error (e.g. action_missing_object_binding) before telling the user the button works; an action you cannot get past the lint is NOT done.", }, { id: '14', diff --git a/packages/runtime/src/action-execution.ts b/packages/runtime/src/action-execution.ts index 2aa7db94e87..d65533b56c2 100644 --- a/packages/runtime/src/action-execution.ts +++ b/packages/runtime/src/action-execution.ts @@ -3621,7 +3621,7 @@ export function summarizeAction( (Array.isArray(action?.locations) && action.locations.some( (l: string) => - l === 'list_item' || l === 'record_header' || l === 'record_more' || l === 'record_related', + l === 'record' || l === 'record_page' || l === 'record_row' || l === 'record_related', )); const description = (typeof action?.ai?.description === 'string' ? action.ai.description : undefined) ?? diff --git a/packages/services/service-messaging/src/in-app-message-action.test.ts b/packages/services/service-messaging/src/in-app-message-action.test.ts index a2021163192..643aeafde83 100644 --- a/packages/services/service-messaging/src/in-app-message-action.test.ts +++ b/packages/services/service-messaging/src/in-app-message-action.test.ts @@ -32,7 +32,7 @@ describe('send_in_app_message ↔ POST /api/v1/messaging/in-app-messages', () => it('is a same-origin api action on the Notification Events list toolbar, aimed at the door', () => { expect(action).toBeDefined(); expect(action!.type).toBe('api'); - expect(action!.locations).toEqual(['list_toolbar']); + expect(action!.locations).toEqual(['list']); expect(action!.target).toBe(IN_APP_MESSAGE_ROUTE); }); diff --git a/packages/spec/liveness/action.json b/packages/spec/liveness/action.json index e022b76ad70..494f94c0ce0 100644 --- a/packages/spec/liveness/action.json +++ b/packages/spec/liveness/action.json @@ -311,7 +311,7 @@ "order": { "status": "live", "evidence": "packages/spec/src/stack.zod.ts (mergeActionsIntoObjects stable-sorts each action group by order)", - "note": "Deterministic action ordering (#2670). Framework stable-sorts every action group by `order` at defineStack/composeStacks time; objectui record_header picks the first as the primary button. Lower = higher; unset = 0." + "note": "Deterministic action ordering (#2670). Framework stable-sorts every action group by `order` at defineStack/composeStacks time; objectui's record page header picks the first as the primary button. Lower = higher; unset = 0." }, "confirmText": { "status": "live", diff --git a/packages/spec/liveness/object.json b/packages/spec/liveness/object.json index 3a3f9be2f74..4c29910a892 100644 --- a/packages/spec/liveness/object.json +++ b/packages/spec/liveness/object.json @@ -71,14 +71,14 @@ "status": "live", "verifiedAt": "2026-11-23", "evidenceScope": "in-repo", - "evidence": "ui/packages/types/src/ui-action.ts#arrangedHeaderActions (a pinned action is placed at `record_header` and leads the sort, in pin order); ui/packages/app-shell/src/views/RecordDetailView.tsx#RecordDetailView (the record header, side preview and phone bar draw them as buttons); ui/packages/components/src/renderers/layout/containers.tsx#PageHeaderActions (an authored `placedActions: true` header too)", + "evidence": "ui/packages/types/src/ui-action.ts#arrangedHeaderActions (a pinned action is a header button, lifted out of the ⋯ fold, and leads the sort, in pin order); ui/packages/app-shell/src/views/RecordDetailView.tsx#RecordDetailView (the record header, side preview and phone bar draw them as buttons); ui/packages/components/src/renderers/layout/containers.tsx#PageHeaderActions (an authored `placedActions: true` header too)", "note": "objectstack#36366: the record header's buttons, at most three, in order." }, "more": { "status": "live", "verifiedAt": "2026-11-23", "evidenceScope": "in-repo", - "evidence": "ui/packages/types/src/ui-action.ts#arrangedHeaderActions (an unpinned action is placed at `record_more`, the ones `more` names first in that order); ui/packages/app-shell/src/views/RecordDetailView.tsx#RecordDetailView (the record header's ⋯ draws them)", + "evidence": "ui/packages/types/src/ui-action.ts#arrangedHeaderActions (an unpinned action is folded into the ⋯ with `component: 'action:menu'`, the ones `more` names first in that order); ui/packages/app-shell/src/views/RecordDetailView.tsx#RecordDetailView (the record header's ⋯ draws them)", "note": "objectstack#36366: the order of the record header's ⋯ menu." } } diff --git a/packages/spec/liveness/page.json b/packages/spec/liveness/page.json index 71f901f49cd..3471f3ca326 100644 --- a/packages/spec/liveness/page.json +++ b/packages/spec/liveness/page.json @@ -1,6 +1,6 @@ { "type": "page", - "_note": "PageSchema (UI). Renderers live in objectui; objectui paths are cited with the `objectui:` realm marker (in `evidence` or `note` prose) and counted, not resolved against this repo (#5623). Seeded from the Studio page-design dogfood (framework#2254/#2261/#2265). Containers (variables/regions/interfaceConfig/slots/aria) classified at top level — one drill level, no divergent sub-statuses. The removed roadmap page types (record_review/blank) and their config fields (recordReview/blankLayout) were hard-removed — no longer authorable. RETIREMENT RECORD (#11027, 2026-08-24): `regions[].components[].responsive` is a retiredKey tombstone (ADR-0049 D2) — measured dead across both repos (zero callers of either objectui consumer implementation); the shared `ResponsiveConfigSchema` left with it. The walk drills one level only, so no component-level key has a row here (`page/regions` stays RECORDED in undrilled-containers.baseline.json — #4956's page-side instance, still open for the other component keys); the checkable record of THIS retirement is the authorable-surface `ui/PageComponent:responsive [RETIRED]` row, RETIRED_KEYS_BY_MAJOR[18], and the `page-component-responsive-removed` conversion. LIVE RECORD (#23016, 2026-10-12, maintainer ruling in the card body; rewritten from its PLANNED record by #24300 once the renderer shipped): `regions[].components[].dataSource` gained a second shape, the API binding `ElementApiDataSourceSchema` (`{ provider: 'api', read: { url, method? }, path? }`, `read.url` a same-origin API path refused at parse otherwise, no credential key) — LIVE: measured at the console pin `.objectui-sha` @0707b4ae3712, which carries the renderer, objectui @c4dd7078ed (objectstack-ai/objectui#12197). The console reads it on every page element (objectui: packages/react/src/SchemaRenderer.tsx calls useElementApiDataSource for each node it renders; the read is objectui: packages/react/src/element-data-source/useElementApiDataSource.ts, which parses the binding with this schema first, sends one GET to `read.url` through the host's signed-in fetch and selects `path`) and binds the selected value as `data` in the element's expression holes, in its `visibleWhen` and in its subtree, drawing a loading or error panel until the value is in; the generic stat / usage-bar / checklist blocks take it as their `dataSource` (objectui: packages/app-shell/src/console/blocks/productBlocks.tsx). No row carries it because the walk never reaches a component-level key (`page/regions` and `page/slots` are recorded undrilled containers) and `childShape()` does not descend the `z.union` the key now is; the checkable record is the authorable-surface `ui/ElementApiDataSource:*` rows and the schema's own describe, which no longer carries the `[PLANNED — not yet rendered]` marker. LIVE RECORD (#23134, 2026-10-13, ruling B on objectstack-ai/objectui#12296, ruling comment 6137226306; rewritten from its PLANNED record by #23585 once the renderer shipped): `regions[].components[].properties.parentDataSource` on `record:related_list` (`RecordRelatedListProps` in packages/spec/src/ui/component.zod.ts) is the block's PARENT-record binding, the element object binding `ElementDataSourceSchema` by reference, read by the single-record rule (the first row by `sort`; no row is a loud absence, never an empty list); the node-level `dataSource` on the block keeps its child-row meaning (#6953). LIVE: measured at the console pin `.objectui-sha` @4016370af3c9, which carries the renderer, objectui @d81e46043 (objectstack-ai/objectui#12407, the related-list leg of objectstack-ai/objectui#12294). The block hands the key to its parent read (objectui: packages/plugin-detail/src/renderers/record-related-list.tsx, whose RecordRelatedListRenderer passes `schema.parentDataSource` to ParentRecordBinding; the read is objectui: packages/plugin-detail/src/renderers/recordBinding.tsx, whose BoundRecordProvider asks the page's own adapter, so under the caller's identity, for one row (`$top: 1`) by the binding's `sort` and provides it as the record context the list body reads, `relationshipValueField` included). No row, or a read the server refuses as forbidden, draws the block's loud absence (NoParentRecord) in its place and queries no child rows; with the key absent, ParentRecordBinding leaves the list as it is and the record page's record context remains the parent. No row carries it for the reason above (component-level keys sit under the recorded undrilled `page/regions` container); the checkable record is the authorable-surface `ui/RecordRelatedListProps:parentDataSource` row and the key's own describe, which no longer carries the `[PLANNED — not yet rendered]` marker. PLANNED RECORD (#24266, 2026-10-18, objectstack-ai/cloud#2774 Q2 = B as the card quotes it): `regions[].components[].properties.emptyState` on the three bound record blocks `record:details`, `record:highlights` and `record:quick_actions` (`RecordDetailsProps`, `RecordHighlightsProps`, `RecordQuickActionsProps` in packages/spec/src/ui/component.zod.ts) is the list view's own `EmptyStateSchema` by reference, drawn only when the block's node-level `dataSource` binding answers no row. PLANNED, not live: measured at objectui @79cb8c03e, the three blocks take their binding through objectui: packages/plugin-detail/src/renderers/recordBinding.tsx, which mounts a 0-row answer as a record context with no record, so each draws its own placeholder and nothing reads the key. Carrier: objectstack-ai/objectui#12932, dispatched once a spec release carrying the key is installable. No row carries it for the reason above (component-level keys sit under the recorded undrilled `page/regions` container); the checkable record is the authorable-surface `ui/RecordDetailsProps:emptyState`, `ui/RecordHighlightsProps:emptyState` and `ui/RecordQuickActionsProps:emptyState` rows and the keys' own `[PLANNED — not yet rendered]` describe. When that card lands, the marker leaves and this sentence is rewritten. LIVE RECORD (#30018, 2026-11-04, ruling record 6624172200 on #29951, letter A; rewritten from its PLANNED record by #29951's ui half once the reader landed): `regions[].components[].properties.placedActions` on `page:header` (`PageHeaderProps` in packages/spec/src/ui/component.zod.ts) is the explicit opt-in to draw every action of the bound object whose `locations` include `record_header` or `record_more`, read live, in place of an authored `actions` id list; `true` beside an authored `actions` list is refused at the key by the props door (`@objectstack/lint` `validateComponentProps`, rule `component-props-invalid`). LIVE: the header renderer reads it (ui/packages/components/src/renderers/layout/containers.tsx, `PageHeaderActions`, which `PageHeaderRenderer` hands the key: `true` draws `placedHeaderActions` from ui/packages/types/src/ui-action.ts over the object's actions as the metadata read serves them, the one placed-header reader `RecordDetailView`'s synthesized header reads too; a pair that skipped validation draws none of the object's actions and is reported once), and the `page:header` registration publishes the input. Its producers are the platform record pages `sys_user_detail` and `sys_organization_detail` (@objectstack/platform-objects) and `sys_approval_request_detail` (@objectstack/plugin-approvals), which set it in place of the frozen id lists that dropped another package's header actions. No row carries it for the reason above (component-level keys sit under the recorded undrilled `page/regions` container); the checkable record is the authorable-surface `ui/PageHeaderProps:placedActions` row and the key's own describe, which no longer carries the `[PLANNED — not yet rendered]` marker.", + "_note": "PageSchema (UI). Renderers live in objectui; objectui paths are cited with the `objectui:` realm marker (in `evidence` or `note` prose) and counted, not resolved against this repo (#5623). Seeded from the Studio page-design dogfood (framework#2254/#2261/#2265). Containers (variables/regions/interfaceConfig/slots/aria) classified at top level — one drill level, no divergent sub-statuses. The removed roadmap page types (record_review/blank) and their config fields (recordReview/blankLayout) were hard-removed — no longer authorable. RETIREMENT RECORD (#11027, 2026-08-24): `regions[].components[].responsive` is a retiredKey tombstone (ADR-0049 D2) — measured dead across both repos (zero callers of either objectui consumer implementation); the shared `ResponsiveConfigSchema` left with it. The walk drills one level only, so no component-level key has a row here (`page/regions` stays RECORDED in undrilled-containers.baseline.json — #4956's page-side instance, still open for the other component keys); the checkable record of THIS retirement is the authorable-surface `ui/PageComponent:responsive [RETIRED]` row, RETIRED_KEYS_BY_MAJOR[18], and the `page-component-responsive-removed` conversion. LIVE RECORD (#23016, 2026-10-12, maintainer ruling in the card body; rewritten from its PLANNED record by #24300 once the renderer shipped): `regions[].components[].dataSource` gained a second shape, the API binding `ElementApiDataSourceSchema` (`{ provider: 'api', read: { url, method? }, path? }`, `read.url` a same-origin API path refused at parse otherwise, no credential key) — LIVE: measured at the console pin `.objectui-sha` @0707b4ae3712, which carries the renderer, objectui @c4dd7078ed (objectstack-ai/objectui#12197). The console reads it on every page element (objectui: packages/react/src/SchemaRenderer.tsx calls useElementApiDataSource for each node it renders; the read is objectui: packages/react/src/element-data-source/useElementApiDataSource.ts, which parses the binding with this schema first, sends one GET to `read.url` through the host's signed-in fetch and selects `path`) and binds the selected value as `data` in the element's expression holes, in its `visibleWhen` and in its subtree, drawing a loading or error panel until the value is in; the generic stat / usage-bar / checklist blocks take it as their `dataSource` (objectui: packages/app-shell/src/console/blocks/productBlocks.tsx). No row carries it because the walk never reaches a component-level key (`page/regions` and `page/slots` are recorded undrilled containers) and `childShape()` does not descend the `z.union` the key now is; the checkable record is the authorable-surface `ui/ElementApiDataSource:*` rows and the schema's own describe, which no longer carries the `[PLANNED — not yet rendered]` marker. LIVE RECORD (#23134, 2026-10-13, ruling B on objectstack-ai/objectui#12296, ruling comment 6137226306; rewritten from its PLANNED record by #23585 once the renderer shipped): `regions[].components[].properties.parentDataSource` on `record:related_list` (`RecordRelatedListProps` in packages/spec/src/ui/component.zod.ts) is the block's PARENT-record binding, the element object binding `ElementDataSourceSchema` by reference, read by the single-record rule (the first row by `sort`; no row is a loud absence, never an empty list); the node-level `dataSource` on the block keeps its child-row meaning (#6953). LIVE: measured at the console pin `.objectui-sha` @4016370af3c9, which carries the renderer, objectui @d81e46043 (objectstack-ai/objectui#12407, the related-list leg of objectstack-ai/objectui#12294). The block hands the key to its parent read (objectui: packages/plugin-detail/src/renderers/record-related-list.tsx, whose RecordRelatedListRenderer passes `schema.parentDataSource` to ParentRecordBinding; the read is objectui: packages/plugin-detail/src/renderers/recordBinding.tsx, whose BoundRecordProvider asks the page's own adapter, so under the caller's identity, for one row (`$top: 1`) by the binding's `sort` and provides it as the record context the list body reads, `relationshipValueField` included). No row, or a read the server refuses as forbidden, draws the block's loud absence (NoParentRecord) in its place and queries no child rows; with the key absent, ParentRecordBinding leaves the list as it is and the record page's record context remains the parent. No row carries it for the reason above (component-level keys sit under the recorded undrilled `page/regions` container); the checkable record is the authorable-surface `ui/RecordRelatedListProps:parentDataSource` row and the key's own describe, which no longer carries the `[PLANNED — not yet rendered]` marker. PLANNED RECORD (#24266, 2026-10-18, objectstack-ai/cloud#2774 Q2 = B as the card quotes it): `regions[].components[].properties.emptyState` on the three bound record blocks `record:details`, `record:highlights` and `record:quick_actions` (`RecordDetailsProps`, `RecordHighlightsProps`, `RecordQuickActionsProps` in packages/spec/src/ui/component.zod.ts) is the list view's own `EmptyStateSchema` by reference, drawn only when the block's node-level `dataSource` binding answers no row. PLANNED, not live: measured at objectui @79cb8c03e, the three blocks take their binding through objectui: packages/plugin-detail/src/renderers/recordBinding.tsx, which mounts a 0-row answer as a record context with no record, so each draws its own placeholder and nothing reads the key. Carrier: objectstack-ai/objectui#12932, dispatched once a spec release carrying the key is installable. No row carries it for the reason above (component-level keys sit under the recorded undrilled `page/regions` container); the checkable record is the authorable-surface `ui/RecordDetailsProps:emptyState`, `ui/RecordHighlightsProps:emptyState` and `ui/RecordQuickActionsProps:emptyState` rows and the keys' own `[PLANNED — not yet rendered]` describe. When that card lands, the marker leaves and this sentence is rewritten. LIVE RECORD (#30018, 2026-11-04, ruling record 6624172200 on #29951, letter A; rewritten from its PLANNED record by #29951's ui half once the reader landed): `regions[].components[].properties.placedActions` on `page:header` (`PageHeaderProps` in packages/spec/src/ui/component.zod.ts) is the explicit opt-in to draw every action of the bound object whose `locations` include `record` or `record_page`, read live, in place of an authored `actions` id list; `true` beside an authored `actions` list is refused at the key by the props door (`@objectstack/lint` `validateComponentProps`, rule `component-props-invalid`). LIVE: the header renderer reads it (ui/packages/components/src/renderers/layout/containers.tsx, `PageHeaderActions`, which `PageHeaderRenderer` hands the key: `true` draws `placedHeaderActions` from ui/packages/types/src/ui-action.ts over the object's actions as the metadata read serves them, the one placed-header reader `RecordDetailView`'s synthesized header reads too; a pair that skipped validation draws none of the object's actions and is reported once), and the `page:header` registration publishes the input. Its producers are the platform record pages `sys_user_detail` and `sys_organization_detail` (@objectstack/platform-objects) and `sys_approval_request_detail` (@objectstack/plugin-approvals), which set it in place of the frozen id lists that dropped another package's header actions. No row carries it for the reason above (component-level keys sit under the recorded undrilled `page/regions` container); the checkable record is the authorable-surface `ui/PageHeaderProps:placedActions` row and the key's own describe, which no longer carries the `[PLANNED — not yet rendered]` marker.", "props": { "source": { "status": "live", diff --git a/packages/spec/src/compose-stacks.test.ts b/packages/spec/src/compose-stacks.test.ts index 60c94b46ddf..574fe8a786c 100644 --- a/packages/spec/src/compose-stacks.test.ts +++ b/packages/spec/src/compose-stacks.test.ts @@ -530,7 +530,7 @@ describe('composeStacks + defineStack integration', () => { // ─── Action `order` sorting (mergeActionsIntoObjects) ─────────────── // Regression coverage for #2670: the record-header primary button is the first -// visible `record_header` action, so `order` must control which action lands +// visible `record_page` action, so `order` must control which action lands // first — instead of fragile cross-file registration order. describe('Action order sorting', () => { diff --git a/packages/spec/src/stack-bound-action-foreign-object.test.ts b/packages/spec/src/stack-bound-action-foreign-object.test.ts index af59baa3c10..1ca7240f5af 100644 --- a/packages/spec/src/stack-bound-action-foreign-object.test.ts +++ b/packages/spec/src/stack-bound-action-foreign-object.test.ts @@ -23,7 +23,7 @@ const manifest = { id: 'com.test.binder', name: 'binder', version: '1.0.0', type const OWN = { name: 'binder_note', label: 'Note', fields: { title: { type: 'text' as const, label: 'Title' } } }; const bound = (objectName: string) => ({ name: 'probe_bound', label: 'Probe', objectName, type: 'url' as const, target: 'https://example.com', - locations: ['record_header' as const], + locations: ['record_page' as const], }); const refusalOf = (config: unknown): any => { diff --git a/packages/spec/src/studio/action-location-retirement.test.ts b/packages/spec/src/studio/action-location-retirement.test.ts index f83e7ce06fa..ec698e75942 100644 --- a/packages/spec/src/studio/action-location-retirement.test.ts +++ b/packages/spec/src/studio/action-location-retirement.test.ts @@ -17,7 +17,7 @@ import { // `commandPalette`), consumed only by `ActionContributionSchema.location` // inside a Studio plugin manifest; // ./ui — the platform-canonical vocabulary for where an action renders -// in a RUNNING APP's UI (`list_toolbar`, …, `record_section`; 7 values at +// in a RUNNING APP's UI (`list`, …, `record_section`; 7 values at // the time of this rename, 6 since #6888 retired `global_nav`), whose // docblock declares it "single source of truth for the whole platform". // @@ -76,7 +76,7 @@ describe('studio ActionLocation dual-source retirement', () => { // declared in ui/action.zod.ts. Not just "same declaration everywhere" // — NO other entry may export the bare name at all. A re-export from // ./studio would share the declaration (green to the dual-source gate) - // while telling Studio plugin authors that `list_toolbar` & co. are + // while telling Studio plugin authors that `list` & co. are // valid manifest contribution locations — the C14/C15 lesson: a // re-export can lie about the domain even when the symbol is honest. for (const name of ['ActionLocationSchema', 'ActionLocation']) { @@ -109,14 +109,14 @@ describe('studio ActionLocation dual-source retirement', () => { } // The two vocabularies were disjoint precisely here — the app-UI values // must NOT leak into the Studio contribution enum: - expect(() => studio.ActionContributionLocationSchema.parse('list_toolbar')).toThrow(); + expect(() => studio.ActionContributionLocationSchema.parse('list')).toThrow(); expect(() => studio.ActionContributionLocationSchema.parse('record_section')).toThrow(); // ui side — untouched by THIS rename, and still the app-UI vocabulary // (`global_nav` left it later and separately, #6888). expect('ActionLocationSchema' in ui).toBe(true); expect('ACTION_LOCATIONS' in ui).toBe(true); - for (const loc of ['list_toolbar', 'record_header', 'record_section']) { + for (const loc of ['list', 'record_page', 'record_section']) { expect(() => ui.ActionLocationSchema.parse(loc)).not.toThrow(); } expect(() => ui.ActionLocationSchema.parse('toolbar')).toThrow(); @@ -137,6 +137,6 @@ describe('studio ActionLocation dual-source retirement', () => { // The authored VALUE domain did not move an inch with the TS rename; the // SAME document differing only in this one value stays illegal (so this // negative cannot pass for an unrelated reason): - expect(() => StudioPluginManifestSchema.parse(manifestWith('list_toolbar'))).toThrow(); + expect(() => StudioPluginManifestSchema.parse(manifestWith('list'))).toThrow(); }); }); diff --git a/packages/spec/src/ui/action-row-update.test.ts b/packages/spec/src/ui/action-row-update.test.ts index cf5121bf58b..44d49bc3a45 100644 --- a/packages/spec/src/ui/action-row-update.test.ts +++ b/packages/spec/src/ui/action-row-update.test.ts @@ -24,7 +24,7 @@ * - MIXING RULE: every executor-binding key beside `operation: 'update'` is * refused at ITS path with code `custom` and a message whose first sentence * names the executor the key belongs to; `patch` without the operation and - * `operation: 'update'` with nothing to write are refused; `list_toolbar` + * `operation: 'update'` with nothing to write are refused; `list` * is refused; the bulk-only operations are refused with the reason. * - BOUNDARIES: an inline page-element action cannot carry the keys; a * standalone action without `objectName` is refused by `defineStack`; the @@ -272,11 +272,11 @@ describe('mixing rule: one refusal per contradiction, at the contradicting key', } }); - it('refuses a `list_toolbar` location — no current record there; the selection bar is the bulk def\'s home', () => { + it('refuses a `list` location — no current record there; the selection bar is the bulk def\'s home', () => { const result = ActionSchema.safeParse({ ...duly, locations: ['record_page', 'list'] }); const issue = issueAt(result, 'locations.1'); expect(issue?.code).toBe('custom'); - expect(issue?.message).toMatch(/^`list_toolbar` has no current record — an `operation: 'update'` action writes ONE record, the one it runs on\./); + expect(issue?.message).toMatch(/^`list` has no current record — an `operation: 'update'` action writes ONE record, the one it runs on\./); expect(issueAt(result, 'locations.0')).toBeUndefined(); expect(ActionSchema.safeParse({ ...duly, locations: ['record', 'record_section'] }).success).toBe(true); }); diff --git a/packages/spec/src/ui/action.test.ts b/packages/spec/src/ui/action.test.ts index f825a5e6c1f..b5650b9808b 100644 --- a/packages/spec/src/ui/action.test.ts +++ b/packages/spec/src/ui/action.test.ts @@ -506,10 +506,10 @@ describe('ActionSchema', () => { describe('Action Locations', () => { it('should accept valid locations', () => { const locations = [ - 'list_toolbar', - 'list_item', - 'record_header', - 'record_more', + 'list', + 'record', + 'record_page', + 'record_row', 'record_related', 'record_section', ] as const; @@ -1244,7 +1244,7 @@ describe('ActionSchema - order', () => { })).toThrow(); }); - it('should combine order with variant and locations (record_header primary hint)', () => { + it('should combine order with variant and locations (record_page primary hint)', () => { const result = ActionSchema.parse({ name: 'approve', label: 'Approve', @@ -1255,7 +1255,7 @@ describe('ActionSchema - order', () => { }); expect(result.order).toBe(-10); expect(result.variant).toBe('primary'); - expect(result.locations).toContain('record_header'); + expect(result.locations).toContain('record_page'); }); }); @@ -1503,15 +1503,33 @@ describe('ACTION_LOCATIONS — canonical source of truth', () => { // of producing a silent runtime mismatch. it('exposes the full set of supported locations', () => { expect([...ACTION_LOCATIONS]).toEqual([ - 'list_toolbar', - 'list_item', - 'record_header', - 'record_more', + 'list', + 'record', + 'record_page', + 'record_row', 'record_related', 'record_section', ]); }); + // ─── objectstack#36495 — the page-part words are retired ──────────────── + // + // Locations say what an action acts on. The four words that named a part of + // a page are refused with the word to write instead, and the ADR-0087 + // conversion `action-locations-acted-on` rewrites stored and pre-19 sources. + it.each([ + ['list_toolbar', '`list`'], + ['list_item', '`record_row`'], + ['record_header', '`record_page`'], + ['record_more', "component: 'action:menu'"], + ])('refuses the retired page-part word %s with its prescription', (word, prescription) => { + const result = ActionLocationSchema.safeParse(word); + expect(result.success).toBe(false); + const message = result.success ? '' : result.error.issues.map((i) => i.message).join('\n'); + expect(message).toContain(`\`${word}\``); + expect(message).toContain(prescription); + }); + it('ActionLocationSchema accepts every value in ACTION_LOCATIONS', () => { for (const loc of ACTION_LOCATIONS) { expect(() => ActionLocationSchema.parse(loc)).not.toThrow(); diff --git a/packages/spec/src/ui/component-action-row-declarative-update.test.ts b/packages/spec/src/ui/component-action-row-declarative-update.test.ts index 9358eeb1b98..879c8929059 100644 --- a/packages/spec/src/ui/component-action-row-declarative-update.test.ts +++ b/packages/spec/src/ui/component-action-row-declarative-update.test.ts @@ -144,7 +144,7 @@ const MEMBERS: readonly Member[] = [ control: (k) => ({ ...UPDATE, [k]: 'script' }), }, { - title: "5. `operation: 'update'` + a `list_toolbar` location", + title: "5. `operation: 'update'` + a `list` location", keys: () => ({ ...UPDATE, locations: ['record_page', 'list'] }), at: () => ['locations', 1], control: () => ({ ...UPDATE, locations: ['record_page'] }), diff --git a/packages/spec/src/ui/component-record-blocks.test.ts b/packages/spec/src/ui/component-record-blocks.test.ts index 729c240d33a..e25942afde2 100644 --- a/packages/spec/src/ui/component-record-blocks.test.ts +++ b/packages/spec/src/ui/component-record-blocks.test.ts @@ -218,7 +218,7 @@ describe('ComponentPropsMap["record:quick_actions"]', () => { }); it('vets `location` against the spec\'s own ActionLocationSchema — one vocabulary, not a restatement', () => { - expect(RecordQuickActionsProps.parse({ location: 'record_more' }).location).toBe('record_more'); + expect(RecordQuickActionsProps.parse({ location: 'record_related' }).location).toBe('record_related'); expect(RecordQuickActionsProps.safeParse({ location: 'toolbar' }).success).toBe(false); // The retired location keeps its retirement prescription — proof the row // rides the shared enum rather than a copy of its values. @@ -236,7 +236,7 @@ describe('ComponentPropsMap["record:quick_actions"]', () => { }); it('materializes nothing for the silent author — no schema defaults', () => { - // `record_header` / `end` / `default` / `sm` are the renderer's fallbacks. + // `record_page` / `end` / `default` / `sm` are the renderer's fallbacks. // NOTE the measured empty-bar truth: with no `actionNames` (and no host // actions) the renderer resolves NOTHING and renders its placeholder — it // does NOT fall back to "every action at this location", whatever the diff --git a/packages/spec/src/ui/component.test.ts b/packages/spec/src/ui/component.test.ts index b55c5496c81..c29cde2fd99 100644 --- a/packages/spec/src/ui/component.test.ts +++ b/packages/spec/src/ui/component.test.ts @@ -144,8 +144,8 @@ describe('PageHeaderProps icon is retired — no renderer reads it', () => { }); // #30018 (ruling record 6624172200 on #29951, letter A): `placedActions` is the -// explicit opt-in to every action of the bound object placed at `record_header` -// / `record_more`, read live, beside the authored `actions` list, which keeps +// explicit opt-in to every action of the bound object placed at `record_page` +// (or `record`), inline or folded, read live, beside the authored `actions` list, which keeps // its #11592 meaning (an authored list is the whole set). The two are refused // together. Each refusal is asserted by code AND path, so a refusal for another // reason (a closed-shape `unrecognized_keys`, a type miss) cannot pass it; and diff --git a/ui/apps/console/src/__tests__/record-block-record-reach.test.tsx b/ui/apps/console/src/__tests__/record-block-record-reach.test.tsx index 7d6030fde79..f0330a5e16c 100644 --- a/ui/apps/console/src/__tests__/record-block-record-reach.test.tsx +++ b/ui/apps/console/src/__tests__/record-block-record-reach.test.tsx @@ -279,7 +279,7 @@ const SAMPLE_BY_INPUT: Readonly> = { // the same record renders differently twice and the stability control // (rightly) refuses to grade the probe. The header is not what this probe // asks about. - // - `record:quick_actions` reads `location || 'record_header'`, + // - `record:quick_actions` reads `location || 'record_page'`, // `align || 'end'`, `variant || 'default'`, `size || 'sm'`; the // probe action is declared at the header location, and the generic // samples (`'x'` for the two strings, the enum's first arm for the diff --git a/ui/apps/console/src/__tests__/registry-inputs-spec-parity.test.ts b/ui/apps/console/src/__tests__/registry-inputs-spec-parity.test.ts index c73aca5cab1..452d2dd0a86 100644 --- a/ui/apps/console/src/__tests__/registry-inputs-spec-parity.test.ts +++ b/ui/apps/console/src/__tests__/registry-inputs-spec-parity.test.ts @@ -2813,7 +2813,7 @@ const ACTION_LEAF_MEMBER_CLAIMS: Record = { bodyShape: 'The `object` arm\'s one member is `wrap`: `{ wrap: \'data\' }` nests the static values under `data` with `bodyExtra` riding flat beside it, while `flat` and an absent key send the same flat body — asserted on the body the runner\'s built-in `api` executor sends (objectui#11168 slice 1).', locations: - 'Members are placement names, read at dispatch by `@object-ui/core`\'s `createServerActionHandler` (the console\'s `script` handler is built on it): a list carrying a record-scoped member (`record_header`) refuses to run with no record or selection in scope — an error toast and no request — while an object-level list (`list_toolbar`) runs (objectui#11168 slice 1).', + 'Members are placement names, read at dispatch by `@object-ui/core`\'s `createServerActionHandler` (the console\'s `script` handler is built on it): a list carrying a record-scoped member (`record_page`) refuses to run with no record or selection in scope — an error toast and no request — while an object-level list (`list`) runs (objectui#11168 slice 1).', toast: 'Members `showOnSuccess` / `showOnError` / `duration`, each asserted on the toast handler the runner calls: `showOnSuccess: false` silences a success, `showOnError: false` silences a failure, and `duration` is handed to the toast; with no `toast` both outcomes are toasted (objectui#11168 slice 1).', resultDialog: @@ -3644,7 +3644,7 @@ const MEMBER_PINS: Record = { }, 'record:related_list.actions': { file: 'packages/plugin-detail/src/__tests__/RecordRelatedListRenderer.authoredActions-11163.test.tsx', - pins: 'Members are action-id STRINGS resolved against the RELATED object\'s own `actions` — the `useMetadataItem` + `resolveDeclaredActionIds` lookup `record:quick_actions.actionNames` resolves through — and placed by each action\'s own `locations`, read through the real `SchemaRenderer`, this block\'s registration, the real `RelatedList` and the real data table. An authored list renders IN AUTHORED ORDER (`list_toolbar` members as header buttons, `list_item` members in each row\'s menu, one list feeding both) and REPLACES the host bridge\'s default rather than adding to it; an ABSENT key leaves the bridge\'s actions exactly as they were and makes no lookup at all (the control); `[]` draws none while the built-in New stays, because New is not an action id; and an authored action runs through the host\'s executor with its resolved definition. The refusals are member facts too: an id the registry cannot resolve and an id whose action declares neither list location are each named in a `role="status"` notice while the resolvable members still render, an array of inline action objects is refused whole, nothing is refused while the lookup is in flight, and with no host the list stays read-only while a bad id is still refused, so the refusal is the registry\'s and not the host\'s. New file (objectui#11163, the ENFORCE ruling on objectstack#20665), replacing the `NO_READ_SITE_TO_PIN` exemption this key carried since objectui#8071 slice 2.', + pins: 'Members are action-id STRINGS resolved against the RELATED object\'s own `actions` — the `useMetadataItem` + `resolveDeclaredActionIds` lookup `record:quick_actions.actionNames` resolves through — and placed by each action\'s own `locations`, read through the real `SchemaRenderer`, this block\'s registration, the real `RelatedList` and the real data table. An authored list renders IN AUTHORED ORDER (`list` members as header buttons, `record_row` members in each row\'s menu, one list feeding both) and REPLACES the host bridge\'s default rather than adding to it; an ABSENT key leaves the bridge\'s actions exactly as they were and makes no lookup at all (the control); `[]` draws none while the built-in New stays, because New is not an action id; and an authored action runs through the host\'s executor with its resolved definition. The refusals are member facts too: an id the registry cannot resolve and an id whose action declares neither list location are each named in a `role="status"` notice while the resolvable members still render, an array of inline action objects is refused whole, nothing is refused while the lookup is in flight, and with no host the list stays read-only while a bad id is still refused, so the refusal is the registry\'s and not the host\'s. New file (objectui#11163, the ENFORCE ruling on objectstack#20665), replacing the `NO_READ_SITE_TO_PIN` exemption this key carried since objectui#8071 slice 2.', }, 'record:related_list.add': { file: 'packages/plugin-detail/src/__tests__/recordRelatedListInputs.spec-parity.test.ts', diff --git a/ui/apps/console/src/record-header-preview.tsx b/ui/apps/console/src/record-header-preview.tsx index 62fa3f1cd10..ad9c0ab423a 100644 --- a/ui/apps/console/src/record-header-preview.tsx +++ b/ui/apps/console/src/record-header-preview.tsx @@ -2,7 +2,7 @@ * DEV-ONLY record-header api-action preview (objectui#3391). * * Mounts the REAL RecordDetailView with a stub dataSource and no backend so - * the `record_header` `type:'api'` `{field}`-interpolation fix can be + * the `record_page` `type:'api'` `{field}`-interpolation fix can be * browser-verified: clicking the header action must PATCH * `/api/v1/data/os_tianshun_ehr_production_plan/plan-42` — not the literal * `{id}` (`%7Bid%7D`) the bug sent. diff --git a/ui/e2e/live/record-topbar-35853.spec.ts b/ui/e2e/live/record-topbar-35853.spec.ts index 1352790bac1..096cd50ba2b 100644 --- a/ui/e2e/live/record-topbar-35853.spec.ts +++ b/ui/e2e/live/record-topbar-35853.spec.ts @@ -13,7 +13,7 @@ import { test, expect, type Locator, type Page } from '@playwright/test'; * 12 px). On a phone the bar is the one-row phone bar. * * Drives the real Console against the real showcase backend. The task record - * page (`showcase_task_detail`) authors three `record_header` actions; the + * page (`showcase_task_detail`) authors three `record_page` actions; the * account page is synthesized, with a tab row. */ @@ -107,7 +107,7 @@ test.describe('record header at 1280 px', () => { }); test('the header shows three authored actions by default, on one line', async ({ page }) => { - // The task page authors Mark Done, Log Time and Archive as record_header + // The task page authors Mark Done, Log Time and Archive as record_page // actions (Mark Done hides on a finished task), plus the host's Edit. await openFromList(page, 'showcase_task', 2); const record = page.locator(BAR).locator(RECORD); @@ -116,7 +116,7 @@ test.describe('record header at 1280 px', () => { await expect(actions.getByRole('button', { name: 'Log Time' })).toBeVisible(); await expect(actions.getByRole('button', { name: 'Archive' })).toBeVisible(); await expect(actions.getByRole('button', { name: 'Edit' })).toBeVisible(); - // The authored actions beyond three, and record_more, are under ⋯. + // The authored actions beyond three, and the folded ones (component: 'action:menu'), are under ⋯. await expect(actions.getByRole('button', { name: /more/i })).toBeVisible(); expect(await actionsOnOneLine(record)).toBe(true); }); diff --git a/ui/e2e/record-header-title-width.spec.ts b/ui/e2e/record-header-title-width.spec.ts index f729467fea7..2c9db08355a 100644 --- a/ui/e2e/record-header-title-width.spec.ts +++ b/ui/e2e/record-header-title-width.spec.ts @@ -35,7 +35,7 @@ import { uiRoot } from '../scripts/ui-root.mjs'; * * ## Calibration against the running app (Chromium, console dev server, * `type: 'detail'` and ``, three labelled - * `record_header` actions, viewport 799px, objectui#7281): + * `record_page` actions, viewport 799px, objectui#7281): * * DetailView before: h1 6.17px of a 218px scrollWidth, tail 724.83px * after: h1 218.39px, tail wrapped to its own line @@ -151,7 +151,7 @@ const ICON_BUTTON = 'h-10 w-10 shrink-0'; * arbitrate at all. * * So these two match what the running app actually produced with three - * labelled `record_header` actions at 799px (DetailView 724.83px, + * labelled `record_page` actions at 799px (DetailView 724.83px, * PageHeader 564.41px), not a width chosen to make a floor look needed: * DetailView 4 x 176px + 3 x 6px (`gap-1.5`) = 722px * PageHeader 3 x 192px + 2 x 8px (`gap-2`) = 592px diff --git a/ui/e2e/toast-under-modal.spec.ts b/ui/e2e/toast-under-modal.spec.ts index 39e50c79862..190850e575a 100644 --- a/ui/e2e/toast-under-modal.spec.ts +++ b/ui/e2e/toast-under-modal.spec.ts @@ -60,7 +60,7 @@ import { uiRoot } from '../scripts/ui-root.mjs'; * nothing. The components' `lib/utils` imports it for its slot helpers, * which the drawer does not call. * - The overlay's content is a stand-in for `RecordDetailView`: the record - * title and two `record_header` actions in its first row, then filler. + * title and two `record_page` actions in its first row, then filler. * Every control in it logs its clicks, so a click that falls through a toast * onto the record is caught. * - Toasts are raised by calling sonner's `toast.success` with an `Undo` @@ -139,7 +139,7 @@ let openOverlay = () => {}; const button = (label, what) => h('button', { type: 'button', className: 'h-9 px-4 rounded-md border', onClick: record(what) }, label); -/** RecordDetailView's first row (title, record_header actions), then filler. */ +/** RecordDetailView's first row (title, record_page actions), then filler. */ function RecordContent() { return h('div', { onClick: record('record') }, h('div', { className: 'flex items-center justify-between gap-4 px-6 py-4 border-b' }, diff --git a/ui/packages/app-shell/src/environment/EnvironmentListToolbar.tsx b/ui/packages/app-shell/src/environment/EnvironmentListToolbar.tsx index 60d6b20e11d..ec5e557ba39 100644 --- a/ui/packages/app-shell/src/environment/EnvironmentListToolbar.tsx +++ b/ui/packages/app-shell/src/environment/EnvironmentListToolbar.tsx @@ -1,6 +1,6 @@ /** * EnvironmentListToolbar — the state-aware replacement for the generic - * `list_toolbar` action bar on the `sys_environment` list. + * `list` action bar on the `sys_environment` list. * * The cloud serves ONE `create_environment` action; born-with-env makes its * meaning depend on org state (which the action metadata can't express). This @@ -150,7 +150,7 @@ export function EnvironmentListToolbar({ actions, entitlements }: Props) { // so a create action the caller may not invoke was counted here and dropped // there. const toolbarActions = (actions || []).filter( - (a: any) => actionRendersAt(a, 'list_toolbar') && mayInvoke(a?.requiredPermissions), + (a: any) => actionRendersAt(a, 'list') && mayInvoke(a?.requiredPermissions), ); const hasCreateAction = toolbarActions.some((a: any) => a?.name === CREATE_ACTION); const ctaKind = entitlements?.ready ? decideEnvironmentCta(entitlements) : null; diff --git a/ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.test.tsx b/ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.test.tsx index 35e8d59c723..612014c175d 100644 --- a/ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.test.tsx +++ b/ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.test.tsx @@ -627,8 +627,8 @@ describe('modalActionHandler — a modal action is CLIENT-SIDE ONLY (objectstack }); }); -describe('flowHandler — list_toolbar selection fallback', () => { - // Toolbar-invoked flow actions carry no `_rowRecord` (that's a list_item / +describe('flowHandler — list selection fallback', () => { + // Toolbar-invoked flow actions carry no `_rowRecord` (that's a record_row / // row-menu concept). The grid publishes its checkbox selection into the // shared ActionRunner context as `selectedRecords`; with exactly one row // selected the flow must receive that row's id as recordId, otherwise a @@ -673,7 +673,7 @@ describe('flowHandler — list_toolbar selection fallback', () => { expect(authFetchSpy).not.toHaveBeenCalled(); }); - it('blocks a record-scoped flow (locations include list_item) launched with zero rows selected (#2210)', async () => { + it('blocks a record-scoped flow (locations include record_row) launched with zero rows selected (#2210)', async () => { // BulkReassignAction shape: mounts on rows AND the toolbar. From the // toolbar with nothing selected there is no record to run on — pre-fix // the wizard opened anyway and died at the first record-bound node @@ -717,7 +717,7 @@ describe('flowHandler — list_toolbar selection fallback', () => { expect(body.recordId ?? null).toBeNull(); }); - it('an explicit _rowRecord (list_item invocation) still wins over the selection', async () => { + it('an explicit _rowRecord (record_row invocation) still wins over the selection', async () => { authFetchSpy.mockResolvedValue({ ok: true, json: async () => ({ success: true, data: {} }) }); const { result } = renderHook(() => useConsoleActionRuntime({ dataSource: {}, objects: [] }), @@ -1077,7 +1077,7 @@ describe('apiHandler — recordIdParam seeding refuses instead of under-specifyi }); }); -describe('serverActionHandler — list_toolbar selection fallback', () => { +describe('serverActionHandler — list selection fallback', () => { it('uses the single selected row from the runner context as recordId', async () => { authFetchSpy.mockResolvedValue({ ok: true, json: async () => ({ success: true, data: {} }) }); const { result } = renderHook(() => diff --git a/ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.undoLookupId-11122.test.tsx b/ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.undoLookupId-11122.test.tsx index 2b875170d6b..0f699015902 100644 --- a/ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.undoLookupId-11122.test.tsx +++ b/ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.undoLookupId-11122.test.tsx @@ -19,7 +19,7 @@ * `DeclaredActionsBar` mount): * * - a `type: 'api'` row action (the shape of objectstack's published - * `ReassignLeadAction`: undoable, on `list_item`, writing a lookup), run by + * `ReassignLeadAction`: undoable, on `record_row`, writing a lookup), run by * the runtime's own `api` handler, which looks the object's field * definitions up itself; * - an `operation: 'update'` row action, run by `ActionRunner`, which reads diff --git a/ui/packages/app-shell/src/hooks/__tests__/useOfferedNavRunAction.test.tsx b/ui/packages/app-shell/src/hooks/__tests__/useOfferedNavRunAction.test.tsx index d595bc7397b..083fa5b5cb7 100644 --- a/ui/packages/app-shell/src/hooks/__tests__/useOfferedNavRunAction.test.tsx +++ b/ui/packages/app-shell/src/hooks/__tests__/useOfferedNavRunAction.test.tsx @@ -59,7 +59,7 @@ const paramNow = () => new URL(window.location.href).searchParams.get(NAV_RUN_AC /** What `ObjectView` does with the hook's answer, verbatim in shape. */ function Toolbar({ actions, enabled = true }: { actions: any[]; enabled?: boolean }) { - const armed = useOfferedNavRunAction(actions, (a: any) => actionRendersAt(a, 'list_toolbar'), enabled); + const armed = useOfferedNavRunAction(actions, (a: any) => actionRendersAt(a, 'list'), enabled); const composed = armed === null ? actions : actions.map((a) => (a?.name === armed ? { ...a, autoTrigger: true } : a)); // Typed as the `action:bar` node it is (objectui#11355), as `ObjectView` types its own. const bar: ActionBarSchema = { type: 'action:bar', location: 'list', actions: composed }; diff --git a/ui/packages/app-shell/src/hooks/useConsoleActionRuntime.tsx b/ui/packages/app-shell/src/hooks/useConsoleActionRuntime.tsx index 6e1a02cf701..6c4a2dc6042 100644 --- a/ui/packages/app-shell/src/hooks/useConsoleActionRuntime.tsx +++ b/ui/packages/app-shell/src/hooks/useConsoleActionRuntime.tsx @@ -634,7 +634,7 @@ export function useConsoleActionRuntime(opts: ConsoleActionRuntimeOptions): Cons // meaningful when an object context exists (ObjectView); pages without an // object resolve their actions through the absolute path above. const obj = action.objectName || objApiName; - // The row record is stashed under `_rowRecord` for list_item actions — + // The row record is stashed under `_rowRecord` for record_row actions — // separate it from the field values, and resolve the record id from it // (the action's static params carry the field changes, not the id). const rowRecord = (params as any)._rowRecord as Record | undefined; @@ -759,7 +759,7 @@ export function useConsoleActionRuntime(opts: ConsoleActionRuntimeOptions): Cons // The record a launch runs on, by the ONE selection rule the `script` // launcher uses (objectui#12331): `@object-ui/core`'s // `resolveServerActionRecordId`. An explicit `params.recordId`, then the - // list_item row (`_rowRecord`), then — for a list_toolbar launch, which + // record_row row (`_rowRecord`), then — for a list launch, which // carries no row — the grid's checkbox selection (`selectedRecords`, // published into the runner context by ObjectGrid). One row supplies the // record. Several rows are refused: a flow takes a single `recordId` diff --git a/ui/packages/app-shell/src/layout/InboxApprovalItem.tsx b/ui/packages/app-shell/src/layout/InboxApprovalItem.tsx index 5f786a23221..4de38fdbea8 100644 --- a/ui/packages/app-shell/src/layout/InboxApprovalItem.tsx +++ b/ui/packages/app-shell/src/layout/InboxApprovalItem.tsx @@ -11,7 +11,7 @@ * (objectstack#34589). * * The decision levers are NOT drawn here: they are the request's own declared - * actions at `list_item` (`approval_approve`, `approval_reject` on + * actions at `record_row` (`approval_approve`, `approval_reject` on * `sys_approval_request`), run through `DeclaredActionsBar` — the governed * path the record page and the decision panel already run them through. So * whether a viewer sees a lever is the action's own `visible` predicate over @@ -34,7 +34,7 @@ import { timeAgo } from '../utils/relativeTime.js'; const APPROVAL_REQUEST_OBJECT = 'sys_approval_request'; /** The declared location of the inline levers (approve / reject). */ -const INLINE_DECISION_LOCATION = 'list_item'; +const INLINE_DECISION_LOCATION = 'record_row'; /** The phone tap floor, as the rest of the panel spells it. */ const PHONE_TAP = 'max-md:min-h-11'; diff --git a/ui/packages/app-shell/src/layout/__tests__/InboxPopover.rightPanel-34589.test.tsx b/ui/packages/app-shell/src/layout/__tests__/InboxPopover.rightPanel-34589.test.tsx index da78bd23ddb..06622c39b49 100644 --- a/ui/packages/app-shell/src/layout/__tests__/InboxPopover.rightPanel-34589.test.tsx +++ b/ui/packages/app-shell/src/layout/__tests__/InboxPopover.rightPanel-34589.test.tsx @@ -9,7 +9,7 @@ * in the page beside it neither closes it nor is swallowed by it; * - "Needs your action" heads the Notifications tab, one item per pending * request, and each item's levers are the request's OWN declared actions - * (`DeclaredActionsBar` over `sys_approval_request` at `list_item`, with + * (`DeclaredActionsBar` over `sys_approval_request` at `record_row`, with * the served row as the dispatch record), not a third approvals client; * - a decision taken there drops the row and the badge at once and asks the * feed to re-read; @@ -183,12 +183,12 @@ describe('InboxPopover — pending approvals pinned on top, decided in place (ob expect(within(section).getByText('Purchase approval · PO-001')).toBeTruthy(); }); - it("runs each request's own declared actions at list_item, with the served row as the dispatch record", () => { + it("runs each request's own declared actions at record_row, with the served row as the dispatch record", () => { render(bell()); openInbox(); expect(barProps).toHaveLength(2); expect(barProps.map((p) => p.objectName)).toEqual(['sys_approval_request', 'sys_approval_request']); - expect(barProps.map((p) => p.location)).toEqual(['list_item', 'list_item']); + expect(barProps.map((p) => p.location)).toEqual(['record_row', 'record_row']); // the row carrying the server-computed `viewer` block the actions gate on expect(barProps[0].record).toBe(approvals[0].row); expect(barProps[1].record).toBe(approvals[1].row); diff --git a/ui/packages/app-shell/src/layout/__tests__/designModeHeaderPinsModel-36366.test.ts b/ui/packages/app-shell/src/layout/__tests__/designModeHeaderPinsModel-36366.test.ts index df1de8f3882..e969b4c98c6 100644 --- a/ui/packages/app-shell/src/layout/__tests__/designModeHeaderPinsModel-36366.test.ts +++ b/ui/packages/app-shell/src/layout/__tests__/designModeHeaderPinsModel-36366.test.ts @@ -54,7 +54,7 @@ describe('the header pins under the design mode (objectstack#36366)', () => { expect(servedPins({ actionLayout: { record: ['convert'], list: { more: ['x'] } } })).toEqual({}); }); - it("with no arm set the panel shows the header's own first three: by order, record_header only, never an action:menu", () => { + it("with no arm set the panel shows the header's own first three: by order, record_page only, never an action:menu", () => { expect(defaultPins(ACTIONS, 'record')).toEqual(['convert', 'mark_won', 'clone']); expect(defaultPins(ACTIONS, 'list')).toEqual(['new_task', 'mass_assign']); const candidates = pinCandidates(ACTIONS, 'record', []); diff --git a/ui/packages/app-shell/src/layout/designModeHeaderPinsModel.ts b/ui/packages/app-shell/src/layout/designModeHeaderPinsModel.ts index 5b16ed6579d..90b201665f0 100644 --- a/ui/packages/app-shell/src/layout/designModeHeaderPinsModel.ts +++ b/ui/packages/app-shell/src/layout/designModeHeaderPinsModel.ts @@ -65,9 +65,10 @@ type PinnableAction = { }; /** The locations whose actions a scope's header places. */ -const PAGE_LOCATIONS: Readonly> = { - list: ['list_toolbar'], - record: ['record_header', 'record_more'], +const PAGE_LOCATIONS: Readonly> = { + list: ['list'], + // `actionRendersAt` draws a `record` action at `record_page` too. + record: ['record_page'], }; /** Whether `action` is placed in `page`'s scope. */ @@ -97,16 +98,15 @@ function headerSort(actions: readonly T[]): T[] { /** * What the header draws as buttons while the object sets no arm for `page`: * the first three of its row's actions by the header's own sort. On the record - * page the row's actions are those placed at `record_header` (one placed at - * `record_more` only is in ⋯ already); an action authored into ⋯ - * (`component: 'action:menu'`) is never a button. + * page the row's actions are those placed on it (`record` / `record_page`); + * an action folded into ⋯ (`component: 'action:menu'`) is never a button. */ export function defaultPins(actions: readonly PinnableAction[], page: PinPage): string[] { const row = actions.filter( (a) => typeof a.name === 'string' && a.component !== 'action:menu' && - (page === 'list' ? actionRendersAt(a as never, 'list_toolbar') : actionRendersAt(a as never, 'record_header')), + (page === 'list' ? actionRendersAt(a as never, 'list') : actionRendersAt(a as never, 'record_page')), ); return headerSort(row) .slice(0, PIN_LIMIT) diff --git a/ui/packages/app-shell/src/utils/__tests__/managedByEmptyState.test.ts b/ui/packages/app-shell/src/utils/__tests__/managedByEmptyState.test.ts index 668c2161e66..ae01cb01290 100644 --- a/ui/packages/app-shell/src/utils/__tests__/managedByEmptyState.test.ts +++ b/ui/packages/app-shell/src/utils/__tests__/managedByEmptyState.test.ts @@ -131,7 +131,7 @@ describe('resolveManagedByEmptyState', () => { /** * The toolbar half of "the page offers a create action": the same three - * questions `action:bar` and `action:button` ask of a `list_toolbar` action. + * questions `action:bar` and `action:button` ask of a `list` action. */ describe('listToolbarDrawsAction (objectui#11687)', () => { const allowAll = () => true; diff --git a/ui/packages/app-shell/src/utils/managedByEmptyState.ts b/ui/packages/app-shell/src/utils/managedByEmptyState.ts index f72e59cb7fa..4fe111b997c 100644 --- a/ui/packages/app-shell/src/utils/managedByEmptyState.ts +++ b/ui/packages/app-shell/src/utils/managedByEmptyState.ts @@ -46,7 +46,7 @@ export interface ManagedByEmptyState { * actions? (objectui#11687) * * The answer is the toolbar's own verdict, asked with the same predicates the - * `action:bar` → `action:button` pair applies to `list_toolbar`: placement + * `action:bar` → `action:button` pair applies to `list`: placement * through `actionRendersAt`, the capability gate the caller passes in (the * `useCapabilityGate` closure), and the action's `visible` gate, asked through * `hasDeclaredPredicate` and evaluated fail-closed with no row bound — a list @@ -58,7 +58,7 @@ export interface ManagedByEmptyState { * Why "the toolbar draws an action" may stand for "the page offers a way to * add a row" in the `better-auth` arm, without asking an action what it does: * read off objectstack's platform objects when objectui#11687 landed, every - * `list_toolbar` action on a `better-auth` object either adds a row (Invite + * `list` action on a `better-auth` object either adds a row (Invite * User, Register OAuth Application, Create Team, Enable 2FA, …) or sits on a * list whose every view is filtered ("Sign out other devices" on sessions), so * an empty one gets the list's view-filter copy rather than first-run copy. @@ -78,7 +78,7 @@ export function listToolbarDrawsAction( requiredPermissions?: unknown; visible?: unknown; }; - if (!actionRendersAt(action, 'list_toolbar')) return false; + if (!actionRendersAt(action, 'list')) return false; if (!mayInvoke(action.requiredPermissions)) return false; if (isActionSwitchedOff(action)) return false; if (!hasDeclaredPredicate(action.visible)) return true; @@ -96,7 +96,7 @@ export function listToolbarDrawsAction( /** * @param pageOffersCreate The list page offers a way to add a row: its generic - * New button, or a `list_toolbar` action it draws + * New button, or a `list` action it draws * ({@link listToolbarDrawsAction}). The `better-auth` arm's copy says rows * are "not added by hand here", which that page contradicts (objectui#11687). */ diff --git a/ui/packages/app-shell/src/utils/recordReadServed.ts b/ui/packages/app-shell/src/utils/recordReadServed.ts index 04bd1e1748b..aa1e940b7a3 100644 --- a/ui/packages/app-shell/src/utils/recordReadServed.ts +++ b/ui/packages/app-shell/src/utils/recordReadServed.ts @@ -14,7 +14,7 @@ * ['list']`, a list-only object — has no record surface: its record page and * drawer could only answer `OBJECT_API_METHOD_NOT_ALLOWED`. So nothing opens * one for it: not its list rows, not a related list, not a link to one of its - * records. Its row menu (`list_item` actions) is not a record surface and + * records. Its row menu (`record_row` actions) is not a record surface and * stays. * * The verdict reads the effective operation set the server hands down diff --git a/ui/packages/app-shell/src/views/DeclaredActionsBar.tsx b/ui/packages/app-shell/src/views/DeclaredActionsBar.tsx index d583204e8dc..142f12cef38 100644 --- a/ui/packages/app-shell/src/views/DeclaredActionsBar.tsx +++ b/ui/packages/app-shell/src/views/DeclaredActionsBar.tsx @@ -13,7 +13,7 @@ * A bespoke page (e.g. the approvals inbox) that already has a record in hand * can drop this bar in to surface the actions the backend declares on that * object (`objectDef.actions[]`) — filtered to a `location` - * (`record_section`, `record_header`, …) and each action's `visible` CEL — + * (`record_section`, `record_page`, …) and each action's `visible` CEL — * and have them execute through the *same* console action runtime ObjectView / * RecordDetailView use: confirm dialogs, param-collection dialogs, result * dialogs, the authenticated api/flow/server handlers, and refresh-after. @@ -60,6 +60,7 @@ import { useActionTextLocalizer, } from '@object-ui/react'; import { isActionSwitchedOff, type ActionDef } from '@object-ui/core'; +import { actionRendersAt, type ActionLocation } from '@object-ui/types'; import type { ConsoleActionDispatch } from '../consoleActionDispatch.js'; import { useObjectTranslation } from '@object-ui/i18n'; import { ChevronDown, Loader2, MoreHorizontal, ShieldAlert } from 'lucide-react'; @@ -1430,8 +1431,9 @@ export function DeclaredActionsBar({ const drop = exclude && exclude.length ? new Set(exclude) : null; return allActions.filter( (a: any) => - Array.isArray(a?.locations) && - a.locations.includes(location) && + // Placement is `actionRendersAt`'s: `record` is drawn at `record_row` + // and `record_page` too (objectstack#36495). + actionRendersAt(a, location as ActionLocation) && !(drop && drop.has(a?.name)), ); }, diff --git a/ui/packages/app-shell/src/views/ObjectView.bulkWiredHeaderDuplicate-12462.test.tsx b/ui/packages/app-shell/src/views/ObjectView.bulkWiredHeaderDuplicate-12462.test.tsx index 51312b3d8c8..7fac058dd6b 100644 --- a/ui/packages/app-shell/src/views/ObjectView.bulkWiredHeaderDuplicate-12462.test.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.bulkWiredHeaderDuplicate-12462.test.tsx @@ -8,7 +8,7 @@ /** * objectui#12462 (ruling A-narrow) — the list page's header does not draw a - * duplicate of a `list_toolbar` action that the ACTIVE view wires to its + * duplicate of a `list` action that the ACTIVE view wires to its * selection bar AND that is record-scoped. * * Measured on HotCRM's Leads list: `create_campaign` ("Add to Campaign", @@ -97,7 +97,7 @@ const CREATE_CAMPAIGN = { params: [{ name: 'campaign', type: 'text', label: 'Campaign', required: true }], }; -/** A plain `list_toolbar` action: object-level, it runs with nothing selected. */ +/** A plain `list` action: object-level, it runs with nothing selected. */ const REFRESH_SCORES = { name: 'refresh_scores', label: 'Refresh Scores', @@ -222,7 +222,7 @@ async function tickRows(n: number): Promise { const addToCampaignIn = (el: HTMLElement) => within(el).queryByRole('button', { name: /Add to Campaign/ }); -describe('objectui#12462 — a bulk-wired, record-scoped list_toolbar action leaves the header for the selection bar', () => { +describe('objectui#12462 — a bulk-wired, record-scoped list action leaves the header for the selection bar', () => { it('the view wires it in `bulkActions`: the plain action stays in the header, Add to Campaign is only in the bar', async () => { mountLeads('all_leads'); const header = await headerWithToolbar(); diff --git a/ui/packages/app-shell/src/views/ObjectView.emptyStateMatchesPage-11687.test.tsx b/ui/packages/app-shell/src/views/ObjectView.emptyStateMatchesPage-11687.test.tsx index 709e1c9ca5b..71746b867a0 100644 --- a/ui/packages/app-shell/src/views/ObjectView.emptyStateMatchesPage-11687.test.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.emptyStateMatchesPage-11687.test.tsx @@ -27,7 +27,7 @@ * spec's `lowerRequiresFeature` / `lowerRequiresMembershipReach` order. * * API Keys is the page that offers NO create action — `sys_api_key` declares - * no `list_toolbar` action and leaves `create` at the bucket default (off); + * no `list` action and leaves `create` at the bucket default (off); * keys are minted elsewhere. So it keeps the identity copy, and it is the * negative control for the first defect. The single-org Invitations case is * the other control: the same object, its Invite User hidden by its own gate, diff --git a/ui/packages/app-shell/src/views/ObjectView.headerSelectionGate-27831.test.tsx b/ui/packages/app-shell/src/views/ObjectView.headerSelectionGate-27831.test.tsx index 540c03235b1..3ed9736c056 100644 --- a/ui/packages/app-shell/src/views/ObjectView.headerSelectionGate-27831.test.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.headerSelectionGate-27831.test.tsx @@ -10,8 +10,8 @@ * objectstack#27831 — a single-record action in a list's header is drawn the * way a launch of it would end. * - * The showcase's Tasks → "Reassign…" (`type: 'flow'`, placed at `list_item` and - * `list_toolbar`) was drawn enabled with nothing selected, and said "select a + * The showcase's Tasks → "Reassign…" (`type: 'flow'`, placed at `record_row` and + * `list`) was drawn enabled with nothing selected, and said "select a * row first" only after a click; on a list whose rows draw no checkbox it could * never work at all. * @@ -102,7 +102,7 @@ const REASSIGN = { refreshAfter: true, }; -/** CONTROL: an object-level header action — declared at `list_toolbar` alone. */ +/** CONTROL: an object-level header action — declared at `list` alone. */ const EXPORT_TASKS = { name: 'showcase_export_tasks', label: 'Export Tasks', diff --git a/ui/packages/app-shell/src/views/ObjectView.listOnlyRecordPage-33219.test.tsx b/ui/packages/app-shell/src/views/ObjectView.listOnlyRecordPage-33219.test.tsx index 388045be5b2..7b002bb606f 100644 --- a/ui/packages/app-shell/src/views/ObjectView.listOnlyRecordPage-33219.test.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.listOnlyRecordPage-33219.test.tsx @@ -22,7 +22,7 @@ * - a ⌘-click opens no tab, and the name is no anchor a new tab follows; * - the name cell draws no 「Open as full page」 ↗; * - a `?recordId=` link opens no drawer and reads no record; - * - the row menu still offers the object's `list_item` action (Revoke); + * - the row menu still offers the object's `record_row` action (Revoke); * - CONTROL: the same object served with no restriction — the row click * opens the drawer, as every object's does. * @@ -267,7 +267,7 @@ describe('objectstack#33219 — a list-only object\'s rows open no record page', expect(findOne).not.toHaveBeenCalled(); }); - it('the row menu still offers the object\'s `list_item` action', async () => { + it('the row menu still offers the object\'s `record_row` action', async () => { await mountList(LIST_ONLY_OPERATIONS); expect(await rowMenuItems('okta-staging')).toContain('Revoke'); }); diff --git a/ui/packages/app-shell/src/views/ObjectView.objectBoundActions-7234.test.tsx b/ui/packages/app-shell/src/views/ObjectView.objectBoundActions-7234.test.tsx index 151a6ba4077..335e5796bdf 100644 --- a/ui/packages/app-shell/src/views/ObjectView.objectBoundActions-7234.test.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.objectBoundActions-7234.test.tsx @@ -32,8 +32,8 @@ * * `action:bar` filters its own set through `useCapabilityGate` before * `actionRendersAt` ever runs, and so do the other two surfaces this card names - * (`page:header` for `record_header` / `record_more`, the grid's row menu for - * `list_item`) — one shared hook exactly so the three cannot drift apart. An + * (`page:header` for `record` / `record_page`, the grid's row menu for + * `record_row`) — one shared hook exactly so the three cannot drift apart. An * action declaring a capability the viewer does not hold is filtered out, at * every location at once, with no error and no 4xx. That is the reported * symptom, and it is this gate rather than a dropped key. @@ -67,7 +67,7 @@ * ## Reverse verification — direction predicted before running * * Predicted, then observed (measurements recorded on the PR): - * • Deleting the `list_toolbar` gate's `objectDef.actions` read in + * • Deleting the `list` gate's `objectDef.actions` read in * `ObjectView.tsx` turns every presence case RED (A, D, E, G, I) and * leaves every absence case GREEN (B, C, F, H) — an absence case asserts * absence, which a deleted renderer supplies for the wrong reason. That @@ -275,7 +275,7 @@ describe('objectui#7234 — object-declared actions reach the list toolbar', () expect(toolbarButton()).toBeNull(); }); - it('C (control): the same action at record_header only is not on this toolbar', async () => { + it('C (control): the same action at record_page only is not on this toolbar', async () => { renderList(objectsWithActions([{ ...APPLY_TO_PEOPLE, locations: ['record_page'] }])); await settle(); expect(toolbarButton()).toBeNull(); diff --git a/ui/packages/app-shell/src/views/ObjectView.recordRelatedNotOnOwnList-11270.test.tsx b/ui/packages/app-shell/src/views/ObjectView.recordRelatedNotOnOwnList-11270.test.tsx index 61e0b96af2b..ad87895b16e 100644 --- a/ui/packages/app-shell/src/views/ObjectView.recordRelatedNotOnOwnList-11270.test.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.recordRelatedNotOnOwnList-11270.test.tsx @@ -6,10 +6,10 @@ * * `record_related` places an action on the rows of a related list inside a * parent record, and nowhere else (objectstack-ai/objectstack#20937, triage - * `5919625056`). `list_item` is the location that places an action on the + * `5919625056`). `record_row` is the location that places an action on the * object's rows everywhere it is listed. So the object list page's row menu - * reads `list_item` and must keep ignoring `record_related`, while a - * `list_item` action still reaches it — the control, over the SAME render, so + * reads `record_row` and must keep ignoring `record_related`, while a + * `record_row` action still reaches it — the control, over the SAME render, so * the absence cannot be a dead relay's. * * The positive half (the related-list rows inside a record show it) is @@ -128,7 +128,7 @@ afterEach(() => { }); describe('objectui#11270 — the child object’s own list view does not place `record_related`', () => { - it('its row actions carry the `list_item` actions and not the `record_related`-only one', async () => { + it('its row actions carry the `record_row` actions and not the `record_related`-only one', async () => { render( @@ -144,7 +144,7 @@ describe('objectui#11270 — the child object’s own list view does not place ` await waitFor(() => expect(listSchema).not.toBeNull()); const names = (listSchema!.rowActionDefs ?? []).map((a) => a.name); // Control: the relay is alive, and `archive` (both locations) reaches the - // list through its `list_item` half. + // list through its `record_row` half. expect(names).toEqual(['send_reminder', 'archive']); expect(names).not.toContain('log_time'); }); diff --git a/ui/packages/app-shell/src/views/ObjectView.rowOpensNothing-33317.test.tsx b/ui/packages/app-shell/src/views/ObjectView.rowOpensNothing-33317.test.tsx index 84965953083..9372d32c625 100644 --- a/ui/packages/app-shell/src/views/ObjectView.rowOpensNothing-33317.test.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.rowOpensNothing-33317.test.tsx @@ -15,7 +15,7 @@ * objectstack#33219). Either way a click on the row opens nothing, so the grid * draws its record-link column as plain text — no anchor, no `role="link"` — * and the row's right-click menu offers no Open / Open in new tab; the row's - * own `list_item` action (Revoke) stays. + * own `record_row` action (Revoke) stays. * * Driven through the real `ObjectView`, the real `ListView` grid and the real * `MePermissionsProvider`, one differential per case: the same object and diff --git a/ui/packages/app-shell/src/views/ObjectView.toolbarScriptSelection-12331.test.tsx b/ui/packages/app-shell/src/views/ObjectView.toolbarScriptSelection-12331.test.tsx index c898a3aed81..757fcf93ce8 100644 --- a/ui/packages/app-shell/src/views/ObjectView.toolbarScriptSelection-12331.test.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.toolbarScriptSelection-12331.test.tsx @@ -8,7 +8,7 @@ /** * objectui#12331 — a single-record script action placed in a list's - * `list_toolbar` never drops a click. + * `list` never drops a click. * * Filed from a browser pass of HotCRM's Leads list: "Add to Campaign", a * `type: 'script'` action with one param (a campaign picker), launched from the @@ -29,7 +29,7 @@ * success toast — the action's own copy, filled from the answer's * `{{ result.* }}`, or the runner's generic line when it declares none. * - * The last block replays HotCRM's own declaration: a `list_item` placement and + * The last block replays HotCRM's own declaration: a `record_row` placement and * a FIELD-BACKED param, so the dialog draws a record picker and the toast * comes after a picker was used. It refuses and reports exactly as the plain * fixture does. @@ -48,7 +48,7 @@ * * "Record-scoped" is a declaration, not a guess: an action is single-record * when its `locations` include a record placement (`isRecordScopedAction`). An - * action declared at `list_toolbar` alone is object-level, so zero rows + * action declared at `list` alone is object-level, so zero rows * dispatches it with no record — pinned below as the control. */ @@ -115,9 +115,9 @@ import { ConsoleToaster } from '../chrome/ConsoleToaster'; const ACTION_URL = '/api/v1/actions/crm_lead/create_campaign'; /** A record-scoped placement: the toolbar plus a record placement. */ -const RECORD_SCOPED = ['list_toolbar', 'record_header']; +const RECORD_SCOPED = ['list', 'record_page']; /** The declaration the card measured: the toolbar alone, i.e. object-level. */ -const TOOLBAR_ONLY = ['list_toolbar']; +const TOOLBAR_ONLY = ['list']; function crmLead(locations: string[], successMessage?: string) { return { @@ -245,7 +245,7 @@ async function launchRefusedFromHeader(refusal: string): Promise { expect(screen.queryByRole('dialog')).toBeNull(); } -describe('objectui#12331 — a record-scoped script action at list_toolbar, with a param', () => { +describe('objectui#12331 — a record-scoped script action at list, with a param', () => { it('0 rows: the refusal shows before any dialog, and no request is sent', async () => { mountLeads(RECORD_SCOPED); await tickRows(0); @@ -284,7 +284,7 @@ describe('objectui#12331 — a record-scoped script action at list_toolbar, with }); describe('objectui#12331 — the refusal follows the `locations` declaration', () => { - it('declared at list_toolbar alone, 2 rows: one dispatch cannot name two records, so it refuses before any dialog', async () => { + it('declared at list alone, 2 rows: one dispatch cannot name two records, so it refuses before any dialog', async () => { mountLeads(TOOLBAR_ONLY); await tickRows(2); await launchRefusedFromHeader(MULTI_ROW_REFUSAL); @@ -292,7 +292,7 @@ describe('objectui#12331 — the refusal follows the `locations` declaration', ( expect(actionCalls()).toHaveLength(0); }); - it('control — declared at list_toolbar alone, 0 rows: object-level, so it dispatches with no record', async () => { + it('control — declared at list alone, 0 rows: object-level, so it dispatches with no record', async () => { mountLeads(TOOLBAR_ONLY); await tickRows(0); await launchFromHeader(); @@ -312,7 +312,7 @@ describe('objectui#12331 — the refusal follows the `locations` declaration', ( * HotCRM's `CreateCampaignAction` (objectstack-ai/hotcrm, `src/sales/actions/ * lead.actions.ts`), with the keys this chain reads. It differs from the * fixture above in the two ways the card's reading could hinge on: the record - * placement is `list_item`, and its one param is FIELD-BACKED, so the dialog + * placement is `record_row`, and its one param is FIELD-BACKED, so the dialog * draws a record picker (a lookup to `crm_campaign`) instead of a text box. */ const HOTCRM_CREATE_CAMPAIGN = { @@ -402,7 +402,7 @@ function mountHotcrmLeads() { /** * Click the HEADER toolbar's "Add to Campaign", pick "Cloud Migration Webinar" - * in the record picker, Confirm — the card's steps. `list_item` also draws the + * in the record picker, Confirm — the card's steps. `record_row` also draws the * action on every row, so the header's toolbar is the first one on the page. */ async function launchHotcrmFromHeader(): Promise { @@ -416,11 +416,11 @@ async function launchHotcrmFromHeader(): Promise { await act(async () => { fireEvent.click(within(dialog).getByRole('button', { name: 'Confirm' })); }); } -describe('objectui#12331 — HotCRM\'s declaration: list_item placement, a field-backed record-picker param', () => { +describe('objectui#12331 — HotCRM\'s declaration: record_row placement, a field-backed record-picker param', () => { it('0 rows: the refusal shows before any dialog, and no request is sent', async () => { mountHotcrmLeads(); await tickRows(0); - // `list_item` also draws the action on every row; the header's toolbar is the first. + // `record_row` also draws the action on every row; the header's toolbar is the first. await launchRefusedFromHeader(ZERO_ROW_REFUSAL); expect(actionCalls()).toHaveLength(0); diff --git a/ui/packages/app-shell/src/views/RecordDetailView.accessibleNames-12625.test.tsx b/ui/packages/app-shell/src/views/RecordDetailView.accessibleNames-12625.test.tsx index 7c3f78c56c9..d28b90dea8a 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.accessibleNames-12625.test.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.accessibleNames-12625.test.tsx @@ -14,7 +14,7 @@ * - The page's regions are named by their labels: the right column, the 动态 * panel (Activity) and a related panel (Task). They were the Details and * Related tabs until objectstack#27524 laid every width out as columns. - * - A declared `record_header` action is named by its label (Log a Call). + * - A declared `record_page` action is named by its label (Log a Call). * - A collapsible field group's header is a button named by its label * (Lead Information) that toggles `aria-expanded` — the half the card found * really broken (`DetailSection`'s header was a div with no role). diff --git a/ui/packages/app-shell/src/views/RecordDetailView.actionLayout-36366.test.tsx b/ui/packages/app-shell/src/views/RecordDetailView.actionLayout-36366.test.tsx index 2a2fabb164d..d4df545fd46 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.actionLayout-36366.test.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.actionLayout-36366.test.tsx @@ -184,14 +184,14 @@ describe.each([ ['the synthesized default page, in the side preview', false], ['an authored page:header with placedActions: true', true], ] as const)('#36366 record header pins: %s', (_face, authored) => { - it('CONTROL — no pins: the header draws as before (record_header inline by order, record_more in ⋯)', async () => { + it('CONTROL — no pins: the header draws as before (record_page inline by order, folded in ⋯)', async () => { mount(undefined, authored); const { inline, menu } = await headerFaces(); expect(inline).toEqual(['Convert', 'Mark Won', 'Share']); expect(menu).toEqual(['Log Call']); }); - it('the pinned actions are the buttons, in pin order (a record_more one too); the rest are in ⋯', async () => { + it('the pinned actions are the buttons, in pin order (a folded one too); the rest are in ⋯', async () => { mount({ record: { pinned: ['log_call', 'share'] } }, authored); const { inline, menu } = await headerFaces(); expect(inline).toEqual(['Log Call', 'Share']); diff --git a/ui/packages/app-shell/src/views/RecordDetailView.actionUser.test.tsx b/ui/packages/app-shell/src/views/RecordDetailView.actionUser.test.tsx index a23644942be..e0c87591c64 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.actionUser.test.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.actionUser.test.tsx @@ -14,7 +14,7 @@ * the capability gate the engine reads (`user.systemPermissions`) is whatever * this object carries. It used to carry identity only — `{id, name, avatar}` — * and since `ActionEngine.getActionsForLocation` fails OPEN on `undefined`, every - * `record_header` / `record_more` action's `requiredPermissions` was silently + * `record` / `record_page` action's `requiredPermissions` was silently * unenforced on the one surface those locations exist on. * * Three properties are pinned here, and they pull in different directions: @@ -69,7 +69,7 @@ describe('resolveActionUser — ADR-0066 D4 capability gate seeding (#3923)', () // backend never reported systemPermissions", and `resolveActionUser` must // forward it unchanged so `ActionEngine`'s own `Array.isArray(held)` check // reads it as unknown and fails OPEN — collapsing it here would silently - // flip that to fail-CLOSED for every record_header/record_more action. + // flip that to fail-CLOSED for every record / record_page action. const resolved = resolveActionUser(user, true, undefined); expect(resolved.systemPermissions).toBeUndefined(); expect(Array.isArray(resolved.systemPermissions)).toBe(false); diff --git a/ui/packages/app-shell/src/views/RecordDetailView.authoredPageDesktopOnly-36150.test.tsx b/ui/packages/app-shell/src/views/RecordDetailView.authoredPageDesktopOnly-36150.test.tsx index 00d573f92cc..089abae37c9 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.authoredPageDesktopOnly-36150.test.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.authoredPageDesktopOnly-36150.test.tsx @@ -11,7 +11,7 @@ * * - The card's pin: an authored `kind: 'full'` page draws on the desktop full * page; on a phone and in the drawer its page-only block is gone, the - * standard page's tab strip is drawn, and the object's `record_more` + * standard page's tab strip is drawn, and the object's folded (`component: 'action:menu'`) * action is still in the header's ⋯ menu. Red before the change (the * authored page drew on all three). * - CONTROL: an object with no authored page draws the standard page on all @@ -267,7 +267,7 @@ describe('#36150 an authored full page', () => { expect(screen.queryByText(AUTHORED_MARK)).toBeNull(); }); - it('on the drawer the object\'s record_more action is in the standard header\'s ⋯ menu', async () => { + it('on the drawer the object\'s folded action is in the standard header\'s ⋯ menu', async () => { mount('qa_project', [fullPage('qa_project')], 'drawer'); await recordDrawn(); const trigger = await screen.findByRole('button', { name: 'More actions' }); diff --git a/ui/packages/app-shell/src/views/RecordDetailView.builtinActionSessionUserPredicate.test.tsx b/ui/packages/app-shell/src/views/RecordDetailView.builtinActionSessionUserPredicate.test.tsx index 55d00426682..313d7d45e5c 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.builtinActionSessionUserPredicate.test.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.builtinActionSessionUserPredicate.test.tsx @@ -32,7 +32,7 @@ * evaluated on this path. * • `RecordDetailView.headerActionLookupPredicate.test.tsx` (#4641 / * objectstack#8500) drives `os.user.id` against a relation field, but only - * through DECLARED `record_header` actions — a different consumption seam + * through DECLARED `record_page` actions — a different consumption seam * (`visible` on an authored action), deliberately not the built-in one. * * The card sits exactly on the intersection, which is why it could be reported diff --git a/ui/packages/app-shell/src/views/RecordDetailView.headerActionLookupPredicate.test.tsx b/ui/packages/app-shell/src/views/RecordDetailView.headerActionLookupPredicate.test.tsx index ca85bb32e9e..54dc29eff1e 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.headerActionLookupPredicate.test.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.headerActionLookupPredicate.test.tsx @@ -13,7 +13,7 @@ * ## What this file pins, and why here * * "Only the record's manager sees this button" is the most common thing an - * author asks a `record_header` action's `visible` to express, and it is + * author asks a `record_page` action's `visible` to express, and it is * written against a lookup field: * * ```yaml @@ -146,7 +146,7 @@ function makeMetadata(objects: any[]) { } as any; } -/** A declared `record_header` action, gated on `visible`. */ +/** A declared `record_page` action, gated on `visible`. */ const headerAction = (name: string, visible: unknown) => ({ name, label: name, diff --git a/ui/packages/app-shell/src/views/RecordDetailView.headerApiInterpolation.test.tsx b/ui/packages/app-shell/src/views/RecordDetailView.headerApiInterpolation.test.tsx index d043b41deca..78a7f4e49db 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.headerApiInterpolation.test.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.headerApiInterpolation.test.tsx @@ -12,9 +12,9 @@ * * The record page's api handler used to gate `{field}` interpolation on * `params._rowRecord` alone — a stash only related-list row dispatches - * carried. A `record_header` action targeting `/api/v1/data/:object/{id}` + * carried. A `record_page` action targeting `/api/v1/data/:object/{id}` * therefore went out with the literal `{id}` (`%7Bid%7D` on the wire → 400), - * while the SAME declaration on `list_item` interpolated fine. + * while the SAME declaration on `record_row` interpolated fine. * * These tests exercise the handler set the view REALLY hands to its * ActionProvider (captured via a pass-through wrapper, same harness as diff --git a/ui/packages/app-shell/src/views/RecordDetailView.headerRecordIdLoadWindow.test.tsx b/ui/packages/app-shell/src/views/RecordDetailView.headerRecordIdLoadWindow.test.tsx index b4f8cbb9292..ef8330d81c4 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.headerRecordIdLoadWindow.test.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.headerRecordIdLoadWindow.test.tsx @@ -7,14 +7,14 @@ */ /** - * `record_header` actions must carry the record id even while the page record + * `record_page` actions must carry the record id even while the page record * is still being fetched (objectui#5176). * * The header is NOT gated on the record load. `isLoading` — the only state the * `` early return reads — is flipped false in a `queueMicrotask` * keyed on the route, while `pageRecord` arrives one `dataSource.findOne` * round-trip later. So for the whole duration of that fetch the page renders its - * real header, with every `record_header` action live and clickable, and + * real header, with every `record_page` action live and clickable, and * `pageRecord` still `null`. * * In that window the `type:'api'` handler's `recordIdParam` seeding used to have @@ -215,7 +215,7 @@ afterEach(() => { vi.unstubAllGlobals(); }); -describe('RecordDetailView record_header actions during the page-record load window (objectui#5176)', () => { +describe('RecordDetailView record_page actions during the page-record load window (objectui#5176)', () => { it('the header renders live actions while the record is still loading', async () => { // The premise the whole card rests on. If the header were gated on the // record load there would be no window to dispatch in, and the reported @@ -235,7 +235,7 @@ describe('RecordDetailView record_header actions during the page-record load win let r: any; await act(async () => { - // A record_header action exactly as authored: no `_rowRecord` stash, no + // A record_page action exactly as authored: no `_rowRecord` stash, no // literal `recordId` override, `recordIdField` defaulting to `id`. r = await handlers.api({ name: 'archive_plan', diff --git a/ui/packages/app-shell/src/views/RecordDetailView.placedHeaderActions-29951.test.tsx b/ui/packages/app-shell/src/views/RecordDetailView.placedHeaderActions-29951.test.tsx index ccdaea08abc..5413a129286 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.placedHeaderActions-29951.test.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.placedHeaderActions-29951.test.tsx @@ -7,10 +7,10 @@ * #27219 rebuilt the platform record pages as `kind: 'full'` pages whose * `page:header` named the platform's own action ids, and an authored id list * is the whole set (#11592), so a `type: 'url'` action an installed package - * places on `sys_user` at `record_header` stopped drawing in the 18.3 Console. + * places on `sys_user` at `record_page` stopped drawing in the 18.3 Console. * Ruling A (record 6624172200) gave the header an opt-in instead, * `placedActions: true` (objectstack#30018): every action of the page's object - * placed at `record_header` / `record_more`, read live. The three platform + * placed at `record` / `record_page`, read live. The three platform * pages now ship exactly `{ type: 'page:header', properties: { placedActions: * true } }` (pinned in platform-objects' `record-page-header-actions.test.ts` * and plugin-approvals' `sys-approval-request-page.test.ts`; that package is @@ -22,7 +22,7 @@ * object and record handed in). * * - The card's pin: on the shipped header node, the packaged url action - * draws inline and the packaged `record_more` one in the ⋯ menu, beside + * draws inline and the packaged folded (`component: 'action:menu'`) one in the ⋯ menu, beside * the platform's own; actions placed elsewhere do not draw. On the frozen * #27219 header (an id list, no opt-in) the same object draws neither * packaged action, which is the regression this pin is red on. diff --git a/ui/packages/app-shell/src/views/RecordDetailView.printPageHeaderActions-12906.test.tsx b/ui/packages/app-shell/src/views/RecordDetailView.printPageHeaderActions-12906.test.tsx index 05622171266..b9ec7d7a057 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.printPageHeaderActions-12906.test.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.printPageHeaderActions-12906.test.tsx @@ -11,8 +11,8 @@ * header actions in the print page's screen-only chrome, beside Print. * * A page that declares `print` may hold only the printable component types, - * and `page:header` (the one block that draws a record's `record_header` / - * `record_more` actions and the system Edit / Share / Delete) is not one of + * and `page:header` (the one block that draws a record's `record_page` / + * folded (`component: 'action:menu'`) actions and the system Edit / Share / Delete) is not one of * them. So the record view draws the same row, through `PageHeaderActions` * (the resolver `page:header` itself draws with), in the chrome row that holds * the Print button, outside the print page's root, where the print stylesheet @@ -224,7 +224,7 @@ afterEach(() => { }); describe('RecordDetailView — a print page draws the record’s header actions in its screen-only chrome beside Print (objectui#12906)', () => { - it('(a) the declared record_header action and Edit / Share / Delete are drawn in the chrome beside Print', async () => { + it('(a) the declared record_page action and Edit / Share / Delete are drawn in the chrome beside Print', async () => { const { onEdit } = await mountRecordPage([PRINT_PAGE]); const chrome = document.querySelector('[data-record-print-chrome]') as HTMLElement; expect(chrome).not.toBeNull(); diff --git a/ui/packages/app-shell/src/views/RecordDetailView.recordIdParamSeed.test.tsx b/ui/packages/app-shell/src/views/RecordDetailView.recordIdParamSeed.test.tsx index 638b74783fe..6962b2f677d 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.recordIdParamSeed.test.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.recordIdParamSeed.test.tsx @@ -18,7 +18,7 @@ * * This call site has two sources `resolveRecordIdParamSeed` alone does not * know about, on top of the row: a literal `recordId` override, and the - * `pageRecord` fallback `record_header` actions rely on when no row is + * `pageRecord` fallback `record_page` actions rely on when no row is * stashed (same fallback `interpolationRecord` above uses for `{field}` URL * tokens). Both are preserved — the tests below pin that, alongside the two * refusal wordings and the happy path — so adopting the helper here did not @@ -273,12 +273,12 @@ describe('RecordDetailView api handler — recordIdParam seeding refuses instead expect(JSON.parse(String(init.body))).toMatchObject({ targetCode: 'INV-1' }); }); - it('falls back to the page record when no row is stashed (record_header actions)', async () => { + it('falls back to the page record when no row is stashed (record_page actions)', async () => { const handlers = await mountAndCaptureHandlers(); let r: any; await act(async () => { - // A record_header-style action: no `_rowRecord` stash, so the only + // A record_page-style action: no `_rowRecord` stash, so the only // source is the page's own loaded record — the fallback // `interpolationRecord` above also relies on. `recordIdField` // defaults to `id`. diff --git a/ui/packages/app-shell/src/views/RecordDetailView.tsx b/ui/packages/app-shell/src/views/RecordDetailView.tsx index 4e7cf1b770f..20c697a96eb 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.tsx @@ -183,7 +183,7 @@ const RECORD_PAGE_APPEND_INSET = 'px-3 md:px-4 lg:px-6'; * action on the record surface, and `ActionEngine.getActionsForLocation` reads the * capability gate off `runner.getContext().user.systemPermissions`. The engine * fails OPEN on `undefined` (unknown ≠ denied), so shipping identity alone - * silently un-gated every `record_header` / `record_more` action that declared + * silently un-gated every `record` / `record_page` action that declared * `requiredPermissions` — the button rendered, and only the server's 403 stopped * it (and only for platform action routes at that). * @@ -200,7 +200,7 @@ const RECORD_PAGE_APPEND_INSET = 'px-3 md:px-4 lg:px-6'; * predating ADR-0066), which is exactly the "unknown" case the engine's own * `Array.isArray(held)` check fails OPEN on — not "holds nothing". Defaulting * it to `[]` here would silently re-introduce the same collapse at this one - * call site and gate every `record_header` / `record_more` action closed on + * call site and gate every `record` / `record_page` action closed on * such a deployment. A REPORTED empty array still forwards as `[]` and gates * strictly, unchanged. */ @@ -2058,7 +2058,7 @@ export function RecordDetailView({ dataSource, objects, onEdit, objectNameOverri // action doesn't retarget another object (a child action interpolated // from the parent's fields would hit the wrong record; same guard as // the recordIdParam fallback below). Without the page-record fallback, - // a `record_header` action reaching here through any dispatch path + // a `record_page` action reaching here through any dispatch path // that doesn't stash `_rowRecord` sent the literal `{id}` on the wire. const interpolationRecord = rowRecord ?? (!action.objectName || action.objectName === objectName @@ -2084,7 +2084,7 @@ export function RecordDetailView({ dataSource, objects, onEdit, objectNameOverri // about — a literal `recordId` override (not a declared ActionDef // field; nothing in this repo's metadata sets it today, hence the // cast) and the same page-record fallback `interpolationRecord` - // above uses for `record_header` actions dispatched with no + // above uses for `record_page` actions dispatched with no // `rowRecord`. Preserve that priority (row -> override -> // page record) and let the helper decide — and word — the // refusal only once every source has been tried, instead of the @@ -2096,7 +2096,7 @@ export function RecordDetailView({ dataSource, objects, onEdit, objectNameOverri // (the only state the early return reads) is flipped // false in a route-keyed microtask, while `pageRecord` lands one // `findOne` round-trip later; for that whole window the real header - // renders with every `record_header` action live. Clicking inside it + // renders with every `record_page` action live. Clicking inside it // seeded from `null`, which `resolveRecordIdParamSeed` deliberately // abstains on (no value AND no error — "no row context" is not that // guard's business), so the request went out naming no record and the @@ -2269,7 +2269,7 @@ export function RecordDetailView({ dataSource, objects, onEdit, objectNameOverri /** * Flow action handler — triggered when an Action with `type: 'flow'` is - * invoked from a record-level location (record_header, record_more, …) or + * invoked from a record-level location (record, record_page, …) or * from a related list on this page. It starts the flow through one of two * doors (objectui#12037, triage ruling B; the rule and its reasons live in * `utils/flowLaunch`): @@ -4737,10 +4737,11 @@ export function RecordDetailView({ dataSource, objects, onEdit, objectNameOverri // `@object-ui/plugin-detail/RecordDetailDrawer`. // Filter actions for the record page header and deduplicate by name. - // Both header locations are included: `record_header` renders inline, - // `record_more` renders inside the header's ⋯ overflow menu (the spec's - // "overflow menu under the More/⋯ button" location — PageHeaderRenderer - // routes record_more-only actions into the overflow; #2358 trap 2). + // Both record page words are included: `record_page` and `record` (which + // `actionRendersAt` draws on the record page too). An action folded into + // the header's ⋯ overflow menu says so with `component: 'action:menu'`, + // which PageHeaderRenderer routes into the overflow (#2358 trap 2; + // until protocol 19 the `record_more` location said it, objectstack#36495). // The set is `placedHeaderActions` (`@object-ui/types`): the ONE reader an // authored `page:header` with `placedActions: true` reads too // (objectstack#29951), so the synthesized header and such a page draw the @@ -5336,7 +5337,7 @@ export function RecordDetailView({ dataSource, objects, onEdit, objectNameOverri const hasAttachments = hasExplicitAttachments(effectivePage as any); // System actions (Edit / Share / Delete) — synthesized for every record - // page so objects without authored record_header actions still surface + // page so objects without authored record_page actions still surface // the basic affordances. // // Placement metadata (objectui#2361): the page header now renders up to @@ -5726,7 +5727,7 @@ export function RecordDetailView({ dataSource, objects, onEdit, objectNameOverri : (synthSystemActions.find((action) => action.name === 'sys_edit') as RecordHeaderEditEntry | undefined); // The synth path hands ONLY business actions (authored on objectDef and - // routed to the record_header location, e.g. Lead.convert) to the page + // routed to the record_page location, e.g. Lead.convert) to the page // schema. System actions (Edit / Share / Delete) ride through // `RecordContext.headerSystemActions` instead, so they reach both // synth/slotted pages AND authored full-Lightning pages without @@ -6443,8 +6444,7 @@ export function RecordDetailView({ dataSource, objects, onEdit, objectNameOverri that declares `print` holds only the printable component types, and `page:header` is not one of them, so the record's header actions have no block to draw them on such a page. - This row draws them: the object's declared `record_header` / - `record_more` actions and the system set the + This row draws them: the object's declared `record` / `record_page` actions and the system set the `RecordContextProvider` above hands over (Edit / Share / Delete), through `PageHeaderActions`, the ONE resolver `page:header` draws them with, so each is gated, ordered, diff --git a/ui/packages/app-shell/src/views/RelatedRecordActionsBridge.tsx b/ui/packages/app-shell/src/views/RelatedRecordActionsBridge.tsx index 059f4df33c5..a2a1bf6da71 100644 --- a/ui/packages/app-shell/src/views/RelatedRecordActionsBridge.tsx +++ b/ui/packages/app-shell/src/views/RelatedRecordActionsBridge.tsx @@ -41,7 +41,7 @@ * - 查看全部 → the child object's list page scoped to this parent * (`onViewAll`, the related list's "View all" link, * objectui#12741) - * - 子对象 action → the child object's `list_item` actions, and its + * - 子对象 action → the child object's `record_row` actions, and its * `record_related` ones when a parent record is in scope, * executed against the clicked row through the page's shared * ActionRunner @@ -270,17 +270,17 @@ export interface RelatedRecordActionsBridgeProps { * The locations a related list places on each ROW, by whether a parent record * is in scope (objectui#11270). * - * `list_item` places an action on the child's rows wherever the child is + * `record_row` places an action on the child's rows wherever the child is * listed. `record_related` places it on them only inside a parent record's * related-list section: objectstack-ai/objectstack#20937's enforce answer * (triage `5919625056`) read the spec's "actions on a related list section * inside a record" as row placement, and the runtime counts the location among * those that require a record. The child object's own list view reads - * `list_item` alone, in `ObjectView`. + * `record_row` alone, in `ObjectView`. */ -const ROW_LOCATIONS_IN_RECORD = ['list_item', 'record_related'] as const; -const ROW_LOCATIONS = ['list_item'] as const; -const TOOLBAR_LOCATIONS = ['list_toolbar'] as const; +const ROW_LOCATIONS_IN_RECORD = ['record_row', 'record_related'] as const; +const ROW_LOCATIONS = ['record_row'] as const; +const TOOLBAR_LOCATIONS = ['list'] as const; /** * Derive the child object's actions for a related-list surface (the row menu @@ -726,7 +726,7 @@ export function RelatedRecordActionsBridge({ // [objectui#11270] `record_related` joins the row menu only when this // bridge is mounted under a parent record — the record page mounts it // with one; a mount without (the "standalone list" these props allow) - // places `list_item` alone. + // places `record_row` alone. // // [objectui#12870] With `parentFromList` (a custom page) the parent is // each list's own: a list that bound its parent through diff --git a/ui/packages/app-shell/src/views/__tests__/DeclaredActionsBar.test.tsx b/ui/packages/app-shell/src/views/__tests__/DeclaredActionsBar.test.tsx index 3500ae61130..4dc37f18a8a 100644 --- a/ui/packages/app-shell/src/views/__tests__/DeclaredActionsBar.test.tsx +++ b/ui/packages/app-shell/src/views/__tests__/DeclaredActionsBar.test.tsx @@ -136,7 +136,7 @@ describe('DeclaredActionsBar', () => { ); expect(screen.getByTestId('declared-action-approval_approve')).toBeInTheDocument(); expect(screen.getByTestId('declared-action-approval_reassign')).toBeInTheDocument(); - // `list_toolbar`-only action must not surface at `record_section`. + // `list`-only action must not surface at `record_section`. expect(screen.queryByTestId('declared-action-approval_bulk')).toBeNull(); }); @@ -175,7 +175,7 @@ describe('DeclaredActionsBar', () => { , ); @@ -261,7 +261,7 @@ describe('DeclaredActionsBar', () => { , diff --git a/ui/packages/app-shell/src/views/__tests__/PageView.relatedListActions-12870.test.tsx b/ui/packages/app-shell/src/views/__tests__/PageView.relatedListActions-12870.test.tsx index 39f44a5b424..45612d2c341 100644 --- a/ui/packages/app-shell/src/views/__tests__/PageView.relatedListActions-12870.test.tsx +++ b/ui/packages/app-shell/src/views/__tests__/PageView.relatedListActions-12870.test.tsx @@ -70,7 +70,7 @@ const CHILD = 'sys_member'; * The child object's registered actions. `invite_user` is the list's header * action; `change_role` a `record_related` row action — placed only inside a * parent record, which the page list is only by its bound parent; `remove` a - * `list_item` row action. + * `record_row` row action. */ const CHILD_ACTIONS = [ { name: 'invite_user', label: 'Invite user', type: 'api', target: '/api/v1/org/invite', locations: ['list'] }, diff --git a/ui/packages/app-shell/src/views/__tests__/RelatedRecordActionsBridge.blankVisible-11294.test.tsx b/ui/packages/app-shell/src/views/__tests__/RelatedRecordActionsBridge.blankVisible-11294.test.tsx index b97fe452b05..257977e7b9a 100644 --- a/ui/packages/app-shell/src/views/__tests__/RelatedRecordActionsBridge.blankVisible-11294.test.tsx +++ b/ui/packages/app-shell/src/views/__tests__/RelatedRecordActionsBridge.blankVisible-11294.test.tsx @@ -11,7 +11,7 @@ * `pred == null || pred === ''`, so a whitespace-only `visible` counted as * declared there, was evaluated, and failed closed: the action showed in the * related list's header and was missing from its rows. That held for an - * action placed on the rows by `record_related` and by `list_item` alike. + * action placed on the rows by `record_related` and by `record_row` alike. * * Every case mounts what a record page mounts, as the objectui#11270 suite * beside this file does: the real `RelatedRecordActionsBridge` around the @@ -54,8 +54,8 @@ afterEach(() => { const CHILD_NAME = 'task'; -/** Each action is on the header (`list_toolbar`) and on the rows by one row location. */ -const both = (row: 'record_related' | 'list_item') => ['list_toolbar', row]; +/** Each action is on the header (`list`) and on the rows by one row location. */ +const both = (row: 'record_related' | 'record_row') => ['list', row]; /** * The card's measured table, plus the controls that keep the verdict honest. @@ -73,10 +73,10 @@ const ROW_ONLY_BLANK = ' '; const CHILD_ACTIONS = [ { name: 'send_reminder', label: 'Send Reminder', type: 'api', target: '/api/remind', locations: ['record_row'] }, { name: 'blank_rr', label: 'Blank RR', type: 'api', target: '/api/b1', locations: both('record_related'), visible: ' ' }, - { name: 'blank_li', label: 'Blank LI', type: 'api', target: '/api/b2', locations: both('list_item'), visible: ' ' }, + { name: 'blank_li', label: 'Blank LI', type: 'api', target: '/api/b2', locations: both('record_row'), visible: ' ' }, { name: 'empty_rr', label: 'Empty RR', type: 'api', target: '/api/e1', locations: both('record_related'), visible: '' }, - { name: 'empty_li', label: 'Empty LI', type: 'api', target: '/api/e2', locations: both('list_item'), visible: '' }, - { name: 'never_li', label: 'Never LI', type: 'api', target: '/api/n', locations: both('list_item'), visible: false }, + { name: 'empty_li', label: 'Empty LI', type: 'api', target: '/api/e2', locations: both('record_row'), visible: '' }, + { name: 'never_li', label: 'Never LI', type: 'api', target: '/api/n', locations: both('record_row'), visible: false }, { name: 'cel_yes_rr', label: 'CEL Yes', type: 'api', target: '/api/c1', locations: ['record_related'], visible: "record.name == 'Write spec'" }, { name: 'cel_no_rr', label: 'CEL No', type: 'api', target: '/api/c2', locations: ['record_related'], visible: "record.name == 'Other'" }, { name: 'blank_row_only', label: 'Blank Row Only', type: 'api', target: '/api/r', locations: ['record_related'], visible: ROW_ONLY_BLANK }, @@ -176,13 +176,13 @@ async function firstRowMenuNames(): Promise { } describe('objectui#11294 — one blank `visible` gives one answer on a related list’s toolbar and rows', () => { - it('a whitespace-only `visible` shows on the toolbar AND the rows, by `record_related` and by `list_item`; `\'\'` is the control', async () => { + it('a whitespace-only `visible` shows on the toolbar AND the rows, by `record_related` and by `record_row`; `\'\'` is the control', async () => { const warn = vi.spyOn(console, 'warn').mockImplementation(() => {}); try { mount(); await screen.findByText('Write spec'); - // The toolbar: every `list_toolbar` action whose gate is blank or empty + // The toolbar: every `list` action whose gate is blank or empty // shows, and the declared `false` does not. await waitFor(() => expect(toolbarNames()).toContain('blank_rr')); expect(toolbarNames()).toEqual(['blank_rr', 'blank_li', 'empty_rr', 'empty_li']); diff --git a/ui/packages/app-shell/src/views/__tests__/RelatedRecordActionsBridge.recordRelated-11270.test.tsx b/ui/packages/app-shell/src/views/__tests__/RelatedRecordActionsBridge.recordRelated-11270.test.tsx index 8eec9fad192..85cac4c34c6 100644 --- a/ui/packages/app-shell/src/views/__tests__/RelatedRecordActionsBridge.recordRelated-11270.test.tsx +++ b/ui/packages/app-shell/src/views/__tests__/RelatedRecordActionsBridge.recordRelated-11270.test.tsx @@ -8,8 +8,8 @@ * * The spec declares the location as "actions on a related list section inside * a record". Triage read it as ROW placement (the runtime counts it among the - * locations that require a record, beside `list_item`), scoped to a parent - * record: `list_item` shows on the child's rows wherever the child is listed, + * locations that require a record, beside `record_row`), scoped to a parent + * record: `record_row` shows on the child's rows wherever the child is listed, * `record_related` only on the related-list rows inside a parent record. * * Every case mounts what a record page mounts: the real @@ -59,7 +59,7 @@ const CHILD_NAME = 'task'; /** * The child object's actions. `log_time` is the showcase's `record_related` * specimen reduced to this card's case (a `form` over the child's edit view, - * placed ONLY by `record_related`); `send_reminder` is the `list_item` control. + * placed ONLY by `record_related`); `send_reminder` is the `record_row` control. * `archive` declares both, so it must render once. */ const CHILD_ACTIONS = [ @@ -181,7 +181,7 @@ const waitForRow = () => screen.findByText('Write spec'); const refusal = () => screen.queryByTestId('record-related-list-actions-refused'); describe('objectui#11270 — the host bridge places `record_related` on each related-list row inside a record', () => { - it('a `record_related`-only child action shows in the row menu, beside the `list_item` control, in declared order', async () => { + it('a `record_related`-only child action shows in the row menu, beside the `record_row` control, in declared order', async () => { mount(); await waitForRow(); // `archive` declares both locations and renders ONCE; `header_only` is a @@ -189,10 +189,10 @@ describe('objectui#11270 — the host bridge places `record_related` on each rel expect(await rowMenuNames()).toEqual(['send_reminder', 'log_time', 'archive']); }); - it('with no parent record in scope the bridge places only `list_item` — `record_related` is a record-page placement', async () => { + it('with no parent record in scope the bridge places only `record_row` — `record_related` is a record-page placement', async () => { mount(undefined, { parentRecord: false }); await waitForRow(); - // Control first: the row menu is alive and draws the `list_item` actions, + // Control first: the row menu is alive and draws the `record_row` actions, // so the absence below is the scope rule's, not a dead menu's. expect(await rowMenuNames()).toEqual(['send_reminder', 'archive']); }); @@ -236,8 +236,8 @@ describe('objectui#11270 — the authored `actions` channel accepts a `record_re await waitFor(() => expect(refusal()).not.toBeNull()); const notice = refusal()!; expect(notice).toHaveTextContent('header_only'); - expect(notice).toHaveTextContent(/list_toolbar/); - expect(notice).toHaveTextContent(/list_item/); + expect(notice).toHaveTextContent(/list/); + expect(notice).toHaveTextContent(/record_row/); expect(notice).toHaveTextContent(/record_related/); // The placeable entry beside it still renders. expect(await rowMenuNames()).toEqual(['log_time']); diff --git a/ui/packages/app-shell/src/views/metadata-admin/MetadataTypeActions.confirmDialog-13333.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/MetadataTypeActions.confirmDialog-13333.test.tsx index 3174e469506..3527d478130 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/MetadataTypeActions.confirmDialog-13333.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/MetadataTypeActions.confirmDialog-13333.test.tsx @@ -64,7 +64,7 @@ afterEach(() => { describe('MetadataTypeActions — confirmText is asked in-app and names the item (objectui#13333)', () => { it('(a) record header: the title names the action and the item; accepting runs it once', async () => { - render(); + render(); fireEvent.click(screen.getByRole('button', { name: 'Purge cache' })); const dialog = await screen.findByRole('alertdialog'); expect(within(dialog).getByRole('heading').textContent).toBe('Purge cache on "warehouse"?'); @@ -76,7 +76,7 @@ describe('MetadataTypeActions — confirmText is asked in-app and names the item }); it('(b) CONTROL: Cancel runs nothing', async () => { - render(); + render(); fireEvent.click(screen.getByRole('button', { name: 'Purge cache' })); const dialog = await screen.findByRole('alertdialog'); fireEvent.click(within(dialog).getByTestId('type-action-confirm-cancel')); @@ -86,7 +86,7 @@ describe('MetadataTypeActions — confirmText is asked in-app and names the item }); it('(c) list toolbar: no item, so the title names the action alone', async () => { - render(); + render(); fireEvent.click(screen.getByRole('button', { name: 'Purge cache' })); const dialog = await screen.findByRole('alertdialog'); expect(within(dialog).getByRole('heading').textContent).toBe('Purge cache?'); diff --git a/ui/packages/app-shell/src/views/metadata-admin/MetadataTypeActions.paramDialogClose-6473.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/MetadataTypeActions.paramDialogClose-6473.test.tsx index 89db853b0a5..e64f33ef26f 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/MetadataTypeActions.paramDialogClose-6473.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/MetadataTypeActions.paramDialogClose-6473.test.tsx @@ -136,7 +136,7 @@ const ACTION = { function renderActions(params: unknown[] = PARAMS) { return render( , diff --git a/ui/packages/app-shell/src/views/metadata-admin/MetadataTypeActions.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/MetadataTypeActions.test.tsx index f731ad47fa1..a02e624d2c5 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/MetadataTypeActions.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/MetadataTypeActions.test.tsx @@ -59,7 +59,7 @@ describe('MetadataTypeActions', () => { it('renders only actions that declare the requested location', () => { const { container } = render( { it('renders nothing when no action declares the requested location', () => { const { container } = render( , ); @@ -89,7 +89,7 @@ describe('MetadataTypeActions', () => { it('runs an api action without params directly (no dialog)', async () => { render( , @@ -104,7 +104,7 @@ describe('MetadataTypeActions', () => { it('collects array params via the dialog and sends them as the body', async () => { render( , @@ -122,7 +122,7 @@ describe('MetadataTypeActions', () => { it('shows the result dialog when the action declares resultDialog', async () => { render( , @@ -147,7 +147,7 @@ describe('MetadataTypeActions', () => { } as never); render( , @@ -169,7 +169,7 @@ describe('MetadataTypeActions', () => { } as never); render( , @@ -190,7 +190,7 @@ describe('MetadataTypeActions', () => { } as never); render( , diff --git a/ui/packages/app-shell/src/views/metadata-admin/MetadataTypeActions.tsx b/ui/packages/app-shell/src/views/metadata-admin/MetadataTypeActions.tsx index cc33e19c553..530b68b853e 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/MetadataTypeActions.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/MetadataTypeActions.tsx @@ -12,8 +12,8 @@ * /api/v1/datasources/${ctx.recordId}/test`). Rendering happens in two * chrome slots: * - * • ResourceEditPage → `location='record_header'`, `recordId` = item name. - * • ResourceListPage → `location='list_toolbar'` (no recordId). + * • ResourceEditPage → `location='record_page'`, `recordId` = item name. + * • ResourceListPage → `location='list'` (no recordId). * * Execution path mirrors ObjectView's auth-aware `apiHandler` rather than the * core ActionRunner's bare `fetch`: the metadata API endpoints require the diff --git a/ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.tsx b/ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.tsx index 685b5b1251e..f0d69efc6e6 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.tsx @@ -3024,13 +3024,13 @@ function MetadataResourceEditPageImpl({ const actionsNode = ( <> {/* Declarative type-level actions (GAP-1) — e.g. datasource - "Test connection". Only on a saved item: record_header actions + "Test connection". Only on a saved item: record_page actions template `${ctx.recordId}` from the item name, which `(new)` drafts don't have yet. */} {!createMode && ( setReloadKey((k) => k + 1)} /> diff --git a/ui/packages/app-shell/src/views/metadata-admin/ResourceListPage.tsx b/ui/packages/app-shell/src/views/metadata-admin/ResourceListPage.tsx index d9a0ed8fbc3..9ffd1de5c66 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/ResourceListPage.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/ResourceListPage.tsx @@ -895,11 +895,11 @@ function DefaultMetadataList({ type, appName }: { type: string; appName?: string )); // Declarative type-level actions (GAP-1) scoped to the list toolbar. - // Per-row (`list_item`) actions are not surfaced here yet — they need the + // Per-row (`record_row`) actions are not surfaced here yet — they need the // row's recordId from the grid. const typeActions = ( <> - + {authoredObject && (