8000 4.77.0 Release by Stream-SDK-Bot · Pull Request #803 · GetStream/stream-chat-swiftui · GitHub
[go: up one dir, main page]

Skip to content

4.77.0 Release #803

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 21 commits into from
Apr 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
ab6869c
Add support for pasting images into composer text input
anh-ngquang Feb 12, 2025
b12468a
Add snapshot postfix to v4.76.0
testableapple Mar 31, 2025
d2bc203
Merge branch 'add/allow-pasting-images-to-composer' into allow-pastin…
nuno-vieira Apr 2, 2025
72a66b9
Merge pull request #754 from anh-ngquang/allow-pasting-images-into-co…
nuno-vieira Apr 2, 2025
6e08e36
Change the solution a bit to avoid breaking changes
nuno-vieira Apr 3, 2025
85ed8f8
Update CHANGELOG.md
nuno-vieira Apr 3, 2025
2ff40f2
Merge pull request #797 from GetStream/add/allow-pasting-images-to-co…
nuno-vieira Apr 3, 2025
f72a87d
Handle canSendPoll capability when creating polls
nuno-vieira Apr 3, 2025
70ca5cd
Update CHANGELOG.md
nuno-vieira Apr 3, 2025
05abfa9
Merge pull request #798 from GetStream/add/handle-send-poll-capability
nuno-vieira Apr 4, 2025
8addc2c
Fix showing double error indicator when a message is empty and attach…
nuno-vieira Apr 4, 2025
8938fbd
Fix showing message sent indicator when message failed to send
nuno-vieira Apr 4, 2025
821c0bd
Fix show indicator on the demo app in the channel list
nuno-vieira Apr 4, 2025
0def868
Add test coverage to double error indicator fix
nuno-vieira Apr 4, 2025
5c2f9ac
Update CHANGELOG.md
nuno-vieira Apr 4, 2025
568942d
Merge pull request #799 from GetStream/fix/double-error-indicator-whe…
nuno-vieira Apr 7, 2025
c413786
Fix accessibility button shapes shown in navigation link views (#800)
nuno-vieira Apr 9, 2025
8f3f169
Added a method for configuring the channel alert type (#801)
martinmitrevski Apr 9, 2025
e57a5da
Update StreamChat dependency to 4.77.0
nuno-vieira Apr 10, 2025
76e3352
Merge pull request #802 from GetStream/ci/update-stream-chat-dependen…
nuno-vieira Apr 10, 2025
3661a78
Bump 4.77.0
Apr 10, 2025
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
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### 🔄 Changed

# [4.77.0](https://github.com/GetStream/stream-chat-swiftui/releases/tag/4.77.0)
_April 10, 2025_

### ✅ Added
- Allow pasting images to the composer [#797](https://github.com/GetStream/stream-chat-swiftui/pull/797)
- Add `ChatChannelListViewModel.setChannelAlertType` for setting the alert type [#801](https://github.com/GetStream/stream-chat-swiftui/pull/801)
### 🐞 Fixed
- Fix allowing to send Polls when the current user does not have the capability [#798](https://github.com/GetStream/stream-chat-swiftui/pull/798)
- Fix showing a double error indicator when sending attachments without any text [#799](https://github.com/GetStream/stream-chat-swiftui/pull/799)
- Fix showing read indicator when message failed to be sent [#799](https://github.com/GetStream/stream-chat-swiftui/pull/799)
- Fix not showing sending indicator when message is in sending state [#799](https://github.com/GetStream/stream-chat-swiftui/pull/799)
- Fix empty accessibility button shapes shown in navigation link views [#800](https://github.com/GetStream/stream-chat-swiftui/pull/800)

# [4.76.0](https://github.com/GetStream/stream-chat-swiftui/releases/tag/4.76.0)
_March 31, 2025_

Expand Down
2 changes: 2 additions & 0 deletions DemoAppSwiftUI/ChannelHeader/CustomChannelHeader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,15 @@ struct CustomChannelModifier: ChannelListHeaderViewModifier {
} label: {
EmptyView()
}
.opacity(0) // Fixes showing accessibility button shape

NavigationLink(isActive: $isNewChatShown) {
NewChatView(isNewChatShown: $isNewChatShown)
} label: {
EmptyView()
}
.isDetailLink(UIDevice.current.userInterfaceIdiom == .pad)
.opacity(0) // Fixes showing accessibility button shape
.alert(isPresented: $logoutAlertShown) {
Alert(
title: Text("Sign out"),
Expand Down
4 changes: 3 additions & 1 deletion DemoAppSwiftUI/PinChannelHelpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ struct DemoAppChatChannelListItem: View {
currentUserId: chatClient.currentUserId,
message: channel.latestMessages.first
),
showReadCount: false
showReadCount: false,
localState: channel.latestMessages.first?.localState
)
}
SubtitleText(text: injectedChannelInfo?.timestamp ?? channel.timestampText)
Expand Down Expand Up @@ -168,6 +169,7 @@ struct DemoAppChatChannelNavigatableListItem<ChannelDestination: View>: View {
} label: {
EmptyView()
}
.opacity(0) // Fixes showing accessibility button shape
}
}

Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ let package = Package(
)
],
dependencies: [
.package(url: "https://github.com/GetStream/stream-chat-swift.git", from: "4.76.0"),
.package(url: "https://github.com/GetStream/stream-chat-swift.git", from: "4.77.0"),
],
targets: [
.target(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ public struct ChatChannelView<Factory: ViewFactory>: View, KeyboardReadable {
} label: {
EmptyView()
}
.opacity(0) // Fixes showing accessibility button shape
}
.accentColor(colors.tintColor)
.overlay(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public struct AttachmentSourcePickerView: View {
)
.accessibilityIdentifier("attachmentPickerCamera")

if viewModel.channelController.channel?.config.pollsEnabled == true && viewModel.messageController == nil {
if viewModel.canSendPoll {
AttachmentPickerButton(
icon: images.attachmentPickerPolls,
pickerType: .polls,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import UIKit

/// SwiftUI wrapper for a text field with multiple rows.
struct ComposerTextInputView: UIViewRepresentable {

@EnvironmentObject var composerViewModel: MessageComposerViewModel
@Injected(\.utils) private var utils

@Binding var text: String
Expand All @@ -33,6 +33,9 @@ struct ComposerTextInputView: UIViewRepresentable {
inputTextView.placeholderLabel.text = placeholder
inputTextView.contentInsetAdjustmentBehavior = .never
inputTextView.setContentCompressionResistancePriority(.streamLow, for: .horizontal)
inputTextView.onImagePasted = {
composerViewModel.imagePasted($0)
}

if utils.messageListConfig.becomesFirstResponderOnOpen {
inputTextView.becomeFirstResponder()
Expand Down
10000
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ public struct ComposerInputView<Factory: ViewFactory>: View, KeyboardReadable {
maxMessageLength: maxMessageLength,
currentHeight: textFieldHeight
)
.environmentObject(viewModel)
.accessibilityIdentifier("ComposerTextInputView")
.accessibilityElement(children: .contain)
.frame(height: textFieldHeight)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,13 @@ open class MessageComposerViewModel: ObservableObject {
public var quotedMessage: Binding<ChatMessage?>?
public var waveformTargetSamples: Int = 100
public internal(set) var pendingAudioRecording: AddedVoiceRecording?


public var canSendPoll: Bool {
channelController.channel?.config.pollsEnabled == true
&& channelController.channel?.canSendPoll == true
&& messageController == nil
}

internal lazy var audioRecorder: AudioRecording = {
let audioRecorder = utils.audioRecorder
audioRecorder.subscribe(self)
Expand Down Expand Up @@ -510,6 +516,20 @@ open class MessageComposerViewModel: ObservableObject {
addedAssets = images
}

public func imagePasted(_ image: UIImage) {
guard let imageURL = try? image.saveAsJpgToTemporaryUrl() else {
log.error("Failed to write image to local temporary file")
return
}
let addedImage = AddedAsset(
image: image,
id: UUID().uuidString,
url: imageURL,
type: .image
)
addedAssets.append(addedImage)
}

public func removeAttachment(with id: String) {
if id.isURL, let url = URL(string: id) {
var urls = [URL]()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ public struct MessageContainerView<Factory: ViewFactory>: View {
)
: nil

(message.localState == .sendingFailed || message.isBounced) ? SendFailureIndicator() : nil
((message.localState == .sendingFailed || message.isBounced) && !message.text.isEmpty) ?
SendFailureIndicator() : nil
}
)
.background(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ public struct MessageReadIndicatorView: View {
.customizable()
.foregroundColor(!readUsers.isEmpty ? colors.tintColor : Color(colors.textLowEmphasis))
.frame(height: 16)
.opacity(localState == .sendingFailed ? 0.0 : 1)
.accessibilityLabel(
Text(
readUsers.isEmpty ? L10n.Message.ReadStatus.seenByNoOne : L10n.Message.ReadStatus.seenByOthers
Expand All @@ -136,7 +137,12 @@ public struct MessageReadIndicatorView: View {
}

private var image: UIImage {
!readUsers.isEmpty ? images.readByAll : (localState == .pendingSend ? images.messageReceiptSending : images.messageSent)
!readUsers.isEmpty ? images.readByAll : (isMessageSending ? images.messageReceiptSending : images.messageSent)
}

private var isMessageSending: Bool {
localState == .sending
|| localState == .pendingSend
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ open class ChatChannelListViewModel: ObservableObject, ChatChannelListController
}

public func onDeleteTapped(channel: ChatChannel) {
channelAlertType = .deleteChannel(channel)
setChannelAlertType(.deleteChannel(channel))
}

public func onMoreTapped(channel: ChatChannel) {
Expand All @@ -217,13 +217,17 @@ open class ChatChannelListViewModel: ObservableObject, ChatChannelListController
controller.deleteChannel { [weak self] error in
if error != nil {
// handle error
self?.channelAlertType = .error
self?.setChannelAlertType(.error)
}
}
}

open func showErrorPopup(_ error: Error?) {
channelAlertType = .error
setChannelAlertType(.error)
}

open func setChannelAlertType(_ channelAlertType: ChannelAlertType) {
self.channelAlertType = channelAlertType
}

// MARK: - ChatChannelListControllerDelegate
Expand Down Expand Up @@ -328,7 +332,7 @@ open class ChatChannelListViewModel: ObservableObject, ChatChannelListController
self.loading = false
if error != nil {
// handle error
self.channelAlertType = .error
self.setChannelAlertType(.error)
} else {
// access channels
self.updateChannels()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public struct ChatChannelNavigatableListItem<Factory: ViewFactory, ChannelDestin
} label: {
EmptyView()
}
.opacity(0) // Fixes showing accessibility button shape
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ struct SearchResultView<Factory: ViewFactory>: View {
} label: {
EmptyView()
}
.opacity(0) // Fixes showing accessibility button shape
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public struct ChatThreadListNavigatableItem<ThreadListItem: View, ThreadDestinat
} label: {
EmptyView()
}
.opacity(0) // Fixes showing accessibility button shape
}
.foregroundColor(.black)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ import Foundation

enum SystemEnvironment {
/// A Stream Chat version.
public static let version: String = "4.76.0"
public static let version: String = "4.77.0"
}
2 changes: 1 addition & 1 deletion Sources/StreamChatSwiftUI/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundl 10000 ePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>4.76.0</string>
<string>4.77.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPhotoLibraryUsageDescription</key>
Expand Down
15 changes: 15 additions & 0 deletions Sources/StreamChatSwiftUI/Utils/Common/InputTextView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ class InputTextView: UITextView, AccessibilityView {
}
}
}

var onImagePasted: ((UIImage) -> Void)?

override open func didMoveToSuperview() {
super.didMoveToSuperview()
Expand Down Expand Up @@ -143,9 +145,22 @@ class InputTextView: UITextView, AccessibilityView {

override open func paste(_ sender: Any?) {
super.paste(sender)
if let pastedImage = UIPasteboard.general.image,
let onImagePasted {
onImagePasted(pastedImage)
return
}
handleTextChange()
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) { [weak self] in
self?.scrollToBottom()
}
}

override func canPerformAction(_ action: Selector, withSender sender: Any?) -> Bool {
if action == #selector(paste(_:)) && onImagePasted != nil && UIPasteboard.general.image != nil {
return true
} else {
return super.canPerformAction(action, withSender: sender)
}
}
}
4 changes: 2 additions & 2 deletions StreamChatSwiftUI-XCFramework.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = 'StreamChatSwiftUI-XCFramework'
spec.version = '4.76.0'
spec.version = '4.77.0'
spec.summary = 'StreamChat SwiftUI Chat Components'
spec.description = 'StreamChatSwiftUI SDK offers flexible SwiftUI components able to display data provided by StreamChat SDK.'

Expand All @@ -19,7 +19,7 @@ Pod::Spec.new do |spec|

spec.framework = 'Foundation', 'UIKit', 'SwiftUI'

spec.dependency 'StreamChat-XCFramework', '~> 4.76.0'
spec.dependency 'StreamChat-XCFramework', '~> 4.77.0'

spec.cocoapods_version = '>= 1.11.0'
end
4 changes: 2 additions & 2 deletions StreamChatSwiftUI.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = 'StreamChatSwiftUI'
spec.version = '4.76.0'
spec.version = '4.77.0'
spec.summary = 'StreamChat SwiftUI Chat Components'
spec.description = 'StreamChatSwiftUI SDK offers flexible SwiftUI components able to display data provided by StreamChat SDK.'

Expand All @@ -19,5 +19,5 @@ Pod::Spec.new do |spec|

spec.framework = 'Foundation', 'UIKit', 'SwiftUI'

spec.dependency 'StreamChat', '~> 4.76.0'
spec.dependency 'StreamChat', '~> 4.77.0'
end
2 changes: 1 addition & 1 deletion StreamChatSwiftUI.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3880,7 +3880,7 @@
repositoryURL = "https://github.com/GetStream/stream-chat-swift.git";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 4.76.0;
minimumVersion = 4.77.0;
};
};
E3A1C01A282BAC66002D1E26 /* XCRemoteSwiftPackageReference "sentry-cocoa" */ = {
Expand Down
Loading
Loading
0