Skip to content

Conversation

@hannahbergam
Copy link
Contributor

@hannahbergam hannahbergam commented Jan 27, 2026

This is a step toward screenreader compatibility for Oceans. While the buttons are not all intuitive yet (sometimes you have to keyboard nav backwards to get to continue), at least the guide is reading out loud when I have VoiceOver turned on.

I was able to download the repo instead of working in a github codespace and use a symlink to connect the two repositories. I had to mess with the package.json file to get the two compatible, but am not pushing those changes here.

Jira:
https://codedotorg.atlassian.net/browse/SL-1529

Future Updates:

  1. Fix the animation so that when you are training, the screenreader reads out loud what the image is so a user knows how to tag it as a fish or not a fish
  2. Fix the text in the guide so users know how to navigate via keyboard.

Before, there was no voiceover action of the guide at all:

Screen.Recording.2026-01-27.at.2.08.22.PM.mov

After:

Screen.Recording.2026-01-27.at.1.53.03.PM.mov

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR implements initial screenreader compatibility for the Oceans Guide component by adding ARIA attributes, keyboard navigation support, and focus management to make the guide accessible to users with screenreaders like VoiceOver.

Changes:

  • Added keyboard event handling to enable navigation with Space and Enter keys
  • Implemented focus management that automatically focuses the guide dialog when it appears
  • Added ARIA attributes (aria-label, aria-labelledby, aria-live, aria-hidden) to improve screenreader announcements

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

<div style={styles.guideTypingText}>

{/* Visually hidden aria-live region for screen readers */}
<div style={{position: 'absolute', left: '-9999px', width: '1px', height: '1px', overflow: 'hidden'}} aria-live="polite">
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

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

The visually hidden div uses inline styles for screen reader-only content. While functional, this pattern is fragile and should be extracted to a reusable style constant or utility class to ensure consistency across the application and make it easier to maintain.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Understood- this is in a small repo and if I reuse it within there I can refactor to a utility class

>
<div
ref={this.guideDialogRef}
aria-labelledby="guide-heading"
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

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

The guide dialog uses aria-labelledby='guide-heading' but this element only exists when currentGuide.style === 'Info'. For other guide styles, the aria-labelledby will reference a non-existent element, which could confuse screenreaders. Consider using aria-label with appropriate text for non-Info guides, or conditionally setting aria-labelledby only when the heading exists.

Suggested change
aria-labelledby="guide-heading"
aria-labelledby={currentGuide.style === 'Info' ? 'guide-heading' : undefined}

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we don't have a guide providing info, we don't need a label here. Plus, I tried adding a conditional aria-label and it took over precedence

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.

1 participant