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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .github/workflows/cron-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ jobs:
- ios: "17.5"
device: "iPhone 15 Pro"
setup_runtime: true
- ios: "16.4"
device: "iPhone 14 Pro"
setup_runtime: true
# - ios: "16.4" # XCTest runner hangs most of the time on iOS 16
# device: "iPhone 14 Pro"
# setup_runtime: true
fail-fast: false
runs-on: macos-15
env:
Expand Down Expand Up @@ -79,8 +79,7 @@ jobs:
name: Test Data E2E (iOS ${{ matrix.ios }})
path: |
fastlane/recordings
fastlane/sinatra_log.txt
fastlane/test_output/report.junit
fastlane/stream-chat-test-mock-server/logs/*
fastlane/test_output/logs/*/Diagnostics/**/*.txt
fastlane/test_output/logs/*/Diagnostics/simctl_diagnostics/DiagnosticReports/*

Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/smoke-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@ jobs:
with:
name: Test Data UI
path: |
fastlane/recordings
fastlane/sinatra_log.txt
fastlane/test_output/snapshots
fastlane/test_output/logs/*/Diagnostics/**/*.txt
fastlane/test_output/logs/*/Diagnostics/simctl_diagnostics/DiagnosticReports/*
Expand Down Expand Up @@ -199,8 +197,7 @@ jobs:
name: Test Data E2E ${{ matrix.batch }}
path: |
fastlane/recordings
fastlane/sinatra_log.txt
fastlane/test_output/report.junit
fastlane/stream-chat-test-mock-server/logs/*
fastlane/test_output/logs/*/Diagnostics/**/*.txt
fastlane/test_output/logs/*/Diagnostics/simctl_diagnostics/DiagnosticReports/*

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ app-thinning.plist
*.dmg
yeetd-normal.pkg
*LinkMap.txt
stream-chat-test-mock-server

# VSCode
.vscode
Expand Down
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ group :fastlane_dependencies do
end

group :sinatra_dependencies do
gem 'eventmachine'
gem 'faye-websocket'
gem 'puma'
gem 'rackup'
end
Expand Down
10 changes: 10 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ GEM
dotenv (2.8.1)
drb (2.2.3)
emoji_regex (3.2.3)
eventmachine (1.2.7)
excon (0.112.0)
faraday (1.10.4)
faraday-em_http (~> 1.0)
Expand Down Expand Up @@ -172,6 +173,9 @@ GEM
xcsize (= 1.2.0)
fastlane-sirp (1.0.0)
sysrandom (~> 1.0)
faye-websocket (0.12.0)
eventmachine (>= 0.12.0)
websocket-driver (>= 0.8.0)
gh_inspector (1.1.3)
git (2.3.3)
activesupport (>= 5.0)
Expand Down Expand Up @@ -352,6 +356,10 @@ GEM
concurrent-ruby (~> 1.0)
uber (0.1.0)
unicode-display_width (2.6.0)
websocket-driver (0.8.0)
base64
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
word_wrap (1.0.0)
xcodeproj (1.27.0)
CFPropertyList (>= 2.3.3, < 4.0)
Expand All @@ -374,13 +382,15 @@ PLATFORMS
DEPENDENCIES
danger
danger-commit_lint
eventmachine
fastlane
fastlane-plugin-create_xcframework
fastlane-plugin-lizard
fastlane-plugin-sonarcloud_metric_kit
fastlane-plugin-stream_actions (= 0.3.102)
fastlane-plugin-versioning
fastlane-plugin-xcsize (= 1.2.0)
faye-websocket
json
lefthook
plist
Expand Down
7 changes: 3 additions & 4 deletions Sources/StreamChatSwiftUI/ChatChannel/ChatChannelView.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright © 2025 Stream.io Inc. All rights reserved.
// Copyright © 2026 Stream.io Inc. All rights reserved.
//

import StreamChat
Expand Down Expand Up @@ -124,9 +124,8 @@ public struct ChatChannelView<Factory: ViewFactory>: View, KeyboardReadable {
messageController: viewModel.messageController,
quotedMessage: $viewModel.quotedMessage,
editedMessage: $viewModel.editedMessage,
onMessageSent: {
viewModel.messageSentTapped()
}
willSendMessage: { viewModel.messageSentTapped() },
onMessageSent: {}
)
)
.opacity((
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright © 2025 Stream.io Inc. All rights reserved.
// Copyright © 2026 Stream.io Inc. All rights reserved.
//

import StreamChat
Expand Down Expand Up @@ -31,6 +31,7 @@ public struct MessageComposerView<Factory: ViewFactory>: View, KeyboardReadable
messageController: ChatMessageController? = nil,
quotedMessage: Binding<ChatMessage?>,
editedMessage: Binding<ChatMessage?>,
willSendMessage: @escaping () -> Void,
onMessageSent: @escaping () -> Void
) {
factory = viewFactory
Expand All @@ -45,10 +46,12 @@ public struct MessageComposerView<Factory: ViewFactory>: View, KeyboardReadable
_quotedMessage = quotedMessage
_editedMessage = editedMessage
self.onMessageSent = onMessageSent
self.willSendMessage = willSendMessage
}

@StateObject var viewModel: MessageComposerViewModel

var willSendMessage: () -> Void
var onMessageSent: () -> Void

public var body: some View {
Expand Down Expand Up @@ -108,6 +111,7 @@ public struct MessageComposerView<Factory: ViewFactory>: View, KeyboardReadable
enabled: viewModel.sendButtonEnabled,
cooldownDuration: viewModel.cooldownDuration,
onTap: {
willSendMessage()
viewModel.sendMessage(
quotedMessage: quotedMessage,
editedMessage: editedMessage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,8 @@ public struct QuotedMessageContentView<Factory: ViewFactory>: View {
}
.onDisappear(.cancel)
.processors([ImageProcessors.Resize(width: options.attachmentSize.width)])
.priority(.high) }
.priority(.high)
}
}
.frame(width: hasVoiceAttachments ? nil : options.attachmentSize.width, height: options.attachmentSize.height)
.aspectRatio(1, contentMode: .fill)
Expand Down
17 changes: 9 additions & 8 deletions Sources/StreamChatSwiftUI/ViewFactory/DefaultViewFactory.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright © 2025 Stream.io Inc. All rights reserved.
// Copyright © 2026 Stream.io Inc. All rights reserved.
//

import Photos
Expand Down Expand Up @@ -529,6 +529,7 @@ extension ViewFactory {
messageController: options.messageController,
quotedMessage: options.quotedMessage,
editedMessage: options.editedMessage,
willSendMessage: options.willSendMessage,
onMessageSent: options.onMessageSent
)
}
Expand Down Expand Up @@ -835,13 +836,13 @@ extension ViewFactory {
}

public func makeQuotedMessageContentView(
options: QuotedMessageContentViewOptions
) -> some View {
QuotedMessageContentView(
factory: self,
options: options
)
}
options: QuotedMessageContentViewOptions
) -> some View {
QuotedMessageContentView(
factory: self,
options: options
)
}

public func makeCustomAttachmentQuotedView(options: CustomAttachmentQuotedViewOptions) -> some View {
EmptyView()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright © 2025 Stream.io Inc. All rights reserved.
// Copyright © 2026 Stream.io Inc. All rights reserved.
//

import Foundation
Expand All @@ -18,6 +18,8 @@ public final class MessageComposerViewTypeOptions: Sendable {
public let quotedMessage: Binding<ChatMessage?>
/// Binding to the edited message.
public let editedMessage: Binding<ChatMessage?>
/// A closure triggered just before sending a new message.
public let willSendMessage: @MainActor () -> Void
/// Callback when a message is sent.
public let onMessageSent: @MainActor () -> Void

Expand All @@ -26,13 +28,15 @@ public final class MessageComposerViewTypeOptions: Sendable {
messageController: ChatMessageController?,
quotedMessage: Binding<ChatMessage?>,
editedMessage: Binding<ChatMessage?>,
willSendMessage: @escaping @MainActor () -> Void,
onMessageSent: @escaping @MainActor () -> Void
) {
self.channelController = channelController
self.messageController = messageController
self.quotedMessage = quotedMessage
self.editedMessage = editedMessage
self.onMessageSent = onMessageSent
self.willSendMessage = willSendMessage
}
}

Expand Down
6 changes: 1 addition & 5 deletions StreamChatSwiftUI.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@
820A61A029D6D78E002257FB /* QuotedReply_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 820A619F29D6D78E002257FB /* QuotedReply_Tests.swift */; };
825AADF4283CCDB000237498 /* ThreadPage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 825AADF3283CCDB000237498 /* ThreadPage.swift */; };
827352FD290BE91100A87385 /* NotificationsHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8492974827ABDDBF00A8EEB0 /* NotificationsHandler.swift */; };
829AB4D228578ACF002DC629 /* StreamTestCase+Tags.swift in Sources */ = {isa = PBXBuildFile; fileRef = 829AB4D128578ACF002DC629 /* StreamTestCase+Tags.swift */; };
829AB4D42858A532002DC629 /* Reactions_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 829AB4D32858A532002DC629 /* Reactions_Tests.swift */; };
829CD5CE2848CA6B003C3877 /* Settings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 829CD5CD2848CA6B003C3877 /* Settings.swift */; };
829EF8772A9362C00045D166 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 829EF8762A9362C00045D166 /* PrivacyInfo.xcprivacy */; };
Expand Down Expand Up @@ -697,7 +696,6 @@
4FEAB3172BFF71F70057E511 /* SwiftUI+UIAlertController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SwiftUI+UIAlertController.swift"; sourceTree = "<group>"; };
820A619F29D6D78E002257FB /* QuotedReply_Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QuotedReply_Tests.swift; sourceTree = "<group>"; };
825AADF3283CCDB000237498 /* ThreadPage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThreadPage.swift; sourceTree = "<group>"; };
829AB4D128578ACF002DC629 /* StreamTestCase+Tags.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "StreamTestCase+Tags.swift"; sourceTree = "<group>"; };
829AB4D32858A532002DC629 /* Reactions_Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Reactions_Tests.swift; sourceTree = "<group>"; };
829CD5CD2848CA6B003C3877 /* Settings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Settings.swift; sourceTree = "<group>"; };
829EF8762A9362C00045D166 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2240,13 +2238,12 @@
isa = PBXGroup;
children = (
A3600B3F283F651200E1C930 /* Base TestCase */,
82A1814528FD69E8005F9D43 /* Message Delivery Status */,
82A1813D28FD68A3005F9D43 /* ChannelList_Tests.swift */,
A3600B31283E9E4700E1C930 /* MessageList_Tests.swift */,
829AB4D32858A532002DC629 /* Reactions_Tests.swift */,
82A1813B28F9BA53005F9D43 /* Attachments_Tests.swift */,
82A1814328FD69AE005F9D43 /* SlowMode_Tests.swift */,
829AB4D128578ACF002DC629 /* StreamTestCase+Tags.swift */,
82A1814528FD69E8005F9D43 /* Message Delivery Status */,
82A1813F28FD691B005F9D43 /* Ephemeral_Messages_Tests.swift */,
82A1814128FD694A005F9D43 /* PushNotification_Tests.swift */,
820A619F29D6D78E002257FB /* QuotedReply_Tests.swift */,
Expand Down Expand Up @@ -2587,7 +2584,6 @@
82A1814728FD69F8005F9D43 /* MessageDeliveryStatus_Tests.swift in Sources */,
A3600B2F283E9E1900E1C930 /* UserRobot+Asserts.swift in Sources */,
82A1814028FD691B005F9D43 /* Ephemeral_Messages_Tests.swift in Sources */,
829AB4D228578ACF002DC629 /* StreamTestCase+Tags.swift in Sources */,
82A1813C28F9BA53005F9D43 /* Attachments_Tests.swift in Sources */,
A3600B35283E9EBA00E1C930 /* Bundle+Target.swift in Sources */,
82A1813A28F84CAA005F9D43 /* SpringBoard.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright © 2025 Stream.io Inc. All rights reserved.
// Copyright © 2026 Stream.io Inc. All rights reserved.
//

import Photos
Expand Down Expand Up @@ -39,6 +39,7 @@ import XCTest
messageController: nil,
quotedMessage: .constant(nil),
editedMessage: .constant(nil),
willSendMessage: {},
onMessageSent: {}
)
.frame(width: defaultScreenSize.width, height: 100)
Expand All @@ -62,6 +63,7 @@ import XCTest
messageController: nil,
quotedMessage: .constant(nil),
editedMessage: .constant(nil),
willSendMessage: {},
onMessageSent: {}
)
.frame(width: defaultScreenSize.width, height: 250)
Expand All @@ -85,6 +87,7 @@ import XCTest
messageController: nil,
quotedMessage: .constant(nil),
editedMessage: .constant(nil),
willSendMessage: {},
onMessageSent: {}
)
.frame(width: defaultScreenSize.width, height: 120)
Expand All @@ -108,6 +111,7 @@ import XCTest
messageController: nil,
quotedMessage: .constant(nil),
editedMessage: .constant(nil),
willSendMessage: {},
onMessageSent: {}
)
.frame(width: defaultScreenSize.width, height: 120)
Expand All @@ -131,6 +135,7 @@ import XCTest
messageController: nil,
quotedMessage: .constant(nil),
editedMessage: .constant(nil),
willSendMessage: {},
onMessageSent: {}
)
.frame(width: defaultScreenSize.width, height: 200)
Expand Down Expand Up @@ -256,6 +261,7 @@ import XCTest
messageController: nil,
quotedMessage: .constant(nil),
editedMessage: .constant(nil),
willSendMessage: {},
onMessageSent: {}
)
.frame(width: defaultScreenSize.width, height: 100)
Expand Down Expand Up @@ -688,6 +694,7 @@ import XCTest
channelController: channelController,
quotedMessage: .constant(nil),
editedMessage: .constant(nil),
willSendMessage: {},
onMessageSent: {}
)
}
Expand Down Expand Up @@ -895,6 +902,7 @@ import XCTest
channelController: channelController,
quotedMessage: .constant(nil),
editedMessage: .constant(editedMessage),
willSendMessage: {},
onMessageSent: {}
)
}
Expand Down Expand Up @@ -928,6 +936,7 @@ import XCTest
messageController: nil,
quotedMessage: .constant(nil),
editedMessage: .constant(nil),
willSendMessage: {},
onMessageSent: {}
)
view.addToViewHierarchy()
Expand Down Expand Up @@ -970,6 +979,7 @@ import XCTest
messageController: nil,
quotedMessage: .constant(nil),
editedMessage: .constant(nil),
willSendMessage: {},
onMessageSent: {}
)
view.addToViewHierarchy()
Expand Down Expand Up @@ -1008,6 +1018,7 @@ import XCTest
messageController: nil,
quotedMessage: .constant(nil),
editedMessage: .constant(nil),
willSendMessage: {},
onMessageSent: {}
)
view.addToViewHierarchy()
Expand Down Expand Up @@ -1045,6 +1056,7 @@ import XCTest
messageController: nil,
quotedMessage: .constant(nil),
editedMessage: .constant(nil),
willSendMessage: {},
onMessageSent: {}
)
view.addToViewHierarchy()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ enum ChannelListPage {
cell.staticTexts["UnreadIndicatorView"]
}

static func statusCheckmark(for status: MessageDeliveryStatus?, in cell: XCUIElement) -> XCUIElement {
static func statusCheckmark(
for status: StreamChatTestMockServer.MessageDeliveryStatus?,
in cell: XCUIElement
) -> XCUIElement {
return cell.images["readIndicatorCheckmark"]
}
}
Expand Down
Loading
Loading