From c4e5bde5bf45217ff3d6e92904e68c0807abe7c6 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Tue, 4 Aug 2026 10:31:02 +0300 Subject: [PATCH] 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. --- .../Sources/Other/SwiftUI/Views/AvatarSettingsButtonLabel.swift | 2 +- ElementX/Sources/Screens/HomeScreen/View/HomeScreen.swift | 1 + .../Sources/Screens/Spaces/SpacesScreen/View/SpacesScreen.swift | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ElementX/Sources/Other/SwiftUI/Views/AvatarSettingsButtonLabel.swift b/ElementX/Sources/Other/SwiftUI/Views/AvatarSettingsButtonLabel.swift index 5a8d48b58..c858b82c9 100644 --- a/ElementX/Sources/Other/SwiftUI/Views/AvatarSettingsButtonLabel.swift +++ b/ElementX/Sources/Other/SwiftUI/Views/AvatarSettingsButtonLabel.swift @@ -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. } } diff --git a/ElementX/Sources/Screens/HomeScreen/View/HomeScreen.swift b/ElementX/Sources/Screens/HomeScreen/View/HomeScreen.swift index 7c72954f6..923acf5cf 100644 --- a/ElementX/Sources/Screens/HomeScreen/View/HomeScreen.swift +++ b/ElementX/Sources/Screens/HomeScreen/View/HomeScreen.swift @@ -89,6 +89,7 @@ struct HomeScreen: View { mediaProvider: context.mediaProvider) } .accessibilityLabel(L10n.commonSettings) + .accessibilityIdentifier(A11yIdentifiers.homeScreen.userAvatar) } @ViewBuilder diff --git a/ElementX/Sources/Screens/Spaces/SpacesScreen/View/SpacesScreen.swift b/ElementX/Sources/Screens/Spaces/SpacesScreen/View/SpacesScreen.swift index 7f2d3ab53..038d5e339 100644 --- a/ElementX/Sources/Screens/Spaces/SpacesScreen/View/SpacesScreen.swift +++ b/ElementX/Sources/Screens/Spaces/SpacesScreen/View/SpacesScreen.swift @@ -101,6 +101,7 @@ struct SpacesScreen: View { } .buttonStyle(.borderless) .accessibilityLabel(L10n.commonSettings) + .accessibilityIdentifier(A11yIdentifiers.homeScreen.userAvatar) } ToolbarItem(placement: .principal) {