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: FeedbackRow up/down (packages/ui-kit/src/blocks/FeedbackRow.tsx:132, :144), SuggestionChips (packages/ui-kit/src/conversation/SuggestionChips.tsx:214; its disabled chip already ignores activation while focusable, :53-56), StreamingAnswer (packages/ui-kit/src/conversation/StreamingAnswer.tsx:198), RelatedFiles (packages/ui-kit/src/conversation/RelatedFiles.tsx:141), InlineToast (packages/ui-kit/src/conversation/InlineToast.tsx:161) and AttachmentRow (packages/ui-kit/src/conversation/AttachmentRow.tsx:144).
Scope
- Migrate these six conversation components' actionable elements to native buttons.
SuggestionChipskeeps its focusable, announced, activation-ignoring disabled chip and itswhytext.- 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.
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