Skip to content

fix(a11y): add aria-label to cross-filter search icon#41619

Merged
eschutho merged 2 commits into
masterfrom
fix/a11y-cross-filter-search-icon
Jul 13, 2026
Merged

fix(a11y): add aria-label to cross-filter search icon#41619
eschutho merged 2 commits into
masterfrom
fix/a11y-cross-filter-search-icon

Conversation

@eschutho

@eschutho eschutho commented Jul 1, 2026

Copy link
Copy Markdown
Member

Summary

  • The cross-filter chart title's search icon (CrossFilterTitle.tsx) is a role="button" icon-only control (clicking it highlights/locates the source chart), but had no accessible name — screen readers would only announce the raw SVG icon content.
  • WCAG 2.1 SC 4.1.2 (Name, Role, Value) — Level A.
  • Added aria-label={t('Locate the chart')}, reusing the same translated string already shown in the element's visual Tooltip, so the visible and accessible names stay in sync.
  • Added a unit test asserting the icon is reachable via getByRole('button', { name: 'Locate the chart' }).
  • Behavior is unchanged — purely additive aria-label + tabIndex/role/onClick untouched.

Test plan

  • npx jest src/dashboard/components/nativeFilters/FilterBar/CrossFilters/CrossFilterTitle.test.tsx — 4/4 passing, including the new accessible-name assertion.
  • Manual: open a dashboard with a cross-filter applied, tab to the search icon next to the filtered chart's title, and confirm a screen reader announces "Locate the chart, button" (not just "search, button" or nothing).

Notes

Also spotted a pre-existing, separate gap while reviewing: the icon has onClick but no onKeyDown, so Enter/Space won't activate it for keyboard users (the sibling VerticalCollapse.tsx in the same directory already handles this correctly and can serve as a reference). Leaving that out of scope for this PR since it's unrelated to the missing-label fix; happy to follow up separately.

@dosubot dosubot Bot added dashboard:cross-filters Related to the Dashboard cross filters design:accessibility Related to accessibility standards labels Jul 1, 2026
@bito-code-review

bito-code-review Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #4f405b

Actionable Suggestions - 0
Additional Suggestions - 1
  • superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/CrossFilterTitle.test.tsx - 1
    • Hardcoded string instead of translation · Line 78-78
      The test hardcodes `'Locate the chart'` as the accessible name, but the component at line 83 uses `t('Locate the chart')` for its `aria-label`. If the translation key changes, this assertion will silently pass against stale text while the component uses a different string. Import `t` and use `t('Locate the chart')` to maintain alignment with the component's i18n pattern.
Review Details
  • Files reviewed - 2 · Commit Range: 244dcc6..a65a800
    • superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/CrossFilterTitle.test.tsx
    • superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/CrossFilterTitle.tsx
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@eschutho
eschutho requested a review from kgabryje July 1, 2026 10:14
@kgabryje

Copy link
Copy Markdown
Member

@eschutho I think some selectors in unit tests need updating

@eschutho
eschutho merged commit 9818da4 into master Jul 13, 2026
64 of 66 checks passed
@eschutho
eschutho deleted the fix/a11y-cross-filter-search-icon branch July 13, 2026 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dashboard:cross-filters Related to the Dashboard cross filters design:accessibility Related to accessibility standards size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants