This repository was archived by the owner on Oct 26, 2026. It is now read-only.
Repository navigation
Commit 455c646
fix(components,plugin-detail,app-shell,i18n): a record action disabled by its predicate says why it is unavailable (objectui#11811) (#11841)
Fixes #11811
Clause-②: yes
A record action greyed out by its declared `disabled` predicate now says
why. It shows the generic reason "Not available for this record" as a
tooltip, on hover and on keyboard focus, and the same text is its
accessible description (`aria-describedby`). Before, the button carried
no tooltip, no `title` and no description.
## Where the card's defect actually lives
The claim's original Responsibility line named `DeclaredActionsBar` as
the code that draws the showcase Task page's *Archive*. It does not:
`DeclaredActionsBar` renders only `sys_approval_request` actions (record
page approvals bar, approvals inbox). Measured on objectstack `main`
(the card's `879bd38c` is its ancestor), the Task page
(`showcase_task_detail`, `kind: 'full'`) draws Archive in two other
renderers:
- **the header**: a `page:header` node whose `actions` are ids, drawn by
`PageHeaderRenderer`'s `renderButton` (`@object-ui/components`);
- **the section bar**: `record:quick_actions` at `location:
'record_section'`, drawn by `QuickActionButton`
(`@object-ui/plugin-detail`).
The seat recorded the correction in claim amendment 6049093782 and added
the header file to the surface. `DeclaredActionsBar` has the same defect
class, so it gets the same fix.
## What changed
- `page:header`
(`packages/components/src/renderers/layout/containers.tsx`): the inline
button gets a tooltip trigger plus an `sr-only` description. In the ⋯
overflow menu the reason is a visible second line under the label and is
the item's `aria-describedby`; the item's name stays the label
(`aria-labelledby`). A tooltip there would be out of keyboard reach: the
menu's roving focus skips a disabled item (`focusable: !disabled`) and
the menu traps Tab. **Only an authored action's declared `disabled`**
gets the reason. The host-injected Edit and Delete
(`RecordContext.headerSystemActions`, a host-computed boolean) and the
inline-edit lock are unchanged. Authored and host actions are told apart
by key, from the dedupe that lets an authored action win.
- `record:quick_actions` (`QuickActionButton`) and `DeclaredActionsBar`:
the same tooltip trigger and description on the inline button.
- One new key, `actions.notAvailableForRecord`, with real translations
in all ten packs.
**Why a wrapper span.** A natively `disabled` button fires no pointer or
focus events, and the Button primitive adds
`disabled:pointer-events-none`, so a tooltip or a native `title` on the
button itself never opens. The span is the tooltip trigger, the pattern
Radix documents for a disabled trigger. It takes the hover, and
`tabIndex={0}` lets a keyboard user focus it. Both the button and the
span carry `aria-describedby` pointing at a persistent `sr-only` copy,
so a screen reader gets the reason with the tooltip closed. The repo had
no disabled-tooltip pattern. Its `title`-on-disabled-Button sites cannot
show at all; a Chromium probe found that the hit target at a
`pointer-events: none` disabled button's centre is its parent.
**Not changed:** a button greyed out only while its own action runs
(spinner) shows no reason. No export, prop or type member is added. The
author-written reason beside the predicate is a spec key for
objectstack, not part of this PR.
## Tests (head `e165c34`)
- New pins, three files: `page-header-disabledReason-11811.test.tsx`
(7), `record-quick-actions.disabledReason-11811.test.tsx` (7),
`DeclaredActionsBar.disabledReason-11811.test.tsx` (7).
- **Disabled by the predicate:** the button is disabled and described by
the reason; hover opens `role=tooltip`; Tab reaches the trigger, which
opens it.
- **Controls:** a predicate that does not hold gives no reason; a
running or loading button gives no reason; the header's host Edit and
Delete with `disabled: true` give no reason.
- **Overflow:** the item shows the reason and is described by it.
- **Text:** the zh pack and the en pack.
- **Fixture:** the predicate is the served CEL envelope. The bare string
goes to the legacy evaluator, where `has()` faults and a fail-soft
`disabled` greys out both rows, so it would pin the wrong reason.
- `vitest run packages/components/` plus the 36 app-shell, console and
example files that name `page:header`, `PageHeaderRenderer` or
`headerSystemActions`, at `e165c34`: `Test Files 401 passed | 1 skipped
(402)`.
- `vitest run packages/plugin-detail/ packages/i18n/` plus the 27
app-shell and console files that name `DeclaredActionsBar`,
`record-quick-actions` or the key, at `e2a498f`: `Test Files 356 passed
| 1 skipped (357)`. `e165c34` changes no file in those packages.
- type-check: `@object-ui/components` exit 0 at `e165c34`;
`@object-ui/i18n`, `@object-ui/plugin-detail` and `@object-ui/app-shell`
exit 0 at `e2a498f`, on dists rebuilt from this branch.
- **Ablations**, run after commit through objectstack's
`scripts/ablation-replace.mjs`: the anchor `if (!disabledReason) return
button;` is replaced by an unconditional `return button;`.
- Header: `Tests 4 failed | 3 passed (7)`. Red: description, hover,
focus, zh. Green: overflow and both controls.
- Quick actions and `DeclaredActionsBar`: `Tests 10 failed | 4 passed
(14)`. Red: description, hover, focus, zh, en on each. Green: the
controls.
- Each restore was proven: blob equals HEAD and `git diff HEAD` is
empty.
- Gates at `e165c34`, all exit 0:
- i18n: `check:i18n-keys`, `check:i18n-drift` (1 key added, no en value
changed), `check:i18n-dead-keys` (report; the new key is not a
candidate), `check:i18n-designer-parity`;
- changeset: `check-changeset-presence` (4 released packages, 1
changeset), `check-changeset-no-major`, `check-changeset-fixed`,
`check:changeset-claims`, `check:pending-changeset-literals`;
- other: `check:control-bytes`, `check:test-path-roots`,
`check:new-line-citations` (0 new); eslint on touched files (0 errors).
- **Not run locally:** the full app-shell suite. The named-file sets
above cannot see a suite that draws these renderers through a page tree
without naming them; CI runs the full farm.
## Changeset
`.changeset/11811-disabled-action-reason.md`: `@object-ui/i18n` and
`@object-ui/components` are `minor`, `@object-ui/app-shell` and
`@object-ui/plugin-detail` are `patch`. The fixed group publishes all of
them at `minor`, never `major`. The body names the three surfaces and
the one key.
## Acceptance notes
- The generic action renderers (`action:button` / `action:icon` /
`action:group` / `action:menu`) have the same gap. They are their own
family card, objectui#11839, and this PR leaves them alone.
- A `disabled` predicate that faults (fail-soft) also greys the action
out, and now also shows the generic reason. That is consistent, since
the action is unavailable either way, but the wording slightly
overstates the case for a broken predicate.
- `InlineEditSaveBar`'s Save button sets `title` on a disabled Button,
which cannot show for the pointer-events reason above. The approval-lock
band already shows that reason on screen. Noted only.
- Overlap: #11836 adds keys to the same ten packs. Whoever lands second
merges `main`.
The session behind this change is
`https://claude.ai/code/session_01CGZy1BGCjdN5cXqL9cnvB8`.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01CGZy1BGCjdN5cXqL9cnvB8)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 57dbe34 commit 455c646
17 files changed
Lines changed: 751 additions & 28 deletions
File tree
- .changeset
- packages
- app-shell/src/views
- __tests__
- components/src
- __tests__
- renderers/layout
- i18n/src/locales
- plugin-detail/src/renderers
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
35 | 44 | | |
36 | 45 | | |
37 | 46 | | |
| |||
178 | 187 | | |
179 | 188 | | |
180 | 189 | | |
| 190 | + | |
| 191 | + | |
181 | 192 | | |
182 | 193 | | |
183 | 194 | | |
| |||
371 | 382 | | |
372 | 383 | | |
373 | 384 | | |
374 | | - | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
375 | 415 | | |
376 | 416 | | |
377 | 417 | | |
378 | 418 | | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
| 419 | + | |
| 420 | + | |
396 | 421 | | |
397 | 422 | | |
398 | 423 | | |
| |||
420 | 445 | | |
421 | 446 | | |
422 | 447 | | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
423 | 477 | | |
424 | 478 | | |
425 | 479 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
0 commit comments