diff --git a/.github/workflows/cron-checks.yml b/.github/workflows/cron-checks.yml index 4f90d563ca7..d2ee4a8b2b3 100644 --- a/.github/workflows/cron-checks.yml +++ b/.github/workflows/cron-checks.yml @@ -49,11 +49,11 @@ jobs: os: macos-12 device: "iPhone 14 Pro Max" setup_runtime: false - - ios: 15.5 - xcode: 13.4.1 + - ios: 15.4 + xcode: 14.2 os: macos-12 device: "iPhone 8" - setup_runtime: false + setup_runtime: true - ios: 14.5 xcode: 14.2 os: macos-12 @@ -138,11 +138,11 @@ jobs: os: macos-13 device: "iPhone 14 Pro Max" setup_runtime: false - - ios: 15.5 - xcode: 13.4.1 + - ios: 15.4 + xcode: 14.2 os: macos-12 device: "iPhone 8" - setup_runtime: false + setup_runtime: true - ios: 14.5 xcode: 14.2 os: macos-12 diff --git a/.github/workflows/smoke-checks.yml b/.github/workflows/smoke-checks.yml index 1a420c1bda0..9f6d05506e4 100644 --- a/.github/workflows/smoke-checks.yml +++ b/.github/workflows/smoke-checks.yml @@ -7,6 +7,12 @@ on: - '!main' workflow_dispatch: + inputs: + snapshots: + description: 'Should Snapshots be recorded on CI?' + type: boolean + required: false + default: false concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -23,7 +29,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_PR_NUM: ${{ github.event.number }} - if: ${{ github.event_name != 'push' }} + if: ${{ github.event_name != 'push' && github.event.inputs.snapshots != 'true' }} steps: - uses: actions/checkout@v3.1.0 with: @@ -61,6 +67,7 @@ jobs: test-llc-debug: name: Test LLC (Debug) runs-on: macos-13 + if: ${{ github.event.inputs.snapshots != 'true' }} needs: build-test-app-and-frameworks env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -112,10 +119,11 @@ jobs: path: derived_data/Build/ - uses: ./.github/actions/bootstrap - name: Run UI Tests (Debug) - run: bundle exec fastlane test_ui device:"${{ env.IOS_SIMULATOR_DEVICE }}" skip_build:true + run: bundle exec fastlane test_ui device:"${{ env.IOS_SIMULATOR_DEVICE }}" skip_build:true record:${{ github.event.inputs.snapshots }} timeout-minutes: 25 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.CI_BOT_GITHUB_TOKEN }} # to open a PR + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # to use github cli GITHUB_PR_NUM: ${{ github.event.number }} - name: Parse xcresult if: failure() @@ -132,7 +140,7 @@ jobs: test-e2e-debug: name: Test E2E UI (Debug) runs-on: macos-12 # TODO: bump macos version to 13 when Xcode 15.0 is released - if: ${{ github.event_name != 'push' }} + if: ${{ github.event_name != 'push' && github.event.inputs.snapshots != 'true' }} needs: - allure_testops_launch - build-test-app-and-frameworks @@ -189,7 +197,7 @@ jobs: allure_testops_launch: name: Launch Allure TestOps runs-on: macos-13 - if: ${{ github.event_name != 'push' }} + if: ${{ github.event_name != 'push' && github.event.inputs.snapshots != 'true' }} outputs: launch_id: ${{ steps.get_launch_id.outputs.launch_id }} steps: @@ -208,7 +216,7 @@ jobs: build-xcode14: name: Build LLC + UI (Xcode 14) runs-on: macos-12 - if: ${{ github.event_name != 'push' }} + if: ${{ github.event_name != 'push' && github.event.inputs.snapshots != 'true' }} env: XCODE_VERSION: "14.0.1" GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -229,7 +237,7 @@ jobs: name: Build Demo App + Example Apps runs-on: macos-13 needs: build-test-app-and-frameworks - if: ${{ github.event_name != 'push' }} + if: ${{ github.event_name != 'push' && github.event.inputs.snapshots != 'true' }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_PR_NUM: ${{ github.event.number }} @@ -261,7 +269,7 @@ jobs: name: Test Integration runs-on: macos-13 needs: build-test-app-and-frameworks - if: ${{ github.event_name != 'push' }} + if: ${{ github.event_name != 'push' && github.event.inputs.snapshots != 'true' }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_PR_NUM: ${{ github.event.number }} diff --git a/.swiftlint.yml b/.swiftlint.yml index a6327b5409f..321666a10c6 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -15,6 +15,7 @@ excluded: - Carthage - Pods - .build + - spm_cache disabled_rules: - large_tuple diff --git a/CHANGELOG.md b/CHANGELOG.md index 7492ec2b02e..6863745e294 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,23 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### 🔄 Changed +# [4.42.0](https://github.com/GetStream/stream-chat-swift/releases/tag/4.42.0) +_November 14, 2023_ + +## StreamChat +### 🐞 Fixed +- Fix not able to mark channel read after clearing history [#2867](https://github.com/GetStream/stream-chat-swift/pull/2867) +- Fix pasting images from browser when isPastingImagesEnabled is false [#2874](https://github.com/GetStream/stream-chat-swift/pull/2874) +- Fix not being able to paste images when multiple attachments are present [#2874](https://github.com/GetStream/stream-chat-swift/pull/2874) +- Fix ComposerVC InputTextView caret's position issues [#2878](https://github.com/GetStream/stream-chat-swift/pull/2878) +- Fix avatar alignment in quoted messages [#2876](https://github.com/GetStream/stream-chat-swift/pull/2876) + +## StreamChatUI +### ✅ Added +- Add support for editing custom attachments [#2879](https://github.com/GetStream/stream-chat-swift/pull/2879) +### 🐞 Fixed +- Fix composer not interactable after enabling send-message capability [#2866](https://github.com/GetStream/stream-chat-swift/pull/2866) + # [4.41.0](https://github.com/GetStream/stream-chat-swift/releases/tag/4.41.0) _November 03, 2023_ diff --git a/Sources/StreamChat/ChatClient.swift b/Sources/StreamChat/ChatClient.swift index d3b3e432bd3..263fd24ca7d 100644 --- a/Sources/StreamChat/ChatClient.swift +++ b/Sources/StreamChat/ChatClient.swift @@ -51,6 +51,16 @@ public class ChatClient { /// The notification center used to send and receive notifications about incoming events. private(set) var eventNotificationCenter: EventNotificationCenter + /// The registry that contains all the attachment payloads associated with their attachment types. + /// For the meantime this is a static property to avoid breaking changes. On v5, this can be changed. + private(set) static var attachmentTypesRegistry: [AttachmentType: AttachmentPayload.Type] = [ + .image: ImageAttachmentPayload.self, + .video: VideoAttachmentPayload.self, + .audio: AudioAttachmentPayload.self, + .file: FileAttachmentPayload.self, + .voiceRecording: VideoAttachmentPayload.self + ] + let connectionRepository: ConnectionRepository let authenticationRepository: AuthenticationRepository @@ -235,6 +245,18 @@ public class ChatClient { ) } + /// Register a custom attachment payload. + /// + /// Example: + /// ``` + /// registerAttachment(CustomAttachmentPayload.self) + /// ``` + /// + /// - Parameter payloadType: The payload type of the attachment. + public func registerAttachment(_ payloadType: Payload.Type) { + Self.attachmentTypesRegistry[Payload.type] = payloadType + } + /// Connects the client with the given user. /// /// - Parameters: diff --git a/Sources/StreamChat/Controllers/ChannelController/ChannelController.swift b/Sources/StreamChat/Controllers/ChannelController/ChannelController.swift index 525a99de808..e40e36eaf20 100644 --- a/Sources/StreamChat/Controllers/ChannelController/ChannelController.swift +++ b/Sources/StreamChat/Controllers/ChannelController/ChannelController.swift @@ -1522,6 +1522,13 @@ private extension ChatChannelController { } guard let lastReadIndex = messages.firstIndex(where: { $0.id == lastReadMessageId }), lastReadIndex != 0 else { + // If there is a lastReadMessageId, and we loaded all messages, but can't find firstUnreadMessageId, + // then it means the lastReadMessageId is not reachable because the channel was truncated or hidden. + // So we return the oldest regular message already fetched. + if hasLoadedAllPreviousMessages { + return oldestRegularMessage() + } + return nil } diff --git a/Sources/StreamChat/Generated/SystemEnvironment+Version.swift b/Sources/StreamChat/Generated/SystemEnvironment+Version.swift index ddfb5b89717..6b93bc88729 100644 --- a/Sources/StreamChat/Generated/SystemEnvironment+Version.swift +++ b/Sources/StreamChat/Generated/SystemEnvironment+Version.swift @@ -7,5 +7,5 @@ import Foundation extension SystemEnvironment { /// A Stream Chat version. - public static let version: String = "4.41.0" + public static let version: String = "4.42.0" } diff --git a/Sources/StreamChat/Info.plist b/Sources/StreamChat/Info.plist index 935fbcf4ebd..3369a5546dc 100644 --- a/Sources/StreamChat/Info.plist +++ b/Sources/StreamChat/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType $(PRODUCT_BUNDLE_PACKAGE_TYPE) CFBundleShortVersionString - 4.41.0 + 4.42.0 CFBundleVersion $(CURRENT_PROJECT_VERSION) diff --git a/Sources/StreamChat/Models/Attachments/AnyAttachmentPayload.swift b/Sources/StreamChat/Models/Attachments/AnyAttachmentPayload.swift index 8ac4eb716ce..4ffae9eb722 100644 --- a/Sources/StreamChat/Models/Attachments/AnyAttachmentPayload.swift +++ b/Sources/StreamChat/Models/Attachments/AnyAttachmentPayload.swift @@ -193,21 +193,16 @@ extension AttachmentPayload { public extension Array where Element == ChatMessageAttachment { func toAnyAttachmentPayload() -> [AnyAttachmentPayload] { compactMap { attachment in - func anyAttachmentPayload(for type: T.Type) -> AnyAttachmentPayload? { - guard let payload = try? JSONDecoder.default.decode(T.self, from: attachment.payload) else { return nil } - return AnyAttachmentPayload(payload: payload) - } - - switch attachment.type { - case .image: return anyAttachmentPayload(for: ImageAttachmentPayload.self) - case .video: return anyAttachmentPayload(for: VideoAttachmentPayload.self) - case .audio: return anyAttachmentPayload(for: AudioAttachmentPayload.self) - case .file: return anyAttachmentPayload(for: FileAttachmentPayload.self) - case .voiceRecording: return anyAttachmentPayload(for: VoiceRecordingAttachmentPayload.self) - default: - log.assertionFailure("Unsupported attachment") + let types = ChatClient.attachmentTypesRegistry + guard let payloadType = types[attachment.type] else { return nil } + guard let payload = try? JSONDecoder.default.decode( + payloadType, + from: attachment.payload + ) else { return nil } + + return AnyAttachmentPayload(payload: payload) } } } diff --git a/Sources/StreamChatUI/CommonViews/InputChatMessageView/InputChatMessageView.swift b/Sources/StreamChatUI/CommonViews/InputChatMessageView/InputChatMessageView.swift index 56bde721740..0d335548ce3 100644 --- a/Sources/StreamChatUI/CommonViews/InputChatMessageView/InputChatMessageView.swift +++ b/Sources/StreamChatUI/CommonViews/InputChatMessageView/InputChatMessageView.swift @@ -120,7 +120,7 @@ open class InputChatMessageView: _View, ComponentsProvider, AppearanceProvider { if let quotingMessage = content.quotingMessage { quotedMessageView.content = .init( message: quotingMessage, - avatarAlignment: .leading, + avatarAlignment: quotingMessage.isSentByCurrentUser ? .trailing : .leading, channel: content.channel ) } diff --git a/Sources/StreamChatUI/CommonViews/InputTextView/InputTextView.swift b/Sources/StreamChatUI/CommonViews/InputTextView/InputTextView.swift index cd6fb1ff39c..9a5a39552fb 100644 --- a/Sources/StreamChatUI/CommonViews/InputTextView/InputTextView.swift +++ b/Sources/StreamChatUI/CommonViews/InputTextView/InputTextView.swift @@ -58,6 +58,14 @@ open class InputTextView: UITextView, AppearanceProvider { } } + override open var intrinsicContentSize: CGSize { + .init(width: UIView.noIntrinsicMetric, height: minimumHeight) + } + + private var oldText: String = "" + private var oldSize: CGSize = .zero + private var shouldScrollAfterHeightChanged = false + override open func didMoveToSuperview() { super.didMoveToSuperview() guard superview != nil else { return } @@ -67,13 +75,47 @@ open class InputTextView: UITextView, AppearanceProvider { setUpAppearance() } + override open func layoutSubviews() { + super.layoutSubviews() + + if text == oldText, bounds.size == oldSize { return } + oldText = text + oldSize = bounds.size + + let size = sizeThatFits(CGSize(width: bounds.size.width, height: CGFloat.greatestFiniteMagnitude)) + var height = size.height + + // Constrain minimum height + height = minimumHeight > 0 ? max(height, minimumHeight) : height + + // Constrain maximum height + height = maximumHeight > 0 ? min(height, maximumHeight) : height + + // Update height constraint if needed + if height != heightConstraint!.constant { + shouldScrollAfterHeightChanged = true + heightConstraint!.constant = height + } else if shouldScrollAfterHeightChanged { + shouldScrollAfterHeightChanged = false + scrollToCaretPosition(animated: true) + } + } + open func setUp() { + contentMode = .redraw + NotificationCenter.default.addObserver( self, selector: #selector(handleTextChange), name: UITextView.textDidChangeNotification, object: self ) + + NotificationCenter.default.addObserver( + self, + selector: #selector(textDidEndEditing), + name: UITextView.textDidEndEditingNotification, object: self + ) } open func setUpAppearance() { @@ -95,17 +137,15 @@ open class InputTextView: UITextView, AppearanceProvider { } open func setUpLayout() { - embed( - placeholderLabel, - insets: .init( - top: .zero, - leading: directionalLayoutMargins.leading, - bottom: .zero, - trailing: .zero - ) - ) - placeholderLabel.pin(anchors: [.centerY], to: self) - placeholderLabel.widthAnchor.pin(equalTo: widthAnchor, multiplier: 0.95).isActive = true + addSubview(placeholderLabel) + NSLayoutConstraint.activate([ + placeholderLabel.leadingAnchor.constraint(equalTo: leadingAnchor, constant: directionalLayoutMargins.leading), + placeholderLabel.trailingAnchor.constraint(lessThanOrEqualTo: trailingAnchor), + placeholderLabel.topAnchor.constraint(equalTo: topAnchor), + placeholderLabel.bottomAnchor.constraint(lessThanOrEqualTo: bottomAnchor), + + placeholderLabel.centerYAnchor.constraint(equalTo: centerYAnchor) + ]) heightConstraint = heightAnchor.pin(equalToConstant: minimumHeight) heightConstraint?.isActive = true @@ -127,17 +167,31 @@ open class InputTextView: UITextView, AppearanceProvider { open func textDidChangeProgrammatically() { delegate?.textViewDidChange?(self) - DispatchQueue.main.async { - self.handleTextChange() - } + handleTextChange() } @objc open func handleTextChange() { placeholderLabel.isHidden = !text.isEmpty - setTextViewHeight() - scrollToCaretPosition(animated: true) + setNeedsLayout() + DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { [weak self] in + // This is due to bug in UITextView where the scroll sometimes disables + // when a very long text is pasted in it. + // Doing this ensures that it doesn't happen + // Reference: https://stackoverflow.com/a/62386088/5493299 + + self?.isScrollEnabled = false + self?.layoutIfNeeded() + self?.isScrollEnabled = true + } + } + + @objc func textDidEndEditing(notification: Notification) { + if let sender = notification.object as? InputTextView, sender == self { + scrollToCaretPosition(animated: true) + } } + @available(*, deprecated, message: "The calculations made by this method are now happening in a more consistent way inside layoutSubviews. This method is not being used now.") open func setTextViewHeight() { var heightToSet = minimumHeight @@ -171,14 +225,12 @@ open class InputTextView: UITextView, AppearanceProvider { } override open func paste(_ sender: Any?) { - if let pasteboardImage = UIPasteboard.general.image { + if isPastingImagesEnabled, let pasteboardImage = UIPasteboard.general.image { clipboardAttachmentDelegate?.inputTextView(self, didPasteImage: pasteboardImage) } else { super.paste(sender) - // On text paste, textView height will not change automatically - // so we must call this function - setTextViewHeight() } + setNeedsDisplay() } /// Scrolls the text view to to the caret's position. diff --git a/Sources/StreamChatUI/CommonViews/QuotedChatMessageView/QuotedChatMessageView.swift b/Sources/StreamChatUI/CommonViews/QuotedChatMessageView/QuotedChatMessageView.swift index 9f934912da9..244350ed079 100644 --- a/Sources/StreamChatUI/CommonViews/QuotedChatMessageView/QuotedChatMessageView.swift +++ b/Sources/StreamChatUI/CommonViews/QuotedChatMessageView/QuotedChatMessageView.swift @@ -53,12 +53,7 @@ open class QuotedChatMessageView: _View, ThemeProvider, SwiftUIRepresentable { /// A Boolean value that checks if all attachments are empty. open var isAttachmentsEmpty: Bool { guard let content = self.content else { return true } - return content.message.fileAttachments.isEmpty - && content.message.imageAttachments.isEmpty - && content.message.linkAttachments.isEmpty - && content.message.giphyAttachments.isEmpty - && content.message.videoAttachments.isEmpty - && content.message.voiceRecordingAttachments.isEmpty + return content.message.allAttachments.isEmpty } /// The container view that holds the `authorAvatarView` and the `contentContainerView`. @@ -244,7 +239,7 @@ open class QuotedChatMessageView: _View, ThemeProvider, SwiftUIRepresentable { attachmentPreviewView.contentMode = .scaleAspectFill setAttachmentPreviewImage(url: imagePayload.imageURL) if textView.text.isEmpty { - textView.text = "Photo" + textView.text = L10n.Composer.QuotedMessage.photo } } else if let linkPayload = message.linkAttachments.first?.payload { attachmentPreviewView.contentMode = .scaleAspectFill @@ -254,7 +249,7 @@ open class QuotedChatMessageView: _View, ThemeProvider, SwiftUIRepresentable { attachmentPreviewView.contentMode = .scaleAspectFill setAttachmentPreviewImage(url: giphyPayload.previewURL) if textView.text.isEmpty { - textView.text = "Giphy" + textView.text = L10n.Composer.QuotedMessage.giphy } } else if let videoPayload = message.videoAttachments.first?.payload { attachmentPreviewView.contentMode = .scaleAspectFill diff --git a/Sources/StreamChatUI/Composer/ComposerVC.swift b/Sources/StreamChatUI/Composer/ComposerVC.swift index 5c15f74196b..61e32b7ee76 100644 --- a/Sources/StreamChatUI/Composer/ComposerVC.swift +++ b/Sources/StreamChatUI/Composer/ComposerVC.swift @@ -567,18 +567,13 @@ open class ComposerVC: _ViewController, return } - // If we have files in attachments, do not allow images to be pasted in the text view. - // This is due to the limitation of UI(files and images cannot be shown together) - let filesExistInAttachments = content.attachments.contains(where: { $0.type == .file }) - composerView.inputMessageView.textView.isPastingImagesEnabled = !filesExistInAttachments - if !isSendMessageEnabled { composerView.inputMessageView.textView.placeholderLabel.text = L10n.Composer.Placeholder.messageDisabled - composerView.inputMessageView.isUserInteractionEnabled = false composerView.recordButton.isHidden = true composerView.attachmentButton.isHidden = true composerView.commandsButton.isHidden = true } + composerView.inputMessageView.isUserInteractionEnabled = isSendMessageEnabled dismissSuggestions() } @@ -701,9 +696,6 @@ open class ComposerVC: _ViewController, if !self.isAttachmentsEnabled { self.composerView.attachmentButton.isHidden = true } - - // Makes sure the text view remains in the same position when it changes size. - self.composerView.inputMessageView.textView.setTextViewHeight() } } diff --git a/Sources/StreamChatUI/Generated/L10n.swift b/Sources/StreamChatUI/Generated/L10n.swift index d7b890397b1..f7ebda20bc1 100644 --- a/Sources/StreamChatUI/Generated/L10n.swift +++ b/Sources/StreamChatUI/Generated/L10n.swift @@ -143,6 +143,12 @@ internal enum L10n { /// Slow mode ON internal static var slowMode: String { L10n.tr("Localizable", "composer.placeholder.slowMode") } } + internal enum QuotedMessage { + /// Giphy + internal static var giphy: String { L10n.tr("Localizable", "composer.quoted-message.giphy") } + /// Photo + internal static var photo: String { L10n.tr("Localizable", "composer.quoted-message.photo") } + } internal enum Suggestions { internal enum Commands { /// Instant Commands diff --git a/Sources/StreamChatUI/Info.plist b/Sources/StreamChatUI/Info.plist index 935fbcf4ebd..3369a5546dc 100644 --- a/Sources/StreamChatUI/Info.plist +++ b/Sources/StreamChatUI/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType $(PRODUCT_BUNDLE_PACKAGE_TYPE) CFBundleShortVersionString - 4.41.0 + 4.42.0 CFBundleVersion $(CURRENT_PROJECT_VERSION) diff --git a/Sources/StreamChatUI/Resources/en.lproj/Localizable.strings b/Sources/StreamChatUI/Resources/en.lproj/Localizable.strings index dee5e9fab85..0867fe92f61 100644 --- a/Sources/StreamChatUI/Resources/en.lproj/Localizable.strings +++ b/Sources/StreamChatUI/Resources/en.lproj/Localizable.strings @@ -75,6 +75,9 @@ "composer.links-disabled.title" = "Links are disabled"; "composer.links-disabled.subtitle" = "Sending links is not allowed in this conversation."; +"composer.quoted-message.photo" = "Photo"; +"composer.quoted-message.giphy" = "Giphy"; + "composer.suggestions.commands.header" = "Instant Commands"; "message.sending.attachment-uploading-failed" = "UPLOADING FAILED"; diff --git a/StreamChat-XCFramework.podspec b/StreamChat-XCFramework.podspec index 4070cd324ef..550de7fbe1d 100644 --- a/StreamChat-XCFramework.podspec +++ b/StreamChat-XCFramework.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |spec| spec.name = "StreamChat-XCFramework" - spec.version = "4.41.0" + spec.version = "4.42.0" spec.summary = "StreamChat iOS Client" spec.description = "stream-chat-swift is the official Swift client for Stream Chat, a service for building chat applications." diff --git a/StreamChat.podspec b/StreamChat.podspec index 92ae6a5cdea..120ed320a87 100644 --- a/StreamChat.podspec +++ b/StreamChat.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |spec| spec.name = "StreamChat" - spec.version = "4.41.0" + spec.version = "4.42.0" spec.summary = "StreamChat iOS Chat Client" spec.description = "stream-chat-swift is the official Swift client for Stream Chat, a service for building chat applications." diff --git a/StreamChat.xcodeproj/project.pbxproj b/StreamChat.xcodeproj/project.pbxproj index 9ad48af0c56..4e7ae483de9 100644 --- a/StreamChat.xcodeproj/project.pbxproj +++ b/StreamChat.xcodeproj/project.pbxproj @@ -766,6 +766,7 @@ 8AE335A824FCF999002B6677 /* Reachability_Vendor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8AE335A524FCF999002B6677 /* Reachability_Vendor.swift */; }; 8AE335A924FCF999002B6677 /* InternetConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8AE335A624FCF999002B6677 /* InternetConnection.swift */; }; 8AE335AA24FCF99E002B6677 /* InternetConnection_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8AE335A424FCF999002B6677 /* InternetConnection_Tests.swift */; }; + 9041E4AD2AE9768800CA2A2A /* MembersResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9041E4AC2AE9768800CA2A2A /* MembersResponse.swift */; }; A30C3F20276B428F00DA5968 /* UnknownUserEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = A30C3F1F276B428F00DA5968 /* UnknownUserEvent.swift */; }; A30C3F22276B4F8800DA5968 /* UnknownUserEvent_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A30C3F21276B4F8800DA5968 /* UnknownUserEvent_Tests.swift */; }; A311B3CE27E8B98C00CFCF6D /* CurrentUserCustomRole.json in Resources */ = {isa = PBXBuildFile; fileRef = 43ABF8B626C513D20034BD62 /* CurrentUserCustomRole.json */; }; @@ -3415,6 +3416,7 @@ 8AE335A424FCF999002B6677 /* InternetConnection_Tests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = InternetConnection_Tests.swift; sourceTree = ""; }; 8AE335A524FCF999002B6677 /* Reachability_Vendor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Reachability_Vendor.swift; sourceTree = ""; }; 8AE335A624FCF999002B6677 /* InternetConnection.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = InternetConnection.swift; sourceTree = ""; }; + 9041E4AC2AE9768800CA2A2A /* MembersResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MembersResponse.swift; sourceTree = ""; }; A30C3F1F276B428F00DA5968 /* UnknownUserEvent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UnknownUserEvent.swift; sourceTree = ""; }; A30C3F21276B4F8800DA5968 /* UnknownUserEvent_Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UnknownUserEvent_Tests.swift; sourceTree = ""; }; A30DEC98260B47DE0066E8CE /* TitleContainerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TitleContainerView.swift; sourceTree = ""; }; @@ -5322,6 +5324,7 @@ 82E4CBDF27F322EA0013B02D /* User.swift */, 82E4CBDB27F240C60013B02D /* WebsocketResponses.swift */, 826992C72900628500D2D470 /* DeviceRemoteControl.swift */, + 9041E4AC2AE9768800CA2A2A /* MembersResponse.swift */, ); path = MockServer; sourceTree = ""; @@ -10899,6 +10902,7 @@ A3A0C9B3283E955200B18DA4 /* EventResponses.swift in Sources */, A3A0C9A1283E955200B18DA4 /* ChannelResponses.swift in Sources */, A3A0C9A9283E955200B18DA4 /* MessageResponses.swift in Sources */, + 9041E4AD2AE9768800CA2A2A /* MembersResponse.swift in Sources */, 826992C82900628500D2D470 /* DeviceRemoteControl.swift in Sources */, A3A0C9AD283E955200B18DA4 /* MessageList.swift in Sources */, A3A0C9B1283E955200B18DA4 /* LaunchArgument.swift in Sources */, @@ -14013,7 +14017,7 @@ repositoryURL = "https://github.com/GetStream/stream-chat-swift-test-helpers.git"; requirement = { kind = exactVersion; - version = 0.3.3; + version = 0.3.5; }; }; ADDFDE272779EC67003B3B07 /* XCRemoteSwiftPackageReference "atlantis" */ = { diff --git a/StreamChatArtifacts.json b/StreamChatArtifacts.json index d3acf977a77..47b5ad25385 100644 --- a/StreamChatArtifacts.json +++ b/StreamChatArtifacts.json @@ -1 +1 @@ -{"4.7.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.7.0/StreamChat-All.zip","4.8.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.8.0/StreamChat-All.zip","4.9.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.9.0/StreamChat-All.zip","4.10.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.10.0/StreamChat-All.zip","4.10.1":"https://github.com/GetStream/stream-chat-swift/releases/download/4.10.1/StreamChat-All.zip","4.11.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.11.0/StreamChat-All.zip","4.12.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.12.0/StreamChat-All.zip","4.13.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.13.0/StreamChat-All.zip","4.13.1":"https://github.com/GetStream/stream-chat-swift/releases/download/4.13.1/StreamChat-All.zip","4.14.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.14.0/StreamChat-All.zip","4.15.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.15.0/StreamChat-All.zip","4.15.1":"https://github.com/GetStream/stream-chat-swift/releases/download/4.15.1/StreamChat-All.zip","4.16.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.16.0/StreamChat-All.zip","4.17.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.17.0/StreamChat-All.zip","4.18.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.18.0/StreamChat-All.zip","4.19.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.19.0/StreamChat-All.zip","4.20.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.20.0/StreamChat-All.zip","4.21.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.21.0/StreamChat-All.zip","4.21.1":"https://github.com/GetStream/stream-chat-swift/releases/download/4.21.1/StreamChat-All.zip","4.21.2":"https://github.com/GetStream/stream-chat-swift/releases/download/4.21.2/StreamChat-All.zip","4.22.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.22.0/StreamChat-All.zip","4.23.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.23.0/StreamChat-All.zip","4.24.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.24.0/StreamChat-All.zip","4.24.1":"https://github.com/GetStream/stream-chat-swift/releases/download/4.24.1/StreamChat-All.zip","4.25.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.25.0/StreamChat-All.zip","4.25.1":"https://github.com/GetStream/stream-chat-swift/releases/download/4.25.1/StreamChat-All.zip","4.26.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.26.0/StreamChat-All.zip","4.27.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.27.0/StreamChat-All.zip","4.27.1":"https://github.com/GetStream/stream-chat-swift/releases/download/4.27.1/StreamChat-All.zip","4.28.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.28.0/StreamChat-All.zip","4.29.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.29.0/StreamChat-All.zip","4.30.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.30.0/StreamChat-All.zip","4.31.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.31.0/StreamChat-All.zip","4.32.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.32.0/StreamChat-All.zip","4.33.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.33.0/StreamChat-All.zip","4.34.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.34.0/StreamChat-All.zip","4.35.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.35.0/StreamChat-All.zip","4.35.1":"https://github.com/GetStream/stream-chat-swift/releases/download/4.35.1/StreamChat-All.zip","4.35.2":"https://github.com/GetStream/stream-chat-swift/releases/download/4.35.2/StreamChat-All.zip","4.36.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.36.0/StreamChat-All.zip","4.37.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.37.0/StreamChat-All.zip","4.37.1":"https://github.com/GetStream/stream-chat-swift/releases/download/4.37.1/StreamChat-All.zip","4.38.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.38.0/StreamChat-All.zip","4.39.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.39.0/StreamChat-All.zip","4.40.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.40.0/StreamChat-All.zip","4.41.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.41.0/StreamChat-All.zip"} \ No newline at end of file +{"4.7.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.7.0/StreamChat-All.zip","4.8.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.8.0/StreamChat-All.zip","4.9.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.9.0/StreamChat-All.zip","4.10.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.10.0/StreamChat-All.zip","4.10.1":"https://github.com/GetStream/stream-chat-swift/releases/download/4.10.1/StreamChat-All.zip","4.11.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.11.0/StreamChat-All.zip","4.12.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.12.0/StreamChat-All.zip","4.13.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.13.0/StreamChat-All.zip","4.13.1":"https://github.com/GetStream/stream-chat-swift/releases/download/4.13.1/StreamChat-All.zip","4.14.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.14.0/StreamChat-All.zip","4.15.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.15.0/StreamChat-All.zip","4.15.1":"https://github.com/GetStream/stream-chat-swift/releases/download/4.15.1/StreamChat-All.zip","4.16.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.16.0/StreamChat-All.zip","4.17.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.17.0/StreamChat-All.zip","4.18.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.18.0/StreamChat-All.zip","4.19.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.19.0/StreamChat-All.zip","4.20.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.20.0/StreamChat-All.zip","4.21.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.21.0/StreamChat-All.zip","4.21.1":"https://github.com/GetStream/stream-chat-swift/releases/download/4.21.1/StreamChat-All.zip","4.21.2":"https://github.com/GetStream/stream-chat-swift/releases/download/4.21.2/StreamChat-All.zip","4.22.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.22.0/StreamChat-All.zip","4.23.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.23.0/StreamChat-All.zip","4.24.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.24.0/StreamChat-All.zip","4.24.1":"https://github.com/GetStream/stream-chat-swift/releases/download/4.24.1/StreamChat-All.zip","4.25.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.25.0/StreamChat-All.zip","4.25.1":"https://github.com/GetStream/stream-chat-swift/releases/download/4.25.1/StreamChat-All.zip","4.26.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.26.0/StreamChat-All.zip","4.27.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.27.0/StreamChat-All.zip","4.27.1":"https://github.com/GetStream/stream-chat-swift/releases/download/4.27.1/StreamChat-All.zip","4.28.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.28.0/StreamChat-All.zip","4.29.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.29.0/StreamChat-All.zip","4.30.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.30.0/StreamChat-All.zip","4.31.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.31.0/StreamChat-All.zip","4.32.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.32.0/StreamChat-All.zip","4.33.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.33.0/StreamChat-All.zip","4.34.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.34.0/StreamChat-All.zip","4.35.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.35.0/StreamChat-All.zip","4.35.1":"https://github.com/GetStream/stream-chat-swift/releases/download/4.35.1/StreamChat-All.zip","4.35.2":"https://github.com/GetStream/stream-chat-swift/releases/download/4.35.2/StreamChat-All.zip","4.36.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.36.0/StreamChat-All.zip","4.37.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.37.0/StreamChat-All.zip","4.37.1":"https://github.com/GetStream/stream-chat-swift/releases/download/4.37.1/StreamChat-All.zip","4.38.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.38.0/StreamChat-All.zip","4.39.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.39.0/StreamChat-All.zip","4.40.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.40.0/StreamChat-All.zip","4.41.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.41.0/StreamChat-All.zip","4.42.0":"https://github.com/GetStream/stream-chat-swift/releases/download/4.42.0/StreamChat-All.zip"} \ No newline at end of file diff --git a/StreamChatUI-XCFramework.podspec b/StreamChatUI-XCFramework.podspec index 4b5ed63865c..eb4abf01474 100644 --- a/StreamChatUI-XCFramework.podspec +++ b/StreamChatUI-XCFramework.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |spec| spec.name = "StreamChatUI-XCFramework" - spec.version = "4.41.0" + spec.version = "4.42.0" spec.summary = "StreamChat UI Components" spec.description = "StreamChatUI SDK offers flexible UI components able to display data provided by StreamChat SDK." diff --git a/StreamChatUI.podspec b/StreamChatUI.podspec index e8cf7cd6edf..52feb4819ec 100644 --- a/StreamChatUI.podspec +++ b/StreamChatUI.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |spec| spec.name = "StreamChatUI" - spec.version = "4.41.0" + spec.version = "4.42.0" spec.summary = "StreamChat UI Components" spec.description = "StreamChatUI SDK offers flexible UI components able to display data provided by StreamChat SDK." diff --git a/TestTools/StreamChatTestMockServer/MockServer/ChannelResponses.swift b/TestTools/StreamChatTestMockServer/MockServer/ChannelResponses.swift index aa46b18e056..22098ea49a0 100644 --- a/TestTools/StreamChatTestMockServer/MockServer/ChannelResponses.swift +++ b/TestTools/StreamChatTestMockServer/MockServer/ChannelResponses.swift @@ -395,10 +395,6 @@ public extension StreamMockServer { return channelDetails } - private func findChannelById(_ id: String) -> [String: Any]? { - try? XCTUnwrap(waitForChannelWithId(id)) - } - func getFirstChannelId() -> String { let endTime = TestData.waitingEndTime while channelList.isEmpty && endTime > TestData.currentTimeInterval {} @@ -446,19 +442,6 @@ public extension StreamMockServer { } } - private func waitForChannelWithId(_ id: String) -> [String: Any]? { - let endTime = TestData.waitingEndTime - var newChannelList: [[String: Any]] = [] - while newChannelList.isEmpty && endTime > TestData.currentTimeInterval { - guard let channels = channelList[JSONKey.channels] as? [[String: Any]] else { return nil } - newChannelList = channels.filter { - let channel = $0[JSONKey.channel] as? [String: Any] - return id == channel?[channelKey.id.rawValue] as? String - } - } - return newChannelList.first - } - private func channelTruncation(_ request: HttpRequest) -> HttpResponse? { waitForChannelQueryUpdate() guard let channelId = request.params[EndpointQuery.channelId] else { return .badRequest(nil) } diff --git a/TestTools/StreamChatTestMockServer/MockServer/MembersResponse.swift b/TestTools/StreamChatTestMockServer/MockServer/MembersResponse.swift new file mode 100644 index 00000000000..fec66e716de --- /dev/null +++ b/TestTools/StreamChatTestMockServer/MockServer/MembersResponse.swift @@ -0,0 +1,28 @@ +// +// Copyright © 2023 Stream.io Inc. All rights reserved. +// + +import Swifter + +public extension StreamMockServer { + + func configureMembersEndpoints() { + server.register(MockEndpoint.members) { [weak self] request in + return self?.mockMembersQuery(request) + } + } + + private func mockMembersQuery(_ request: HttpRequest) -> HttpResponse { + guard + let payloadQuery = request.queryParams.first(where: { $0.0 == JSONKey.payload }), + let payload = payloadQuery.1.removingPercentEncoding?.json, + let channelId = payload[JSONKey.id] as? String + else { + return .badRequest(nil) + } + + guard let channel = findChannelById(channelId) else { return .badRequest(nil) } + guard let members = channel[JSONKey.members] else { return .badRequest(nil) } + return .ok(.json([JSONKey.members: members])) + } +} diff --git a/TestTools/StreamChatTestMockServer/MockServer/MockServerAttributes.swift b/TestTools/StreamChatTestMockServer/MockServer/MockServerAttributes.swift index 4668e667876..87c07b2ada3 100644 --- a/TestTools/StreamChatTestMockServer/MockServer/MockServerAttributes.swift +++ b/TestTools/StreamChatTestMockServer/MockServer/MockServerAttributes.swift @@ -52,18 +52,20 @@ public enum MockEndpoint { public static let channels = "/channels" public static let channel = "/channels/messaging/\(EndpointQuery.channelId)" public static let event = "/channels/messaging/\(EndpointQuery.channelId)/event" - public static let query = "/channels/messaging/\(EndpointQuery.channelId)/query" + public static let query = "/channels/\(EndpointQuery.channelType)/\(EndpointQuery.channelId)/query" public static let messageRead = "/channels/messaging/\(EndpointQuery.channelId)/read" public static let message = "/channels/messaging/\(EndpointQuery.channelId)/message" public static let image = "/channels/messaging/\(EndpointQuery.channelId)/image" public static let file = "/channels/messaging/\(EndpointQuery.channelId)/file" public static let truncate = "/channels/messaging/\(EndpointQuery.channelId)/truncate" public static let sync = "/sync" + public static let members = "/members" } public enum EndpointQuery { public static let messageId = ":message_id" public static let channelId = ":channel_id" + public static let channelType = ":channel_type" public static let reactionType = ":reaction_type" } diff --git a/TestTools/StreamChatTestMockServer/MockServer/StreamMockServer.swift b/TestTools/StreamChatTestMockServer/MockServer/StreamMockServer.swift index 3f1e416907d..f07fc4f0647 100644 --- a/TestTools/StreamChatTestMockServer/MockServer/StreamMockServer.swift +++ b/TestTools/StreamChatTestMockServer/MockServer/StreamMockServer.swift @@ -5,6 +5,7 @@ @testable import StreamChat import Swifter import Foundation +import XCTest public final class StreamMockServer { @@ -56,6 +57,7 @@ public final class StreamMockServer { configureReactionEndpoints() configureMessagingEndpoints() configureAttachmentEndpoints() + configureMembersEndpoints() } public func writeText(_ text: String) { @@ -81,6 +83,27 @@ public final class StreamMockServer { } } +// MARK: Shared + +extension StreamMockServer { + func findChannelById(_ id: String) -> [String: Any]? { + try? XCTUnwrap(waitForChannelWithId(id)) + } + + func waitForChannelWithId(_ id: String) -> [String: Any]? { + let endTime = TestData.waitingEndTime + var newChannelList: [[String: Any]] = [] + while newChannelList.isEmpty && endTime > TestData.currentTimeInterval { + guard let channels = channelList[JSONKey.channels] as? [[String: Any]] else { return nil } + newChannelList = channels.filter { + let channel = $0[JSONKey.channel] as? [String: Any] + return id == channel?[channelKey.id.rawValue] as? String + } + } + return newChannelList.first + } +} + // MARK: Config public extension StreamMockServer { diff --git a/TestTools/StreamChatTestTools/Extensions/JSONEncoder+Extensions.swift b/TestTools/StreamChatTestTools/Extensions/JSONEncoder+Extensions.swift index a6d2b3b6912..74e143c7051 100644 --- a/TestTools/StreamChatTestTools/Extensions/JSONEncoder+Extensions.swift +++ b/TestTools/StreamChatTestTools/Extensions/JSONEncoder+Extensions.swift @@ -7,16 +7,7 @@ import StreamChat public extension JSONEncoder { func encodedString(_ encodable: T) -> String { - if #available(iOS 13, *) { - let encodedData = try! encode(encodable) - return String(data: encodedData, encoding: .utf8)!.trimmingCharacters(in: .init(charactersIn: "\"")) - - } else { - @available(iOS, deprecated: 12.0, message: "Remove this workaround when dropping iOS 12 support.") - // Workaround for a bug https://bugs.swift.org/browse/SR-6163 fixed in iOS 13 - let data = try! encode(["key": encodable]) - let json = try! JSONSerialization.jsonObject(with: data) as! [String: Any] - return json["key"] as! String - } + let encodedData = try! encode(encodable) + return String(data: encodedData, encoding: .utf8)!.trimmingCharacters(in: .init(charactersIn: "\"")) } } diff --git a/Tests/StreamChatTests/Controllers/ChannelController/ChannelController_Tests.swift b/Tests/StreamChatTests/Controllers/ChannelController/ChannelController_Tests.swift index aa38e883ebd..d3e162435f9 100644 --- a/Tests/StreamChatTests/Controllers/ChannelController/ChannelController_Tests.swift +++ b/Tests/StreamChatTests/Controllers/ChannelController/ChannelController_Tests.swift @@ -401,7 +401,7 @@ final class ChannelController_Tests: XCTestCase { try AssertFirstUnreadMessageIsOldestRegularMessageId(oldestMessageType: .system) } - func test_firstUnreadMessageId_whenReadsContainsCurrentUserId_whenLastReadMessageIdDoesNotExist() throws { + func test_firstUnreadMessageId_whenReadsContainsCurrentUserId_whenLastReadMessageIdNotFoundLocally() throws { let oldestMessageId = MessageId.unique let newestMessageId = MessageId.unique let notLoadedLastReadMessageId = MessageId.unique @@ -425,6 +425,34 @@ final class ChannelController_Tests: XCTestCase { XCTAssertNil(controller.firstUnreadMessageId) } + func test_firstUnreadMessageId_whenReadsContainsCurrentUserId_whenLastReadMessageIdNotFoundLocally_whenAllPreviousMessagesAreLoaded() throws { + let oldestMessageId = MessageId.unique + let newestMessageId = MessageId.unique + let notLoadedLastReadMessageId = MessageId.unique + + let userId = UserId.unique + let channelRead = ChannelReadPayload( + user: .dummy(userId: userId), + lastReadAt: .unique, + lastReadMessageId: notLoadedLastReadMessageId, + unreadMessagesCount: 3 + ) + let token = Token(rawValue: "", userId: userId, expiration: nil) + controller.client.authenticationRepository.setMockToken(token) + + try createChannel(oldestMessageId: oldestMessageId, newestMessageId: newestMessageId, channelReads: [channelRead]) + + try client.databaseContainer.writeSynchronously { + try $0.saveCurrentUser(payload: .dummy(userId: userId, role: .user)) + } + + // When LastReadMessageId exists, and all messages are fetched, but still the LastReadMessageId + // is never fetched, it means this message is unreachable because the history was cleared. + // so the unread message id is the top message of the message list (the oldest one). + try mockHasLoadedAllPreviousMessages(true) + XCTAssertEqual(controller.firstUnreadMessageId, oldestMessageId) + } + func test_firstUnreadMessageId_whenReadsContainsCurrentUserId_whenLastReadMessageIdIsTheSameAsTheLastMessage() throws { let oldestMessageId = MessageId.unique let newestMessageId = MessageId.unique diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC+SwiftUI_Tests/test_chatChannel_isPopulated.default-light.png b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC+SwiftUI_Tests/test_chatChannel_isPopulated.default-light.png index e5d18061da1..35cbc49be6a 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC+SwiftUI_Tests/test_chatChannel_isPopulated.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC+SwiftUI_Tests/test_chatChannel_isPopulated.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC+SwiftUI_Tests/test_customNavigationViewValues_arePopulated.default-light.png b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC+SwiftUI_Tests/test_customNavigationViewValues_arePopulated.default-light.png index af2a0bec4d9..c5708453b2b 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC+SwiftUI_Tests/test_customNavigationViewValues_arePopulated.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC+SwiftUI_Tests/test_customNavigationViewValues_arePopulated.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC+SwiftUI_Tests/test_customNavigationViewValues_arePopulated.extraExtraExtraLarge-light.png b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC+SwiftUI_Tests/test_customNavigationViewValues_arePopulated.extraExtraExtraLarge-light.png index dfb426d364a..111ce78edc6 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC+SwiftUI_Tests/test_customNavigationViewValues_arePopulated.extraExtraExtraLarge-light.png and b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC+SwiftUI_Tests/test_customNavigationViewValues_arePopulated.extraExtraExtraLarge-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC+SwiftUI_Tests/test_customNavigationViewValues_arePopulated.rightToLeftLayout-default.png b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC+SwiftUI_Tests/test_customNavigationViewValues_arePopulated.rightToLeftLayout-default.png index 3ca4fe89f01..5e7565a7d02 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC+SwiftUI_Tests/test_customNavigationViewValues_arePopulated.rightToLeftLayout-default.png and b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC+SwiftUI_Tests/test_customNavigationViewValues_arePopulated.rightToLeftLayout-default.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC+SwiftUI_Tests/test_customNavigationViewValues_arePopulated.small-dark.png b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC+SwiftUI_Tests/test_customNavigationViewValues_arePopulated.small-dark.png index 36d2e2c2a6a..48bc9772bf6 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC+SwiftUI_Tests/test_customNavigationViewValues_arePopulated.small-dark.png and b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC+SwiftUI_Tests/test_customNavigationViewValues_arePopulated.small-dark.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_defaultAppearance.default-light.png b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_defaultAppearance.default-light.png index a4f23605447..a6d94e9f6b0 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_defaultAppearance.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_defaultAppearance.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_deletedMessagesVisibilityWhenAlwaysVisible.default-light.png b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_deletedMessagesVisibilityWhenAlwaysVisible.default-light.png index b5d0975016f..063e33682e8 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_deletedMessagesVisibilityWhenAlwaysVisible.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_deletedMessagesVisibilityWhenAlwaysVisible.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_deletedMessagesVisibilityWhenOnlyVisibleToYou.default-light.png b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_deletedMessagesVisibilityWhenOnlyVisibleToYou.default-light.png index 59d4a41f30e..da9a99fa540 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_deletedMessagesVisibilityWhenOnlyVisibleToYou.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_deletedMessagesVisibilityWhenOnlyVisibleToYou.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_deletedMessagesWithAttachmentsAppearance.default-light.png b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_deletedMessagesWithAttachmentsAppearance.default-light.png index dcf5e239c35..258ef43da79 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_deletedMessagesWithAttachmentsAppearance.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_deletedMessagesWithAttachmentsAppearance.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_emptyAppearance.default-light.png b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_emptyAppearance.default-light.png index 06ea160ba1c..08cdfd1d0f7 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_emptyAppearance.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_emptyAppearance.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_emptyAppearance.extraExtraExtraLarge-light.png b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_emptyAppearance.extraExtraExtraLarge-light.png index 6a199c52cb0..b44f1f7f36a 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_emptyAppearance.extraExtraExtraLarge-light.png and b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_emptyAppearance.extraExtraExtraLarge-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_emptyAppearance.rightToLeftLayout-default.png b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_emptyAppearance.rightToLeftLayout-default.png index 62c9a73d44a..d6c77f68d34 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_emptyAppearance.rightToLeftLayout-default.png and b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_emptyAppearance.rightToLeftLayout-default.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_emptyAppearance.small-dark.png b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_emptyAppearance.small-dark.png index 06673d5aeb8..f0e9e685abb 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_emptyAppearance.small-dark.png and b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_emptyAppearance.small-dark.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_headerViewForMessage_returnsExpectedValue_whenUnreadSeparatorIsDisabled_whenMessageShouldShowDateSeparator_AndIsMarkedAsUnread.default-light.png b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_headerViewForMessage_returnsExpectedValue_whenUnreadSeparatorIsDisabled_whenMessageShouldShowDateSeparator_AndIsMarkedAsUnread.default-light.png index 3761ddd6d41..ffcc2508d12 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_headerViewForMessage_returnsExpectedValue_whenUnreadSeparatorIsDisabled_whenMessageShouldShowDateSeparator_AndIsMarkedAsUnread.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_headerViewForMessage_returnsExpectedValue_whenUnreadSeparatorIsDisabled_whenMessageShouldShowDateSeparator_AndIsMarkedAsUnread.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_headerViewForMessage_returnsExpectedValue_whenUnreadSeparatorIsEnabled_whenMessageShouldShowDateSeparator_AndIsMarkedAsUnread.default-light.png b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_headerViewForMessage_returnsExpectedValue_whenUnreadSeparatorIsEnabled_whenMessageShouldShowDateSeparator_AndIsMarkedAsUnread.default-light.png index 82fad8f1cae..bf92eaa3b17 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_headerViewForMessage_returnsExpectedValue_whenUnreadSeparatorIsEnabled_whenMessageShouldShowDateSeparator_AndIsMarkedAsUnread.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_headerViewForMessage_returnsExpectedValue_whenUnreadSeparatorIsEnabled_whenMessageShouldShowDateSeparator_AndIsMarkedAsUnread.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_onlyEmojiMessageAppearance.default-light.png b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_onlyEmojiMessageAppearance.default-light.png index 6a54c5b1121..3dd81da2a0f 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_onlyEmojiMessageAppearance.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_onlyEmojiMessageAppearance.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_onlyEmojiMessageAppearance.extraExtraExtraLarge-light.png b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_onlyEmojiMessageAppearance.extraExtraExtraLarge-light.png index 375d81b3fc8..fd4df273135 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_onlyEmojiMessageAppearance.extraExtraExtraLarge-light.png and b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_onlyEmojiMessageAppearance.extraExtraExtraLarge-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_onlyEmojiMessageAppearance.rightToLeftLayout-default.png b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_onlyEmojiMessageAppearance.rightToLeftLayout-default.png index f169c98eb32..7b6e92a7775 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_onlyEmojiMessageAppearance.rightToLeftLayout-default.png and b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_onlyEmojiMessageAppearance.rightToLeftLayout-default.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_onlyEmojiMessageAppearance.small-dark.png b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_onlyEmojiMessageAppearance.small-dark.png index 126939603fa..6166abd6477 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_onlyEmojiMessageAppearance.small-dark.png and b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_onlyEmojiMessageAppearance.small-dark.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_staticDateSeparatorsAppearance.default-light.png b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_staticDateSeparatorsAppearance.default-light.png index ed620b14569..dc3913588d7 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_staticDateSeparatorsAppearance.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_staticDateSeparatorsAppearance.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenMessageFromCurrentUserIsFollowedByEphemeralMessage_messagesAreNotGrouped.default-light.png b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenMessageFromCurrentUserIsFollowedByEphemeralMessage_messagesAreNotGrouped.default-light.png index 5b2bc157084..aa0d52b1be5 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenMessageFromCurrentUserIsFollowedByEphemeralMessage_messagesAreNotGrouped.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenMessageFromCurrentUserIsFollowedByEphemeralMessage_messagesAreNotGrouped.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenMessageFromCurrentUserIsFollowedByErrorMessage_messagesAreNotGrouped.default-light.png b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenMessageFromCurrentUserIsFollowedByErrorMessage_messagesAreNotGrouped.default-light.png index c3078732d1c..9e134626a72 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenMessageFromCurrentUserIsFollowedByErrorMessage_messagesAreNotGrouped.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenMessageFromCurrentUserIsFollowedByErrorMessage_messagesAreNotGrouped.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenMessageFromCurrentUserIsFollowedBySystemMessage_messagesAreNotGrouped.default-light.png b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenMessageFromCurrentUserIsFollowedBySystemMessage_messagesAreNotGrouped.default-light.png index fe64b182542..6e6feeeaf35 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenMessageFromCurrentUserIsFollowedBySystemMessage_messagesAreNotGrouped.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenMessageFromCurrentUserIsFollowedBySystemMessage_messagesAreNotGrouped.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenReactionIsAddedByCurrentUserWithSameType_shouldUpdateReactionColor.default-light-after-current-user-reaction.png b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenReactionIsAddedByCurrentUserWithSameType_shouldUpdateReactionColor.default-light-after-current-user-reaction.png index a87b328e233..be1e27f264a 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenReactionIsAddedByCurrentUserWithSameType_shouldUpdateReactionColor.default-light-after-current-user-reaction.png and b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenReactionIsAddedByCurrentUserWithSameType_shouldUpdateReactionColor.default-light-after-current-user-reaction.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenReactionIsAddedByCurrentUserWithSameType_shouldUpdateReactionColor.default-light-before-current-user-reaction.png b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenReactionIsAddedByCurrentUserWithSameType_shouldUpdateReactionColor.default-light-before-current-user-reaction.png index 1165fd9774f..76e2c52f184 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenReactionIsAddedByCurrentUserWithSameType_shouldUpdateReactionColor.default-light-before-current-user-reaction.png and b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenReactionIsAddedByCurrentUserWithSameType_shouldUpdateReactionColor.default-light-before-current-user-reaction.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenShouldMessagesStartAtTheTopIsTrue.small-dark.png b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenShouldMessagesStartAtTheTopIsTrue.small-dark.png index 4b16ba93606..2d19a7a904e 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenShouldMessagesStartAtTheTopIsTrue.small-dark.png and b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenShouldMessagesStartAtTheTopIsTrue.small-dark.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenThereIsAnUnreadMessageOutOfScreen_shouldShowJumpToUnreadPill_whenJumpToUnreadIsDisabled.default-light.png b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenThereIsAnUnreadMessageOutOfScreen_shouldShowJumpToUnreadPill_whenJumpToUnreadIsDisabled.default-light.png index ce9ede56ac2..a99b19697cc 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenThereIsAnUnreadMessageOutOfScreen_shouldShowJumpToUnreadPill_whenJumpToUnreadIsDisabled.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenThereIsAnUnreadMessageOutOfScreen_shouldShowJumpToUnreadPill_whenJumpToUnreadIsDisabled.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenThereIsAnUnreadMessageOutOfScreen_shouldShowJumpToUnreadPill_whenJumpToUnreadIsEnabled.default-light.png b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenThereIsAnUnreadMessageOutOfScreen_shouldShowJumpToUnreadPill_whenJumpToUnreadIsEnabled.default-light.png index a088aa0665c..e0ee69e823d 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenThereIsAnUnreadMessageOutOfScreen_shouldShowJumpToUnreadPill_whenJumpToUnreadIsEnabled.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenThereIsAnUnreadMessageOutOfScreen_shouldShowJumpToUnreadPill_whenJumpToUnreadIsEnabled.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenThereIsAnUnreadMessage_whenFeatureIsDisabled_shouldShowABannerOnTopOfIt.default-light.png b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenThereIsAnUnreadMessage_whenFeatureIsDisabled_shouldShowABannerOnTopOfIt.default-light.png index 9eb59a201e7..f32dddb09c2 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenThereIsAnUnreadMessage_whenFeatureIsDisabled_shouldShowABannerOnTopOfIt.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenThereIsAnUnreadMessage_whenFeatureIsDisabled_shouldShowABannerOnTopOfIt.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenThereIsAnUnreadMessage_whenFeatureIsEnabled_shouldShowABannerOnTopOfIt.default-light.png b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenThereIsAnUnreadMessage_whenFeatureIsEnabled_shouldShowABannerOnTopOfIt.default-light.png index cf5112e45d5..28b3b36849a 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenThereIsAnUnreadMessage_whenFeatureIsEnabled_shouldShowABannerOnTopOfIt.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenThereIsAnUnreadMessage_whenFeatureIsEnabled_shouldShowABannerOnTopOfIt.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenTimeIntervalBetween2MessagesFromAnotherUserIs1minOrLess_messagesAreGrouped.default-light.png b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenTimeIntervalBetween2MessagesFromAnotherUserIs1minOrLess_messagesAreGrouped.default-light.png index 0f91d95f5f0..c432dddf815 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenTimeIntervalBetween2MessagesFromAnotherUserIs1minOrLess_messagesAreGrouped.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenTimeIntervalBetween2MessagesFromAnotherUserIs1minOrLess_messagesAreGrouped.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenTimeIntervalBetween2MessagesFromAnotherUserIsMoreThan1min_messagesAreNotGrouped.default-light.png b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenTimeIntervalBetween2MessagesFromAnotherUserIsMoreThan1min_messagesAreNotGrouped.default-light.png index ba862be0f4e..4c985baa024 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenTimeIntervalBetween2MessagesFromAnotherUserIsMoreThan1min_messagesAreNotGrouped.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenTimeIntervalBetween2MessagesFromAnotherUserIsMoreThan1min_messagesAreNotGrouped.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenTimeIntervalBetween2MessagesFromTheCurrentUserIs1minOrLess_messagesAreGrouped.default-light.png b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenTimeIntervalBetween2MessagesFromTheCurrentUserIs1minOrLess_messagesAreGrouped.default-light.png index dc08475ec44..547aa571971 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenTimeIntervalBetween2MessagesFromTheCurrentUserIs1minOrLess_messagesAreGrouped.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenTimeIntervalBetween2MessagesFromTheCurrentUserIs1minOrLess_messagesAreGrouped.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenTimeIntervalBetween2MessagesFromTheCurrentUserIsMoreThan1min_messagesAreNotGrouped.default-light.png b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenTimeIntervalBetween2MessagesFromTheCurrentUserIsMoreThan1min_messagesAreNotGrouped.default-light.png index f6b0bfcf2f3..27bcbf17d30 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenTimeIntervalBetween2MessagesFromTheCurrentUserIsMoreThan1min_messagesAreNotGrouped.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/ChatChannel/__Snapshots__/ChatChannelVC_Tests/test_whenTimeIntervalBetween2MessagesFromTheCurrentUserIsMoreThan1min_messagesAreNotGrouped.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatChannelList/__Snapshots__/ChatChannelListVC_Tests/test_appearance_withSearchBar.default-light.png b/Tests/StreamChatUITests/SnapshotTests/ChatChannelList/__Snapshots__/ChatChannelListVC_Tests/test_appearance_withSearchBar.default-light.png index c1d3e22744a..689a719aed3 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatChannelList/__Snapshots__/ChatChannelListVC_Tests/test_appearance_withSearchBar.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/ChatChannelList/__Snapshots__/ChatChannelListVC_Tests/test_appearance_withSearchBar.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatChannelList/__Snapshots__/ChatChannelListVC_Tests/test_appearance_withSearchBar.extraExtraExtraLarge-light.png b/Tests/StreamChatUITests/SnapshotTests/ChatChannelList/__Snapshots__/ChatChannelListVC_Tests/test_appearance_withSearchBar.extraExtraExtraLarge-light.png index 94e9856695d..fa70db6218a 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatChannelList/__Snapshots__/ChatChannelListVC_Tests/test_appearance_withSearchBar.extraExtraExtraLarge-light.png and b/Tests/StreamChatUITests/SnapshotTests/ChatChannelList/__Snapshots__/ChatChannelListVC_Tests/test_appearance_withSearchBar.extraExtraExtraLarge-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatChannelList/__Snapshots__/ChatChannelListVC_Tests/test_appearance_withSearchBar.rightToLeftLayout-default.png b/Tests/StreamChatUITests/SnapshotTests/ChatChannelList/__Snapshots__/ChatChannelListVC_Tests/test_appearance_withSearchBar.rightToLeftLayout-default.png index ca6586b393b..ffd0219f63e 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatChannelList/__Snapshots__/ChatChannelListVC_Tests/test_appearance_withSearchBar.rightToLeftLayout-default.png and b/Tests/StreamChatUITests/SnapshotTests/ChatChannelList/__Snapshots__/ChatChannelListVC_Tests/test_appearance_withSearchBar.rightToLeftLayout-default.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatChannelList/__Snapshots__/ChatChannelListVC_Tests/test_appearance_withSearchBar.small-dark.png b/Tests/StreamChatUITests/SnapshotTests/ChatChannelList/__Snapshots__/ChatChannelListVC_Tests/test_appearance_withSearchBar.small-dark.png index 27537ac2424..f845893eeea 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatChannelList/__Snapshots__/ChatChannelListVC_Tests/test_appearance_withSearchBar.small-dark.png and b/Tests/StreamChatUITests/SnapshotTests/ChatChannelList/__Snapshots__/ChatChannelListVC_Tests/test_appearance_withSearchBar.small-dark.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearanceCustomization_usingSubclassing.default-light.png b/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearanceCustomization_usingSubclassing.default-light.png index 97c81d5791c..602f941b362 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearanceCustomization_usingSubclassing.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearanceCustomization_usingSubclassing.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearanceCustomization_usingSubclassing.extraExtraExtraLarge-light.png b/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearanceCustomization_usingSubclassing.extraExtraExtraLarge-light.png index a290ba76dc0..ee8cf6ca1aa 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearanceCustomization_usingSubclassing.extraExtraExtraLarge-light.png and b/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearanceCustomization_usingSubclassing.extraExtraExtraLarge-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearanceCustomization_usingSubclassing.rightToLeftLayout-default.png b/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearanceCustomization_usingSubclassing.rightToLeftLayout-default.png index c6eab438733..da4165eff70 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearanceCustomization_usingSubclassing.rightToLeftLayout-default.png and b/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearanceCustomization_usingSubclassing.rightToLeftLayout-default.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearanceCustomization_usingSubclassing.small-dark.png b/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearanceCustomization_usingSubclassing.small-dark.png index e4485dc36b8..f0218350202 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearanceCustomization_usingSubclassing.small-dark.png and b/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearanceCustomization_usingSubclassing.small-dark.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearance_five_attachments.default-light.png b/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearance_five_attachments.default-light.png index 4c49c7ed2be..af61860af10 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearance_five_attachments.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearance_five_attachments.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearance_five_attachments.extraExtraExtraLarge-light.png b/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearance_five_attachments.extraExtraExtraLarge-light.png index eb8e3fc7ca2..13dbde0c1a1 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearance_five_attachments.extraExtraExtraLarge-light.png and b/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearance_five_attachments.extraExtraExtraLarge-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearance_five_attachments.rightToLeftLayout-default.png b/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearance_five_attachments.rightToLeftLayout-default.png index 508bf3babd4..4dffbf59909 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearance_five_attachments.rightToLeftLayout-default.png and b/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearance_five_attachments.rightToLeftLayout-default.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearance_five_attachments.small-dark.png b/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearance_five_attachments.small-dark.png index 310f6744436..9b0d9e90279 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearance_five_attachments.small-dark.png and b/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearance_five_attachments.small-dark.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearance_one_attachment.default-light.png b/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearance_one_attachment.default-light.png index 41892c1b8e5..d23c4bd021b 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearance_one_attachment.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearance_one_attachment.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearance_one_attachment.extraExtraExtraLarge-light.png b/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearance_one_attachment.extraExtraExtraLarge-light.png index 0aa22fef29b..c54a927738b 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearance_one_attachment.extraExtraExtraLarge-light.png and b/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearance_one_attachment.extraExtraExtraLarge-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearance_one_attachment.rightToLeftLayout-default.png b/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearance_one_attachment.rightToLeftLayout-default.png index ee042dbee87..04d988d4521 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearance_one_attachment.rightToLeftLayout-default.png and b/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearance_one_attachment.rightToLeftLayout-default.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearance_one_attachment.small-dark.png b/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearance_one_attachment.small-dark.png index 9fba376fdcb..86de5d55a7b 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearance_one_attachment.small-dark.png and b/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearance_one_attachment.small-dark.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearance_two_attachments.default-light.png b/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearance_two_attachments.default-light.png index 8a44cc7f27c..4cdfa78f1fd 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearance_two_attachments.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearance_two_attachments.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearance_two_attachments.extraExtraExtraLarge-light.png b/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearance_two_attachments.extraExtraExtraLarge-light.png index c323c7f8ce5..4aad78fa66e 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearance_two_attachments.extraExtraExtraLarge-light.png and b/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearance_two_attachments.extraExtraExtraLarge-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearance_two_attachments.rightToLeftLayout-default.png b/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearance_two_attachments.rightToLeftLayout-default.png index 489a0da989b..bf06c621152 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearance_two_attachments.rightToLeftLayout-default.png and b/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearance_two_attachments.rightToLeftLayout-default.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearance_two_attachments.small-dark.png b/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearance_two_attachments.small-dark.png index b6f978e560f..3b915ada6f3 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearance_two_attachments.small-dark.png and b/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/Attachments/__Snapshots__/ChatMessageVoiceRecordingAttachmentListView_Tests/test_appearance_two_attachments.small-dark.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/__Snapshots__/JumpToUnreadMessagesButton_Tests/test_jumpToUnreadMessages_hundredMessages.default-dark.png b/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/__Snapshots__/JumpToUnreadMessagesButton_Tests/test_jumpToUnreadMessages_hundredMessages.default-dark.png index 4745f2e2a08..dc0fb2759dd 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/__Snapshots__/JumpToUnreadMessagesButton_Tests/test_jumpToUnreadMessages_hundredMessages.default-dark.png and b/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/__Snapshots__/JumpToUnreadMessagesButton_Tests/test_jumpToUnreadMessages_hundredMessages.default-dark.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/__Snapshots__/JumpToUnreadMessagesButton_Tests/test_jumpToUnreadMessages_hundredMessages.default-light.png b/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/__Snapshots__/JumpToUnreadMessagesButton_Tests/test_jumpToUnreadMessages_hundredMessages.default-light.png index 4745f2e2a08..dc0fb2759dd 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/__Snapshots__/JumpToUnreadMessagesButton_Tests/test_jumpToUnreadMessages_hundredMessages.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/__Snapshots__/JumpToUnreadMessagesButton_Tests/test_jumpToUnreadMessages_hundredMessages.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/__Snapshots__/JumpToUnreadMessagesButton_Tests/test_jumpToUnreadMessages_zeroMessages.default-dark.png b/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/__Snapshots__/JumpToUnreadMessagesButton_Tests/test_jumpToUnreadMessages_zeroMessages.default-dark.png index 2933c883496..588e289a8b4 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/__Snapshots__/JumpToUnreadMessagesButton_Tests/test_jumpToUnreadMessages_zeroMessages.default-dark.png and b/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/__Snapshots__/JumpToUnreadMessagesButton_Tests/test_jumpToUnreadMessages_zeroMessages.default-dark.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/__Snapshots__/JumpToUnreadMessagesButton_Tests/test_jumpToUnreadMessages_zeroMessages.default-light.png b/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/__Snapshots__/JumpToUnreadMessagesButton_Tests/test_jumpToUnreadMessages_zeroMessages.default-light.png index 2933c883496..588e289a8b4 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/__Snapshots__/JumpToUnreadMessagesButton_Tests/test_jumpToUnreadMessages_zeroMessages.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/ChatMessageList/__Snapshots__/JumpToUnreadMessagesButton_Tests/test_jumpToUnreadMessages_zeroMessages.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatThread/__Snapshots__/ChatThreadVC+SwiftUI_Tests/test_chatThreadVC_isPopulated.default-light.png b/Tests/StreamChatUITests/SnapshotTests/ChatThread/__Snapshots__/ChatThreadVC+SwiftUI_Tests/test_chatThreadVC_isPopulated.default-light.png index efeba6c2163..351daa9888f 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatThread/__Snapshots__/ChatThreadVC+SwiftUI_Tests/test_chatThreadVC_isPopulated.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/ChatThread/__Snapshots__/ChatThreadVC+SwiftUI_Tests/test_chatThreadVC_isPopulated.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatThread/__Snapshots__/ChatThreadVC+SwiftUI_Tests/test_customNavigationViewValues_arePopulated.default-light.png b/Tests/StreamChatUITests/SnapshotTests/ChatThread/__Snapshots__/ChatThreadVC+SwiftUI_Tests/test_customNavigationViewValues_arePopulated.default-light.png index 1aa14b20020..67d19a616c2 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatThread/__Snapshots__/ChatThreadVC+SwiftUI_Tests/test_customNavigationViewValues_arePopulated.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/ChatThread/__Snapshots__/ChatThreadVC+SwiftUI_Tests/test_customNavigationViewValues_arePopulated.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatThread/__Snapshots__/ChatThreadVC+SwiftUI_Tests/test_customNavigationViewValues_arePopulated.extraExtraExtraLarge-light.png b/Tests/StreamChatUITests/SnapshotTests/ChatThread/__Snapshots__/ChatThreadVC+SwiftUI_Tests/test_customNavigationViewValues_arePopulated.extraExtraExtraLarge-light.png index 74f5bbd722a..531657eb427 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatThread/__Snapshots__/ChatThreadVC+SwiftUI_Tests/test_customNavigationViewValues_arePopulated.extraExtraExtraLarge-light.png and b/Tests/StreamChatUITests/SnapshotTests/ChatThread/__Snapshots__/ChatThreadVC+SwiftUI_Tests/test_customNavigationViewValues_arePopulated.extraExtraExtraLarge-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatThread/__Snapshots__/ChatThreadVC+SwiftUI_Tests/test_customNavigationViewValues_arePopulated.rightToLeftLayout-default.png b/Tests/StreamChatUITests/SnapshotTests/ChatThread/__Snapshots__/ChatThreadVC+SwiftUI_Tests/test_customNavigationViewValues_arePopulated.rightToLeftLayout-default.png index bc8eaed2d08..8750a4ab677 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatThread/__Snapshots__/ChatThreadVC+SwiftUI_Tests/test_customNavigationViewValues_arePopulated.rightToLeftLayout-default.png and b/Tests/StreamChatUITests/SnapshotTests/ChatThread/__Snapshots__/ChatThreadVC+SwiftUI_Tests/test_customNavigationViewValues_arePopulated.rightToLeftLayout-default.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatThread/__Snapshots__/ChatThreadVC+SwiftUI_Tests/test_customNavigationViewValues_arePopulated.small-dark.png b/Tests/StreamChatUITests/SnapshotTests/ChatThread/__Snapshots__/ChatThreadVC+SwiftUI_Tests/test_customNavigationViewValues_arePopulated.small-dark.png index 16ba10c8b9e..7647ed5b50e 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatThread/__Snapshots__/ChatThreadVC+SwiftUI_Tests/test_customNavigationViewValues_arePopulated.small-dark.png and b/Tests/StreamChatUITests/SnapshotTests/ChatThread/__Snapshots__/ChatThreadVC+SwiftUI_Tests/test_customNavigationViewValues_arePopulated.small-dark.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatThread/__Snapshots__/ChatThreadVC_Tests/test_defaultAppearance.default-light.png b/Tests/StreamChatUITests/SnapshotTests/ChatThread/__Snapshots__/ChatThreadVC_Tests/test_defaultAppearance.default-light.png index 04d98bd9cf7..78a89cf3458 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatThread/__Snapshots__/ChatThreadVC_Tests/test_defaultAppearance.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/ChatThread/__Snapshots__/ChatThreadVC_Tests/test_defaultAppearance.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatThread/__Snapshots__/ChatThreadVC_Tests/test_emptyAppearance.default-light.png b/Tests/StreamChatUITests/SnapshotTests/ChatThread/__Snapshots__/ChatThreadVC_Tests/test_emptyAppearance.default-light.png index 5af89464047..1316c00da08 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatThread/__Snapshots__/ChatThreadVC_Tests/test_emptyAppearance.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/ChatThread/__Snapshots__/ChatThreadVC_Tests/test_emptyAppearance.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatThread/__Snapshots__/ChatThreadVC_Tests/test_whenShouldMessagesStartAtTheTopIsTrue.small-dark.png b/Tests/StreamChatUITests/SnapshotTests/ChatThread/__Snapshots__/ChatThreadVC_Tests/test_whenShouldMessagesStartAtTheTopIsTrue.small-dark.png index bdc60150b71..30fffe83fff 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatThread/__Snapshots__/ChatThreadVC_Tests/test_whenShouldMessagesStartAtTheTopIsTrue.small-dark.png and b/Tests/StreamChatUITests/SnapshotTests/ChatThread/__Snapshots__/ChatThreadVC_Tests/test_whenShouldMessagesStartAtTheTopIsTrue.small-dark.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/ChatThread/__Snapshots__/ChatThreadVC_Tests/test_whenThreadRendersParentMessageEnabledIsFalse.default-light.png b/Tests/StreamChatUITests/SnapshotTests/ChatThread/__Snapshots__/ChatThreadVC_Tests/test_whenThreadRendersParentMessageEnabledIsFalse.default-light.png index d7eb664b8af..be6478eaf39 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/ChatThread/__Snapshots__/ChatThreadVC_Tests/test_whenThreadRendersParentMessageEnabledIsFalse.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/ChatThread/__Snapshots__/ChatThreadVC_Tests/test_whenThreadRendersParentMessageEnabledIsFalse.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/Attachments/AttachmentViews/__Snapshots__/VoiceRecordingAttachmentComposerPreview_Tests/test_appearance_wasConfiguredAsExpected.default-light.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/Attachments/AttachmentViews/__Snapshots__/VoiceRecordingAttachmentComposerPreview_Tests/test_appearance_wasConfiguredAsExpected.default-light.png index 1dd6980e486..f726f44c12a 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/CommonViews/Attachments/AttachmentViews/__Snapshots__/VoiceRecordingAttachmentComposerPreview_Tests/test_appearance_wasConfiguredAsExpected.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/Attachments/AttachmentViews/__Snapshots__/VoiceRecordingAttachmentComposerPreview_Tests/test_appearance_wasConfiguredAsExpected.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/Attachments/AttachmentViews/__Snapshots__/VoiceRecordingAttachmentComposerPreview_Tests/test_appearance_wasConfiguredAsExpected.extraExtraExtraLarge-light.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/Attachments/AttachmentViews/__Snapshots__/VoiceRecordingAttachmentComposerPreview_Tests/test_appearance_wasConfiguredAsExpected.extraExtraExtraLarge-light.png index fddb045e037..537e35cef2a 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/CommonViews/Attachments/AttachmentViews/__Snapshots__/VoiceRecordingAttachmentComposerPreview_Tests/test_appearance_wasConfiguredAsExpected.extraExtraExtraLarge-light.png and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/Attachments/AttachmentViews/__Snapshots__/VoiceRecordingAttachmentComposerPreview_Tests/test_appearance_wasConfiguredAsExpected.extraExtraExtraLarge-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/Attachments/AttachmentViews/__Snapshots__/VoiceRecordingAttachmentComposerPreview_Tests/test_appearance_wasConfiguredAsExpected.rightToLeftLayout-default.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/Attachments/AttachmentViews/__Snapshots__/VoiceRecordingAttachmentComposerPreview_Tests/test_appearance_wasConfiguredAsExpected.rightToLeftLayout-default.png index bb0a58c0818..7e3577a9109 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/CommonViews/Attachments/AttachmentViews/__Snapshots__/VoiceRecordingAttachmentComposerPreview_Tests/test_appearance_wasConfiguredAsExpected.rightToLeftLayout-default.png and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/Attachments/AttachmentViews/__Snapshots__/VoiceRecordingAttachmentComposerPreview_Tests/test_appearance_wasConfiguredAsExpected.rightToLeftLayout-default.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/Attachments/AttachmentViews/__Snapshots__/VoiceRecordingAttachmentComposerPreview_Tests/test_appearance_wasConfiguredAsExpected.small-dark.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/Attachments/AttachmentViews/__Snapshots__/VoiceRecordingAttachmentComposerPreview_Tests/test_appearance_wasConfiguredAsExpected.small-dark.png index e9bff31c319..e8dfe69172b 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/CommonViews/Attachments/AttachmentViews/__Snapshots__/VoiceRecordingAttachmentComposerPreview_Tests/test_appearance_wasConfiguredAsExpected.small-dark.png and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/Attachments/AttachmentViews/__Snapshots__/VoiceRecordingAttachmentComposerPreview_Tests/test_appearance_wasConfiguredAsExpected.small-dark.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/Attachments/__Snapshots__/AttachmentsPreviewVC_Tests/test_appearance_contentHasLessItemsThanMaxNumberOfVerticalItems_rendersCorrectly.default-light.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/Attachments/__Snapshots__/AttachmentsPreviewVC_Tests/test_appearance_contentHasLessItemsThanMaxNumberOfVerticalItems_rendersCorrectly.default-light.png index 5687f78e139..7faed4a157f 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/CommonViews/Attachments/__Snapshots__/AttachmentsPreviewVC_Tests/test_appearance_contentHasLessItemsThanMaxNumberOfVerticalItems_rendersCorrectly.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/Attachments/__Snapshots__/AttachmentsPreviewVC_Tests/test_appearance_contentHasLessItemsThanMaxNumberOfVerticalItems_rendersCorrectly.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/Attachments/__Snapshots__/AttachmentsPreviewVC_Tests/test_appearance_contentHasLessItemsThanMaxNumberOfVerticalItems_rendersCorrectly.extraExtraExtraLarge-light.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/Attachments/__Snapshots__/AttachmentsPreviewVC_Tests/test_appearance_contentHasLessItemsThanMaxNumberOfVerticalItems_rendersCorrectly.extraExtraExtraLarge-light.png index 3116d5a5da2..671c8b88e46 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/CommonViews/Attachments/__Snapshots__/AttachmentsPreviewVC_Tests/test_appearance_contentHasLessItemsThanMaxNumberOfVerticalItems_rendersCorrectly.extraExtraExtraLarge-light.png and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/Attachments/__Snapshots__/AttachmentsPreviewVC_Tests/test_appearance_contentHasLessItemsThanMaxNumberOfVerticalItems_rendersCorrectly.extraExtraExtraLarge-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/Attachments/__Snapshots__/AttachmentsPreviewVC_Tests/test_appearance_contentHasLessItemsThanMaxNumberOfVerticalItems_rendersCorrectly.rightToLeftLayout-default.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/Attachments/__Snapshots__/AttachmentsPreviewVC_Tests/test_appearance_contentHasLessItemsThanMaxNumberOfVerticalItems_rendersCorrectly.rightToLeftLayout-default.png index 6cd4bf6f71e..fcfd1931e0f 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/CommonViews/Attachments/__Snapshots__/AttachmentsPreviewVC_Tests/test_appearance_contentHasLessItemsThanMaxNumberOfVerticalItems_rendersCorrectly.rightToLeftLayout-default.png and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/Attachments/__Snapshots__/AttachmentsPreviewVC_Tests/test_appearance_contentHasLessItemsThanMaxNumberOfVerticalItems_rendersCorrectly.rightToLeftLayout-default.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/Attachments/__Snapshots__/AttachmentsPreviewVC_Tests/test_appearance_contentHasLessItemsThanMaxNumberOfVerticalItems_rendersCorrectly.small-dark.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/Attachments/__Snapshots__/AttachmentsPreviewVC_Tests/test_appearance_contentHasLessItemsThanMaxNumberOfVerticalItems_rendersCorrectly.small-dark.png index 07033d3c848..98702022eb4 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/CommonViews/Attachments/__Snapshots__/AttachmentsPreviewVC_Tests/test_appearance_contentHasLessItemsThanMaxNumberOfVerticalItems_rendersCorrectly.small-dark.png and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/Attachments/__Snapshots__/AttachmentsPreviewVC_Tests/test_appearance_contentHasLessItemsThanMaxNumberOfVerticalItems_rendersCorrectly.small-dark.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/Attachments/__Snapshots__/AttachmentsPreviewVC_Tests/test_appearance_contentHasMoreItemsThanMaxNumberOfVerticalItems_rendersCorrectly.default-light.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/Attachments/__Snapshots__/AttachmentsPreviewVC_Tests/test_appearance_contentHasMoreItemsThanMaxNumberOfVerticalItems_rendersCorrectly.default-light.png index db326b462f4..48f1435dee6 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/CommonViews/Attachments/__Snapshots__/AttachmentsPreviewVC_Tests/test_appearance_contentHasMoreItemsThanMaxNumberOfVerticalItems_rendersCorrectly.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/Attachments/__Snapshots__/AttachmentsPreviewVC_Tests/test_appearance_contentHasMoreItemsThanMaxNumberOfVerticalItems_rendersCorrectly.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/Attachments/__Snapshots__/AttachmentsPreviewVC_Tests/test_appearance_contentHasMoreItemsThanMaxNumberOfVerticalItems_rendersCorrectly.extraExtraExtraLarge-light.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/Attachments/__Snapshots__/AttachmentsPreviewVC_Tests/test_appearance_contentHasMoreItemsThanMaxNumberOfVerticalItems_rendersCorrectly.extraExtraExtraLarge-light.png index cd6223db946..9b8a5b25841 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/CommonViews/Attachments/__Snapshots__/AttachmentsPreviewVC_Tests/test_appearance_contentHasMoreItemsThanMaxNumberOfVerticalItems_rendersCorrectly.extraExtraExtraLarge-light.png and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/Attachments/__Snapshots__/AttachmentsPreviewVC_Tests/test_appearance_contentHasMoreItemsThanMaxNumberOfVerticalItems_rendersCorrectly.extraExtraExtraLarge-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/Attachments/__Snapshots__/AttachmentsPreviewVC_Tests/test_appearance_contentHasMoreItemsThanMaxNumberOfVerticalItems_rendersCorrectly.rightToLeftLayout-default.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/Attachments/__Snapshots__/AttachmentsPreviewVC_Tests/test_appearance_contentHasMoreItemsThanMaxNumberOfVerticalItems_rendersCorrectly.rightToLeftLayout-default.png index a94243200a4..cf86faee7ea 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/CommonViews/Attachments/__Snapshots__/AttachmentsPreviewVC_Tests/test_appearance_contentHasMoreItemsThanMaxNumberOfVerticalItems_rendersCorrectly.rightToLeftLayout-default.png and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/Attachments/__Snapshots__/AttachmentsPreviewVC_Tests/test_appearance_contentHasMoreItemsThanMaxNumberOfVerticalItems_rendersCorrectly.rightToLeftLayout-default.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/Attachments/__Snapshots__/AttachmentsPreviewVC_Tests/test_appearance_contentHasMoreItemsThanMaxNumberOfVerticalItems_rendersCorrectly.small-dark.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/Attachments/__Snapshots__/AttachmentsPreviewVC_Tests/test_appearance_contentHasMoreItemsThanMaxNumberOfVerticalItems_rendersCorrectly.small-dark.png index b86f0dae74b..d0cfe0981bd 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/CommonViews/Attachments/__Snapshots__/AttachmentsPreviewVC_Tests/test_appearance_contentHasMoreItemsThanMaxNumberOfVerticalItems_rendersCorrectly.small-dark.png and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/Attachments/__Snapshots__/AttachmentsPreviewVC_Tests/test_appearance_contentHasMoreItemsThanMaxNumberOfVerticalItems_rendersCorrectly.small-dark.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/PlayPauseButton/__Snapshots__/PlayPauseButton_Tests/test_appearance_wasConfiguredCorrectly.default-light-bigger.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/PlayPauseButton/__Snapshots__/PlayPauseButton_Tests/test_appearance_wasConfiguredCorrectly.default-light-bigger.png index 3809e53e5de..fe58e4e7942 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/CommonViews/PlayPauseButton/__Snapshots__/PlayPauseButton_Tests/test_appearance_wasConfiguredCorrectly.default-light-bigger.png and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/PlayPauseButton/__Snapshots__/PlayPauseButton_Tests/test_appearance_wasConfiguredCorrectly.default-light-bigger.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/PlayPauseButton/__Snapshots__/PlayPauseButton_Tests/test_appearance_wasConfiguredCorrectly.default-light-isHighlighted.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/PlayPauseButton/__Snapshots__/PlayPauseButton_Tests/test_appearance_wasConfiguredCorrectly.default-light-isHighlighted.png index e23f0a4954f..cab2941256e 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/CommonViews/PlayPauseButton/__Snapshots__/PlayPauseButton_Tests/test_appearance_wasConfiguredCorrectly.default-light-isHighlighted.png and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/PlayPauseButton/__Snapshots__/PlayPauseButton_Tests/test_appearance_wasConfiguredCorrectly.default-light-isHighlighted.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/PlayPauseButton/__Snapshots__/PlayPauseButton_Tests/test_appearance_wasConfiguredCorrectly.default-light.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/PlayPauseButton/__Snapshots__/PlayPauseButton_Tests/test_appearance_wasConfiguredCorrectly.default-light.png index c0da5463919..3c484579030 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/CommonViews/PlayPauseButton/__Snapshots__/PlayPauseButton_Tests/test_appearance_wasConfiguredCorrectly.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/PlayPauseButton/__Snapshots__/PlayPauseButton_Tests/test_appearance_wasConfiguredCorrectly.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/PlayPauseButton/__Snapshots__/PlayPauseButton_Tests/test_appearance_wasConfiguredCorrectly.extraExtraExtraLarge-light-bigger.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/PlayPauseButton/__Snapshots__/PlayPauseButton_Tests/test_appearance_wasConfiguredCorrectly.extraExtraExtraLarge-light-bigger.png index 3809e53e5de..fe58e4e7942 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/CommonViews/PlayPauseButton/__Snapshots__/PlayPauseButton_Tests/test_appearance_wasConfiguredCorrectly.extraExtraExtraLarge-light-bigger.png and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/PlayPauseButton/__Snapshots__/PlayPauseButton_Tests/test_appearance_wasConfiguredCorrectly.extraExtraExtraLarge-light-bigger.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/PlayPauseButton/__Snapshots__/PlayPauseButton_Tests/test_appearance_wasConfiguredCorrectly.extraExtraExtraLarge-light-isHighlighted.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/PlayPauseButton/__Snapshots__/PlayPauseButton_Tests/test_appearance_wasConfiguredCorrectly.extraExtraExtraLarge-light-isHighlighted.png index e23f0a4954f..cab2941256e 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/CommonViews/PlayPauseButton/__Snapshots__/PlayPauseButton_Tests/test_appearance_wasConfiguredCorrectly.extraExtraExtraLarge-light-isHighlighted.png and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/PlayPauseButton/__Snapshots__/PlayPauseButton_Tests/test_appearance_wasConfiguredCorrectly.extraExtraExtraLarge-light-isHighlighted.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/PlayPauseButton/__Snapshots__/PlayPauseButton_Tests/test_appearance_wasConfiguredCorrectly.extraExtraExtraLarge-light.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/PlayPauseButton/__Snapshots__/PlayPauseButton_Tests/test_appearance_wasConfiguredCorrectly.extraExtraExtraLarge-light.png index c0da5463919..3c484579030 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/CommonViews/PlayPauseButton/__Snapshots__/PlayPauseButton_Tests/test_appearance_wasConfiguredCorrectly.extraExtraExtraLarge-light.png and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/PlayPauseButton/__Snapshots__/PlayPauseButton_Tests/test_appearance_wasConfiguredCorrectly.extraExtraExtraLarge-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/PlayPauseButton/__Snapshots__/PlayPauseButton_Tests/test_appearance_wasConfiguredCorrectly.rightToLeftLayout-default-bigger.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/PlayPauseButton/__Snapshots__/PlayPauseButton_Tests/test_appearance_wasConfiguredCorrectly.rightToLeftLayout-default-bigger.png index 3809e53e5de..fe58e4e7942 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/CommonViews/PlayPauseButton/__Snapshots__/PlayPauseButton_Tests/test_appearance_wasConfiguredCorrectly.rightToLeftLayout-default-bigger.png and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/PlayPauseButton/__Snapshots__/PlayPauseButton_Tests/test_appearance_wasConfiguredCorrectly.rightToLeftLayout-default-bigger.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/PlayPauseButton/__Snapshots__/PlayPauseButton_Tests/test_appearance_wasConfiguredCorrectly.rightToLeftLayout-default-isHighlighted.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/PlayPauseButton/__Snapshots__/PlayPauseButton_Tests/test_appearance_wasConfiguredCorrectly.rightToLeftLayout-default-isHighlighted.png index e23f0a4954f..cab2941256e 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/CommonViews/PlayPauseButton/__Snapshots__/PlayPauseButton_Tests/test_appearance_wasConfiguredCorrectly.rightToLeftLayout-default-isHighlighted.png and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/PlayPauseButton/__Snapshots__/PlayPauseButton_Tests/test_appearance_wasConfiguredCorrectly.rightToLeftLayout-default-isHighlighted.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/PlayPauseButton/__Snapshots__/PlayPauseButton_Tests/test_appearance_wasConfiguredCorrectly.rightToLeftLayout-default.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/PlayPauseButton/__Snapshots__/PlayPauseButton_Tests/test_appearance_wasConfiguredCorrectly.rightToLeftLayout-default.png index c0da5463919..3c484579030 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/CommonViews/PlayPauseButton/__Snapshots__/PlayPauseButton_Tests/test_appearance_wasConfiguredCorrectly.rightToLeftLayout-default.png and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/PlayPauseButton/__Snapshots__/PlayPauseButton_Tests/test_appearance_wasConfiguredCorrectly.rightToLeftLayout-default.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/PlayPauseButton/__Snapshots__/PlayPauseButton_Tests/test_appearance_wasConfiguredCorrectly.small-dark-bigger.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/PlayPauseButton/__Snapshots__/PlayPauseButton_Tests/test_appearance_wasConfiguredCorrectly.small-dark-bigger.png index 3809e53e5de..fe58e4e7942 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/CommonViews/PlayPauseButton/__Snapshots__/PlayPauseButton_Tests/test_appearance_wasConfiguredCorrectly.small-dark-bigger.png and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/PlayPauseButton/__Snapshots__/PlayPauseButton_Tests/test_appearance_wasConfiguredCorrectly.small-dark-bigger.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/PlayPauseButton/__Snapshots__/PlayPauseButton_Tests/test_appearance_wasConfiguredCorrectly.small-dark-isHighlighted.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/PlayPauseButton/__Snapshots__/PlayPauseButton_Tests/test_appearance_wasConfiguredCorrectly.small-dark-isHighlighted.png index 953fa73d2da..d32d6151e96 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/CommonViews/PlayPauseButton/__Snapshots__/PlayPauseButton_Tests/test_appearance_wasConfiguredCorrectly.small-dark-isHighlighted.png and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/PlayPauseButton/__Snapshots__/PlayPauseButton_Tests/test_appearance_wasConfiguredCorrectly.small-dark-isHighlighted.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/PlayPauseButton/__Snapshots__/PlayPauseButton_Tests/test_appearance_wasConfiguredCorrectly.small-dark.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/PlayPauseButton/__Snapshots__/PlayPauseButton_Tests/test_appearance_wasConfiguredCorrectly.small-dark.png index c0da5463919..3c484579030 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/CommonViews/PlayPauseButton/__Snapshots__/PlayPauseButton_Tests/test_appearance_wasConfiguredCorrectly.small-dark.png and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/PlayPauseButton/__Snapshots__/PlayPauseButton_Tests/test_appearance_wasConfiguredCorrectly.small-dark.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/QuotedChatMessageView_Tests.swift b/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/QuotedChatMessageView_Tests.swift index 57d99e66f21..7de6ad78d0b 100644 --- a/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/QuotedChatMessageView_Tests.swift +++ b/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/QuotedChatMessageView_Tests.swift @@ -55,6 +55,31 @@ final class QuotedChatMessageView_Tests: XCTestCase { AssertSnapshot(view, suffix: "-emptyText") } + + func test_withImageAttachmentAppearance_currentUser() { + let attachment = ChatMessageImageAttachment.mock( + id: .unique, + imageURL: TestImages.yoda.url, + title: "" + ) + view.content = makeContent( + text: "Hello Vader!", + isSentByCurrentUser: true, + avatarAlignment: .trailing, + attachments: [attachment.asAnyAttachment] + ) + + AssertSnapshot(view) + + view.content = makeContent( + text: "", + isSentByCurrentUser: true, + avatarAlignment: .trailing, + attachments: [attachment.asAnyAttachment] + ) + + AssertSnapshot(view, suffix: "-emptyText") + } func test_withFileAttachmentAppearance() { let attachment = ChatMessageFileAttachment.mock( @@ -73,6 +98,34 @@ final class QuotedChatMessageView_Tests: XCTestCase { AssertSnapshot(view, suffix: "-emptyText") } + + func test_withFileAttachmentAppearance_currentUser() { + let attachment = ChatMessageFileAttachment.mock( + id: .unique, + title: "Data.csv", + assetURL: .unique(), + file: AttachmentFile(type: .csv, size: 0, mimeType: "text/csv"), + localState: nil + ) + + view.content = makeContent( + text: "Hello Vader!", + isSentByCurrentUser: true, + avatarAlignment: .trailing, + attachments: [attachment.asAnyAttachment] + ) + + AssertSnapshot(view) + + view.content = makeContent( + text: "", + isSentByCurrentUser: true, + avatarAlignment: .trailing, + attachments: [attachment.asAnyAttachment] + ) + + AssertSnapshot(view, suffix: "-emptyText") + } func test_withLinkAttachmentAppearance() { let attachment = ChatMessageLinkAttachment.mock( @@ -86,6 +139,24 @@ final class QuotedChatMessageView_Tests: XCTestCase { AssertSnapshot(view) } + + func test_withLinkAttachmentAppearance_currentUser() { + let attachment = ChatMessageLinkAttachment.mock( + id: .unique, + originalURL: URL(string: "https://www.yoda.com")!, + assetURL: .unique(), + previewURL: TestImages.yoda.url + ) + + view.content = makeContent( + text: "Hello Vader!", + isSentByCurrentUser: true, + avatarAlignment: .trailing, + attachments: [attachment.asAnyAttachment] + ) + + AssertSnapshot(view) + } func test_withGiphyAttachmentAppearance() { let attachment = ChatMessageGiphyAttachment( diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView+SwiftUI_Tests/test_injectedSwiftUIView.default-light.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView+SwiftUI_Tests/test_injectedSwiftUIView.default-light.png index 4b8a29a2950..c500f78a82c 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView+SwiftUI_Tests/test_injectedSwiftUIView.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView+SwiftUI_Tests/test_injectedSwiftUIView.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withFileAttachmentAppearance_currentUser.default-light-emptyText.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withFileAttachmentAppearance_currentUser.default-light-emptyText.png new file mode 100644 index 00000000000..26b98e5e813 Binary files /dev/null and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withFileAttachmentAppearance_currentUser.default-light-emptyText.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withFileAttachmentAppearance_currentUser.default-light.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withFileAttachmentAppearance_currentUser.default-light.png new file mode 100644 index 00000000000..b9d28c64c6a Binary files /dev/null and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withFileAttachmentAppearance_currentUser.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withFileAttachmentAppearance_currentUser.extraExtraExtraLarge-light-emptyText.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withFileAttachmentAppearance_currentUser.extraExtraExtraLarge-light-emptyText.png new file mode 100644 index 00000000000..bb0f1b12e91 Binary files /dev/null and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withFileAttachmentAppearance_currentUser.extraExtraExtraLarge-light-emptyText.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withFileAttachmentAppearance_currentUser.extraExtraExtraLarge-light.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withFileAttachmentAppearance_currentUser.extraExtraExtraLarge-light.png new file mode 100644 index 00000000000..9cbd4856408 Binary files /dev/null and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withFileAttachmentAppearance_currentUser.extraExtraExtraLarge-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withFileAttachmentAppearance_currentUser.rightToLeftLayout-default-emptyText.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withFileAttachmentAppearance_currentUser.rightToLeftLayout-default-emptyText.png new file mode 100644 index 00000000000..0baa4f721b1 Binary files /dev/null and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withFileAttachmentAppearance_currentUser.rightToLeftLayout-default-emptyText.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withFileAttachmentAppearance_currentUser.rightToLeftLayout-default.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withFileAttachmentAppearance_currentUser.rightToLeftLayout-default.png new file mode 100644 index 00000000000..cce6db4559a Binary files /dev/null and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withFileAttachmentAppearance_currentUser.rightToLeftLayout-default.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withFileAttachmentAppearance_currentUser.small-dark-emptyText.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withFileAttachmentAppearance_currentUser.small-dark-emptyText.png new file mode 100644 index 00000000000..a5ab9bcbf03 Binary files /dev/null and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withFileAttachmentAppearance_currentUser.small-dark-emptyText.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withFileAttachmentAppearance_currentUser.small-dark.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withFileAttachmentAppearance_currentUser.small-dark.png new file mode 100644 index 00000000000..0ee8ce36368 Binary files /dev/null and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withFileAttachmentAppearance_currentUser.small-dark.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withImageAttachmentAppearance_currentUser.default-light-emptyText.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withImageAttachmentAppearance_currentUser.default-light-emptyText.png new file mode 100644 index 00000000000..dfe58580cce Binary files /dev/null and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withImageAttachmentAppearance_currentUser.default-light-emptyText.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withImageAttachmentAppearance_currentUser.default-light.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withImageAttachmentAppearance_currentUser.default-light.png new file mode 100644 index 00000000000..3c52450fe47 Binary files /dev/null and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withImageAttachmentAppearance_currentUser.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withImageAttachmentAppearance_currentUser.extraExtraExtraLarge-light-emptyText.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withImageAttachmentAppearance_currentUser.extraExtraExtraLarge-light-emptyText.png new file mode 100644 index 00000000000..f325d8ec37d Binary files /dev/null and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withImageAttachmentAppearance_currentUser.extraExtraExtraLarge-light-emptyText.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withImageAttachmentAppearance_currentUser.extraExtraExtraLarge-light.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withImageAttachmentAppearance_currentUser.extraExtraExtraLarge-light.png new file mode 100644 index 00000000000..5fa22cce6db Binary files /dev/null and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withImageAttachmentAppearance_currentUser.extraExtraExtraLarge-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withImageAttachmentAppearance_currentUser.rightToLeftLayout-default-emptyText.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withImageAttachmentAppearance_currentUser.rightToLeftLayout-default-emptyText.png new file mode 100644 index 00000000000..3ad74c2a1ab Binary files /dev/null and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withImageAttachmentAppearance_currentUser.rightToLeftLayout-default-emptyText.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withImageAttachmentAppearance_currentUser.rightToLeftLayout-default.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withImageAttachmentAppearance_currentUser.rightToLeftLayout-default.png new file mode 100644 index 00000000000..6e7ea47b67f Binary files /dev/null and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withImageAttachmentAppearance_currentUser.rightToLeftLayout-default.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withImageAttachmentAppearance_currentUser.small-dark-emptyText.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withImageAttachmentAppearance_currentUser.small-dark-emptyText.png new file mode 100644 index 00000000000..08f5239e547 Binary files /dev/null and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withImageAttachmentAppearance_currentUser.small-dark-emptyText.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withImageAttachmentAppearance_currentUser.small-dark.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withImageAttachmentAppearance_currentUser.small-dark.png new file mode 100644 index 00000000000..8a0564fbccd Binary files /dev/null and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withImageAttachmentAppearance_currentUser.small-dark.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withLinkAttachmentAppearance_currentUser.default-light.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withLinkAttachmentAppearance_currentUser.default-light.png new file mode 100644 index 00000000000..77b7af2af1c Binary files /dev/null and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withLinkAttachmentAppearance_currentUser.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withLinkAttachmentAppearance_currentUser.extraExtraExtraLarge-light.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withLinkAttachmentAppearance_currentUser.extraExtraExtraLarge-light.png new file mode 100644 index 00000000000..11b28ced4ee Binary files /dev/null and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withLinkAttachmentAppearance_currentUser.extraExtraExtraLarge-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withLinkAttachmentAppearance_currentUser.rightToLeftLayout-default.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withLinkAttachmentAppearance_currentUser.rightToLeftLayout-default.png new file mode 100644 index 00000000000..b22fe45fc1d Binary files /dev/null and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withLinkAttachmentAppearance_currentUser.rightToLeftLayout-default.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withLinkAttachmentAppearance_currentUser.small-dark.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withLinkAttachmentAppearance_currentUser.small-dark.png new file mode 100644 index 00000000000..8f9a96128ab Binary files /dev/null and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/QuotedChatMessageView/__Snapshots__/QuotedChatMessageView_Tests/test_withLinkAttachmentAppearance_currentUser.small-dark.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/Suggestions/TitleContainerView/__Snapshots__/TitleContainerView_Tests/test_appearanceCustomization_usingAppearance.default-light.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/Suggestions/TitleContainerView/__Snapshots__/TitleContainerView_Tests/test_appearanceCustomization_usingAppearance.default-light.png index 8f9099e5bc7..b41ecd28d5f 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/CommonViews/Suggestions/TitleContainerView/__Snapshots__/TitleContainerView_Tests/test_appearanceCustomization_usingAppearance.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/Suggestions/TitleContainerView/__Snapshots__/TitleContainerView_Tests/test_appearanceCustomization_usingAppearance.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/Suggestions/TitleContainerView/__Snapshots__/TitleContainerView_Tests/test_appearanceCustomization_usingAppearance.rightToLeftLayout-default.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/Suggestions/TitleContainerView/__Snapshots__/TitleContainerView_Tests/test_appearanceCustomization_usingAppearance.rightToLeftLayout-default.png index 8f9099e5bc7..b41ecd28d5f 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/CommonViews/Suggestions/TitleContainerView/__Snapshots__/TitleContainerView_Tests/test_appearanceCustomization_usingAppearance.rightToLeftLayout-default.png and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/Suggestions/TitleContainerView/__Snapshots__/TitleContainerView_Tests/test_appearanceCustomization_usingAppearance.rightToLeftLayout-default.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/Suggestions/TitleContainerView/__Snapshots__/TitleContainerView_Tests/test_defaultAppearance.default-light-full.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/Suggestions/TitleContainerView/__Snapshots__/TitleContainerView_Tests/test_defaultAppearance.default-light-full.png index c0d5842fd5f..7967f5607a3 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/CommonViews/Suggestions/TitleContainerView/__Snapshots__/TitleContainerView_Tests/test_defaultAppearance.default-light-full.png and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/Suggestions/TitleContainerView/__Snapshots__/TitleContainerView_Tests/test_defaultAppearance.default-light-full.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/Suggestions/TitleContainerView/__Snapshots__/TitleContainerView_Tests/test_defaultAppearance.rightToLeftLayout-default-full.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/Suggestions/TitleContainerView/__Snapshots__/TitleContainerView_Tests/test_defaultAppearance.rightToLeftLayout-default-full.png index c0d5842fd5f..7967f5607a3 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/CommonViews/Suggestions/TitleContainerView/__Snapshots__/TitleContainerView_Tests/test_defaultAppearance.rightToLeftLayout-default-full.png and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/Suggestions/TitleContainerView/__Snapshots__/TitleContainerView_Tests/test_defaultAppearance.rightToLeftLayout-default-full.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/Suggestions/TitleContainerView/__Snapshots__/TitleContainerView_Tests/test_swiftUIWrapper.default-light.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/Suggestions/TitleContainerView/__Snapshots__/TitleContainerView_Tests/test_swiftUIWrapper.default-light.png index ec984dd5d39..3836130527d 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/CommonViews/Suggestions/TitleContainerView/__Snapshots__/TitleContainerView_Tests/test_swiftUIWrapper.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/Suggestions/TitleContainerView/__Snapshots__/TitleContainerView_Tests/test_swiftUIWrapper.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/Suggestions/TitleContainerView/__Snapshots__/TitleContainerView_Tests/test_swiftUIWrapper.rightToLeftLayout-default.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/Suggestions/TitleContainerView/__Snapshots__/TitleContainerView_Tests/test_swiftUIWrapper.rightToLeftLayout-default.png index ec984dd5d39..3836130527d 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/CommonViews/Suggestions/TitleContainerView/__Snapshots__/TitleContainerView_Tests/test_swiftUIWrapper.rightToLeftLayout-default.png and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/Suggestions/TitleContainerView/__Snapshots__/TitleContainerView_Tests/test_swiftUIWrapper.rightToLeftLayout-default.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/__Snapshots__/PillButton_Tests/test_appearance_wasConfiguredCorrectly.default-light-isHighlighted.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/__Snapshots__/PillButton_Tests/test_appearance_wasConfiguredCorrectly.default-light-isHighlighted.png index 3a5b8d91888..02a4c52f7a0 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/CommonViews/__Snapshots__/PillButton_Tests/test_appearance_wasConfiguredCorrectly.default-light-isHighlighted.png and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/__Snapshots__/PillButton_Tests/test_appearance_wasConfiguredCorrectly.default-light-isHighlighted.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/__Snapshots__/PillButton_Tests/test_appearance_wasConfiguredCorrectly.default-light.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/__Snapshots__/PillButton_Tests/test_appearance_wasConfiguredCorrectly.default-light.png index 564c91808c0..157fb895a01 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/CommonViews/__Snapshots__/PillButton_Tests/test_appearance_wasConfiguredCorrectly.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/__Snapshots__/PillButton_Tests/test_appearance_wasConfiguredCorrectly.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/__Snapshots__/PillButton_Tests/test_appearance_wasConfiguredCorrectly.extraExtraExtraLarge-light-isHighlighted.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/__Snapshots__/PillButton_Tests/test_appearance_wasConfiguredCorrectly.extraExtraExtraLarge-light-isHighlighted.png index 3a5b8d91888..02a4c52f7a0 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/CommonViews/__Snapshots__/PillButton_Tests/test_appearance_wasConfiguredCorrectly.extraExtraExtraLarge-light-isHighlighted.png and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/__Snapshots__/PillButton_Tests/test_appearance_wasConfiguredCorrectly.extraExtraExtraLarge-light-isHighlighted.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/__Snapshots__/PillButton_Tests/test_appearance_wasConfiguredCorrectly.extraExtraExtraLarge-light.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/__Snapshots__/PillButton_Tests/test_appearance_wasConfiguredCorrectly.extraExtraExtraLarge-light.png index 564c91808c0..157fb895a01 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/CommonViews/__Snapshots__/PillButton_Tests/test_appearance_wasConfiguredCorrectly.extraExtraExtraLarge-light.png and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/__Snapshots__/PillButton_Tests/test_appearance_wasConfiguredCorrectly.extraExtraExtraLarge-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/__Snapshots__/PillButton_Tests/test_appearance_wasConfiguredCorrectly.rightToLeftLayout-default-isHighlighted.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/__Snapshots__/PillButton_Tests/test_appearance_wasConfiguredCorrectly.rightToLeftLayout-default-isHighlighted.png index 3a5b8d91888..02a4c52f7a0 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/CommonViews/__Snapshots__/PillButton_Tests/test_appearance_wasConfiguredCorrectly.rightToLeftLayout-default-isHighlighted.png and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/__Snapshots__/PillButton_Tests/test_appearance_wasConfiguredCorrectly.rightToLeftLayout-default-isHighlighted.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/__Snapshots__/PillButton_Tests/test_appearance_wasConfiguredCorrectly.rightToLeftLayout-default.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/__Snapshots__/PillButton_Tests/test_appearance_wasConfiguredCorrectly.rightToLeftLayout-default.png index 564c91808c0..157fb895a01 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/CommonViews/__Snapshots__/PillButton_Tests/test_appearance_wasConfiguredCorrectly.rightToLeftLayout-default.png and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/__Snapshots__/PillButton_Tests/test_appearance_wasConfiguredCorrectly.rightToLeftLayout-default.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/__Snapshots__/PillButton_Tests/test_appearance_wasConfiguredCorrectly.small-dark-isHighlighted.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/__Snapshots__/PillButton_Tests/test_appearance_wasConfiguredCorrectly.small-dark-isHighlighted.png index 2d8efd3a93d..cc9d3bde454 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/CommonViews/__Snapshots__/PillButton_Tests/test_appearance_wasConfiguredCorrectly.small-dark-isHighlighted.png and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/__Snapshots__/PillButton_Tests/test_appearance_wasConfiguredCorrectly.small-dark-isHighlighted.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/CommonViews/__Snapshots__/PillButton_Tests/test_appearance_wasConfiguredCorrectly.small-dark.png b/Tests/StreamChatUITests/SnapshotTests/CommonViews/__Snapshots__/PillButton_Tests/test_appearance_wasConfiguredCorrectly.small-dark.png index 564c91808c0..157fb895a01 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/CommonViews/__Snapshots__/PillButton_Tests/test_appearance_wasConfiguredCorrectly.small-dark.png and b/Tests/StreamChatUITests/SnapshotTests/CommonViews/__Snapshots__/PillButton_Tests/test_appearance_wasConfiguredCorrectly.small-dark.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/Composer/ComposerVC_Tests.swift b/Tests/StreamChatUITests/SnapshotTests/Composer/ComposerVC_Tests.swift index 363c8e4b43d..951e28486be 100644 --- a/Tests/StreamChatUITests/SnapshotTests/Composer/ComposerVC_Tests.swift +++ b/Tests/StreamChatUITests/SnapshotTests/Composer/ComposerVC_Tests.swift @@ -413,6 +413,31 @@ final class ComposerVC_Tests: XCTestCase { XCTAssertEqual(composerVC.isSendMessageEnabled, true) } + func test_updateContent_whenSendMessageEnabledAfterBeingDisabled_thenComposerViewIsInteractable() { + let mock = ChatChannelController_Mock.mock() + composerVC.components.isVoiceRecordingEnabled = true + + // When disabled + mock.channel_mock = .mock(cid: .unique, ownCapabilities: [.uploadFile]) + composerVC.channelController = mock + composerVC.updateContent() + XCTAssertEqual(composerVC.isSendMessageEnabled, false) + XCTAssertEqual(composerVC.composerView.inputMessageView.isUserInteractionEnabled, false) + XCTAssertEqual(composerVC.composerView.recordButton.isHidden, true) + XCTAssertEqual(composerVC.composerView.attachmentButton.isHidden, true) + XCTAssertEqual(composerVC.composerView.commandsButton.isHidden, true) + + // After enabling it + mock.channel_mock = .mock(cid: .unique, ownCapabilities: [.uploadFile, .sendMessage]) + composerVC.channelController = mock + composerVC.updateContent() + XCTAssertEqual(composerVC.isSendMessageEnabled, true) + XCTAssertEqual(composerVC.composerView.inputMessageView.isUserInteractionEnabled, true) + XCTAssertEqual(composerVC.composerView.recordButton.isHidden, false) + XCTAssertEqual(composerVC.composerView.attachmentButton.isHidden, false) + XCTAssertEqual(composerVC.composerView.commandsButton.isHidden, false) + } + func test_quotedTranslatedMessage() { composerVC.appearance = Appearance.default composerVC.content = .initial() diff --git a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedOneAfterThree.default-light.png b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedOneAfterThree.default-light.png index e3355c20091..6b27d8d9e8a 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedOneAfterThree.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedOneAfterThree.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedOneAfterThree.extraExtraExtraLarge-light.png b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedOneAfterThree.extraExtraExtraLarge-light.png index 481c9ec4b42..7c4c974de29 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedOneAfterThree.extraExtraExtraLarge-light.png and b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedOneAfterThree.extraExtraExtraLarge-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedOneAfterThree.rightToLeftLayout-default.png b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedOneAfterThree.rightToLeftLayout-default.png index 82c735f65ff..4cb08edfa7e 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedOneAfterThree.rightToLeftLayout-default.png and b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedOneAfterThree.rightToLeftLayout-default.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedOneAfterThree.small-dark.png b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedOneAfterThree.small-dark.png index 24a4c1e40ec..f88b0f9f913 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedOneAfterThree.small-dark.png and b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedOneAfterThree.small-dark.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedSameTime.default-light.png b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedSameTime.default-light.png index e3355c20091..6b27d8d9e8a 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedSameTime.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedSameTime.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedSameTime.extraExtraExtraLarge-light.png b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedSameTime.extraExtraExtraLarge-light.png index 481c9ec4b42..7c4c974de29 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedSameTime.extraExtraExtraLarge-light.png and b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedSameTime.extraExtraExtraLarge-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedSameTime.rightToLeftLayout-default.png b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedSameTime.rightToLeftLayout-default.png index 82c735f65ff..4cb08edfa7e 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedSameTime.rightToLeftLayout-default.png and b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedSameTime.rightToLeftLayout-default.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedSameTime.small-dark.png b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedSameTime.small-dark.png index 24a4c1e40ec..f88b0f9f913 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedSameTime.small-dark.png and b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedSameTime.small-dark.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedThreeAfterOne.default-light.png b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedThreeAfterOne.default-light.png index e3355c20091..6b27d8d9e8a 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedThreeAfterOne.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedThreeAfterOne.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedThreeAfterOne.extraExtraExtraLarge-light.png b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedThreeAfterOne.extraExtraExtraLarge-light.png index 481c9ec4b42..7c4c974de29 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedThreeAfterOne.extraExtraExtraLarge-light.png and b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedThreeAfterOne.extraExtraExtraLarge-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedThreeAfterOne.rightToLeftLayout-default.png b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedThreeAfterOne.rightToLeftLayout-default.png index 82c735f65ff..4cb08edfa7e 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedThreeAfterOne.rightToLeftLayout-default.png and b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedThreeAfterOne.rightToLeftLayout-default.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedThreeAfterOne.small-dark.png b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedThreeAfterOne.small-dark.png index 24a4c1e40ec..f88b0f9f913 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedThreeAfterOne.small-dark.png and b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedThreeAfterOne.small-dark.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedTwoAfterTwo.default-light.png b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedTwoAfterTwo.default-light.png index e3355c20091..6b27d8d9e8a 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedTwoAfterTwo.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedTwoAfterTwo.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedTwoAfterTwo.extraExtraExtraLarge-light.png b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedTwoAfterTwo.extraExtraExtraLarge-light.png index 481c9ec4b42..7c4c974de29 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedTwoAfterTwo.extraExtraExtraLarge-light.png and b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedTwoAfterTwo.extraExtraExtraLarge-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedTwoAfterTwo.rightToLeftLayout-default.png b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedTwoAfterTwo.rightToLeftLayout-default.png index 82c735f65ff..4cb08edfa7e 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedTwoAfterTwo.rightToLeftLayout-default.png and b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedTwoAfterTwo.rightToLeftLayout-default.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedTwoAfterTwo.small-dark.png b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedTwoAfterTwo.small-dark.png index 24a4c1e40ec..f88b0f9f913 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedTwoAfterTwo.small-dark.png and b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withFourAttachments_addedTwoAfterTwo.small-dark.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withLongFileNames.default-light.png b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withLongFileNames.default-light.png index 23cb214b7ab..bf44813dbf1 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withLongFileNames.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withLongFileNames.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withMultipleAttachmentTypes.default-light.png b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withMultipleAttachmentTypes.default-light.png index 3bc0494fca4..4df729d66d6 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withMultipleAttachmentTypes.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withMultipleAttachmentTypes.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withMultipleAttachmentTypes.extraExtraExtraLarge-light.png b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withMultipleAttachmentTypes.extraExtraExtraLarge-light.png index 01042f68e22..235f9cb12ea 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withMultipleAttachmentTypes.extraExtraExtraLarge-light.png and b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withMultipleAttachmentTypes.extraExtraExtraLarge-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withMultipleAttachmentTypes.rightToLeftLayout-default.png b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withMultipleAttachmentTypes.rightToLeftLayout-default.png index 61b1fa23a4e..048552c62ad 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withMultipleAttachmentTypes.rightToLeftLayout-default.png and b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withMultipleAttachmentTypes.rightToLeftLayout-default.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withMultipleAttachmentTypes.small-dark.png b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withMultipleAttachmentTypes.small-dark.png index 953ad6189e0..90d36def094 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withMultipleAttachmentTypes.small-dark.png and b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_attachmentsPreview_withMultipleAttachmentTypes.small-dark.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_canNotSendMessage.default-light.png b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_canNotSendMessage.default-light.png index 939ac94c523..cdfe3204065 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_canNotSendMessage.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_canNotSendMessage.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_canNotSendMessage.extraExtraExtraLarge-light.png b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_canNotSendMessage.extraExtraExtraLarge-light.png index 939ac94c523..67f56506de2 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_canNotSendMessage.extraExtraExtraLarge-light.png and b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_canNotSendMessage.extraExtraExtraLarge-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_canNotSendMessage.rightToLeftLayout-default.png b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_canNotSendMessage.rightToLeftLayout-default.png index f0bc401bc78..ff583a3f9a1 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_canNotSendMessage.rightToLeftLayout-default.png and b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_canNotSendMessage.rightToLeftLayout-default.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_canNotSendMessage.small-dark.png b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_canNotSendMessage.small-dark.png index cbb0a9e4918..87e9a6edf30 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_canNotSendMessage.small-dark.png and b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_canNotSendMessage.small-dark.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_channelWithSlowModeActive_messageIsSent_SlowModeIsOnWithCountdownShown.extraExtraExtraLarge-light.png b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_channelWithSlowModeActive_messageIsSent_SlowModeIsOnWithCountdownShown.extraExtraExtraLarge-light.png index 9b692d975c7..c928a8573fa 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_channelWithSlowModeActive_messageIsSent_SlowModeIsOnWithCountdownShown.extraExtraExtraLarge-light.png and b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_channelWithSlowModeActive_messageIsSent_SlowModeIsOnWithCountdownShown.extraExtraExtraLarge-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_commandWithEmptyArgs_hasSendButtonEnabled.default-light.png b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_commandWithEmptyArgs_hasSendButtonEnabled.default-light.png index ce4770626a0..01b3ed8f3a7 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_commandWithEmptyArgs_hasSendButtonEnabled.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_commandWithEmptyArgs_hasSendButtonEnabled.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_commandWithEmptyArgs_hasSendButtonEnabled.extraExtraExtraLarge-light.png b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_commandWithEmptyArgs_hasSendButtonEnabled.extraExtraExtraLarge-light.png index 090b1008d47..1e47fe7d323 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_commandWithEmptyArgs_hasSendButtonEnabled.extraExtraExtraLarge-light.png and b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_commandWithEmptyArgs_hasSendButtonEnabled.extraExtraExtraLarge-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_commandWithEmptyArgs_hasSendButtonEnabled.rightToLeftLayout-default.png b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_commandWithEmptyArgs_hasSendButtonEnabled.rightToLeftLayout-default.png index a9c603e87d9..6adfcde2bdd 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_commandWithEmptyArgs_hasSendButtonEnabled.rightToLeftLayout-default.png and b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_commandWithEmptyArgs_hasSendButtonEnabled.rightToLeftLayout-default.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_commandWithEmptyArgs_hasSendButtonEnabled.small-dark.png b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_commandWithEmptyArgs_hasSendButtonEnabled.small-dark.png index 2a31a56ab37..5df62ea0366 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_commandWithEmptyArgs_hasSendButtonEnabled.small-dark.png and b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_commandWithEmptyArgs_hasSendButtonEnabled.small-dark.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_commandWithNonEmptyArgs_hasSendButtonDisabled.default-light.png b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_commandWithNonEmptyArgs_hasSendButtonDisabled.default-light.png index b4c5d61e683..cd9a43d394f 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_commandWithNonEmptyArgs_hasSendButtonDisabled.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_commandWithNonEmptyArgs_hasSendButtonDisabled.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_commandWithNonEmptyArgs_hasSendButtonDisabled.extraExtraExtraLarge-light.png b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_commandWithNonEmptyArgs_hasSendButtonDisabled.extraExtraExtraLarge-light.png index 74622d12b98..4e96be42f30 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_commandWithNonEmptyArgs_hasSendButtonDisabled.extraExtraExtraLarge-light.png and b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_commandWithNonEmptyArgs_hasSendButtonDisabled.extraExtraExtraLarge-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_commandWithNonEmptyArgs_hasSendButtonDisabled.rightToLeftLayout-default.png b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_commandWithNonEmptyArgs_hasSendButtonDisabled.rightToLeftLayout-default.png index e549f2737f4..579cd3249c5 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_commandWithNonEmptyArgs_hasSendButtonDisabled.rightToLeftLayout-default.png and b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_commandWithNonEmptyArgs_hasSendButtonDisabled.rightToLeftLayout-default.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_commandWithNonEmptyArgs_hasSendButtonDisabled.small-dark.png b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_commandWithNonEmptyArgs_hasSendButtonDisabled.small-dark.png index 8c8a8c6a542..b1ed2fe4a31 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_commandWithNonEmptyArgs_hasSendButtonDisabled.small-dark.png and b/Tests/StreamChatUITests/SnapshotTests/Composer/__Snapshots__/ComposerVC_Tests/test_commandWithNonEmptyArgs_hasSendButtonDisabled.small-dark.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/MessageActionsPopup/__Snapshots__/ChatMessageActionControl_Tests/test_defaultAppearance_whenHighlighted.extraExtraExtraLarge-light.png b/Tests/StreamChatUITests/SnapshotTests/MessageActionsPopup/__Snapshots__/ChatMessageActionControl_Tests/test_defaultAppearance_whenHighlighted.extraExtraExtraLarge-light.png index 406dd1b2bd3..e090f443d3e 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/MessageActionsPopup/__Snapshots__/ChatMessageActionControl_Tests/test_defaultAppearance_whenHighlighted.extraExtraExtraLarge-light.png and b/Tests/StreamChatUITests/SnapshotTests/MessageActionsPopup/__Snapshots__/ChatMessageActionControl_Tests/test_defaultAppearance_whenHighlighted.extraExtraExtraLarge-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/VoiceRecording/__Snapshots__/VoiceRecordingVC_Tests/test_updateContent_idle_viewIsConfiguredAsExpected.default-dark.png b/Tests/StreamChatUITests/SnapshotTests/VoiceRecording/__Snapshots__/VoiceRecordingVC_Tests/test_updateContent_idle_viewIsConfiguredAsExpected.default-dark.png index 0add6252eef..c19a55da95f 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/VoiceRecording/__Snapshots__/VoiceRecordingVC_Tests/test_updateContent_idle_viewIsConfiguredAsExpected.default-dark.png and b/Tests/StreamChatUITests/SnapshotTests/VoiceRecording/__Snapshots__/VoiceRecordingVC_Tests/test_updateContent_idle_viewIsConfiguredAsExpected.default-dark.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/VoiceRecording/__Snapshots__/VoiceRecordingVC_Tests/test_updateContent_idle_viewIsConfiguredAsExpected.default-light.png b/Tests/StreamChatUITests/SnapshotTests/VoiceRecording/__Snapshots__/VoiceRecordingVC_Tests/test_updateContent_idle_viewIsConfiguredAsExpected.default-light.png index aaa9b5d8db9..b42230070c2 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/VoiceRecording/__Snapshots__/VoiceRecordingVC_Tests/test_updateContent_idle_viewIsConfiguredAsExpected.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/VoiceRecording/__Snapshots__/VoiceRecordingVC_Tests/test_updateContent_idle_viewIsConfiguredAsExpected.default-light.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/VoiceRecording/__Snapshots__/VoiceRecordingVC_Tests/test_updateContent_preview_delayIsGreaterThanDebouncerTimeout_viewIsConfiguredAsExpected.default-dark.png b/Tests/StreamChatUITests/SnapshotTests/VoiceRecording/__Snapshots__/VoiceRecordingVC_Tests/test_updateContent_preview_delayIsGreaterThanDebouncerTimeout_viewIsConfiguredAsExpected.default-dark.png deleted file mode 100644 index 57bdacdf675..00000000000 Binary files a/Tests/StreamChatUITests/SnapshotTests/VoiceRecording/__Snapshots__/VoiceRecordingVC_Tests/test_updateContent_preview_delayIsGreaterThanDebouncerTimeout_viewIsConfiguredAsExpected.default-dark.png and /dev/null differ diff --git a/Tests/StreamChatUITests/SnapshotTests/VoiceRecording/__Snapshots__/VoiceRecordingVC_Tests/test_updateContent_preview_delayIsGreaterThanDebouncerTimeout_viewIsConfiguredAsExpected.default-light.png b/Tests/StreamChatUITests/SnapshotTests/VoiceRecording/__Snapshots__/VoiceRecordingVC_Tests/test_updateContent_preview_delayIsGreaterThanDebouncerTimeout_viewIsConfiguredAsExpected.default-light.png deleted file mode 100644 index cad0e17a792..00000000000 Binary files a/Tests/StreamChatUITests/SnapshotTests/VoiceRecording/__Snapshots__/VoiceRecordingVC_Tests/test_updateContent_preview_delayIsGreaterThanDebouncerTimeout_viewIsConfiguredAsExpected.default-light.png and /dev/null differ diff --git a/Tests/StreamChatUITests/SnapshotTests/VoiceRecording/__Snapshots__/VoiceRecordingVC_Tests/test_updateContent_preview_delayIsZero_viewIsConfiguredAsExpected.default-dark.png b/Tests/StreamChatUITests/SnapshotTests/VoiceRecording/__Snapshots__/VoiceRecordingVC_Tests/test_updateContent_preview_delayIsZero_viewIsConfiguredAsExpected.default-dark.png deleted file mode 100644 index 8a09ea883e0..00000000000 Binary files a/Tests/StreamChatUITests/SnapshotTests/VoiceRecording/__Snapshots__/VoiceRecordingVC_Tests/test_updateContent_preview_delayIsZero_viewIsConfiguredAsExpected.default-dark.png and /dev/null differ diff --git a/Tests/StreamChatUITests/SnapshotTests/VoiceRecording/__Snapshots__/VoiceRecordingVC_Tests/test_updateContent_preview_delayIsZero_viewIsConfiguredAsExpected.default-light.png b/Tests/StreamChatUITests/SnapshotTests/VoiceRecording/__Snapshots__/VoiceRecordingVC_Tests/test_updateContent_preview_delayIsZero_viewIsConfiguredAsExpected.default-light.png deleted file mode 100644 index e609e098420..00000000000 Binary files a/Tests/StreamChatUITests/SnapshotTests/VoiceRecording/__Snapshots__/VoiceRecordingVC_Tests/test_updateContent_preview_delayIsZero_viewIsConfiguredAsExpected.default-light.png and /dev/null differ diff --git a/Tests/StreamChatUITests/SnapshotTests/VoiceRecording/__Snapshots__/VoiceRecordingVC_Tests/test_updateContent_showingTip_viewIsConfiguredAsExpected.default-dark.png b/Tests/StreamChatUITests/SnapshotTests/VoiceRecording/__Snapshots__/VoiceRecordingVC_Tests/test_updateContent_showingTip_viewIsConfiguredAsExpected.default-dark.png index 862769604cf..75a48732b4d 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/VoiceRecording/__Snapshots__/VoiceRecordingVC_Tests/test_updateContent_showingTip_viewIsConfiguredAsExpected.default-dark.png and b/Tests/StreamChatUITests/SnapshotTests/VoiceRecording/__Snapshots__/VoiceRecordingVC_Tests/test_updateContent_showingTip_viewIsConfiguredAsExpected.default-dark.png differ diff --git a/Tests/StreamChatUITests/SnapshotTests/VoiceRecording/__Snapshots__/VoiceRecordingVC_Tests/test_updateContent_showingTip_viewIsConfiguredAsExpected.default-light.png b/Tests/StreamChatUITests/SnapshotTests/VoiceRecording/__Snapshots__/VoiceRecordingVC_Tests/test_updateContent_showingTip_viewIsConfiguredAsExpected.default-light.png index d80bd8491c5..d01b41e9eea 100644 Binary files a/Tests/StreamChatUITests/SnapshotTests/VoiceRecording/__Snapshots__/VoiceRecordingVC_Tests/test_updateContent_showingTip_viewIsConfiguredAsExpected.default-light.png and b/Tests/StreamChatUITests/SnapshotTests/VoiceRecording/__Snapshots__/VoiceRecordingVC_Tests/test_updateContent_showingTip_viewIsConfiguredAsExpected.default-light.png differ diff --git a/docusaurus/docs/iOS/assets/add-channel-button.png b/docusaurus/docs/iOS/assets/add-channel-button.png new file mode 100644 index 00000000000..3cac09495d0 Binary files /dev/null and b/docusaurus/docs/iOS/assets/add-channel-button.png differ diff --git a/docusaurus/docs/iOS/assets/creating-channels.png b/docusaurus/docs/iOS/assets/creating-channels.png new file mode 100644 index 00000000000..92f15e9d750 Binary files /dev/null and b/docusaurus/docs/iOS/assets/creating-channels.png differ diff --git a/docusaurus/docs/iOS/common-content/reference-docs/stream-chat-ui/common-views/input-text-view/input-text-view-properties.md b/docusaurus/docs/iOS/common-content/reference-docs/stream-chat-ui/common-views/input-text-view/input-text-view-properties.md index b141f54fb39..37bf02c4ab8 100644 --- a/docusaurus/docs/iOS/common-content/reference-docs/stream-chat-ui/common-views/input-text-view/input-text-view-properties.md +++ b/docusaurus/docs/iOS/common-content/reference-docs/stream-chat-ui/common-views/input-text-view/input-text-view-properties.md @@ -115,7 +115,7 @@ open func textDidChangeProgrammatically() @objc open func handleTextChange() ``` -### `setTextViewHeight()` +### `setTextViewHeight()` - deprecated ``` swift open func setTextViewHeight() diff --git a/docusaurus/docs/iOS/common-content/reference-docs/stream-chat-ui/common-views/input-text-view/input-text-view.md b/docusaurus/docs/iOS/common-content/reference-docs/stream-chat-ui/common-views/input-text-view/input-text-view.md index c3cef2b581a..012da5bbb76 100644 --- a/docusaurus/docs/iOS/common-content/reference-docs/stream-chat-ui/common-views/input-text-view/input-text-view.md +++ b/docusaurus/docs/iOS/common-content/reference-docs/stream-chat-ui/common-views/input-text-view/input-text-view.md @@ -132,7 +132,7 @@ open func textDidChangeProgrammatically() @objc open func handleTextChange() ``` -### `setTextViewHeight()` +### `setTextViewHeight()` - deprecated ``` swift open func setTextViewHeight() diff --git a/docusaurus/docs/iOS/swiftui/swiftui-cookbook/creating-channels.md b/docusaurus/docs/iOS/swiftui/swiftui-cookbook/creating-channels.md new file mode 100644 index 00000000000..7e002251cd9 --- /dev/null +++ b/docusaurus/docs/iOS/swiftui/swiftui-cookbook/creating-channels.md @@ -0,0 +1,560 @@ +--- +title: Creating Channels Flow +description: How to build your own UI for creating channels +--- + +Different apps have different UI for starting a chat with other users. For example, there can be a way to search through the available users, or show a button to invoke a chat with a user from their profile. + +In this cookbook, we will build a UI that will allow creation of channels by searching the users on the platform. + +![Screenshot showing the UI for searching users](../../assets/creating-channels.png) + +## Custom Channel List Header + +The screen will be invoked from the channel list's header, which will contain a new button on the trailing navigation bar area. + +![Screenshot showing the navigation bar for adding channels](../../assets/add-channel-button.png) + +To modify the header of the channel list, we need to provide our own version of the view factory method `makeChannelListHeaderViewModifier`. + +To do this, create a new file called `DemoAppFactory` and add the following contents. + +```swift +import StreamChat +import StreamChatSwiftUI +import SwiftUI + +class DemoAppFactory: ViewFactory { + + @Injected(\.chatClient) public var chatClient + + func makeChannelListHeaderViewModifier(title: String) -> some ChannelListHeaderViewModifier { + CustomChannelModifier(title: title) + } +} +``` + +Next, let's implement the `CustomChannelModifier`. Create a new file with the same name, and add the following contents. + +```swift +import StreamChat +import StreamChatSwiftUI +import SwiftUI + +struct CustomChannelModifier: ChannelListHeaderViewModifier { + + @Injected(\.chatClient) var chatClient + + var title: String + + @State var isNewChatShown = false + + func body(content: Content) -> some View { + ZStack { + content.toolbar { + CustomChannelHeader( + title: title, + currentUserController: chatClient.currentUserController(), + isNewChatShown: $isNewChatShown + ) + } + + NavigationLink(isActive: $isNewChatShown) { + NewChatView(isNewChatShown: $isNewChatShown) + } label: { + EmptyView() + } + .isDetailLink(UIDevice.current.userInterfaceIdiom == .pad) + } + } +} +``` + +The code above contains a `toolbar` modifier that attaches a `CustomChannelHeader`, as well as a navigation link that will open the new chat. The visibility of the new chat view is controlled by the state variable `isNewChatShown`. + +Here is how the `CustomChannelHeader` looks like. + +```swift +import StreamChat +import StreamChatSwiftUI +import SwiftUI + +public struct CustomChannelHeader: ToolbarContent { + + @Injected(\.fonts) var fonts + @Injected(\.images) var images + @Injected(\.colors) var colors + + var title: String + var currentUserController: CurrentChatUserController + @Binding var isNewChatShown: Bool + + @MainActor + public var body: some ToolbarContent { + ToolbarItem(placement: .principal) { + Text(title) + .font(fonts.bodyBold) + } + ToolbarItem(placement: .navigationBarTrailing) { + Button { + isNewChatShown = true + } label: { + Image(uiImage: images.messageActionEdit) + .resizable() + .scaledToFit() + .foregroundColor(Color.white) + .padding(.all, 8) + .background(colors.tintColor) + .clipShape(Circle()) + } + } + ToolbarItem(placement: .navigationBarLeading) { + StreamLazyImage(url: currentUserController.currentUser?.imageURL) + } + } +} +``` + +It's an implementation of the `ToolbarContent` protocol for creating navigation bar layouts. Our implementation consists of a title, a leading view showing the user's profile image, as well as a trailing view that contains our button for starting the flow for adding a new chat. The button sets the `isNewChatShown` binding to `true`. + +## View for adding chats + +Now that we have our header setup, let's implement the view that is displayed when the button is tapped. + +To do this, create a new file called `NewChatView` and add the following content. + +```swift +import StreamChat +import StreamChatSwiftUI +import SwiftUI + +struct NewChatView: View, KeyboardReadable { + + @Injected(\.fonts) var fonts + @Injected(\.colors) var colors + + @StateObject var viewModel = NewChatViewModel() + + @Binding var isNewChatShown: Bool + + @State private var keyboardShown = false + + let columns = [GridItem(.adaptive(minimum: 120), spacing: 2)] + + var body: some View { + VStack(spacing: 0) { + HStack { + Text("TO:") + .font(fonts.footnote) + .foregroundColor(Color(colors.textLowEmphasis)) + + VStack { + if !viewModel.selectedUsers.isEmpty { + LazyVGrid(columns: columns, alignment: .leading) { + ForEach(viewModel.selectedUsers) { user in + SelectedUserView(user: user) + .onTapGesture( + perform: { + withAnimation { + viewModel.userTapped(user) + } + } + ) + } + } + } + + SearchUsersView(viewModel: viewModel) + } + } + .padding() + + if viewModel.state == .loading { + VerticallyCenteredView { + ProgressView() + } + } else if viewModel.state == .loaded { + List(viewModel.chatUsers) { user in + Button { + withAnimation { + viewModel.userTapped(user) + } + } label: { + ChatUserView( + user: user, + onlineText: viewModel.onlineInfo(for: user), + isSelected: viewModel.isSelected(user: user) + ) + .onAppear { + viewModel.onChatUserAppear(user) + } + } + } + .listStyle(.plain) + } else if viewModel.state == .noUsers { + VerticallyCenteredView { + Text("No user matches these keywords") + .font(.title2) + .foregroundColor(Color(colors.textLowEmphasis)) + } + } else if viewModel.state == .error { + VerticallyCenteredView { + Text("Error loading the users") + .font(.title2) + .foregroundColor(Color(colors.textLowEmphasis)) + } + } else if viewModel.state == .channel, let controller = viewModel.channelController { + Divider() + ChatChannelView( + viewFactory: DemoAppFactory.shared, + channelController: controller + ) + } else { + Spacer() + } + } + .navigationTitle("New Chat") + .onReceive(keyboardWillChangePublisher) { visible in + keyboardShown = visible + } + .modifier(HideKeyboardOnTapGesture(shouldAdd: keyboardShown)) + } +} +``` + +The code above builds the UI for adding new channels. It consists of a text input view, where you can search for users available on the platform. When you select a user, it creates a channel view to start sending messages and shows the added users above the text input. + +In the trailing part of the text input, there's a button to add additional users to the chat. + +Below the text input view, there is a list that shows the available users to add to a chat. + +In the code above, we are also using some helper views, that help us achieve the desired user interface. + +```swift +struct SelectedUserView: View { + + @Injected(\.colors) var colors + + var user: ChatUser + + var body: some View { + HStack { + MessageAvatarView( + avatarURL: user.imageURL, + size: CGSize(width: 20, height: 20) + ) + + Text(user.name ?? user.id) + .lineLimit(1) + .padding(.vertical, 2) + .padding(.trailing) + } + .background(Color(colors.background1)) + .cornerRadius(16) + } +} + +struct SearchUsersView: View { + + @StateObject var viewModel: NewChatViewModel + + var body: some View { + HStack { + TextField("Type a name", text: $viewModel.searchText) + Button { + if viewModel.state == .channel { + withAnimation { + viewModel.state = .loaded + } + } + } label: { + Image(systemName: "person.badge.plus") + } + } + } +} + +struct VerticallyCenteredView: View { + + var content: () -> Content + + var body: some View { + VStack { + Spacer() + content() + Spacer() + } + } +} + +struct CreateGroupButton: View { + + @Injected(\.colors) var colors + @Injected(\.fonts) var fonts + + @Binding var isNewChatShown: Bool + + var body: some View { + NavigationLink { + CreateGroupView(isNewChatShown: $isNewChatShown) + } label: { + HStack { + Image(systemName: "person.3") + .renderingMode(.template) + .foregroundColor(colors.tintColor) + + Text("Create a group") + .font(fonts.bodyBold) + .foregroundColor(Color(colors.text)) + + Spacer() + } + .padding() + } + .isDetailLink(false) + } +} + +struct ChatUserView: View { + + @Injected(\.colors) var colors + @Injected(\.fonts) var fonts + + var user: ChatUser + var onlineText: String + var isSelected: Bool + + var body: some View { + HStack { + LazyView( + MessageAvatarView(avatarURL: user.imageURL) + ) + + VStack(alignment: .leading, spacing: 4) { + Text(user.name ?? user.id) + .lineLimit(1) + .font(fonts.bodyBold) + Text(onlineText) + .font(fonts.footnote) + .foregroundColor(Color(colors.textLowEmphasis)) + } + Spacer() + + if isSelected { + Image(systemName: "checkmark") + .renderingMode(.template) + .foregroundColor(colors.tintColor) + } + } + } +} + +struct UsersHeaderView: View { + + @Injected(\.colors) var colors + @Injected(\.fonts) var fonts + + var title = "On the platform" + + var body: some View { + HStack { + Text(title) + .padding(.horizontal) + .padding(.vertical, 2) + .font(fonts.body) + .foregroundColor(Color(colors.textLowEmphasis)) + + Spacer() + } + .background(Color(colors.background1)) + } +} + +``` + +## New Chat View Model + +Next, let's see the view model that provides the state and logic for this view. + +The view model should provide us with the list of users, as well as the actions we perform, such as searching and creating new channels. + +Let's see its implementation. + +```swift +import StreamChat +import StreamChatSwiftUI +import SwiftUI + +class NewChatViewModel: ObservableObject, ChatUserSearchControllerDelegate { + + @Injected(\.chatClient) var chatClient + + @Published var searchText: String = "" { + didSet { + searchUsers(with: searchText) + } + } + + @Published var messageText: String = "" + @Published var chatUsers = [ChatUser]() + @Published var state: NewChatState = .initial + @Published var selectedUsers = [ChatUser]() { + didSet { + if !updatingSelectedUsers { + updatingSelectedUsers = true + if !selectedUsers.isEmpty { + do { + try makeChannelController() + } catch { + state = .error + updatingSelectedUsers = false + } + + } else { + withAnimation { + state = .loaded + updatingSelectedUsers = false + } + } + } + } + } + + private var loadingNextUsers: Bool = false + private var updatingSelectedUsers: Bool = false + + var channelController: ChatChannelController? + + private lazy var searchController: ChatUserSearchController = chatClient.userSearchController() + private let lastSeenDateFormatter = DateUtils.timeAgo + + init() { + chatUsers = searchController.userArray + searchController.delegate = self + // Empty initial search to get all users + searchUsers(with: nil) + } + + func userTapped(_ user: ChatUser) { + if updatingSelectedUsers { + return + } + + if selectedUsers.contains(user) { + selectedUsers.removeAll { selected in + selected == user + } + } else { + selectedUsers.append(user) + } + } + + func onlineInfo(for user: ChatUser) -> String { + if user.isOnline { + return "Online" + } else if let lastActiveAt = user.lastActiveAt, + let timeAgo = lastSeenDateFormatter(lastActiveAt) { + return timeAgo + } else { + return "Offline" + } + } + + func isSelected(user: ChatUser) -> Bool { + selectedUsers.contains(user) + } + + func onChatUserAppear(_ user: ChatUser) { + guard let index = chatUsers.firstIndex(where: { element in + user.id == element.id + }) else { + return + } + + if index < chatUsers.count - 10 { + return + } + + if !loadingNextUsers { + loadingNextUsers = true + searchController.loadNextUsers(limit: 50) { [weak self] _ in + guard let self = self else { return } + self.chatUsers = self.searchController.userArray + self.loadingNextUsers = false + } + } + } + + // MARK: - ChatUserSearchControllerDelegate + + func controller( + _ controller: ChatUserSearchController, + didChangeUsers changes: [ListChange] + ) { + chatUsers = controller.userArray + } + + // MARK: - private + + private func searchUsers(with term: String?) { + state = .loading + searchController.search(term: term) { [weak self] error in + if error != nil { + self?.state = .error + } else { + self?.state = .loaded + } + } + } + + private func makeChannelController() throws { + let selectedUserIds = Set(selectedUsers.map(\.id)) + channelController = try chatClient.channelController( + createDirectMessageChannelWith: selectedUserIds, + name: nil, + imageURL: nil, + extraData: [:] + ) + channelController?.synchronize { [weak self] error in + if error != nil { + self?.state = .error + self?.updatingSelectedUsers = false + } else { + withAnimation { + self?.state = .channel + self?.updatingSelectedUsers = false + } + } + } + } +} + +enum NewChatState { + case initial + case loading + case noUsers + case error + case loaded + case channel +} +``` + +The most important bits here are the searching of users and the creation of new channels. + +To perform the searching part, we listen to changes of the `searchText`. When that happens, we call the method `searchUsers`, which uses the `searchController`'s method `search(term:)`, and provides its results via the `ChatUserSearchControllerDelegate`'s method `didChangeUsers`. + +For the creation of the channel, we use the `chatClient`'s method `createDirectMessageChannelWith`. In this method, we provide the IDs of the users that were selected by the user. + +With that, we have completed the functionality for our new chat users view. + +If you now run the app, you should see a UI similar to the one below. + +![Screenshot showing the UI for searching users](../../assets/creating-channels.png) + +## Summary + +In this cookbook, you learnt how to implement a view that allows you to create direct messaging channels with particular users easily. + +You can find more ways how to create channels in our docs [here](https://getstream.io/chat/docs/ios-swift/creating_channels/?language=swift). + +As a next step, you can also explore other parts of our cookbook, where we build many interesting customizations. Furthermore, for a complete social experience, we recommend looking into our [Video SDK](https://getstream.io/video/docs/ios/). diff --git a/docusaurus/docs/iOS/swiftui/swiftui-cookbook/overview.md b/docusaurus/docs/iOS/swiftui/swiftui-cookbook/overview.md index 3751b1bee7e..66037111422 100644 --- a/docusaurus/docs/iOS/swiftui/swiftui-cookbook/overview.md +++ b/docusaurus/docs/iOS/swiftui/swiftui-cookbook/overview.md @@ -35,4 +35,10 @@ This example will show you how to always align the messages to the left. We will build a message list using the low-level client state in this section. -![Screenshot of the custom message list.](../../assets/custom-message-list.png) \ No newline at end of file +![Screenshot of the custom message list.](../../assets/custom-message-list.png) + +### Creating Channels Flow + +In this section, we will build a view that allows you to create new chats. + +![Screenshot of the view for creating chats.](../../assets/creating-channels.png) \ No newline at end of file diff --git a/docusaurus/docs/iOS/uikit/components/channel.md b/docusaurus/docs/iOS/uikit/components/channel.md index ef6794b17df..712d20d1aaf 100644 --- a/docusaurus/docs/iOS/uikit/components/channel.md +++ b/docusaurus/docs/iOS/uikit/components/channel.md @@ -22,7 +22,7 @@ The following diagram shows the components hierarchy of `ChatChannelVC`: ### Overview -- [`ChatChannelHeaderView`](../views/channel-header-view) is responsible to display the channel information in the `navigationItem.titleView`. +- [`ChatChannelHeaderView`](../../views/channel-header-view) is responsible to display the channel information in the `navigationItem.titleView`. - [`ChatMessageListVC`](../message-list) is the component that handles the rendering of the messages. - [`ComposerVC`](../message-composer) is the component that handles the creation of new messages. diff --git a/docusaurus/docs/iOS/uikit/components/message.md b/docusaurus/docs/iOS/uikit/components/message.md index 40ab212d3b7..a3f198e0f29 100644 --- a/docusaurus/docs/iOS/uikit/components/message.md +++ b/docusaurus/docs/iOS/uikit/components/message.md @@ -269,7 +269,7 @@ final class DemoChatThreadRepliesCountDecorationView: ChatThreadRepliesCountDeco ## Advanced Customizations -Creating a subclass of [`ChatMessageContentView`](#chatmessagecontentview) is the best way do more advanced customizations since you have access to all the message subviews. By customizing this component you can not only change the existing views but add new ones and add new functionality. +Creating a subclass of [`ChatMessageContentView`](#chatmessagecontentview) is the best way to do more advanced customizations since you have access to all the message subviews. By customizing this component you can not only change the existing views, but add new ones and add new functionality. :::note `ChatMessageContentView` sets up its own layout on the `layout(options: ChatMessageLayoutOptions)` method and not in `setupLayout()` like other regular views. This view is different from the other ones since the layout is calculated based on the `ChatMessageLayoutOptions`. @@ -371,7 +371,7 @@ extension ChatMessageLayoutOption { static let shareAttachments: Self = "shareAttachments" } ``` -The `ChatMessageLayoutOption` has a similar usage of an `enum` but it is not an `enum`. Instead, it is a struct that holds a string raw value. The advantage of this approach is that it is extendable while the `enum` is not. +The `ChatMessageLayoutOption` has a similar usage as an `enum`, but it is not an `enum`. Instead, it is a struct that holds a string raw value. The advantage of this approach is that it is extendable, while the `enum` is not. The next step is to subclass the `ChatMessageLayoutOptionsResolver` so that we can add the new `.shareAttachments` option if the message has attachments: ```swift diff --git a/docusaurus/docs/iOS/uikit/guides/customize-message-composer.md b/docusaurus/docs/iOS/uikit/guides/customize-message-composer.md index ac50b4758e2..b1ee2e83432 100644 --- a/docusaurus/docs/iOS/uikit/guides/customize-message-composer.md +++ b/docusaurus/docs/iOS/uikit/guides/customize-message-composer.md @@ -8,7 +8,7 @@ import ComponentsNote from '../../common-content/components-note.md' The `ComposerVC` is the component responsible to create new messages or change existing messages. The composer belongs to the `ChatMessageListVC` component that integrates the message list and the composer in one view. But if you are not using our `ChatMessageListVC` you can use the composer component in isolation with your own chat view as well. The `ComposerVC` manages all the logic and actions of the `ComposerView`, where the latter is only responsible for the composer's layout. ## How to Change the Composer Layout -Since the `ComposerView` is responsible for the composer's layout, if you want to change the styling, the position of the views, removing views or adding new ones, you need to override the `ComposerView`. Let's go through an example of customizing the composer to look like the iMessage app. The iMessage's composer is quite different than the composer that comes with the SDK: there is only one button to add pictures/videos and the send button is inside the input text container. +Since the `ComposerView` is responsible for the composer's layout, if you want to change the styling, the position of the views, remove views or add new ones, you need to override the `ComposerView`. Let's go through an example of customizing the composer to look like the iMessage app. The iMessage's composer is quite different than the composer that comes with the SDK: there is only one button to add pictures/videos and the send button is inside the input text container. | Before | After | | ------------- | ------------- | @@ -16,7 +16,7 @@ Since the `ComposerView` is responsible for the composer's layout, if you want t After changing the layout through the following steps you should have the result of the picture above. -First thing we need to do is to subclass the `ComposerView` and change it's layout. To have a better understand of how the `ComposerView`'s layout is structured it is recommended to read this page first, [here](../../components/message-composer#composer-view). +First thing we need to do is to subclass the `ComposerView` and change its layout. To have a better understand of how the `ComposerView`'s layout is structured, please check this [page](../../components/message-composer#composer-view). ```swift class iMessageComposerView: ComposerView { override func setUpLayout() { @@ -215,7 +215,7 @@ Here we simply remove the shadow and customize the border style of the suggestio | | | #### Customizing the Suggestions Cells -If you want to further customize the suggestions UI and want to change the suggestions cells, the recommended way is to subclass the `ChatMentionSuggestionView` and `ChatCommandSuggestionView` components. Let's see an example of how we can change the user mention cell by remove the username and the "@" symbol: +If you want to further customize the suggestions UI and want to change the suggestions cells, the recommended way is to subclass the `ChatMentionSuggestionView` and `ChatCommandSuggestionView` components. Let's see an example of how we can change the user mention cell by removing the username and the "@" symbol: ```swift class CustomMentionSuggestionView: ChatMentionSuggestionView { @@ -239,7 +239,7 @@ Components.default.suggestionsMentionView = CustomMentionSuggestionView.self | | | #### Bypassing how the Suggestions are Presented -Finally, if you need to have complete control over how the suggestions are presented and not use our `ChatSuggestionsVC` component you can by overriding the following functions: +Finally, if you need to have complete control over how the suggestions are presented and not use our `ChatSuggestionsVC` component, you can do that by overriding the following functions: ```swift class CustomComposerVC: ComposerVC { override func showMentionSuggestions(for typingMention: String, mentionRange: NSRange) { diff --git a/docusaurus/docs/iOS/uikit/guides/message-composer-custom-attachments.md b/docusaurus/docs/iOS/uikit/guides/message-composer-custom-attachments.md index 4cabfd6d4ec..b73e8e5f0a4 100644 --- a/docusaurus/docs/iOS/uikit/guides/message-composer-custom-attachments.md +++ b/docusaurus/docs/iOS/uikit/guides/message-composer-custom-attachments.md @@ -5,7 +5,7 @@ title: Message Composer Custom Attachments import ComponentsNote from '../../common-content/components-note.md' import ThemingNote from '../../common-content/theming-note.md' -The `ComposerVC` can be customized in order to change the built-in attachments or can be extended to support your own custom attachments. By default the composer handles images, videos, giphy's and files, but you can create your own custom attachments. Some examples of common custom attachments are: location sharing, contact details, workouts and voice memos. You can read more about how attachments work in the [Working with Attachments](../../uikit/guides/working-with-attachments) guide. +The `ComposerVC` can be customized in order to change the built-in attachments or can be extended to support your own custom attachments. By default the composer handles images, videos, giphys and files, but you can also create your own custom attachments. Some examples of common custom attachments are: location sharing, contact details, workouts and voice memos. You can read more about how attachments work in the [Working with Attachments](../../uikit/guides/working-with-attachments) guide. All the provided attachments are customizable in the composer in terms of style changes, layout changes or how they are presented. For example, you can change the clip button styling responsible for opening the attachments picker, you can replace the built-in attachments picker with your own, or even change all the flow and render the attachments picker in a subview instead of being presented in a view controller. @@ -107,7 +107,7 @@ Components.default.messageComposerVC = CustomComposerVC.self With the new action added, now if the user selects the Camera action it will present the native iOS Camera so the user can directly add a photo to the attachments. ## How to support a custom attachment -In order for the composer to support your own custom attachments we will go through the full process of creating a custom **Contact** attachment and adding the necessary changes for the composer to support it. The process can be breakdown into these steps: +In order for the composer to support your own custom attachments we will go through the full process of creating a custom **Contact** attachment and adding the necessary changes for the composer to support it. The process consists of the following steps: 1. Extend `AttachmentType` to include the new contact custom type. 2. Create a new `ContactAttachmentPayload` struct to define the contact data. @@ -124,7 +124,7 @@ extension AttachmentType { ``` ### Adding the contact attachment payload -To add custom data to your custom attachment you need to create a `ContactAttachmentPayload` which implements the `AttachmentPayload` protocol. This protocol has only one requirement, and is to have a `static let type: AttachmentType` property. +To add custom data to your custom attachment you need to create a `ContactAttachmentPayload` which implements the `AttachmentPayload` protocol. This protocol has only one requirement, which is the `static let type: AttachmentType` property. ```swift struct ContactAttachmentPayload: AttachmentPayload { static let type: AttachmentType = .contact @@ -275,7 +275,7 @@ The close button is automatically added by the `AttachmentPreviewContainer` comp ::: ## Advanced customization of the attachments picker -You can totally customize the flow of how the attachments picker is presented. Not only you can replace any default picker with your custom one but also can bypass the action sheet and present the attachments picker directly in a different view. +You can totally customize the flow of how the attachments picker is presented. Not only you can replace any default picker with your custom one, but you can also bypass the action sheet and present the attachments picker directly in a different view. ### Replace the default media picker To replace the default `UIImagePickerController` with your own custom `UIViewController` you just need to override the `var mediaPickerVC: UIViewController` property and replace with your own, and make sure your custom view controller sends events to the composer. When the composer receives the selected attachments from your custom media picker, you need to update the attachments of the composer's content which is represented by the `ComposerVC.Content`. diff --git a/docusaurus/docs/iOS/uikit/guides/working-with-attachments.md b/docusaurus/docs/iOS/uikit/guides/working-with-attachments.md index 53a1a454cff..388d18ee2bb 100644 --- a/docusaurus/docs/iOS/uikit/guides/working-with-attachments.md +++ b/docusaurus/docs/iOS/uikit/guides/working-with-attachments.md @@ -94,10 +94,11 @@ Components.default.filesAttachmentInjector = MyCustomAttachmentViewInjector.self Stream chat allows you to create your own types of attachments as well. The steps to follow to add support for a custom attachment type are the following: 1. Extend `AttachmentType` to include the custom type -1. Create a new `AttachmentPayload` struct to handle your custom attachment data -1. Create a `typealias` for `ChatMessageAttachment` which will be used for the content of the view -1. Create a new `AttachmentViewInjector` -1. Configure the SDK to use your view injector class to render custom attachments +2. Create a new `AttachmentPayload` struct to handle your custom attachment data +3. Register the new attachment payload type in `ChatClient` +4. Create a `typealias` for `ChatMessageAttachment` which will be used for the content of the view +5. Create a new `AttachmentViewInjector` +6. Configure the SDK to use your view injector class to render custom attachments Let's assume we want to attach a workout session to a message, the payload of the attachment will look like this: @@ -113,7 +114,7 @@ Let's assume we want to attach a workout session to a message, the payload of th } ``` -Here's how we get around the first three steps: +In the code, the payload and attachment type should look something like this: ```swift public extension AttachmentType { @@ -143,11 +144,22 @@ public struct WorkoutAttachmentPayload: AttachmentPayload { Here we extended `AttachmentType` to include the `workout` type and afterwards we introduced a new struct to match the payload data that we expect. -1. WorkoutAttachmentPayload.type is used to match message attachments to this struct -1. All attachment fields are optional, this is highly recommended for all custom data -1. We use CodingKeys to map JSON field names to struct fields +1. `WorkoutAttachmentPayload.type` is used to match message attachments to this struct +2. All attachment fields are optional, this is highly recommended for all custom data +3. We use `CodingKeys` to map JSON field names to struct fields -Let's now create a custom view injector to handle the workout attachment. +Then, you should register your custom attachment type when creating the `ChatClient`, example: + +```swift +let client = ChatClient(config: config) +client.registerAttachment(WorkoutAttachmentPayload.self) +``` + +:::note +The `ChatClient.registerAttachment()` is only available after the 4.42.0 release. This one was added to make sure that editing custom attachments is also supported. +::: + +Let's now create a custom view injector to handle the workout attachment view. ```swift import StreamChat @@ -238,9 +250,9 @@ open class WorkoutAttachmentViewInjector: AttachmentViewInjector { } ``` -The `WorkoutAttachmentView` class is where all layout and content logic happens. In `contentViewDidLayout` we add `WorkoutAttachmentView` as a subview of `bubbleContentContainer` using `insertArrangedSubview`, more information about layout customizations is available [here](../custom-components.md). The last interesting bit happens in `contentViewDidUpdateContent`, there we use the `attachments` method to retrieve all attachments for this messages with type `WorkoutAttachmentPayload` and then pick the first one. This allows us to have the type we defined earlier as the content to render in our custom view. +The `WorkoutAttachmentView` class is where all layout and content logic happens. In `contentViewDidLayout` we add `WorkoutAttachmentView` as a subview of `bubbleContentContainer` using `insertArrangedSubview`. More information about layout customizations is available [here](../custom-components.md). The last interesting bit happens in `contentViewDidUpdateContent`, where we use the `attachments` method to retrieve all attachments for these messages with type `WorkoutAttachmentPayload` and then pick the first one. This allows us to have the type we defined earlier as the content to render in our custom view. -Now that we have data and view ready we only need to configure the SDK to use `WorkoutAttachmentViewInjector` for workout attachments, this is done by changing the default `AttachmentViewCatalog` with our own. +Now that we have data and view ready we only need to configure the SDK to use `WorkoutAttachmentViewInjector` for workout attachments. This is done by changing the default `AttachmentViewCatalog` with our own. ```swift class MyAttachmentViewCatalog: AttachmentViewCatalog { @@ -269,7 +281,7 @@ controller.createNewMessage(text: "work-out-test", attachments: [.init(payload: In case you need to interact with your custom attachment, there are a couple of steps required: 1. Create a delegate for your custom attachment view which extends from `ChatMessageContentViewDelegate`. -2. Create a custom `ChatMessageListVC` if you didn't already, and make it conform to the delegate created in step 1. +2. Create a custom `ChatMessageListVC` if you haven't already, and make it conform to the delegate created in step 1. 3. Change your custom injector and add a tap gesture recognizer to your custom view. The delegate can be called by accessing `contentView.delegate` and casting it to your custom delegate. Below is the full example on how to add a interaction to the custom workout attachment: @@ -320,11 +332,43 @@ class WorkoutAttachmentViewInjector: AttachmentViewInjector { } ``` -Finally, don't forget to assign the custom message list if you didn't yet: +Finally, don't forget to assign the custom message list if you haven't yet: ```swift Components.default.messageListVC = CustomChatMessageListVC.self ``` +### Quoted Message View Preview + +A preview of the custom attachment view while a message containing such attachment is being quoted, needs to be provided as well. + +In order to do this, you need to subclass the `QuotedChatMessageView` and provide your own implementation for the custom attachment type. + +For example, let's create a `CustomQuotedMessageView` with the following implementation. + +```swift +class CustomQuotedMessageView: QuotedChatMessageView { + + override func setAttachmentPreview(for message: ChatMessage) { + if let customPayload = message.attachments(payloadType: WorkoutAttachmentPayload.self).first?.payload { + attachmentPreviewView.contentMode = .scaleAspectFit + attachmentPreviewView.image = appearance.images.fileFallback + if textView.text.isEmpty { + textView.text = customPayload.workoutType + } + } + return super.setAttachmentPreview(for: message) + } +} +``` + +In the subclass, we are overriding the implementation of the `setAttachmentPreview` method. We are checking if the message contains a custom attachment of type `WorkoutAttachmentPayload`. If it does, we are providing an image and a text available from the message payload. + +Finally, you need to inject your custom implementation of the `CustomQuotedMessageView` in our `Components`'s property `quotedMessageView`. + +``` +Components.default.quotedMessageView = CustomQuotedMessageView.self +``` + ### Tracking custom attachment upload progress In the previous examples, we assumed that you already have the custom attachment remote URL available. But, you can also upload the custom attachment through the Stream's SDK and observe the uploading progress. diff --git a/docusaurus/sidebars-ios.json b/docusaurus/sidebars-ios.json index 0f27b558aef..7b38ab0f3d6 100644 --- a/docusaurus/sidebars-ios.json +++ b/docusaurus/sidebars-ios.json @@ -103,7 +103,8 @@ "swiftui/swiftui-cookbook/custom-composer", "swiftui/swiftui-cookbook/reactions-reordering", "swiftui/swiftui-cookbook/list-alignment", - "swiftui/swiftui-cookbook/custom-message-list" + "swiftui/swiftui-cookbook/custom-message-list", + "swiftui/swiftui-cookbook/creating-channels" ] } ] diff --git a/fastlane/Fastfile b/fastlane/Fastfile index c133d467233..eab1e4045d7 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -389,7 +389,7 @@ desc 'Runs ui tests in Debug config' lane :test_ui do |options| next unless is_check_required(sources: sources_matrix[:ui], force_check: @force_check) - remove_snapshots if options[:record] + remove_snapshots unless options[:record].to_s.empty? update_testplan_on_ci(path: 'Tests/StreamChatUITests/StreamChatUITestPlan.xctestplan') @@ -403,8 +403,30 @@ lane :test_ui do |options| devices: options[:device], build_for_testing: options[:build_for_testing], skip_build: options[:skip_build], - xcargs: buildcache_xcargs + xcargs: buildcache_xcargs, + fail_build: options[:record].to_s.empty? ) + + if options[:record] && is_ci + png_files = git_status(ext: '.png').map { |_, png| png }.flatten + next if png_files.empty? + + title = "[CI] Snapshots" + base = current_branch + head = "#{base}-snapshots" + sh("git checkout -b #{head}") + png_files.each { |png| sh("git add #{png}") || true } + sh("git commit -m '#{title}'") + push_to_git_remote(tags: false) + create_pull_request( + api_token: ENV.fetch('GITHUB_TOKEN', nil), + repo: github_repo, + title: title, + head: head, + base: base, + body: 'This PR was created automatically by CI.' + ) + end end private_lane :match_macos do @@ -595,8 +617,15 @@ lane :install_sim do |options| end desc 'Remove UI snapshots' -private_lane :remove_snapshots do - Dir.glob("../Tests/StreamChatUITests/**/__Snapshots__/**/*.png").select { |file| File.delete(file) } +private_lane :remove_snapshots do |options| + snapshots_path = "../Tests/StreamChatUITests/**/__Snapshots__/**/*.png" + if options[:only_unchanged] + pnf_files = git_status(ext: '.png') + changed_snapshots = (pnf_files[:a] + pnf_files[:m]).map { |f| File.expand_path(f) } + Dir.glob(snapshots_path).select { |f| File.delete(f) unless changed_snapshots.include?(File.expand_path(f)) } + else + Dir.glob(snapshots_path).select { |f| File.delete(f) } + end end lane :sources_matrix do @@ -614,3 +643,32 @@ end private_lane :current_branch do ENV['BRANCH_NAME'] || git_branch end + +private_lane :git_status do |options| + UI.user_error!('Extension should be provided') unless options[:ext] + + untracked_files = sh('git status -s', log: false).split("\n").map(&:strip) + UI.important("Git Status: #{untracked_files}") + + deleted_files = select_files_from(files: untracked_files, with_extension: options[:ext], that_start_with: 'D') + added_files = select_files_from(files: untracked_files, with_extension: options[:ext], that_start_with: ['A', '??']) + renamed_files = select_files_from(files: untracked_files, with_extension: options[:ext], that_start_with: 'R') + modified_files = select_files_from(files: untracked_files, with_extension: options[:ext], that_start_with: 'M') + + renamed_files.each do |renamed_file| + content = renamed_file.split.drop(1).join.split('->').map(&:strip) + deleted_files << content.first + added_files << content.last + end + { a: added_files, d: deleted_files, m: modified_files } +end + +def select_files_from(files:, with_extension:, that_start_with:) + files.select do |f| + f.start_with?(*that_start_with) + end.map do |f| + f.split.drop(1).join(' ') + end.select do |f| + f.gsub(/['"]/, '').end_with?(with_extension) + end +end