Make initials-only rails avatar component default to aria-hidden
What does this MR do and why?
The Rails Avatar component currently uses the item name as a default alt text if no alt text is provided, but this makes no sense when there is no image.
This MR adjusts the default behavior so that by default, initial-only rails avatars will have no alt text and will be aria-hidden.
This MR also adjusts the usage of rails avatar components on Group or Project homepages so that the avatar that immediately precedes the name of the group or project will also have aria-hidden=true, since even if it does have an image, reading the group or project name aloud here will be useless to the screen reader user, who will hear the group or project name read aloud again by the text that follows the avatar.
References
Screenshots or screen recordings
N/A, no change
How to set up and validate locally
- check out this branch
- Visit a group homepage in the GDK for a group that has no avatar image
- inspect the avatar in devtools
- you will see that it has no alt text and has
aria-hidden="true" - Visit a group homepage in the GDK for a group that DOES have an avatar image
- inspect the avatar in devtools
- you will see that it has no alt text and has
aria-hidden="true" - Visit a project homepage in the GDK for a project that has no avatar image
- inspect the avatar in devtools
- you will see that it has no alt text and has
aria-hidden="true" - Visit a project homepage in the GDK for a project that DOES have an avatar image
- inspect the avatar in devtools
- you will see that it has no alt text and has
aria-hidden="true"
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.