You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(DateDetails): make the trigger keyboard accessible - #1348
DateDetails now passes asChild to Popover.Trigger with an EmptyButton wrapping the existing Link/Text, so the trigger role, aria-haspopup and aria-expanded land on a focusable <button> instead of a div.
Tab focuses the trigger, Enter and Space open the popover, and Escape closes it with focus returning to the trigger.
The Popover.Trigger default is unchanged.
Unit tests cover the button attributes, Tab + Enter, and Space + Escape with focus return. All three fail without the change.
Flyout.Trigger has the same div problem described in the issue. I left it out because changing its default changes the rendered element for every consumer, which AGENTS.md treats as a public API change. Happy to follow up with whichever approach you prefer (new default, or asChild at call sites), which is why this uses "Refs" rather than "Fixes".
Visual: the text looks the same. The trigger now shows the EmptyButton focus ring on keyboard focus.
Not run: Playwright visual tests (need Docker), storybook:build, and a screen-reader pass.
Checklist
Breaking changes? (add migration notes in changesets) None.
Visual changes? (specify in changesets) Focus ring on keyboard focus, noted in the changeset.
Design review needed?
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 (build yes; storybook:build not run)
Tests and Stories are aligned with the changes
Accessibility
Keyboard - Tab / Enter / Space / Esc covered by unit tests (jsdom); focus returns to the trigger on close
Names - the button's accessible name is the visible text (e.g. "5 minutes ago")
Vision - focus ring comes from EmptyButton tokens; not checked visually
yarn typecheck, yarn lint, yarn format, yarn circular-dependency:check, yarn test and yarn build pass locally.
Note
Low Risk
Scoped accessibility change to DateDetails trigger markup with no auth or data-handling impact; visual regression risk is limited to the new keyboard focus ring.
Overview DateDetails now uses Popover.Trigger with asChild and an EmptyButton around the existing link-styled label, so aria-haspopup, aria-expanded, and the popover trigger semantics live on a real button instead of a non-focusable wrapper.
Keyboard users can Tab to the trigger, open with Enter or Space, and close with Escape (focus returns to the trigger). Appearance is unchanged except for the EmptyButton focus ring on keyboard focus.
Coverage is expanded with unit tests, Storybookplay stories (FocusVisible, Keyboard), a changeset, and Playwright selectors updated to getByRole('button').
Reviewed by Cursor Bugbot for commit 0d15a49. Bugbot is set up for automated code reviews on this repo. Configure here.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The test still uses a CSS tag selector for interactive hover and click actions instead of the repository-required role-based button locator.
No open issues 🎉
1 previously missed issue
In code that hasn't changed since last review
Use a role-based locator for button interactions
tests/display/date-details.spec.ts:15
This new locator is used for hover and click interactions, but it still selects the trigger by a CSS tag selector. The repository's visual-test guidance requires role-based locators for interactions; use page.getByRole('button') (scoped to the harness if needed) at the call sites so the test verifies the semantic button rather than silently passing for any matching element.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Human assessment is needed because an omitted review finding leaves uncertainty about whether the new interactive-state documentation is adequately verified.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
DateDetailsnow passesasChildtoPopover.Triggerwith anEmptyButtonwrapping the existingLink/Text, so the trigger role,aria-haspopupandaria-expandedland on a focusable<button>instead of adiv.Popover.Triggerdefault is unchanged.Links and tickets
Refs #1346
Good to know
Flyout.Triggerhas the samedivproblem described in the issue. I left it out because changing its default changes the rendered element for every consumer, which AGENTS.md treats as a public API change. Happy to follow up with whichever approach you prefer (new default, orasChildat call sites), which is why this uses "Refs" rather than "Fixes".EmptyButtonfocus ring on keyboard focus.storybook:build, and a screen-reader pass.Checklist
Contribution
buildandbuild-storybookwork locally (buildyes;storybook:buildnot run)Accessibility
EmptyButtontokens; not checked visuallyWCAG 2.2 criteria targeted: 2.1.1 Keyboard, 4.1.2 Name, Role, Value.
yarn typecheck,yarn lint,yarn format,yarn circular-dependency:check,yarn testandyarn buildpass locally.Note
Low Risk
Scoped accessibility change to DateDetails trigger markup with no auth or data-handling impact; visual regression risk is limited to the new keyboard focus ring.
Overview
DateDetailsnow usesPopover.TriggerwithasChildand anEmptyButtonaround the existing link-styled label, soaria-haspopup,aria-expanded, and the popover trigger semantics live on a realbuttoninstead of a non-focusable wrapper.Keyboard users can Tab to the trigger, open with Enter or Space, and close with Escape (focus returns to the trigger). Appearance is unchanged except for the
EmptyButtonfocus ring on keyboard focus.Coverage is expanded with unit tests, Storybook
playstories (FocusVisible,Keyboard), a changeset, and Playwright selectors updated togetByRole('button').Reviewed by Cursor Bugbot for commit 0d15a49. Bugbot is set up for automated code reviews on this repo. Configure here.