Skip to content

Epic: actionable rows, cards and Composer controls are native buttons #2586

Open
0 of 5 issues completed
Open

Description

@schlessera

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>).
  • ListRow consequence: a button row cannot hold interactive children. Its trailing Button/Toggle renders 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: Surface and ActionCard use a stretched title button (no role on the card, inner controls above the overlay); LinkPreviewCard and SearchResultCard are whole-button cards with phrasing-only content and a diagnostic for interactive or flow children.
  • D55 is amended: the row and surface raw-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

Breakdown

  1. ui-kit: Composer's stop, send, mic, provider, attach and remove controls render span role=button #2759: Composer's six controls.
  2. ui-kit: conversation feedback, suggestion, answer, file, toast and attachment controls render span role=button #2760: conversation leaves (FeedbackRow, SuggestionChips, StreamingAnswer, RelatedFiles, InlineToast, AttachmentRow).
  3. ui-kit: ListRow, QueueItemRow and Placeholder actions render div role=button and nest decorative controls #2761: rows (ListRow row and pill, QueueItemRow, Placeholder), including the trailing-content change and its diagnostic.
  4. ui-kit: Surface, ActionCard, LinkPreviewCard and SearchResultCard render the whole card as div role=button #2762: cards (Surface, ActionCard stretched title; LinkPreviewCard, SearchResultCard whole-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.
  5. 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 own tabIndex (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-*/src returns 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.md and 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

  1. added
    type: refactor
    area: ui-react
    area: ui-kit
    priority: p3
    needs: decision
    on Oct 22, 2026
  2. schlessera commented on Oct 22, 2026

    @schlessera
    OwnerAuthor

    Maintainer ruling

    1. All proposed leaf controls become native <button type="button">:

      • Composer's six: stop, send, hold-to-talk mic, provider chip, attach/mic icon button, attachment remove
      • FeedbackRow (both)
      • SuggestionChips, InlineToast, AttachmentRow, RelatedFiles, StreamingAnswer, Placeholder, QueueItemRow
      • ListRow (row and pill)
      • the zoomable image: a <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/Toggle either 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 actionable ListRow receives interactive trailing content.

    2. Card-sized surfaces, decided per card:

      • Surface → (b) stretched link. A native button on the title, a ::after covering 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.
    3. D55 is amended:

    D55 amendment text

    D55 addendum: actionable rows, cards and Composer controls are native. Every actionable control in the kit renders <button type="button">; div/span role="button" is not used. Leaf controls are buttons. A card that holds its own actions (Surface, ActionCard) uses a stretched title button. A card whose whole face is one action and holds only phrasing content (LinkPreviewCard, SearchResultCard) is a button. A button never contains interactive content, and development diagnostics enforce it. Disabled actionable controls use ariaDisabled (#1474): focusable, announced, inert on activation.

    Before code

    • Contract classification: forwarded refs and any ariaDisabled or prop changes on these components must be classified under contract-versioning.md, adding contract/breaking as needed, before implementation starts (per the issue).

    • Suggested split:

      1. Composer
      2. the conversation leaves (SuggestionChips, StreamingAnswer, RelatedFiles, InlineToast, AttachmentRow, FeedbackRow)
      3. rows (ListRow, QueueItemRow, Placeholder), including the trailing-content change
      4. cards (Surface and ActionCard (b); LinkPreviewCard and SearchResultCard (a))
      5. the zoomable image, plus the [role="button"] selector sweep

      Each part keeps pixels, tabStop and roving behaviour, and has the single-activation tests from the acceptance criteria.

  3. added
    agent-ready
    and removed
    needs: decision
    on Oct 22, 2026
  4. schlessera commented on Oct 22, 2026

    @schlessera
    OwnerAuthor

    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.

  5. added
    epic
    and removed
    agent-ready
    on Oct 24, 2026
  6. changed the title [-]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[/+] on Oct 24, 2026
  7. schlessera commented on Oct 24, 2026

    @schlessera
    OwnerAuthor

    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.

  8. schlessera commented on Oct 24, 2026

    @schlessera
    OwnerAuthor

    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.

  9. schlessera commented on Nov 10, 2026

    @schlessera
    OwnerAuthor

    2026-11-10 triage at main 3aadc8df5: citation drift only: the [role="button"] selector example in tokens.css moved from :2611 to :2663. All five children remain open; no merged PR since the last pass references them. Breakdown, labels and native membership unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: ui-kitarea: ui-reactepicpriority: p3type: refactor

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions