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: ListRow row (packages/ui-kit/src/rows/ListRow.tsx:164-185) and pill (:215-231), QueueItemRow (packages/ui-kit/src/rows/QueueItemRow.tsx:195) and Placeholder (packages/ui-kit/src/states/Placeholder.tsx:235). ListRow's trailing Toggle and actionLabel Button are decorative today (ListRow.tsx:196-197). The trailing Button is handlerless, so #1474's actionable-only rule also requires it to become noninteractive markup: whichever of #1474 and this issue lands first makes that change, and the other keeps it. The ruling's ListRow consequence: a row that is a button cannot hold interactive children. Its trailing Button/Toggle either renders presentation-only (it is decorative: the row is the action) or, where the trailing control is its own action, moves outside the row as a sibling. A development diagnostic warns when an actionable ListRow receives interactive trailing content.
Scope
- Migrate
ListRowrow and pill,QueueItemRowandPlaceholderto native buttons. - Render ListRow's decorative trailing
Toggle/Buttonpresentation-only (no button, no input, no role), keeping pixels; move any caller whose trailing control is an independent action to a sibling outside the row. - Add the development diagnostic for interactive trailing content in an actionable
ListRow. - Replace selectors that target these rows by role (for example in
packages/ui-react/src/components/chat/session-list.tsx,session-drawer.tsx,sessions-pane.tsx,packages/ui-kit/src/chrome/SessionStrip.tsx,PendingFollowUps.tsx).
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.
- Tests cover both a noninteractive decorative trailing control and an independent sibling trailing action; the diagnostic fires for interactive trailing content in an actionable row, and not otherwise.
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