From 60cd7fd5cc1838d81c8abca86fea7b1c19ab0d4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Wischer?= Date: Wed, 15 Jul 2026 11:19:52 +0200 Subject: [PATCH] Give the pinned items banner an explicit accessibility label and value The view-all button drops its visible text to an empty string while loading, relying only on a ProgressView for feedback, so VoiceOver users focusing it while it loads hear an unlabelled button. The main pinned-item button also has no accessibility label/value describing which pinned item is shown or its position, since children: .contain leaves that to implicit merging of its sub-views. Set an explicit label on the view-all button so it always announces its title, and give the main button an explicit label (the pinned message) and value (its position, reusing the existing bannerIndicatorDescription/ screenRoomPinnedBannerIndicator strings) instead of relying on container merging. --- .../View/PinnedItemsBanner/PinnedItemsBannerView.swift | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ElementX/Sources/Screens/RoomScreen/View/PinnedItemsBanner/PinnedItemsBannerView.swift b/ElementX/Sources/Screens/RoomScreen/View/PinnedItemsBanner/PinnedItemsBannerView.swift index a101a213e..7ae6650df 100644 --- a/ElementX/Sources/Screens/RoomScreen/View/PinnedItemsBanner/PinnedItemsBannerView.swift +++ b/ElementX/Sources/Screens/RoomScreen/View/PinnedItemsBanner/PinnedItemsBannerView.swift @@ -40,9 +40,11 @@ struct PinnedItemsBannerView: View { } } .disabled(state.isLoading) - .accessibilityElement(children: .contain) + .accessibilityElement(children: .ignore) + .accessibilityLabel(Text(state.displayedMessage)) + .accessibilityValue(state.count > 1 ? Text(state.bannerIndicatorDescription) : Text("")) } - + private var viewAllButton: some View { Button { onViewAllButtonTap() } label: { Text(state.isLoading ? "" : L10n.screenRoomPinnedBannerViewAllButtonTitle) @@ -58,6 +60,7 @@ struct PinnedItemsBannerView: View { .padding(.vertical, 5) } .disabled(state.isLoading) + .accessibilityLabel(L10n.screenRoomPinnedBannerViewAllButtonTitle) } private var content: some View {