Skip to content

Commit 84b84f5

Browse files
V5: Use StreamCore based chat (#1034)
* Use StreamCore based chat * Remove duplicate Identifiable conformances * Link StreamCore and StreamChat dynamically for size calculation * Bump xcsize version * Race between logout and login in UI-tests * Keep logout before connect --------- Co-authored-by: Alexey Alter-Pesotskiy <alex@testableapple.com>
1 parent 348aedf commit 84b84f5

38 files changed

+114
-281
lines changed

Gemfile.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ GEM
168168
fastlane-plugin-stream_actions (0.3.101)
169169
xctest_list (= 1.2.1)
170170
fastlane-plugin-versioning (0.7.1)
171-
fastlane-plugin-xcsize (1.1.0)
172-
xcsize (= 1.1.0)
171+
fastlane-plugin-xcsize (1.2.0)
172+
xcsize (= 1.2.0)
173173
fastlane-sirp (1.0.0)
174174
sysrandom (~> 1.0)
175175
gh_inspector (1.1.3)
@@ -364,7 +364,7 @@ GEM
364364
rouge (~> 3.28.0)
365365
xcpretty-travis-formatter (1.0.1)
366366
xcpretty (~> 0.2, >= 0.0.7)
367-
xcsize (1.1.0)
367+
xcsize (1.2.0)
368368
commander (>= 4.6, < 6.0)
369369
xctest_list (1.2.1)
370370

@@ -380,7 +380,7 @@ DEPENDENCIES
380380
fastlane-plugin-sonarcloud_metric_kit
381381
fastlane-plugin-stream_actions (= 0.3.101)
382382
fastlane-plugin-versioning
383-
fastlane-plugin-xcsize (= 1.1.0)
383+
fastlane-plugin-xcsize (= 1.2.0)
384384
json
385385
lefthook
386386
plist

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ let package = Package(
1616
)
1717
],
1818
dependencies: [
19-
.package(url: "https://github.com/GetStream/stream-chat-swift.git", from: "4.92.0")
19+
.package(url: "https://github.com/GetStream/stream-chat-swift.git", branch: "v5")
2020
],
2121
targets: [
2222
.target(

Sources/StreamChatSwiftUI/ChatChannel/ChannelInfo/FileAttachmentsView.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,5 +108,3 @@ struct MonthlyAttachmentsHeader: View {
108108
.background(Color(colors.background6))
109109
}
110110
}
111-
112-
extension ChatMessageFileAttachment: Identifiable {}

Sources/StreamChatSwiftUI/ChatChannel/ChatChannelView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public struct ChatChannelView<Factory: ViewFactory>: View, KeyboardReadable {
8484
)
8585
} else {
8686
ZStack {
87-
factory.makeEmptyMessagesView(for: channel, colors: colors)
87+
factory.makeEmptyMessagesView(options: EmptyMessagesViewOptions(channel: channel, colors: colors))
8888
.dismissKeyboardOnTap(enabled: keyboardShown) {
8989
hideComposerCommandsAndAttachmentsPicker()
9090
}

Sources/StreamChatSwiftUI/ChatChannel/ChatChannelViewModel.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,7 @@ import SwiftUI
850850
}
851851
}
852852

853-
extension ChatMessage: Identifiable {
853+
extension ChatMessage {
854854
@MainActor public var scrollMessageId: String {
855855
messageId
856856
}

Sources/StreamChatSwiftUI/ChatChannel/Composer/MessageComposerView.swift

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -410,13 +410,15 @@ public struct ComposerInputView<Factory: ViewFactory>: View, KeyboardReadable {
410410
}
411411

412412
factory.makeComposerTextInputView(
413-
text: $text,
414-
height: $textHeight,
415-
selectedRangeLocation: $selectedRangeLocation,
416-
placeholder: isInCooldown ? L10n.Composer.Placeholder.slowMode : (isChannelFrozen ? L10n.Composer.Placeholder.messageDisabled : L10n.Composer.Placeholder.message),
417-
editable: !isInputDisabled,
418-
maxMessageLength: maxMessageLength,
419-
currentHeight: textFieldHeight
413+
options: ComposerTextInputViewOptions(
414+
text: $text,
415+
height: $textHeight,
416+
selectedRangeLocation: $selectedRangeLocation,
417+
placeholder: isInCooldown ? L10n.Composer.Placeholder.slowMode : (isChannelFrozen ? L10n.Composer.Placeholder.messageDisabled : L10n.Composer.Placeholder.message),
418+
editable: !isInputDisabled,
419+
maxMessageLength: maxMessageLength,
420+
currentHeight: textFieldHeight
421+
)
420422
)
421423
.environmentObject(viewModel)
422424
.accessibilityIdentifier("ComposerTextInputView")

Sources/StreamChatSwiftUI/ChatChannel/MessageList/MessageListView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ public struct MessageListView<Factory: ViewFactory>: View, KeyboardReadable {
321321
)
322322
) : nil
323323
)
324-
.modifier(factory.makeMessageListContainerModifier())
324+
.modifier(factory.makeMessageListContainerModifier(options: MessageListContainerModifierOptions()))
325325
.onDisappear {
326326
messageRenderingUtil.update(previousTopMessage: nil)
327327
}

Sources/StreamChatSwiftUI/ChatChannel/MessageList/Polls/PollAttachmentView.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,6 @@ public struct PollAttachmentView<Factory: ViewFactory>: View {
180180
}
181181
}
182182

183-
extension PollOption: Identifiable {}
184-
185183
struct PollOptionView<Factory: ViewFactory>: View {
186184
@ObservedObject var viewModel: PollAttachmentViewModel
187185

Sources/StreamChatSwiftUI/ChatChannel/MessageList/Polls/PollCommentsViewModel.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ import SwiftUI
4545
$comments
4646
.dropFirst()
4747
.map { _ in true }
48-
.assignWeakly(to: \.animateChanges, on: self)
48+
.assign(to: \.animateChanges, onWeak: self)
4949
.store(in: &cancellables)
5050
}
5151

Sources/StreamChatSwiftUI/ChatChannel/MessageList/Polls/PollOptionAllVotesViewModel.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import SwiftUI
3333
$pollVotes
3434
.dropFirst()
3535
.map { _ in true }
36-
.assignWeakly(to: \.animateChanges, on: self)
36+
.assign(to: \.animateChanges, onWeak: self)
3737
.store(in: &cancellables)
3838
}
3939

0 commit comments

Comments
 (0)