Skip to content

fix(a11y): Keyboard-operable Cards - #1275

Open
XOP wants to merge 3 commits into
mainfrom
fix/cui-308-clickable-cards
Open

XOP wants to merge 3 commits into
mainfrom
fix/cui-308-clickable-cards

Conversation

@XOP

@XOP XOP commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Links and tickets

CUI-308 (CUI-305 to CUI-310 burn-down). Follows #1269.

Checklist

  • Breaking changes? (add migration notes in changesets) No.
  • Visual changes? (specify in changesets) No.
  • Design review needed? No.

Contribution

  • Sufficient research before PR
  • Self-reviewed the PR
  • Manually tested the changes (when applies - visual confirmation in Storybook)
  • build and build-storybook work locally (full pre-PR command from AGENTS.md section 2 passes)
  • Tests and Stories are aligned with the changes

Note

Medium Risk
Touches shared card interaction and ARIA roles across three components; behavior changes for disabled clicks and keyboard focus, though covered by expanded tests.

Overview
Clickable cards (CardPrimary, CardSecondary, and aligned CardHorizontal) now behave like buttons for keyboard and assistive tech when they have an onClick and no competing inner control: role="button", Enter/Space activation via shared clickOnActivationKey, and disabled cards no longer invoke onClick.

When an inner infoText button (CardPrimary / CardHorizontal) or infoUrl link (CardSecondary) is present, the outer card drops the button role so Enter/Space stay on that control; CardHorizontal also respects onClick={undefined} so only the inner button fires. Display-only cards are unchanged. CardSecondary hides the chevron icon from the accessible name when infoText is set.

ESLint suppressions for the primary/secondary cards are removed; tests, Storybook keyboard stories, and a patch changeset document the behavior (including guidance not to nest links/buttons in clickable card content).

Reviewed by Cursor Bugbot for commit 37e7053. Bugbot is set up for automated code reviews on this repo. Configure here.

@XOP
XOP requested review from DreaminDani and EvandroLG October 19, 2026 12:55
@XOP XOP added bug Something isn't working a11y Accessibility improvements labels Oct 19, 2026
@changeset-bot

changeset-bot Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9cbc99e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@clickhouse/click-ui Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit ced04ae. Configure here.

Comment thread src/components/CardPrimary/CardPrimary.tsx

@DreaminDani DreaminDani left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two inconsistencies still (feel free to fix elsewhere if not relevant):

  1. Spacebar doesn't do anything in secondary card buttons
  2. Hitting "Enter" opens in a new tab on primary card but opens in the same tab on secondary card

Not sure if either of these are intentional. Walkthrough (video has audio):

CleanShot.2026-10-19.at.10.46.56.mp4

@workflow-authentication-public

Copy link
Copy Markdown
Contributor

Storybook Preview Deployed

✅ Preview URL: https://click-n6mv24evp-clickhouse.vercel.app

Built from commit: 20f05baae35ec20920edda2faed967159025d9dc

@workflow-authentication-public

Copy link
Copy Markdown
Contributor

Chromatic Storybook

Check Status Link
Storybook ✅ 666 stories published Open Storybook
UI Tests ✅ 666 tests unchanged Open build

Built from commit: 9cbc99e00b79d0e986d280b941c6dfcbc1701294 · Chromatic run

Statuses as of the end of the run. The build link shows the live review state.

This branch has not been deployed

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

Labels

a11y Accessibility improvements bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants