Skip to content

Commit a122269

Browse files
fix(ui): a destructive action block confirms through the destructive button (#26776)
<!-- claude-projects-attribution: {"github_login":"os-warren"} --> _Requested by **Warren** · [project thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ8UvbzHXduHALDwfXpk6vCwo)_ Fixes #26665 Clause-②: no Metadata-protocol: none ## 维护者速读 - 改了什么:四个动作块(`action:button` / `action:icon` / `action:group` / `action:menu`)把 `variant` 转发给动作执行器,`destructive` 在这一处转成 `danger`;`UIActionSchema.variant` 按引用取 spec 块行的词表(补上 `link`)。 - 为什么改:块里声明 `destructive` 的危险动作,确认框一直是中性按钮;执行器只认动作方言里的 `danger`,而四个块从不转发 `variant`。 - 风险与回滚:只影响带 `confirmText` 且 variant 为 `destructive` 的块,确认按钮改为红色;`default` / `outline` 不转发,行为不变。回滚即 revert 本 PR。 - 先看:`ui/packages/components/src/renderers/action/runner-variant.ts`(映射本身)、`action-button.tsx` 的 forward 一行、`ui/packages/types/src/ui-action.ts` 的 `variant`。 - 两分钟验证:`pnpm --dir ui exec vitest run packages/components/src/renderers/action/__tests__/action-variant-confirm-26665.test.tsx`,预期 9 个测试全部通过。 - 需要你做的:无,席位落地。 ## What changes `@objectstack/spec` spells `variant` in two dialects, each on its own surface (seat ruling: premise correction comment 6444873110 on #26665): - the four action blocks' rows (`ActionButtonPropsSchema`, `ActionIconPropsSchema`, `ActionGroupPropsSchema`, `ActionMenuPropsSchema`, and the group/menu member items) take the Button primitive's vocabulary plus `primary`, and refuse `danger`; - `ActionSchema`, which the runner dispatches, takes `primary | secondary | danger | ghost | link`. The runner reads `variant` for one purpose: `danger` paints the confirm button destructive (`confirmOptions` in `ActionRunner.ts`). The four block renderers forwarded no `variant`, so a block declared `destructive` confirmed through a neutral button. Now: - **`runner-variant.ts` (new, `@object-ui/components`)**: `toRunnerVariant` translates the block value into the action value at the one forward: `destructive` becomes `danger`; `primary`, `secondary`, `ghost` and `link` pass through; `default` and `outline`, which the action dialect has no word for, forward nothing. It reads no `danger`: it is not a reader-side alias. - **The four renderers** forward `variant: toRunnerVariant(...)` beside `confirmText`. `action:group` and `action:menu` forward each member's own `variant`, not the container's. - **`UIActionSchema.variant` (`@object-ui/types`)** is typed by reference to the spec's `ActionButtonProps['variant']`, the way `size` beside it already is. That adds `link`, which the block rows accept, and keeps refusing `danger`, which they refuse. - **`ui/scripts/check-action-forward-parity.mjs`**: the four `SURFACE:variant` JUSTIFIED entries are removed; the gate now finds `variant` forwarded on all four surfaces. ## Why The goal of the card is unchanged: a destructive action declared through one of the four blocks confirms through the destructive button. The method follows the seat's premise correction: the block rows keep their own spec dialect, and the translation lives at the forward, because each value is spec-declared on its own surface. ## Tests - New `action-variant-confirm-26665.test.tsx`: per surface, a `destructive` action asks the confirm handler with `destructive: true`; the `outline` control asks without it; each row first asserts the handler was called once and that nothing ran after the cancel. One row pins the mapping table of `toRunnerVariant`. - `action-forward-precedence.test.tsx`: `variant` added to the button and icon key-order lists, beside `confirmText` (one added name, no neighbour moved). ## Acceptance notes - `action:group`'s inline members draw the group's `variant` when they declare none, but the forward carries only the member's own `variant`: the group's value is the container's style, not a declaration about each action. - The `action:button` / `action:icon` registration `inputs` still publish the variant enum without `link`. Publishing it is a registry change with a manifest regeneration and is not in this card. - `@object-ui/types` has no zod mirror of `UIActionSchema.variant`; the public-block zod faces take the spec rows by reference already. ## Verification All local runs on head `631c2c46`. <details><summary>Ablation (two mutations, both restored by blob hash)</summary> - `runner-variant.ts`, `return 'danger';` replaced with `return undefined;` (anchor 1 to 0, blob changed): 5 failed, the four `destructive` rows and the mapping row. Restored: blob equals the HEAD blob, `git diff HEAD` empty. - `action-group.tsx`, the `variant: toRunnerVariant(action.variant),` forward deleted: 1 failed (the `action:group` destructive row), 8 passed. Restored the same way. </details> <details><summary>Reverse type check</summary> A scratch file in `ui/packages/types/src` typed two `UIActionSchema` literals: `variant: 'link'` compiled, `variant: 'danger'` failed with TS2322 (the union printed is the block rows' seven values). The file was removed; the tree is clean. </details> <details><summary>Tests and type-check</summary> - `pnpm --dir ui exec vitest run --maxWorkers=2 packages/components/src/renderers/action/` (under the verify lock, before the main merge): Test Files 35 passed (35), Tests 581 passed (581). - The new pin alone: Test Files 1 passed, Tests 9 passed. - `pnpm --filter @object-ui/types --filter @object-ui/components run type-check` (under the lock): both packages Done, VERDICT command-exit 0. - `pnpm --dir ui run check:action-forward-parity`: exit 0, 26 justified omissions, 0 known gaps; `variant` forwarded on all four surfaces. - `pnpm --dir ui run check:new-line-citations`: 0 new citations, exit 0. - `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` derived 34 families on head `631c2c46`; all 34 ran with exit 0, and `--ran` reconciles 34 derived, 34 run, 0 NOT-MEASURED, 0 UNRUN (`pnpm --dir ui exec vitest run scripts/` included, under the lock). - `test:repo`, `pnpm lint` and the type-check lanes are CI's. </details> ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. (No `packages/spec` change.) - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; `pnpm lint` is CI's. - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. - [x] 6. `packages/spec` not touched. - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English (the maintainer brief is Chinese by rule). Implemented in the card thread session `session_01JQwxbZyGPLFfG86a9oeMDr` for seat `domain:ui#1`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01JQwxbZyGPLFfG86a9oeMDr --- _Generated by [Claude Code](https://claude.ai/code/session_01JQwxbZyGPLFfG86a9oeMDr)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 7bdff7e commit a122269

10 files changed

Lines changed: 205 additions & 25 deletions
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
'@object-ui/components': patch
3+
'@object-ui/types': patch
4+
---
5+
6+
fix(ui): a `destructive` action block confirms through the destructive button (#26665)
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
The four action blocks (`action:button`, `action:icon`, `action:group`, `action:menu`) now forward their `variant` to the action runner. `@objectstack/spec` spells the value in two dialects, each on its own surface: the blocks' rows take the Button primitive's vocabulary plus `primary`, and `ActionSchema`, which the runner dispatches, takes `primary | secondary | danger | ghost | link`. The forward translates: `destructive` becomes `danger`, `primary` / `secondary` / `ghost` / `link` pass through, and `default` / `outline` forward nothing. So a block declared `variant: 'destructive'` with a `confirmText` now asks its question through the destructive confirm button, where before it asked through a neutral one.
12+
13+
`UIActionSchema.variant` (`@object-ui/types`) now takes the block rows' vocabulary by reference (`ActionButtonProps['variant']`), which adds `link`, a value those rows already accept. `danger` stays refused there, as the block rows refuse it.

‎ui/packages/components/src/renderers/action/__tests__/action-forward-precedence.test.tsx‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,14 @@ const CONTEXT = { target: 'contextWins', extraFromHost: 'present' };
113113
* `outcomeMessages` (objectui#11344) is the next middle insertion, beside
114114
* `successMessage`, the copy it outranks in the success toast. Same reading:
115115
* one added name, no neighbour moved.
116+
*
117+
* `variant` (objectstack#26665) is the next, beside `confirmText`: the runner
118+
* reads it to paint that question's confirm button. Same reading.
116119
*/
117120
const BUTTON_ORDER = [
118121
'type', 'name', 'label', 'description', 'target', 'openIn', 'endpoint', 'method',
119122
'params',
120-
'bodyExtra', 'bodyShape', 'operation', 'confirmText', 'successMessage', 'outcomeMessages', 'errorMessage',
123+
'bodyExtra', 'bodyShape', 'operation', 'confirmText', 'variant', 'successMessage', 'outcomeMessages', 'errorMessage',
121124
'refreshAfter', 'undoable', 'recordIdField', 'locations', 'toast', 'resultDialog', 'onSuccess', 'objectName',
122125
];
123126

@@ -129,7 +132,7 @@ const BUTTON_ORDER = [
129132
const ICON_ORDER = [
130133
'type', 'name', 'label', 'description', 'target', 'openIn', 'endpoint', 'method',
131134
'params',
132-
'bodyExtra', 'bodyShape', 'operation', 'confirmText', 'successMessage', 'outcomeMessages', 'errorMessage',
135+
'bodyExtra', 'bodyShape', 'operation', 'confirmText', 'variant', 'successMessage', 'outcomeMessages', 'errorMessage',
133136
'refreshAfter', 'locations', 'toast', 'resultDialog', 'onSuccess', 'objectName',
134137
];
135138

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
/**
2+
* ObjectUI
3+
* Copyright (c) 2024-present ObjectStack Inc.
4+
*
5+
* This source code is licensed under the MIT license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
/**
10+
* objectstack#26665 — a `destructive` action block confirms through the
11+
* destructive button.
12+
*
13+
* The runner paints its confirm button destructive when the action it runs
14+
* declares `variant: 'danger'` (`confirmOptions`, objectstack#26580). The four
15+
* action blocks speak the spec's BLOCK dialect, where that value is spelled
16+
* `destructive`, and before this card none of them forwarded `variant` at all,
17+
* so a destructive block asked its question through a neutral button. Each
18+
* renderer now forwards its variant through `toRunnerVariant`.
19+
*
20+
* Every row reads the confirm handler's own call, the artefact the dialog is
21+
* drawn from, and first asserts it was called once (the positive control). The
22+
* `outline` row is the control for the mapping: a value the action dialect has
23+
* no word for forwards nothing, so that question stays neutral.
24+
*/
25+
26+
import { describe, it, expect, vi, beforeEach, type Mock } from 'vitest';
27+
import { render, screen, waitFor, fireEvent } from '@testing-library/react';
28+
import React from 'react';
29+
import { ComponentRegistry } from '@object-ui/core';
30+
import type { ActionContext, ActionDef, ActionResult, ConfirmationHandler } from '@object-ui/core';
31+
import { ActionProvider } from '@object-ui/react';
32+
// Module-scope side-effect imports — these renderers register themselves with
33+
// the ComponentRegistry, and the light `dom` project does not load the
34+
// `@object-ui/components` graph. Module scope, not a `beforeAll`, per
35+
// AGENTS.md §测试纪律.
36+
import '../action-button';
37+
import '../action-icon';
38+
import '../action-group';
39+
import '../action-menu';
40+
import { toRunnerVariant } from '../runner-variant';
41+
42+
const ACTION = {
43+
name: 'purge_history',
44+
label: 'Purge history',
45+
confirmText: 'This cannot be undone.',
46+
};
47+
48+
let script: Mock<(action: ActionDef, ctx: ActionContext) => Promise<ActionResult>>;
49+
let confirm: Mock<ConfirmationHandler>;
50+
51+
beforeEach(() => {
52+
script = vi.fn(async () => ({ success: true }));
53+
// A cancel: the question is what is measured, not the run.
54+
confirm = vi.fn(async () => false);
55+
});
56+
57+
function surface(type: string, schema: Record<string, unknown>) {
58+
const C = ComponentRegistry.get(type);
59+
if (!C) throw new Error(`${type} is not registered`);
60+
return <C schema={schema as never} />;
61+
}
62+
63+
/** Each surface, carrying one action declared with `variant`, and how to run it. */
64+
const SURFACES: Array<[string, (variant: string) => Record<string, unknown>, boolean]> = [
65+
['action:button', (variant) => ({ ...ACTION, type: 'action:button', actionType: 'script', variant }), true],
66+
['action:icon', (variant) => ({ ...ACTION, type: 'action:icon', actionType: 'script', icon: 'trash', variant }), true],
67+
['action:group', (variant) => ({ type: 'action:group', actions: [{ ...ACTION, type: 'script', variant }] }), true],
68+
// `autoTrigger` runs `handleExecute`, the function a click on the menu item
69+
// calls, without opening the Radix dropdown (see `action-onSuccess-forward.test.tsx`).
70+
['action:menu', (variant) => ({ type: 'action:menu', actions: [{ ...ACTION, type: 'script', variant, autoTrigger: true }] }), false],
71+
];
72+
73+
async function confirmOptionsFor(type: string, schema: Record<string, unknown>, click: boolean) {
74+
render(
75+
<ActionProvider handlers={{ script }} onConfirm={confirm}>
76+
{surface(type, schema)}
77+
</ActionProvider>,
78+
);
79+
if (click) fireEvent.click(screen.getByRole('button', { name: 'Purge history' }));
80+
await waitFor(() => expect(confirm).toHaveBeenCalledTimes(1));
81+
expect(script).not.toHaveBeenCalled();
82+
return confirm.mock.calls[0][1];
83+
}
84+
85+
describe.each(SURFACES)('%s forwards its variant in the runner dialect (objectstack#26665)', (type, schemaFor, click) => {
86+
it('`destructive` confirms through the destructive button', async () => {
87+
expect(await confirmOptionsFor(type, schemaFor('destructive'), click)).toEqual({
88+
title: 'Purge history',
89+
confirmText: 'Purge history',
90+
destructive: true,
91+
});
92+
});
93+
94+
it('CONTROL: `outline` has no action-dialect word, so the question stays neutral', async () => {
95+
expect(await confirmOptionsFor(type, schemaFor('outline'), click)).toEqual({
96+
title: 'Purge history',
97+
confirmText: 'Purge history',
98+
});
99+
});
100+
});
101+
102+
describe('toRunnerVariant (objectstack#26665)', () => {
103+
it('maps the block dialect onto the action dialect', () => {
104+
expect(toRunnerVariant('destructive')).toBe('danger');
105+
expect(toRunnerVariant('primary')).toBe('primary');
106+
expect(toRunnerVariant('secondary')).toBe('secondary');
107+
expect(toRunnerVariant('ghost')).toBe('ghost');
108+
expect(toRunnerVariant('link')).toBe('link');
109+
expect(toRunnerVariant('default')).toBeUndefined();
110+
expect(toRunnerVariant('outline')).toBeUndefined();
111+
expect(toRunnerVariant(undefined)).toBeUndefined();
112+
});
113+
});

‎ui/packages/components/src/renderers/action/action-button.tsx‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import { resolveIcon } from './resolve-icon';
3131
import { hasDeclaredVisibilityGate } from './visibility-gate';
3232
import { useAutoTriggerOnce } from './auto-trigger';
3333
import { readStaticParamValues } from './static-params';
34+
import { toRunnerVariant } from './runner-variant';
3435
import { DisabledReasonTrigger, describedByWithReason, useDisabledReason } from './disabled-reason';
3536
import type { RendererHostProps } from '../../lib/renderer-host-props';
3637

@@ -324,6 +325,10 @@ const ActionButtonRenderer = forwardRef<
324325
// objectui#12941.
325326
operation: schema.operation,
326327
confirmText: schema.confirmText,
328+
// The block's `variant`, in the runner's dialect: a `destructive`
329+
// button confirms through the destructive button, as a `danger`
330+
// action does (objectstack#26665). See `./runner-variant`.
331+
variant: toRunnerVariant(schema.variant),
327332
successMessage: schema.successMessage,
328333
// Success copy per handler outcome (spec 17.6.0, objectui#11344): the
329334
// runner's success toast reads the entry named by the answer's

‎ui/packages/components/src/renderers/action/action-group.tsx‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import { Loader2, ChevronDown } from 'lucide-react';
3636
import { resolveIcon } from './resolve-icon';
3737
import { hasDeclaredVisibilityGate } from './visibility-gate';
3838
import { readActionEntryParamValues } from './static-params';
39+
import { toRunnerVariant } from './runner-variant';
3940
import {
4041
DisabledReasonMenuLabel,
4142
DisabledReasonTrigger,
@@ -371,6 +372,9 @@ const ActionGroupRenderer = forwardRef<HTMLDivElement, { schema: ActionGroupSche
371372
// (objectui#13022).
372373
operation: action.operation,
373374
confirmText: action.confirmText,
375+
// See action-button.tsx — the member's own `variant` in the runner's
376+
// dialect (objectstack#26665).
377+
variant: toRunnerVariant(action.variant),
374378
successMessage: action.successMessage,
375379
// See action-button.tsx — success copy per handler outcome, the
376380
// toast's first rung (objectui#11344).

‎ui/packages/components/src/renderers/action/action-icon.tsx‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import { resolveIcon } from './resolve-icon';
2727
import { hasDeclaredVisibilityGate } from './visibility-gate';
2828
import { useAutoTriggerOnce } from './auto-trigger';
2929
import { readStaticParamValues } from './static-params';
30+
import { toRunnerVariant } from './runner-variant';
3031
import { DisabledReasonTrigger, describedByWithReason, useDisabledReason } from './disabled-reason';
3132
import type { RendererHostProps } from '../../lib/renderer-host-props';
3233

@@ -191,6 +192,9 @@ const ActionIconRenderer = forwardRef<
191192
// (objectui#13022).
192193
operation: schema.operation,
193194
confirmText: schema.confirmText,
195+
// See action-button.tsx — the block's `variant` in the runner's
196+
// dialect (objectstack#26665).
197+
variant: toRunnerVariant(schema.variant),
194198
successMessage: schema.successMessage,
195199
// See action-button.tsx — success copy per handler outcome, the
196200
// toast's first rung (objectui#11344).

‎ui/packages/components/src/renderers/action/action-menu.tsx‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import { resolveIcon } from './resolve-icon';
3434
import { hasDeclaredVisibilityGate } from './visibility-gate';
3535
import { useAutoTriggerOnce } from './auto-trigger';
3636
import { readActionEntryParamValues } from './static-params';
37+
import { toRunnerVariant } from './runner-variant';
3738
import { DisabledReasonMenuLabel, menuItemReasonAria, useDisabledReason } from './disabled-reason';
3839
import type { RendererHostProps } from '../../lib/renderer-host-props';
3940

@@ -304,6 +305,9 @@ const ActionMenuRenderer = forwardRef<HTMLButtonElement, { schema: ActionMenuSch
304305
// `patch` (objectui#13022).
305306
operation: action.operation,
306307
confirmText: action.confirmText,
308+
// See action-button.tsx — the member's own `variant` in the runner's
309+
// dialect (objectstack#26665).
310+
variant: toRunnerVariant(action.variant),
307311
successMessage: action.successMessage,
308312
// See action-button.tsx — success copy per handler outcome, the
309313
// toast's first rung (objectui#11344).
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/**
2+
* ObjectUI
3+
* Copyright (c) 2024-present ObjectStack Inc.
4+
*
5+
* This source code is licensed under the MIT license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
import type { ActionDef } from '@object-ui/core';
10+
import type { UIActionSchema } from '@object-ui/types';
11+
12+
/**
13+
* The `variant` an action block forwards to the action runner
14+
* (objectstack#26665).
15+
*
16+
* `@objectstack/spec` spells `variant` in two dialects, each on its own
17+
* surface. The four action blocks' rows (`ActionButtonPropsSchema`,
18+
* `ActionIconPropsSchema`, `ActionGroupPropsSchema`, `ActionMenuPropsSchema`
19+
* and the group/menu member items) take the Button primitive's vocabulary,
20+
* plus `primary`, and refuse `danger`. `ActionSchema`, which the runner
21+
* dispatches, takes `primary | secondary | danger | ghost | link`. The runner
22+
* reads `variant` for one purpose: `danger` paints the confirm button
23+
* destructive (`confirmOptions` in `ActionRunner.ts`).
24+
*
25+
* So this forward is the one place a block's value becomes an action's:
26+
* `destructive` is `danger`, the four values both dialects spell alike pass
27+
* through, and `default` / `outline`, which the action dialect has no word
28+
* for, forward nothing. ⛔ Not a reader-side alias: the block rows keep
29+
* refusing `danger`, and nothing here reads it.
30+
*/
31+
export function toRunnerVariant(variant: UIActionSchema['variant']): ActionDef['variant'] {
32+
switch (variant) {
33+
case 'destructive':
34+
return 'danger';
35+
case 'primary':
36+
case 'secondary':
37+
case 'ghost':
38+
case 'link':
39+
return variant;
40+
default:
41+
return undefined;
42+
}
43+
}

‎ui/packages/types/src/ui-action.ts‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -879,8 +879,20 @@ export interface UIActionSchema {
879879

880880
// === Styling ===
881881

882-
/** Button variant */
883-
variant?: 'default' | 'primary' | 'secondary' | 'destructive' | 'outline' | 'ghost';
882+
/**
883+
* Button variant — the vocabulary `@objectstack/spec`'s action block rows
884+
* declare, by reference: the Button primitive's `default`, `destructive`,
885+
* `outline`, `secondary`, `ghost` and `link`, plus `primary`, which renders
886+
* as `default`.
887+
*
888+
* objectstack#26665: this is the BLOCK dialect, not the one `ActionSchema`
889+
* speaks (`primary | secondary | danger | ghost | link`). The block rows
890+
* refuse `danger`, so this type does too; the four block renderers translate
891+
* at their forward to the runner, where `destructive` becomes `danger`
892+
* (`toRunnerVariant` in `@object-ui/components`). `link` was missing here
893+
* while the rows declared it: aligned, not widened.
894+
*/
895+
variant?: SpecActionButtonProps['variant'];
884896

885897
/**
886898
* Button size — the vocabulary `@objectstack/spec`'s `action:button` row

‎ui/scripts/check-action-forward-parity.mjs‎

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -305,27 +305,6 @@ export const JUSTIFIED = {
305305
])
306306
),
307307

308-
...Object.fromEntries(
309-
["action:button", "action:icon", "action:group", "action:menu"].map((surface) => [
310-
`${surface}:variant`,
311-
{
312-
reason:
313-
"Consumed HERE, in another vocabulary. The runner reads `variant` for one purpose: " +
314-
"`variant: 'danger'` paints the confirm dialog's button destructive (`confirmOptions` in " +
315-
"ActionRunner.ts, objectstack#26580), against the spec's enum on `ActionDef` " +
316-
"(`primary | secondary | danger | ghost | link`). These renderers' `variant` is " +
317-
"`@object-ui/types`' `UIActionSchema.variant`, the button-style vocabulary " +
318-
"(`default | primary | secondary | destructive | outline | ghost`), which each renderer " +
319-
"maps onto its own control and `action:group` / `action:menu` read as `'destructive'`. " +
320-
"Forwarded raw it does not type-check against `ActionDef` and carries no `danger` for the " +
321-
"runner to read; mapping `destructive` to `danger` is a dialect decision, not a forward. " +
322-
"The spread-based hosts (DeclaredActionsBar's dispatch spreads the localized " +
323-
"declaration) carry the declaration's own `variant`.",
324-
issue: 26580,
325-
},
326-
])
327-
),
328-
329308
// ── Read off the declaration, never off the node ───────────────────────────
330309
...Object.fromEntries(
331310
["action:button", "action:icon", "action:group", "action:menu"].map((surface) => [

0 commit comments

Comments
 (0)