Repository navigation
Description
Outcome
Every actionable control in @schlessera/brain-ui-kit outside Button and Disclosure, and the zoomable image in @schlessera/brain-ui-react, renders a native <button type="button"> instead of a div/span with role="button", tabIndex and a hand-written Enter/Space handler, with no pixel change and no prop change.
Why now
Part of #2576. A review against Google Chrome's modern-web-guidance found 22 actionable controls in 15 files with hand-rolled button semantics, counted with grep -rn 'role={[^}]*"button"\|role="button"' packages/ui-kit/src packages/ui-react/src (excluding selectors). About 40 [role="button"] selectors in ui-react and the kit depend on them (for example packages/ui-react/src/components/chat/session-list.tsx:114, packages/ui-kit/src/chrome/SessionStrip.tsx:116, packages/ui-kit/src/tokens.css:2666). The work spans several markup patterns and a cross-package selector migration, so it is split by group.
Guide html/html: "DO use <button> for triggered actions (JS, Modals, Forms) … Set type="button" for non-submit buttons".
Shared context
Binding ruling (maintainer, 2026-10-22):
- All listed leaf controls become native buttons: Composer's six,
FeedbackRow(both),SuggestionChips,InlineToast,AttachmentRow,RelatedFiles,StreamingAnswer,Placeholder,QueueItemRow,ListRow(row and pill), and the zoomable image (a<button>wrapping the<img>, the role removed from the<img>). ListRowconsequence: a button row cannot hold interactive children. Its trailingButton/Togglerenders presentation-only, or, where it is its own action, moves outside the row as a sibling. A development diagnostic warns on interactive trailing content.- Cards, per card:
SurfaceandActionCarduse a stretched title button (no role on the card, inner controls above the overlay);LinkPreviewCardandSearchResultCardare whole-button cards with phrasing-only content and a diagnostic for interactive or flow children. - D55 is amended: the
rowandsurfaceraw-button reasons are dropped; the addendum text is in the ruling comment. - Disabled actionable controls stay focusable and announced, and ignore activation.
Attribution correction (2026-10-24). The ruling phrases the disabled rule as following "#1474's ariaDisabled semantics". It matches #1474 on focus and announcement but not on activation: #1474's ariaDisabled Button forwards the tap to the caller's onClick so the caller can explain the missing prerequisite, whereas the ruling says these controls ignore activation ("inert on activation" in the D55 addendum). These components print their reason instead (for example SuggestionChips' why, packages/ui-kit/src/conversation/SuggestionChips.tsx:61). The children implement the ruling's words: focusable, announced, activation ignored. This difference is intentional, not an inherited #1474 rule.
Constraints and non-goals
- No visual change; existing baselines stay green in both themes; D34 44px reach holds.
- Public prop shapes and meanings stay as they are. The ruling needs no new forwarded refs or prop changes. A child that finds a necessary supported prop/ref or documented semantic change classifies it under
docs/decisions/contract-versioning.mdand addscontract/breakingbefore code; pre-1.0 an approved break ships as a minor changeset naming it. - Not here: the kit
Button(ui-kit: Button renders a div with role=button instead of a native button #1474),Disclosure(ui-kit: Disclosure hand-rolls a toggle button instead of rendering details/summary #2584), elements with other roles (tabs, radios, options), the Composer textarea's IME handling (ui-kit: Composer shortcuts send or stop during IME composition #1810).
Breakdown
- ui-kit: Composer's stop, send, mic, provider, attach and remove controls render span role=button #2759: Composer's six controls.
- ui-kit: conversation feedback, suggestion, answer, file, toast and attachment controls render span role=button #2760: conversation leaves (
FeedbackRow,SuggestionChips,StreamingAnswer,RelatedFiles,InlineToast,AttachmentRow). - ui-kit: ListRow, QueueItemRow and Placeholder actions render div role=button and nest decorative controls #2761: rows (
ListRowrow and pill,QueueItemRow,Placeholder), including the trailing-content change and its diagnostic. - ui-kit: Surface, ActionCard, LinkPreviewCard and SearchResultCard render the whole card as div role=button #2762: cards (
Surface,ActionCardstretched title;LinkPreviewCard,SearchResultCardwhole-button). The later maintainer ruling approves whole-button unlabelled Surface, text-content naming and development warnings, with the phrasing-content restriction explicitly classified as breaking. ui-kit: Surface, ActionCard, LinkPreviewCard and SearchResultCard render the whole card as div role=button #2762 is now agent-ready with contract/breaking; preserve the labelled stretched-button pattern, pixels and documented root-swap state reset. - ui-react: the zoomable image puts role=button on an img, and the role=button selector sweep and D55 addendum remain #2764: the zoomable image, the final
[role="button"]selector sweep and the D55 addendum. Blocked by 1–4.
Tasks 1–4 can land in any order; each replaces the selectors that target its own components.
Definition of done
- Every control named in the ruling renders a native
<button type="button">with no owntabIndex(unless roving) and no Enter/Space handler, proven per component by a real-browser single-activation test that failed on the old tree, with a re-added-Enter-handler mutation showing double activation. grep -rn '\[role="button"\]' packages/ui-*/srcreturns only selectors for components outside this migration.- Visual baselines unchanged in both themes; every 44px reach assertion passes.
- The D55 addendum is recorded in
docs/decisions/design-kit/components-and-interactions.mdand agrees with the shipped behaviour.
2026-10-24: converted into a sub-epic under #2576 with the five children from the ruling's suggested split; corrected the #1474 attribution of the disabled rule; the per-component specification moved into the children.
2026-10-24 triage at main 77f35ef1ba34e4fab7092ada5362ae799852ea24: Updated the #2762 handoff to retain both outstanding prerequisites: approval of the label-less interaction and classification of its proposed public content-semantics consequence. The other ruled card patterns and native-button constraints remain settled; no design or API break is approved.
2026-10-24 triage reconciliation: the maintainer's later #2762 ruling (comment 6386667660) approves A + breaking + warning and resolves both prerequisites. Updated the active parent handoff to consume that ruling; earlier pending-design notes are historical. The child became ready concurrently, and its approved body/labels are preserved.
2026-10-24 maintainer reconciliation: folded the resolved child ruling into active context; historical proposal/triage notes remain history. No delivery or epic completion is inferred.
2026-10-29 source review at main a8e80eea1ec045579ee7d69d6019bce5e78afa5e: Refreshed the disabled-reason why property pointer and verified the selector references. The explicit leaf-control disabled rule still differs from Button activation semantics exactly as the maintainer ruled; no policy is reopened. All five native children remain open. Preserve the existing priority, accepted rulings, exclusions and native membership; the epic remains without agent-ready. No implementation, new extension seam, runtime qualification or release commitment is supplied by this correction.
2026-11-16 source refresh at main 43d73cbe6: Moved the cited model-limits role-button selector past the new markup-motion rule. Existing decisions, native outputs and epic readiness remain unchanged; no new runtime proof is claimed.
Activity
schlessera commentedon Oct 22, 2026
Maintainer ruling
All proposed leaf controls become native
<button type="button">:FeedbackRow(both)SuggestionChips,InlineToast,AttachmentRow,RelatedFiles,StreamingAnswer,Placeholder,QueueItemRowListRow(row and pill)<button>wrapping the<img>, with the role removed from the<img>ListRow consequence: a row that is a button cannot hold interactive children. Its trailing
Button/Toggleeither becomes non-interactive (it already is decorative: the row is the action, so it renders as presentation only, with no button or input) or, where the trailing control is its own action, moves outside the row as a sibling. A development diagnostic warns when an actionableListRowreceives interactive trailing content.Card-sized surfaces, decided per card:
Surface→ (b) stretched link. A native button on the title, a::aftercovering the card, and no role on the card. Inner links and buttons sit above the overlay (position: relative; z-index).ActionCard→ (b) stretched link, for the same reason: it holds its own actions.LinkPreviewCard,SearchResultCard→ (a) button card. The whole card is a<button>, content is restricted to phrasing elements (spans styled as blocks), and a development diagnostic flags interactive or flow children.D55 is amended:
rowandsurfaceraw-button reasons are dropped. Actionable rows and surfaces are native, as above.ariaDisabledsemantics: they stay focusable and tappable, announce disabled, and the activation is ignored.D55 amendment text
Before code
Contract classification: forwarded refs and any
ariaDisabledor prop changes on these components must be classified undercontract-versioning.md, addingcontract/breakingas needed, before implementation starts (per the issue).Suggested split:
SuggestionChips,StreamingAnswer,RelatedFiles,InlineToast,AttachmentRow,FeedbackRow)ListRow,QueueItemRow,Placeholder), including the trailing-content changeSurfaceandActionCard(b);LinkPreviewCardandSearchResultCard(a))[role="button"]selector sweepEach part keeps pixels,
tabStopand roving behaviour, and has the single-activation tests from the acceptance criteria.schlessera commentedon Oct 22, 2026
2026-10-22 readiness reconciliation: folded the maintainer ruling into the body, replacing the unresolved-choice specification and aligning scope/criteria with the accepted branch. The remaining work is explicitly scoped; add agent-ready. Preserve priority, native parent, assignment and release attribution. This is issue preparation, not implementation, runtime proof or delivery.
[-]ui-kit: actionable rows, cards and Composer controls render div role=button instead of native buttons[/-][+]Epic: actionable rows, cards and Composer controls are native buttons[/+]chore(ci): give the epics created in the backlog restructuring their …
schlessera commentedon Oct 24, 2026
2026-10-24 triage at main
77f35ef1ba34e4fab7092ada5362ae799852ea24: Updated the #2762 handoff to retain both outstanding prerequisites: approval of the label-less interaction and classification of its proposed public content-semantics consequence. The other ruled card patterns and native-button constraints remain settled; no design or API break is approved.schlessera commentedon Oct 24, 2026
2026-10-24 triage reconciliation: the maintainer's later #2762 ruling (comment 6386667660) approves A + breaking + warning and resolves both prerequisites. Updated the active parent handoff to consume that ruling; earlier pending-design notes are historical. The child became ready concurrently, and its approved body/labels are preserved.
schlessera commentedon Nov 10, 2026
2026-11-10 triage at main
3aadc8df5: citation drift only: the[role="button"]selector example intokens.cssmoved from:2611to:2663. All five children remain open; no merged PR since the last pass references them. Breakdown, labels and native membership unchanged.