diff --git a/.changeset/26849-action-keys-disabled-reason.md b/.changeset/26849-action-keys-disabled-reason.md new file mode 100644 index 00000000000..dd74f63f26b --- /dev/null +++ b/.changeset/26849-action-keys-disabled-reason.md @@ -0,0 +1,10 @@ +--- +'@object-ui/core': patch +--- + +fix(core): the action key inventory lists the spec's `disabledReason`, so an action carrying it is no longer reported as having an unknown key + +Clause-②: no +Metadata-protocol: none + +`@objectstack/spec`'s `ActionSchema` declares `disabledReason`, the display-only sentence a greyed action shows to say why. `SPEC_ACTION_KEYS` in `@object-ui/core`, which restates every key that schema declares, did not list it, so the dev-mode unknown-key warning named it on a spec-valid action and the inventory's pin test failed. The entry is added. `ActionDef` is unchanged and nothing in the runner reads the key: its readers ship with the console's disabled-reason work. 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..5fba66d496c 100644 --- a/ui/packages/core/src/actions/__tests__/actionKeys.pin.test.ts +++ b/ui/packages/core/src/actions/__tests__/actionKeys.pin.test.ts @@ -323,5 +323,6 @@ describe('unknown-key warning', () => { unknown: ['targt'], retired: ['execute'], }); + expect(classifyActionKeys({ type: 'script', disabledReason: 'Closed deals are locked' })).toEqual({ unknown: [], retired: [] }); }); }); diff --git a/ui/packages/core/src/actions/actionKeys.ts b/ui/packages/core/src/actions/actionKeys.ts index 9184acb74c2..e7f884db588 100644 --- a/ui/packages/core/src/actions/actionKeys.ts +++ b/ui/packages/core/src/actions/actionKeys.ts @@ -246,6 +246,13 @@ export const SPEC_ACTION_KEYS = [ // key, which is the only thing the inventory is consulted for. 'description', 'disabled', + // Added to `ActionSchema` by objectstack#26786: the display-only sentence a + // greyed action shows to say why. Listed for the reason `description` is — + // this array restates the spec's declared keys, so an action carrying it is + // not reported as having an unknown key. `ActionDef` does NOT declare it and + // nothing here reads it: its readers ship with the console half of + // objectstack#26619. + 'disabledReason', 'errorMessage', // No `execute`: its spec-17 tombstone (`retiredKey()`, objectstack#3855) aged // out of `ActionSchema` at objectstack#25767 — the spec now refuses it as an