From 361fa407d58bb576d5e907e6ccbe590bcca3b4fe Mon Sep 17 00:00:00 2001 From: Emily <92288602+burtonemily@users.noreply.github.com> Date: Mon, 13 Feb 2023 15:23:30 +1100 Subject: [PATCH] Updating read status accessibility ids --- .../Context Menu/ContextMenuVC+Action.swift | 16 ++++++++++----- .../Message Cells/VisibleMessageCell.swift | 20 +++++++++---------- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/Session/Conversations/Context Menu/ContextMenuVC+Action.swift b/Session/Conversations/Context Menu/ContextMenuVC+Action.swift index b8f19816b..fbce5ed60 100644 --- a/Session/Conversations/Context Menu/ContextMenuVC+Action.swift +++ b/Session/Conversations/Context Menu/ContextMenuVC+Action.swift @@ -46,14 +46,17 @@ extension ContextMenuVC { static func copy(_ cellViewModel: MessageViewModel, _ delegate: ContextMenuActionDelegate?) -> Action { return Action( icon: UIImage(named: "ic_copy"), - title: "copy".localized() + title: "copy".localized(), + accessibilityLabel: "Copy text" ) { delegate?.copy(cellViewModel) } } static func copySessionID(_ cellViewModel: MessageViewModel, _ delegate: ContextMenuActionDelegate?) -> Action { return Action( icon: UIImage(named: "ic_copy"), - title: "vc_conversation_settings_copy_session_id_button_title".localized() + title: "vc_conversation_settings_copy_session_id_button_title".localized(), + accessibilityLabel: "Copy Session ID" + ) { delegate?.copySessionID(cellViewModel) } } @@ -76,14 +79,16 @@ extension ContextMenuVC { static func ban(_ cellViewModel: MessageViewModel, _ delegate: ContextMenuActionDelegate?) -> Action { return Action( icon: UIImage(named: "ic_block"), - title: "context_menu_ban_user".localized() + title: "context_menu_ban_user".localized(), + accessibilityLabel: "Ban user" ) { delegate?.ban(cellViewModel) } } static func banAndDeleteAllMessages(_ cellViewModel: MessageViewModel, _ delegate: ContextMenuActionDelegate?) -> Action { return Action( icon: UIImage(named: "ic_block"), - title: "context_menu_ban_and_delete_all".localized() + title: "context_menu_ban_and_delete_all".localized(), + accessibilityLabel: "Ban user and delete" ) { delegate?.banAndDeleteAllMessages(cellViewModel) } } @@ -96,7 +101,8 @@ extension ContextMenuVC { static func emojiPlusButton(_ cellViewModel: MessageViewModel, _ delegate: ContextMenuActionDelegate?) -> Action { return Action( - isEmojiPlus: true + isEmojiPlus: true, + accessibilityLabel: "Add emoji" ) { delegate?.showFullEmojiKeyboard(cellViewModel) } } diff --git a/Session/Conversations/Message Cells/VisibleMessageCell.swift b/Session/Conversations/Message Cells/VisibleMessageCell.swift index 9ccb6f916..23c328844 100644 --- a/Session/Conversations/Message Cells/VisibleMessageCell.swift +++ b/Session/Conversations/Message Cells/VisibleMessageCell.swift @@ -422,7 +422,7 @@ final class VisibleMessageCell: MessageCell, TappableLabelDelegate { messageStatusLabel.text = statusText messageStatusLabel.themeTextColor = tintColor messageStatusImageView.image = image - messageStatusImageView.accessibilityIdentifier = "Message sent status: \(statusText)" + messageStatusLabel.accessibilityIdentifier = "Message sent status: \(statusText ?? "invalid")" messageStatusImageView.themeTintColor = tintColor messageStatusContainerView.isHidden = ( cellViewModel.variant != .standardOutgoing || @@ -765,15 +765,15 @@ final class VisibleMessageCell: MessageCell, TappableLabelDelegate { // MARK: - Interaction - override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? { - if let bodyTappableLabel = bodyTappableLabel { - let btIngetBodyTappableLabelCoordinates = convert(point, to: bodyTappableLabel) - if bodyTappableLabel.bounds.contains(btIngetBodyTappableLabelCoordinates) { - return bodyTappableLabel - } - } - return super.hitTest(point, with: event) - } +// override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? { +// if let bodyTappableLabel = bodyTappableLabel { +// let btIngetBodyTappableLabelCoordinates = convert(point, to: bodyTappableLabel) +// if bodyTappableLabel.bounds.contains(btIngetBodyTappableLabelCoordinates) { +// return bodyTappableLabel +// } +// } +// return super.hitTest(point, with: event) +// } override func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool { return true // Needed for the pan gesture recognizer to work with the table view's pan gesture recognizer