diff --git a/Signal/ConversationView/Components/CVComponentMessage.swift b/Signal/ConversationView/Components/CVComponentMessage.swift index 9abadb88433..a32b941d74c 100644 --- a/Signal/ConversationView/Components/CVComponentMessage.swift +++ b/Signal/ConversationView/Components/CVComponentMessage.swift @@ -2232,6 +2232,10 @@ public class CVComponentMessage: CVComponentBase, CVRootComponent { } } + func focusAccessibility() { + UIAccessibility.post(notification: .layoutChanged, argument: self.hInnerStack) + } + // MARK: - Flashing Message Bubble func performMessageBubbleHighlightAnimation() { diff --git a/Signal/ConversationView/ConversationViewController+CVC.swift b/Signal/ConversationView/ConversationViewController+CVC.swift index f5127ab2d00..010d36d460c 100644 --- a/Signal/ConversationView/ConversationViewController+CVC.swift +++ b/Signal/ConversationView/ConversationViewController+CVC.swift @@ -4,6 +4,7 @@ // public import Foundation +public import UIKit public import SignalServiceKit public import SignalUI @@ -37,6 +38,20 @@ extension ConversationViewController { } return renderItem.interaction } + + func focusAccessibilityOn(messageId: String) { + if let indexPath = indexPath(forInteractionUniqueId: messageId) { + guard let cell = collectionView.cellForItem(at: indexPath) as? CVCell, + let componentView = cell.componentView as? CVComponentMessage.CVComponentViewMessage + else { + owsFailDebug("Could not find CVComponentViewMessage") + return + } + componentView.focusAccessibility() + } else { + owsFailDebug("Unable to find message to highlight [\(messageId)]") + } + } var indexPathOfUnreadMessagesIndicator: IndexPath? { loadCoordinator.indexPathOfUnreadIndicator @@ -69,11 +84,12 @@ extension ConversationViewController { func performMessageHighlightAnimationIfNeeded() { if let messageId = viewState.highlightedMessageId { + focusAccessibilityOn(messageId: messageId) performHighlightAnimationSequenceFor(messageId: messageId) viewState.highlightedMessageId = nil } } - + private func performHighlightAnimationSequenceFor(messageId: String) { if let indexPath = indexPath(forInteractionUniqueId: messageId) { guard let cell = collectionView.cellForItem(at: indexPath) as? CVCell, @@ -82,7 +98,6 @@ extension ConversationViewController { owsFailDebug("Could not find CVComponentViewMessage") return } - componentViewMessage.performMessageBubbleHighlightAnimation() } else { owsFailDebug("Unable to find a message to highlight. [\(messageId)]") diff --git a/Signal/translations/en.lproj/Localizable.strings b/Signal/translations/en.lproj/Localizable.strings index b27f4254b38..f32c721b3a9 100644 --- a/Signal/translations/en.lproj/Localizable.strings +++ b/Signal/translations/en.lproj/Localizable.strings @@ -6545,7 +6545,7 @@ "PUSH_REGISTER_SUCCESS" = "Successfully re-registered for push notifications."; /* Accessibility label stating the author of the message to which you are replying. Embeds: {{ the author of the message to which you are replying }}. */ -"QUOTED_REPLY_ACCESSIBILITY_LABEL_FORMAT" = "Replying to %@."; +"QUOTED_REPLY_ACCESSIBILITY_LABEL_FORMAT" = "Replying to %@. Double Tap to go to original message."; /* Indicates the author of a quoted message. Embeds {{the author's name or phone number}}. */ "QUOTED_REPLY_AUTHOR_INDICATOR_FORMAT" = "%@";