Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Signal/ConversationView/Components/CVComponentMessage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2232,6 +2232,10 @@ public class CVComponentMessage: CVComponentBase, CVRootComponent {
}
}

func focusAccessibility() {
UIAccessibility.post(notification: .layoutChanged, argument: self.hInnerStack)
}

// MARK: - Flashing Message Bubble

func performMessageBubbleHighlightAnimation() {
Expand Down
19 changes: 17 additions & 2 deletions Signal/ConversationView/ConversationViewController+CVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
//

public import Foundation
public import UIKit
public import SignalServiceKit
public import SignalUI

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand All @@ -82,7 +98,6 @@ extension ConversationViewController {
owsFailDebug("Could not find CVComponentViewMessage")
return
}

componentViewMessage.performMessageBubbleHighlightAnimation()
} else {
owsFailDebug("Unable to find a message to highlight. [\(messageId)]")
Expand Down
2 changes: 1 addition & 1 deletion Signal/translations/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -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" = "%@";
Expand Down