-
Notifications
You must be signed in to change notification settings - Fork 12
Screenreader working Draft for Oceans Guide #411
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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"> |
Copilot
AI
Jan 27, 2026
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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" |
Copilot
AI
Jan 27, 2026
There was a problem hiding this comment.
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.
| aria-labelledby="guide-heading" | |
| aria-labelledby={currentGuide.style === 'Info' ? 'guide-heading' : undefined} |
There was a problem hiding this comment.
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
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:
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