fix(avatar): decorative when unnamed + no double-announce (obs-9)#3427
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR No new or modified components detected. Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
nynexman4464
approved these changes
Jul 2, 2026
nynexman4464
left a comment
Contributor
There was a problem hiding this comment.
Seems reasonable. Can confirm voicover ignores the avatar element when the alt/name text is not provided. I wonder if there's a way to make that clear in the doc. Ideally this is only done when there isn't another alternative accessible text describing the person/image.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of the accessibility & keyboard-management program (#3343). Fixes observation
obs-9.Problem
AvatarcomputedaccessibleName = alt || name || 'Avatar'on arole="img"wrapper, so an avatar with neitheraltnornamewas announced as the meaningless generic "Avatar, image" — noise for screen-reader users, with no decorative opt-out. Additionally the outerrole="img"(named) contained an inner<img alt={accessibleName}>, double-announcing the name.Fix
altand noname, the avatar is decorative:role="presentation"+aria-hidden(no generic "Avatar" label).<img>usesalt=""so the accessible name is announced once (by therole="img"wrapper), not twice.Tests
Adds a colocated
Avatar.test.tsx: named avatar exposesrole="img"with the name;altwins overname; an unnamed avatar is decorative (aria-hidden, norole="img"); the inner image isalt=""when the wrapper is named. Full Avatar + AvatarGroup suites green (20 tests), typecheck + lint clean.