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 ARIA labels to all site buttons #3125

Merged
merged 4 commits into from
Jan 23, 2024
Merged

🎉 add ARIA labels to all site buttons #3125

merged 4 commits into from
Jan 23, 2024

Conversation

ikesau
Copy link
Member

@ikesau ikesau commented Jan 22, 2024

Just a quick and easy thing I noticed when reviewing our Lighthouse audits. Effectively, procrastination in the face of our other, much harder to improve metrics like Largest Contentful Paint 😬

Summary by CodeRabbit

  • Accessibility Improvements
    • Enhanced screen reader support with added aria-label attributes to various interactive elements across the site.

@ikesau ikesau requested a review from mlbrgl January 22, 2024 21:51
Copy link
Member

@mlbrgl mlbrgl left a comment

Choose a reason for hiding this comment

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

Good idea!

There are a couple of cases (search, donation), where the aria-label and the default accessible name could be considered redundant (e.g. "Search" vs "Submit search"), but not a major concern.

site/blocks/GalleryArrow.tsx Outdated Show resolved Hide resolved
Copy link

coderabbitai bot commented Jan 23, 2024

Warning

Rate Limit Exceeded

@ikesau has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 13 minutes and 19 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.
Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.
Please see our FAQ for further information.

Commits Files that changed from the base of the PR and between dc3bb33 and 8c657fc.

Walkthrough

The recent updates focus on enhancing web accessibility across various components of a website. By adding or refining aria-label attributes, the changes improve the user experience for those utilizing assistive technologies, ensuring that interactive elements like buttons and navigation controls are more accessible and descriptive.

Changes

Files Change Summary
site/CookieNotice.tsx, site/DonateForm.tsx, site/NewsletterSubscription.tsx Added aria-label to buttons.
site/Feedback.tsx, site/NotFoundPage.tsx, .../SiteMobileMenu.tsx, .../SiteNavigation.tsx, .../SiteNavigationToggle.tsx, .../SiteNavigationTopics.tsx, .../blocks/CookiePreferences.tsx, .../blocks/ExpandableParagraph.tsx, .../blocks/GalleryArrow.tsx, .../blocks/KeyInsights.tsx, .../gdocs/components/BlockErrorBoundary.tsx, .../gdocs/components/ChartStory.tsx, .../gdocs/components/TableOfContents.tsx, .../gdocs/pages/DataInsight.tsx, .../search/SearchPanel.tsx Added or updated aria-label attributes for accessibility.

🐇✨
To the web where all can roam,
With aria-labels they find home.
Clicks and taps now clear as day,
Accessibility wins hooray! 🎉
🥕🌐

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between a960e79 and dc3bb33.
Files selected for processing (19)
  • site/CookieNotice.tsx (2 hunks)
  • site/DonateForm.tsx (1 hunks)
  • site/Feedback.tsx (3 hunks)
  • site/NewsletterSubscription.tsx (2 hunks)
  • site/NotFoundPage.tsx (1 hunks)
  • site/SiteMobileCategory.tsx (1 hunks)
  • site/SiteMobileMenu.tsx (1 hunks)
  • site/SiteNavigation.tsx (4 hunks)
  • site/SiteNavigationToggle.tsx (2 hunks)
  • site/SiteNavigationTopics.tsx (1 hunks)
  • site/blocks/CookiePreferences.tsx (1 hunks)
  • site/blocks/ExpandableParagraph.tsx (1 hunks)
  • site/blocks/GalleryArrow.tsx (1 hunks)
  • site/blocks/KeyInsights.tsx (5 hunks)
  • site/gdocs/components/BlockErrorBoundary.tsx (1 hunks)
  • site/gdocs/components/ChartStory.tsx (2 hunks)
  • site/gdocs/components/TableOfContents.tsx (1 hunks)
  • site/gdocs/pages/DataInsight.tsx (1 hunks)
  • site/search/SearchPanel.tsx (2 hunks)
Files skipped from review due to trivial changes (13)
  • site/CookieNotice.tsx
  • site/DonateForm.tsx
  • site/Feedback.tsx
  • site/NewsletterSubscription.tsx
  • site/NotFoundPage.tsx
  • site/SiteNavigation.tsx
  • site/SiteNavigationTopics.tsx
  • site/blocks/ExpandableParagraph.tsx
  • site/blocks/GalleryArrow.tsx
  • site/gdocs/components/BlockErrorBoundary.tsx
  • site/gdocs/components/ChartStory.tsx
  • site/gdocs/components/TableOfContents.tsx
  • site/search/SearchPanel.tsx
Additional comments: 8
site/SiteNavigationToggle.tsx (2)
  • 7-15: The addition of the ariaLabel prop and its type declaration is correct and aligns with the PR's objective to enhance accessibility.
  • 30-30: The aria-label attribute has been correctly added to the button element, ensuring that the button's purpose is conveyed to screen reader users.
site/SiteMobileCategory.tsx (1)
  • 31-33: The dynamic setting of the ariaLabel prop based on the isActive state is a good practice for accessibility, providing contextually relevant information to assistive technologies.
site/SiteMobileMenu.tsx (1)
  • 54-54: The ariaLabel prop has been correctly added to the SiteNavigationToggle component, enhancing accessibility for the resources menu toggle.
site/blocks/CookiePreferences.tsx (1)
  • 124-124: The aria-label attribute has been correctly added to the button, providing a clear description of the button's action for screen reader users.
site/gdocs/pages/DataInsight.tsx (1)
  • 127-127: The aria-label attribute has been appropriately added to the "copy-link-button", which will help screen reader users understand the button's function.
site/blocks/KeyInsights.tsx (2)
  • 18-21: The addition of the ArrowDirection enum is a good practice for code readability and maintainability, providing clear direction indicators for the arrows.
  • 226-228: The aria-label attribute in the Arrow component is correctly based on the direction prop, providing directional context for screen reader users.

@@ -27,6 +32,7 @@ const Thumb = ({
}) => {
return (
<button
aria-label="Go to slide"
Copy link

Choose a reason for hiding this comment

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

The aria-label attribute added to the Thumb component's button element is a good accessibility improvement, but it could be more descriptive by including the slide title.

- aria-label="Go to slide"
+ aria-label={`Go to slide: ${title}`}

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
aria-label="Go to slide"
aria-label={`Go to slide: ${title}`}

@ikesau ikesau merged commit 80c3a9d into master Jan 23, 2024
12 of 13 checks passed
@ikesau ikesau deleted the buttons-aria-labels branch January 23, 2024 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants