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".
Controls (Composer, packages/ui-kit/src/chrome/Composer.tsx): stop (:325), send (:338), hold-to-talk mic (:353), provider chip (:387), the attach/mic icon button (:444) and attachment remove (:488). Send's disabled state today is aria-disabled plus tabIndex -1 (Composer.tsx:335-346), so it leaves the tab order; under the ruling it stays focusable.
Scope
- Migrate the six Composer controls to native buttons, keeping their paint, glow and accessible names (the mic keeps its
micLabel/ "Hold to talk" name; today it activates on click, Enter and Space like the others,Composer.tsx:350-360). - Send while unavailable (offline, dictating) becomes focusable and announced with its reason, and ignores activation.
- Replace selectors that target these controls by role.
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.
- Send while unavailable is reachable by Tab, announces its reason, and a click, Enter or Space on it sends nothing.
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).
2026-10-24: filed from #2586 when it became a sub-epic, following the ruling's suggested split.
Activity