Skip to content
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

4.68.0 Release #674

Merged
merged 8 commits into from
Dec 3, 2024
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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### 🔄 Changed

# [4.68.0](https://github.com/GetStream/stream-chat-swiftui/releases/tag/4.68.0)
_December 03, 2024_

### 🐞 Fixed
- Fix showing giphy message in the channel list [#669](https://github.com/GetStream/stream-chat-swiftui/pull/669)
- Fix message list scroll not working when drag gestured is initiated from a message [#671](https://github.com/GetStream/stream-chat-swiftui/pull/671)

# [4.67.0](https://github.com/GetStream/stream-chat-swiftui/releases/tag/4.67.0)
_November 25, 2024_

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,11 @@ public struct MessageContainerView<Factory: ViewFactory>: View {
handleGestureForMessage(showsMessageActions: true)
}
}
.highPriorityGesture(
LongPressGesture()
.onEnded { _ in
if !message.isDeleted {
handleGestureForMessage(showsMessageActions: true)
}
}
)
.onLongPressGesture(perform: {
if !message.isDeleted {
handleGestureForMessage(showsMessageActions: true)
}
})
.offset(x: min(self.offsetX, maximumHorizontalSwipeDisplacement))
.simultaneousGesture(
DragGesture(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,12 @@ public struct InjectedChannelInfo {

extension ChatChannel {

public var previewMessageText: String? {
guard let previewMessage else { return nil }
let messageFormatter = InjectedValues[\.utils].messagePreviewFormatter
return messageFormatter.format(previewMessage)
}

public var lastMessageText: String? {
guard let latestMessage = latestMessages.first else { return nil }
let messageFormatter = InjectedValues[\.utils].messagePreviewFormatter
Expand All @@ -293,8 +299,8 @@ extension ChatChannel {
return L10n.Channel.Item.muted
} else if shouldShowTypingIndicator {
return typingIndicatorString(currentUserId: InjectedValues[\.chatClient].currentUserId)
} else if let lastMessageText = lastMessageText {
return lastMessageText
} else if let previewMessageText {
return previewMessageText
} else {
return L10n.Channel.Item.emptyMessages
}
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.67.0"
public static let version: String = "4.68.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>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>4.67.0</string>
<string>4.68.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPhotoLibraryUsageDescription</key>
Expand Down
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.67.0'
spec.version = '4.68.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.67.0'
spec.dependency 'StreamChat-XCFramework', '~> 4.68.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.67.0'
spec.version = '4.68.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.67.0'
spec.dependency 'StreamChat', '~> 4.68.0'
end
2 changes: 1 addition & 1 deletion StreamChatSwiftUI.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3821,7 +3821,7 @@
repositoryURL = "https://github.com/GetStream/stream-chat-swift.git";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 4.67.0;
minimumVersion = 4.68.0;
};
};
E3A1C01A282BAC66002D1E26 /* XCRemoteSwiftPackageReference "sentry-cocoa" */ = {
Expand Down
2 changes: 1 addition & 1 deletion StreamChatSwiftUIArtifacts.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"4.40.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.40.0/StreamChatSwiftUI.zip","4.41.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.41.0/StreamChatSwiftUI.zip","4.42.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.42.0/StreamChatSwiftUI.zip","4.43.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.43.0/StreamChatSwiftUI.zip","4.44.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.44.0/StreamChatSwiftUI.zip","4.45.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.45.0/StreamChatSwiftUI.zip","4.46.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.46.0/StreamChatSwiftUI.zip","4.47.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.47.0/StreamChatSwiftUI.zip","4.47.1":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.47.1/StreamChatSwiftUI.zip","4.48.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.48.0/StreamChatSwiftUI.zip","4.49.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.49.0/StreamChatSwiftUI.zip","4.50.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.50.0/StreamChatSwiftUI.zip","4.50.1":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.50.1/StreamChatSwiftUI.zip","4.51.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.51.0/StreamChatSwiftUI.zip","4.52.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.52.0/StreamChatSwiftUI.zip","4.53.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.53.0/StreamChatSwiftUI.zip","4.54.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.54.0/StreamChatSwiftUI.zip","4.55.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.55.0/StreamChatSwiftUI.zip","4.56.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.56.0/StreamChatSwiftUI.zip","4.57.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.57.0/StreamChatSwiftUI.zip","4.58.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.58.0/StreamChatSwiftUI.zip","4.59.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.59.0/StreamChatSwiftUI.zip","4.60.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.60.0/StreamChatSwiftUI.zip","4.61.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.61.0/StreamChatSwiftUI.zip","4.62.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.62.0/StreamChatSwiftUI.zip","4.63.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.63.0/StreamChatSwiftUI.zip","4.64.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.64.0/StreamChatSwiftUI.zip","4.65.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.65.0/StreamChatSwiftUI.zip","4.66.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.66.0/StreamChatSwiftUI.zip","4.67.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.67.0/StreamChatSwiftUI.zip"}
{"4.40.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.40.0/StreamChatSwiftUI.zip","4.41.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.41.0/StreamChatSwiftUI.zip","4.42.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.42.0/StreamChatSwiftUI.zip","4.43.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.43.0/StreamChatSwiftUI.zip","4.44.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.44.0/StreamChatSwiftUI.zip","4.45.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.45.0/StreamChatSwiftUI.zip","4.46.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.46.0/StreamChatSwiftUI.zip","4.47.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.47.0/StreamChatSwiftUI.zip","4.47.1":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.47.1/StreamChatSwiftUI.zip","4.48.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.48.0/StreamChatSwiftUI.zip","4.49.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.49.0/StreamChatSwiftUI.zip","4.50.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.50.0/StreamChatSwiftUI.zip","4.50.1":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.50.1/StreamChatSwiftUI.zip","4.51.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.51.0/StreamChatSwiftUI.zip","4.52.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.52.0/StreamChatSwiftUI.zip","4.53.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.53.0/StreamChatSwiftUI.zip","4.54.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.54.0/StreamChatSwiftUI.zip","4.55.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.55.0/StreamChatSwiftUI.zip","4.56.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.56.0/StreamChatSwiftUI.zip","4.57.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.57.0/StreamChatSwiftUI.zip","4.58.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.58.0/StreamChatSwiftUI.zip","4.59.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.59.0/StreamChatSwiftUI.zip","4.60.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.60.0/StreamChatSwiftUI.zip","4.61.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.61.0/StreamChatSwiftUI.zip","4.62.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.62.0/StreamChatSwiftUI.zip","4.63.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.63.0/StreamChatSwiftUI.zip","4.64.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.64.0/StreamChatSwiftUI.zip","4.65.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.65.0/StreamChatSwiftUI.zip","4.66.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.66.0/StreamChatSwiftUI.zip","4.67.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.67.0/StreamChatSwiftUI.zip","4.68.0":"https://github.com/GetStream/stream-chat-swiftui/releases/download/4.68.0/StreamChatSwiftUI.zip"}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import Combine
@testable import StreamChat
@testable import StreamChatSwiftUI
@testable import StreamChatTestTools
import XCTest

class AddUsersViewModel_Tests: StreamChatTestCase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
@testable import SnapshotTesting
@testable import StreamChat
@testable import StreamChatSwiftUI
@testable import StreamChatTestTools
import StreamSwiftTestHelpers
import SwiftUI
import XCTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import Combine
@testable import StreamChat
@testable import StreamChatSwiftUI
@testable import StreamChatTestTools
import XCTest

class FileAttachmentsViewModel_Tests: StreamChatTestCase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
@testable import SnapshotTesting
@testable import StreamChat
@testable import StreamChatSwiftUI
@testable import StreamChatTestTools
import StreamSwiftTestHelpers
import SwiftUI
import XCTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import Combine
@testable import StreamChat
@testable import StreamChatSwiftUI
@testable import StreamChatTestTools
import XCTest

class MediaAttachmentsViewModel_Tests: StreamChatTestCase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
@testable import SnapshotTesting
@testable import StreamChat
@testable import StreamChatSwiftUI
@testable import StreamChatTestTools
import StreamSwiftTestHelpers
import SwiftUI
import XCTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import SnapshotTesting
@testable import StreamChat
@testable import StreamChatSwiftUI
@testable import StreamChatTestTools
import SwiftUI
import XCTest

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

@testable import StreamChat
@testable import StreamChatSwiftUI
@testable import StreamChatTestTools
import XCTest

class ChatChannelTestHelpers {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
@testable import SnapshotTesting
@testable import StreamChat
@testable import StreamChatSwiftUI
@testable import StreamChatTestTools
import StreamSwiftTestHelpers
import SwiftUI
import XCTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

@testable import StreamChat
@testable import StreamChatSwiftUI
@testable import StreamChatTestTools
import SwiftUI
import XCTest

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
@testable import SnapshotTesting
@testable import StreamChat
@testable import StreamChatSwiftUI
@testable import StreamChatTestTools
import StreamSwiftTestHelpers
import SwiftUI
import XCTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

@testable import StreamChat
@testable import StreamChatSwiftUI
@testable import StreamChatTestTools
import XCTest

class ChatMessage_AdjustedText_Tests: StreamChatTestCase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Photos
import SnapshotTesting
@testable import StreamChat
@testable import StreamChatSwiftUI
@testable import StreamChatTestTools
import StreamSwiftTestHelpers
import SwiftUI
import XCTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import SnapshotTesting
@testable import StreamChat
@testable import StreamChatSwiftUI
@testable import StreamChatTestTools
import StreamSwiftTestHelpers
import SwiftUI
import XCTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Combine
import Foundation
import StreamChat
import StreamChatSwiftUI
@testable import StreamChatTestTools
import SwiftUI

/// Test commands configuration.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ final class ChatChannelListItemView_Tests: StreamChatTestCase {
func test_channelListItem_audioMessage() throws {
// Given
let message = try mockAudioMessage(text: "Audio", isSentByCurrentUser: true)
let channel = ChatChannel.mock(cid: .unique, latestMessages: [message])
let channel = ChatChannel.mock(cid: .unique, latestMessages: [message], previewMessage: message)

// When
let view = ChatChannelListItem(
Expand All @@ -42,7 +42,7 @@ final class ChatChannelListItemView_Tests: StreamChatTestCase {
func test_channelListItem_imageMessage() throws {
// Given
let message = try mockImageMessage(text: "Image", isSentByCurrentUser: true)
let channel = ChatChannel.mock(cid: .unique, latestMessages: [message])
let channel = ChatChannel.mock(cid: .unique, latestMessages: [message], previewMessage: message)

// When
let view = ChatChannelListItem(
Expand All @@ -61,7 +61,7 @@ final class ChatChannelListItemView_Tests: StreamChatTestCase {
func test_channelListItem_videoMessage() throws {
// Given
let message = try mockVideoMessage(text: "Video", isSentByCurrentUser: true)
let channel = ChatChannel.mock(cid: .unique, latestMessages: [message])
let channel = ChatChannel.mock(cid: .unique, latestMessages: [message], previewMessage: message)

// When
let view = ChatChannelListItem(
Expand All @@ -80,7 +80,7 @@ final class ChatChannelListItemView_Tests: StreamChatTestCase {
func test_channelListItem_fileMessage() throws {
// Given
let message = try mockFileMessage(title: "Filename", text: "File", isSentByCurrentUser: true)
let channel = ChatChannel.mock(cid: .unique, latestMessages: [message])
let channel = ChatChannel.mock(cid: .unique, latestMessages: [message], previewMessage: message)

// When
let view = ChatChannelListItem(
Expand All @@ -96,10 +96,11 @@ final class ChatChannelListItemView_Tests: StreamChatTestCase {
assertSnapshot(matching: view, as: .image(perceptualPrecision: precision))
}

func test_channelListItem_giphyMessage() throws {
func test_channelListItem_giphyMessageLatestButPreviewIsAnotherMessage() throws {
// Given
let message = try mockGiphyMessage(text: "Giphy", isSentByCurrentUser: true)
let channel = ChatChannel.mock(cid: .unique, latestMessages: [message])
let previewMessage = try mockImageMessage(text: "Hi!", isSentByCurrentUser: true)
let latestMessage = try mockGiphyMessage(text: "Giphy", isSentByCurrentUser: true)
let channel = ChatChannel.mock(cid: .unique, latestMessages: [latestMessage], previewMessage: previewMessage)

// When
let view = ChatChannelListItem(
Expand All @@ -118,7 +119,7 @@ final class ChatChannelListItemView_Tests: StreamChatTestCase {
func test_channelListItem_pollMessage_youCreated() throws {
// Given
let message = try mockPollMessage(isSentByCurrentUser: true)
let channel = ChatChannel.mock(cid: .unique, latestMessages: [message])
let channel = ChatChannel.mock(cid: .unique, latestMessages: [message], previewMessage: message)

// When
let view = ChatChannelListItem(
Expand All @@ -137,7 +138,7 @@ final class ChatChannelListItemView_Tests: StreamChatTestCase {
func test_channelListItem_pollMessage_someoneCreated() throws {
// Given
let message = try mockPollMessage(isSentByCurrentUser: false)
let channel = ChatChannel.mock(cid: .unique, latestMessages: [message])
let channel = ChatChannel.mock(cid: .unique, latestMessages: [message], previewMessage: message)

// When
let view = ChatChannelListItem(
Expand All @@ -161,7 +162,7 @@ final class ChatChannelListItemView_Tests: StreamChatTestCase {
.unique,
.unique
])
let channel = ChatChannel.mock(cid: .unique, membership: .mock(id: currentUserId), latestMessages: [message])
let channel = ChatChannel.mock(cid: .unique, membership: .mock(id: currentUserId), previewMessage: message)

// When
let view = ChatChannelListItem(
Expand All @@ -185,7 +186,7 @@ final class ChatChannelListItemView_Tests: StreamChatTestCase {
.unique,
.mock(pollId: .unique, optionId: .unique, user: .mock(id: currentUserId))
])
let channel = ChatChannel.mock(cid: .unique, membership: .mock(id: currentUserId), latestMessages: [message])
let channel = ChatChannel.mock(cid: .unique, membership: .mock(id: currentUserId), previewMessage: message)

// When
let view = ChatChannelListItem(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import SnapshotTesting
@testable import StreamChat
@testable import StreamChatSwiftUI
@testable import StreamChatTestTools
import StreamSwiftTestHelpers
import SwiftUI
import XCTest
Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ lane :swiftui_testflight_build do
sdk_target: 'StreamChatSwiftUI',
app_target: 'DemoAppSwiftUI',
app_identifier: 'io.getstream.iOS.DemoAppSwiftUI',
app_version: last_git_tag
app_version: File.read(swift_environment_path).match(/String\s+=\s+"([\d.]+)"/)[1]
)
end

Expand Down
Loading