Skip to content

Commit 513d5b6

Browse files
committed
fix(ui): restore the #26665 changeset; this card's changeset supersedes its variant sentences
Claude-Session: https://claude.ai/code/session_01WGufzeYWDZN6LkXji5ziLF Co-authored-by: Claude <noreply@anthropic.com>
1 parent d34cb6e commit 513d5b6

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

‎.changeset/26665-action-block-destructive-confirm.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
'@object-ui/types': patch
44
---
55

6-
fix(ui): a destructive action block confirms through the destructive button (#26665)
6+
fix(ui): a `destructive` action block confirms through the destructive button (#26665)
77

88
Clause-②: no
99
Metadata-protocol: none
1010

11-
The four action blocks (`action:button`, `action:icon`, `action:group`, `action:menu`) now forward their `variant` to the action runner, which reads it to paint the confirm button: a destructive block with a `confirmText` now asks its question through the destructive confirm button, where before it asked through a neutral one. `danger` / `primary` / `secondary` / `ghost` / `link` forward as they are, and `default` / `outline`, which an action's own `variant` has no word for, forward nothing. The destructive value is spelled `danger` on the blocks, the same word `ActionSchema.variant` uses (see the action block variant entry in this release).
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.
1212

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.
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.

‎.changeset/26779-action-block-variant-danger.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ The block rows now take `danger` in place of `destructive`: `default | danger |
1313

1414
The four block renderers forward `danger` to the runner as it is and draw it as the primitive's `destructive`. They no longer read `destructive`: stored pages are rewritten by the conversion below, so no renderer keeps a bridge for the old word. `UIActionSchema.variant` (`@object-ui/types`) follows the rows by reference. The record detail views' Delete entry in the `⋯` menu is spelled `danger` too.
1515

16+
This replaces the variant sentences of the #26665 entry in this release: the action blocks no longer translate `destructive` to `danger` at their forward to the runner, and `danger` is the spelling they accept (`UIActionSchema.variant` included). That entry's confirm-dialog behaviour is unchanged: a destructive block with a `confirmText` asks through the destructive confirm button, now when it is declared `variant: 'danger'`.
17+
1618
Stored rows and older built artifacts: the ADR-0087 D2 conversion `page-action-block-variant-destructive-to-danger` rewrites `variant: 'destructive'` to `'danger'` on the four blocks' `properties.variant` and on each `action:group` / `action:menu` member's `variant`, at every position a page nests a component (regions, slots, nested containers). A stored `page` row is rewritten when it is rehydrated, so it keeps drawing the destructive button and confirming through the destructive confirm button. The conversion is retired from the load path, so a source that still writes `destructive` on a block is refused, not rewritten. The D3 entry `ui-page-action-block-variant-destructive-refused` carries the judgment for `os migrate meta`.
1719

1820
Clause-②: no (narrowing) — the action block rows refuse `destructive`, a value they used to accept. `danger` takes its place on the same rows.

0 commit comments

Comments
 (0)