Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add accessible names to profile and notebook dialogs #6222

Merged
merged 1 commit into from
Feb 23, 2024
Merged

Conversation

acelaya
Copy link
Contributor

@acelaya acelaya commented Feb 20, 2024

After the work from #6187, the has been a second accessibility review, which has highlighted the lack of an accessible name for the notebook dialog.

We have been suggested to use aria-labelledby to do this, which is also the recommendation in https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/dialog_role.

However, since the label value is not displayed anywhere else, this PR implements a solution using aria-label instead.

@acelaya acelaya requested a review from robertknight February 20, 2024 10:24
Copy link

codecov bot commented Feb 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (0d31f7c) 99.44% compared to head (a3f4802) 99.44%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6222   +/-   ##
=======================================
  Coverage   99.44%   99.44%           
=======================================
  Files         266      266           
  Lines       10130    10130           
  Branches     2401     2401           
=======================================
  Hits        10074    10074           
  Misses         56       56           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@robertknight robertknight left a comment

Choose a reason for hiding this comment

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

Some thoughts:

  • Use aria-labelledby only if the content already exists in the UI and just needs to be semantically linked to an element. For assistive-technology only labels, aria-label is more appropriate
  • We don't need to include the widget type in labels (eg. "button", "dialog") because that information is already included in the widget's role.
  • For these dialogs, we probably do want to make it clear that the dialog belongs to Hypothesis and not the host page. The Hypothesis sidebar iframe for example is labeled as "Hypothesis annotation viewer".

src/annotator/components/NotebookModal.tsx Outdated Show resolved Hide resolved
src/annotator/components/NotebookModal.tsx Outdated Show resolved Hide resolved
src/annotator/components/ProfileModal.tsx Outdated Show resolved Hide resolved
src/annotator/components/NotebookModal.tsx Outdated Show resolved Hide resolved
@acelaya acelaya merged commit bdcb3c2 into main Feb 23, 2024
4 checks passed
@acelaya acelaya deleted the dialog-name branch February 23, 2024 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants