From e29b13fe08d002261eecae0e3c05de03301cec6b Mon Sep 17 00:00:00 2001 From: Mauro Romito Date: Mon, 21 Jul 2025 13:35:56 +0200 Subject: [PATCH] read receipt cell should be grouped and the avatar accessibility hidden --- AccessibilityTests/Sources/AccessibilityTests.swift | 3 ++- ElementX/Sources/Other/AccessibilityIdentifiers.swift | 5 +++++ ElementX/Sources/Screens/Timeline/View/Polls/PollView.swift | 1 + .../Screens/Timeline/View/ReadReceipts/ReadReceiptCell.swift | 2 ++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/AccessibilityTests/Sources/AccessibilityTests.swift b/AccessibilityTests/Sources/AccessibilityTests.swift index c5ab25ad7..a6638ca3c 100644 --- a/AccessibilityTests/Sources/AccessibilityTests.swift +++ b/AccessibilityTests/Sources/AccessibilityTests.swift @@ -91,7 +91,8 @@ final class AccessibilityTests: XCTestCase { private static let notHumanReadableMessage = "Label not human-readable" /// Use this array to filter add specific filters to ignore specific issues for certain elements - private static let ignoredA11yIdentifiers: [String: [FilterType]] = [A11yIdentifiers.authenticationStartScreen.appVersion: [.auditType(.hitRegion)]] + private static let ignoredA11yIdentifiers: [String: [FilterType]] = [A11yIdentifiers.authenticationStartScreen.appVersion: [.auditType(.hitRegion)], + A11yIdentifiers.pollView.summary: [.auditType(.hitRegion)]] } private enum FilterType { diff --git a/ElementX/Sources/Other/AccessibilityIdentifiers.swift b/ElementX/Sources/Other/AccessibilityIdentifiers.swift index 8cedb2c5b..d29216ca1 100644 --- a/ElementX/Sources/Other/AccessibilityIdentifiers.swift +++ b/ElementX/Sources/Other/AccessibilityIdentifiers.swift @@ -42,6 +42,7 @@ enum A11yIdentifiers { static let pollFormScreen = PollFormScreen() static let roomPollsHistoryScreen = RoomPollsHistoryScreen() static let manageRoomMemberSheet = ManageRoomMemberSheet() + static let pollView = PollView() struct AlertInfo { let primaryButton = "alert_info-primary_button" @@ -297,4 +298,8 @@ enum A11yIdentifiers { struct ManageRoomMemberSheet { let viewProfile = "manage_room_member_sheet-view_profile" } + + struct PollView { + let summary = "poll_view-summary" + } } diff --git a/ElementX/Sources/Screens/Timeline/View/Polls/PollView.swift b/ElementX/Sources/Screens/Timeline/View/Polls/PollView.swift index df7165b3f..e58bde4e5 100644 --- a/ElementX/Sources/Screens/Timeline/View/Polls/PollView.swift +++ b/ElementX/Sources/Screens/Timeline/View/Polls/PollView.swift @@ -128,6 +128,7 @@ struct PollView: View { .scaledPadding(.leading, showVotes ? 0 : 32) .foregroundColor(.compound.textSecondary) .frame(maxWidth: .infinity, alignment: showVotes ? .trailing : .leading) + .accessibilityIdentifier(A11yIdentifiers.pollView.summary) } } diff --git a/ElementX/Sources/Screens/Timeline/View/ReadReceipts/ReadReceiptCell.swift b/ElementX/Sources/Screens/Timeline/View/ReadReceipts/ReadReceiptCell.swift index eff89d75c..1d5423291 100644 --- a/ElementX/Sources/Screens/Timeline/View/ReadReceipts/ReadReceiptCell.swift +++ b/ElementX/Sources/Screens/Timeline/View/ReadReceipts/ReadReceiptCell.swift @@ -30,6 +30,7 @@ struct ReadReceiptCell: View { contentID: readReceipt.userID, avatarSize: .user(on: .readReceiptSheet), mediaProvider: mediaProvider) + .accessibilityHidden(true) VStack(alignment: .leading, spacing: 0) { HStack(spacing: 12) { Text(title) @@ -50,6 +51,7 @@ struct ReadReceiptCell: View { .lineLimit(1) } } + .accessibilityElement(children: .combine) .padding(.vertical, 8) .padding(.horizontal, 16) }