Repository navigation
Description
Context
Part of #2586 (sub-epic under #2576). The maintainer ruling (2026-10-22) makes every actionable kit control a native <button type="button">: no div/span role="button", no own tabIndex (unless roving) and no hand-written Enter/Space handler. A button never contains interactive content. Disabled actionable controls stay focusable and announced (aria-disabled), and ignore activation. That shares #1474's ariaDisabled focus and announcement, but not its activation: #1474's ariaDisabled Button forwards the tap to the caller's onClick so it can explain, whereas these controls print their reason (why, blockedWhy) and ignore the tap. The difference is intentional per the ruling's own wording ("activation is ignored", "inert on activation").
Guide html/html: "DO use <button> for triggered actions (JS, Modals, Forms) … Set type="button" for non-submit buttons".
The zoomable image puts role="button" on an <img> (packages/ui-react/src/components/images/zoomable-image.tsx:62-70). The ruling: a <button> wrapping the <img>, with the role removed from the <img>. This child also closes the selector sweep and records the D55 addendum once the other groups have landed. D55 (components-and-interactions.md, "D55: native icon and text actions") keeps row and surface raw-button reasons that the ruling drops.
Scope
- Wrap the zoomable image in a native button and remove the
<img>'s role. - Sweep any remaining
[role="button"]selector inpackages/ui-*/srcand tests. - Record the ruling's D55 addendum text (in the ruling comment) in
components-and-interactions.md, dropping therowandsurfaceraw-button reasons, and stating the disabled rule as focusable, announced and inert on activation.
Out of scope
- The kit
Button(ui-kit: Button renders a div with role=button instead of a native button #1474) andDisclosure(ui-kit: Disclosure hand-rolls a toggle button instead of rendering details/summary #2584). - Elements with roles other than
button(tabs, radios, options). - Visual changes. Pixels stay as they are in both themes.
- The Composer textarea's IME handling (ui-kit: Composer shortcuts send or stop during IME composition #1810).
Acceptance criteria
- Each migrated control renders a native
<button type="button">with no owntabIndex(unless roving) and no Enter/Space handler, keepingtabStop/roving behaviour. Activation fires once per click, Enter or Space. - Disabled states (where the component has one) stay focusable, announce
aria-disabled, and ignore click, Enter and Space. -
[role="button"]selectors inpackages/ui-*/srcand tests that target this child's components are replaced withbuttonselectors ordata-hooks. - A real-browser test per migrated component asserts the native element and single activation, and fails on the current tree. A mutation that re-adds a manual Enter handler shows double activation. Record both runs in the PR.
- Visual baselines are unchanged in both themes, and every 44px reach assertion (D34) passes.
-
grep -rn '\[role="button"\]' packages/ui-*/srcreturns only selectors that target components still outside this migration (Disclosureuntil ui-kit: Disclosure hand-rolls a toggle button instead of rendering details/summary #2584, the kitButtonuntil ui-kit: Button renders a div with role=button instead of a native button #1474). - The D55 addendum is recorded and agrees with the shipped behaviour of all five groups.
Verification
node scripts/visual.mjs
bun run test packages/ui-kit packages/ui-react
bun run typecheck
bun run lint
bun run check:pr --base origin/mainContract impact
- This touches the integration contract, so it needs the
contractlabel, aCONTRACT:commit prefix, and the doc updated in the same commit. Not expected: the ruling needs no new forwarded refs or prop changes, and existing public prop shapes and meanings are preserved. If implementation finds a necessary supported prop/ref or documented semantic change, classify it underdocs/decisions/contract-versioning.mdand addcontract/breakingbefore code is written; pre-1.0 an approved break ships as a minor changeset naming it. - This changes a published package's behaviour, so it needs a changeset (
@schlessera/brain-ui-kit, plus@schlessera/brain-ui-reactwhere it changes).
Blocked by #2759
Blocked by #2760
Blocked by #2761
Blocked by #2762
2026-10-24: filed from #2586 when it became a sub-epic, following the ruling's suggested split.
Activity