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

fix(toolbar): assign label to icons #12734

Merged
merged 3 commits into from
Dec 20, 2024
Merged

Conversation

ematipico
Copy link
Member

Changes

There were some accessibility issues related to the labels of icons and buttons in our toolbar. This PR should fix it.

Testing

CI should pass

Docs

N/A

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Dec 13, 2024
Copy link

codspeed-hq bot commented Dec 13, 2024

CodSpeed Performance Report

Merging #12734 will not alter performance

Comparing fix/toolbar-bar-label-icons (31314a7) with main (f3d8385)

Summary

✅ 4 untouched benchmarks

Copy link
Member

@delucis delucis left a comment

Choose a reason for hiding this comment

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

We shouldn’t use <title> here as it introduces a duplicate tooltip for those using a mouse to hover:

toolbar icon with a “Menu” tooltip and also the browser’s native title tooltip reading “Menu” overlapping

I also did some screenreader testing and it appears these changes are not required — the buttons already include accessible labels in the accessibility tree when testing with the version on main:

Firefox accessibility tree visualization showing 4 buttons with labels of Menu, Inspect, Audit, and Settings

Instead, we should hide the SVGs using aria-hidden="true".

Copy link

changeset-bot bot commented Dec 17, 2024

⚠️ No Changeset found

Latest commit: 31314a7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

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

@ematipico ematipico requested a review from delucis December 17, 2024 13:49
Copy link
Member

@delucis delucis left a comment

Choose a reason for hiding this comment

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

Thanks for the changes @ematipico! They look good. Just one question.

packages/astro/src/runtime/client/dev-toolbar/toolbar.ts Outdated Show resolved Hide resolved
@ematipico ematipico requested a review from delucis December 20, 2024 15:07
Copy link
Member

@delucis delucis left a comment

Choose a reason for hiding this comment

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

Perfect. OK, should be good to go I think! Thanks for bearing with me on this one 🙌

@ematipico ematipico merged commit 98f9e83 into main Dec 20, 2024
16 checks passed
@ematipico ematipico deleted the fix/toolbar-bar-label-icons branch December 20, 2024 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants