Fix the missing accessibility description on the Settings button's avatar

The accessibility audit flagged the avatar node in AvatarSettingsButtonLabel
as having no description, since it carried an accessibility identifier but
never a label.

The avatar is purely decorative, both screens that use it wrap it in a button
that is already labelled with the Settings title, so it is now hidden from
accessibility and the identifier has moved up onto the buttons themselves,
where the UI and integration tests query it.
This commit is contained in:
Stefan Ceriu
2026-08-04 10:31:02 +03:00
parent 4ca7c1a8fa
commit c4e5bde5bf
3 changed files with 3 additions and 1 deletions
@@ -18,9 +18,9 @@ struct AvatarSettingsButtonLabel: View {
contentID: userProfile.id,
avatarSize: .user(on: .chats),
mediaProvider: mediaProvider)
.accessibilityIdentifier(A11yIdentifiers.homeScreen.userAvatar)
.modifier(StatusEmojiModifier(statusEmoji: userProfile.status.displayed?.emoji))
.geometryGroup()
.accessibilityHidden(true) // Decorative, the enclosing button provides the description.
}
}
@@ -89,6 +89,7 @@ struct HomeScreen: View {
mediaProvider: context.mediaProvider)
}
.accessibilityLabel(L10n.commonSettings)
.accessibilityIdentifier(A11yIdentifiers.homeScreen.userAvatar)
}
@ViewBuilder
@@ -101,6 +101,7 @@ struct SpacesScreen: View {
}
.buttonStyle(.borderless)
.accessibilityLabel(L10n.commonSettings)
.accessibilityIdentifier(A11yIdentifiers.homeScreen.userAvatar)
}
ToolbarItem(placement: .principal) {