Skip to content

Commit 703f975

Browse files
Merge branch 'GetStream:develop' into develop
2 parents 82cd117 + 02bd443 commit 703f975

33 files changed

+324
-129
lines changed

.spi.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ builder:
44
- platform: ios
55
documentation_targets: [StreamChatSwiftUI]
66
scheme: StreamChatSwiftUI
7+
swift_version: '6.1'

CHANGELOG.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,19 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
44
# Upcoming
55

66
### 🐞 Fixed
7-
- Fix composer not being locked after the channel was frozen [#1015](https://github.com/GetStream/stream-chat-swiftui/pull/1015)
7+
- Fix composer deleting newly entered text after deleting draft text [#1030](https://github.com/GetStream/stream-chat-swiftui/pull/1030)
88

9-
### 🔄 Changed
9+
# [4.91.0](https://github.com/GetStream/stream-chat-swiftui/releases/tag/4.91.0)
10+
_October 22, 2025_
11+
12+
### ✅ Added
13+
- Add the `makeAttachmentTextView` method to ViewFactory [#1013](https://github.com/GetStream/stream-chat-swiftui/pull/1013)
14+
- Allow dismissing commands overlay when tapping the message list [#1024](https://github.com/GetStream/stream-chat-swiftui/pull/1024)
15+
- Allows dismissing the keyboard attachments picker when tapping the message list [#1024](https://github.com/GetStream/stream-chat-swiftui/pull/1024)
16+
### 🐞 Fixed
17+
- Fix composer not being locked after the channel was frozen [#1015](https://github.com/GetStream/stream-chat-swiftui/pull/1015)
18+
- Fix `PollOptionAllVotesView` not updated on poll cast events [#1025](https://github.com/GetStream/stream-chat-swiftui/pull/1025)
19+
- Fix action sheet not showing when discarding Poll creation on iOS 26 [#1027](https://github.com/GetStream/stream-chat-swiftui/pull/1027)
1020

1121
# [4.90.0](https://github.com/GetStream/stream-chat-swiftui/releases/tag/4.90.0)
1222
_October 08, 2025_

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.90.0")
19+
.package(url: "https://github.com/GetStream/stream-chat-swift.git", from: "4.91.0")
2020
],
2121
targets: [
2222
.target(

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<p align="center">
66
<a href="https://sonarcloud.io/summary/new_code?id=GetStream_stream-chat-swiftui"><img src="https://sonarcloud.io/api/project_badges/measure?project=GetStream_stream-chat-swiftui&metric=coverage" /></a>
77

8-
<img id="stream-chat-swiftui-label" alt="StreamChatSwiftUI" src="https://img.shields.io/badge/StreamChatSwiftUI-9.57%20MB-blue"/>
8+
<img id="stream-chat-swiftui-label" alt="StreamChatSwiftUI" src="https://img.shields.io/badge/StreamChatSwiftUI-9.58%20MB-blue"/>
99
</p>
1010

1111
## SwiftUI StreamChat SDK
@@ -39,6 +39,17 @@ The SwiftUI SDK offers three types of components:
3939
- Stateful components - Offer more customization options and possibility to inject custom views. Also fairly simple to integrate, if the extension points are suitable for your chat use-case. These components come with view models.
4040
- Stateless components - These are the building blocks for the other two types of components. In order to use them, you would have to provide the state and data. Using these components only make sense if you want to implement completely custom chat experience.
4141

42+
## Documentation Generation
43+
44+
To generate the documentation for SwiftUI StreamChat SDK, run the following command:
45+
46+
```bash
47+
xcodebuild docbuild -skipMacroValidation -skipPackagePluginValidation -derivedDataPath .derivedData -scheme StreamChatSwiftUI -destination generic/platform=iOS | xcpretty
48+
open .derivedData/Build/Products/Debug-iphoneos/StreamChatSwiftUI.doccarchive
49+
```
50+
51+
This will build the documentation archive and automatically open it in Xcode.
52+
4253
## Free for Makers
4354

4455
Stream is free for most side and hobby projects. You can use Stream Chat for free if you have less than five team members and no more than $10,000 in monthly revenue.

Sources/StreamChatSwiftUI/ChatChannel/ChatChannelView.swift

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ public struct ChatChannelView<Factory: ViewFactory>: View, KeyboardReadable {
7373
},
7474
onJumpToMessage: viewModel.jumpToMessage(messageId:)
7575
)
76+
.dismissKeyboardOnTap(enabled: true) {
77+
hideComposerCommandsAndAttachmentsPicker()
78+
}
7679
.overlay(
7780
viewModel.currentDateString != nil ?
7881
factory.makeDateIndicatorView(dateString: viewModel.currentDateString!)
@@ -81,7 +84,9 @@ public struct ChatChannelView<Factory: ViewFactory>: View, KeyboardReadable {
8184
} else {
8285
ZStack {
8386
factory.makeEmptyMessagesView(for: channel, colors: colors)
84-
.dismissKeyboardOnTap(enabled: keyboardShown)
87+
.dismissKeyboardOnTap(enabled: keyboardShown) {
88+
hideComposerCommandsAndAttachmentsPicker()
89+
}
8590
if viewModel.shouldShowTypingIndicator {
8691
factory.makeTypingIndicatorBottomView(
8792
channel: channel,
@@ -183,13 +188,6 @@ public struct ChatChannelView<Factory: ViewFactory>: View, KeyboardReadable {
183188
viewModel.reactionsShown = false
184189
messageDisplayInfo = nil
185190
}
186-
.onChange(of: presentationMode.wrappedValue, perform: { newValue in
187-
if newValue.isPresented == false {
188-
viewModel.onViewDissappear()
189-
} else {
190-
viewModel.setActive()
191-
}
192-
})
193191
.background(
194192
Color(colors.background).background(
195193
TabBarAccessor { _ in
@@ -220,10 +218,13 @@ public struct ChatChannelView<Factory: ViewFactory>: View, KeyboardReadable {
220218
let bottomPadding = topVC()?.view.safeAreaInsets.bottom ?? 0
221219
return bottomPadding
222220
}
223-
}
224221

225-
extension PresentationMode: Equatable {
226-
public static func == (lhs: PresentationMode, rhs: PresentationMode) -> Bool {
227-
lhs.isPresented == rhs.isPresented
222+
private func hideComposerCommandsAndAttachmentsPicker() {
223+
NotificationCenter.default.post(
224+
name: .attachmentPickerHiddenNotification, object: nil
225+
)
226+
NotificationCenter.default.post(
227+
name: .commandsOverlayHiddenNotification, object: nil
228+
)
228229
}
229230
}

Sources/StreamChatSwiftUI/ChatChannel/Composer/MessageComposerView.swift

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import SwiftUI
99
public struct MessageComposerView<Factory: ViewFactory>: View, KeyboardReadable {
1010
@Injected(\.colors) private var colors
1111
@Injected(\.fonts) private var fonts
12+
@Injected(\.utils) private var utils
1213

1314
// Initial popup size, before the keyboard is shown.
1415
@State private var popupSize: CGFloat = 350
@@ -228,6 +229,18 @@ public struct MessageComposerView<Factory: ViewFactory>: View, KeyboardReadable
228229
viewModel.updateDraftMessage(quotedMessage: quotedMessage)
229230
}
230231
})
232+
.onReceive(NotificationCenter.default.publisher(for: .commandsOverlayHiddenNotification)) { _ in
233+
guard utils.messageListConfig.hidesCommandsOverlayOnMessageListTap else {
234+
return
235+
}
236+
viewModel.composerCommand = nil
237+
}
238+
.onReceive(NotificationCenter.default.publisher(for: .attachmentPickerHiddenNotification)) { _ in
239+
guard utils.messageListConfig.hidesAttachmentsPickersOnMessageListTap else {
240+
return
241+
}
242+
viewModel.pickerTypeState = .expanded(.none)
243+
}
231244
.accessibilityElement(children: .contain)
232245
}
233246
}
@@ -444,3 +457,13 @@ public struct ComposerInputView<Factory: ViewFactory>: View, KeyboardReadable {
444457
isInCooldown || isChannelFrozen
445458
}
446459
}
460+
461+
// MARK: - Notification Names
462+
463+
extension Notification.Name {
464+
/// Notification sent when the attachments picker should be hidden.
465+
static let attachmentPickerHiddenNotification = Notification.Name("attachmentPickerHiddenNotification")
466+
467+
/// Notification sent when the commands overlay should be hidden.
468+
static let commandsOverlayHiddenNotification = Notification.Name("commandsOverlayHiddenNotification")
469+
}

Sources/StreamChatSwiftUI/ChatChannel/Composer/MessageComposerViewModel.swift

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -908,14 +908,6 @@ extension MessageComposerViewModel: EventsControllerDelegate {
908908
fillDraftMessage()
909909
}
910910
}
911-
912-
if let event = event as? DraftDeletedEvent {
913-
let isFromSameThread = messageController?.messageId == event.threadId
914-
let isFromSameChannel = channelController.cid == event.cid && messageController == nil
915-
if isFromSameThread || isFromSameChannel {
916-
clearInputData()
917-
}
918-
}
919911
}
920912
}
921913

Sources/StreamChatSwiftUI/ChatChannel/MessageList/AsyncVoiceMessages/VoiceRecordingContainerView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public struct VoiceRecordingContainerView<Factory: ViewFactory>: View {
6767
}
6868
}
6969
if !message.text.isEmpty {
70-
AttachmentTextView(message: message)
70+
AttachmentTextView(factory: factory, message: message)
7171
.frame(maxWidth: .infinity)
7272
}
7373
}

Sources/StreamChatSwiftUI/ChatChannel/MessageList/ImageAttachmentView.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public struct ImageAttachmentContainer<Factory: ViewFactory>: View {
4747
}
4848

4949
if !message.text.isEmpty {
50-
AttachmentTextView(message: message)
50+
AttachmentTextView(factory: factory, message: message)
5151
.frame(width: width)
5252
}
5353
}
@@ -93,21 +93,23 @@ public struct ImageAttachmentContainer<Factory: ViewFactory>: View {
9393
}
9494
}
9595

96-
public struct AttachmentTextView: View {
96+
public struct AttachmentTextView<Factory: ViewFactory>: View {
9797
@Injected(\.colors) private var colors
9898
@Injected(\.fonts) private var fonts
9999

100+
var factory: Factory
100101
var message: ChatMessage
101102
let injectedBackgroundColor: UIColor?
102103

103-
public init(message: ChatMessage, injectedBackgroundColor: UIColor? = nil) {
104+
public init(factory: Factory = DefaultViewFactory.shared, message: ChatMessage, injectedBackgroundColor: UIColor? = nil) {
105+
self.factory = factory
104106
self.message = message
105107
self.injectedBackgroundColor = injectedBackgroundColor
106108
}
107109

108110
public var body: some View {
109111
HStack {
110-
StreamTextView(message: message)
112+
factory.makeAttachmentTextView(options: .init(mesage: message))
111113
.standardPadding()
112114
.fixedSize(horizontal: false, vertical: true)
113115
Spacer()

Sources/StreamChatSwiftUI/ChatChannel/MessageList/LinkAttachmentView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public struct LinkAttachmentContainer<Factory: ViewFactory>: View {
5151

5252
if #available(iOS 15, *) {
5353
HStack {
54-
StreamTextView(message: message)
54+
factory.makeAttachmentTextView(options: .init(mesage: message))
5555
.standardPadding()
5656
Spacer()
5757
}

0 commit comments

Comments
 (0)