fides icon indicating copy to clipboard operation
fides copied to clipboard

Add keyboard accessible CustomTooltip HOC

Open gilluminate opened this issue 7 months ago • 1 comments

Closes ENG-849

Description Of Changes

Introduces a new Higher-Order Component (HOC) CustomTooltip that wraps the Ant Design Tooltip to provide enhanced keyboard accessibility. This HOC automatically adds a tabIndex to non-focusable elements, allowing them to receive focus and trigger the tooltip. It also applies a custom focus-visible style for better visibility.

Code Changes

  • fidesui
    • Added a new CustomTooltip HOC that automatically provides keyboard accessibility (focus trigger, tabIndex) to Ant Design's Tooltip.
    • Exported CustomTooltip as the default AntTooltip from the fidesui library.
  • admin-ui
    • Updated the POC page to demonstrate the new tooltip behaviors.
    • Added theme overrides for the Tag component.

Steps to Confirm

  1. Navigate to the Ant components POC page at /poc/ant-components.
  2. Hover over the various tooltipped elements to confirm the tooltips appear as expected.
  3. Use the Tab key to navigate the page.
  4. Confirm that the text "Hover or focus this text" receives focus, shows a dashed outline, and displays its tooltip.
  5. Confirm that the "Button with tooltip" also receives focus and displays its tooltip, but without the custom dashed outline.

Pre-Merge Checklist

  • [x] Issue requirements met
  • [ ] All CI pipelines succeeded
  • [x] CHANGELOG.md updated
    • [ ] Add a https://github.com/ethyca/fides/labels/db-migration label to the entry if your change includes a DB migration
    • [ ] Add a https://github.com/ethyca/fides/labels/high-risk label to the entry if your change includes a high-risk change (i.e. potential for performance impact or unexpected regression) that should be flagged
    • [ ] Updates unreleased work already in Changelog, no new entry necessary
  • Followup issues:
    • [ ] Followup issues created
    • [x] No followup issues
  • Database migrations:
    • [ ] Ensure that your downrev is up to date with the latest revision on main
    • [ ] Ensure that your downgrade() migration is correct and works
      • [ ] If a downgrade migration is not possible for this change, please call this out in the PR description!
    • [x] No migrations
  • Documentation:
    • [ ] Documentation complete, PR opened in fidesdocs
    • [ ] Documentation issue created in fidesdocs
    • [ ] If there are any new client scopes created as part of the pull request, remember to update public-facing documentation that references our scope registry
    • [x] No documentation updates required

gilluminate avatar Jun 27 '25 22:06 gilluminate

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
fides-plus-nightly ⬜️ Ignored (Inspect) Visit Preview Jun 27, 2025 11:23pm
fides-privacy-center ⬜️ Ignored (Inspect) Jun 27, 2025 11:23pm

vercel[bot] avatar Jun 27 '25 22:06 vercel[bot]

fides    Run #13037

Run Properties:  status check passed Passed #13037  •  git commit 029dc8a6fa: Add keyboard accessible CustomTooltip HOC (#6276)
Project fides
Branch Review main
Run status status check passed Passed #13037
Run duration 00m 53s
Commit git commit 029dc8a6fa: Add keyboard accessible CustomTooltip HOC (#6276)
Committer Jason Gill
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 5
View all changes introduced in this branch ↗︎

cypress[bot] avatar Jun 30 '25 15:06 cypress[bot]