Skip to content

Commit

Permalink
Merge branch 'develop' into filecdn-video
Browse files Browse the repository at this point in the history
  • Loading branch information
martinmitrevski authored Oct 21, 2024
2 parents 00fd3b6 + 78bf645 commit a9451bb
Show file tree
Hide file tree
Showing 22 changed files with 72 additions and 67 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

# Upcoming

### 🔄 Changed

# [4.65.0](https://github.com/GetStream/stream-chat-swiftui/releases/tag/4.65.0)
_October 18, 2024_

### ✅ Added
- New Thread List UI Component [#621](https://github.com/GetStream/stream-chat-swiftui/pull/621)
- Handles marking a thread read in `ChatChannelViewModel` [#621](https://github.com/GetStream/stream-chat-swiftui/pull/621)
Expand Down
18 changes: 9 additions & 9 deletions DemoAppSwiftUI/DemoAppSwiftUIApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ struct DemoAppSwiftUIApp: App {
case .notLoggedIn:
LoginView()
case .loggedIn:
TabView {
channelListView()
.tabItem { Label("Chat", systemImage: "message") }
.badge(appState.unreadCount.channels)
threadListView()
.tabItem { Label("Threads", systemImage: "text.bubble") }
.badge(appState.unreadCount.threads)
}
TabView {
channelListView()
.tabItem { Label("Chat", systemImage: "message") }
.badge(appState.unreadCount.channels)
threadListView()
.tabItem { Label("Threads", systemImage: "text.bubble") }
.badge(appState.unreadCount.threads)
}
}
}
.onChange(of: appState.userState) { newValue in
Expand Down Expand Up @@ -104,7 +104,7 @@ class AppState: ObservableObject, CurrentChatUserControllerDelegate {
private init() {}

func currentUserController(_ controller: CurrentChatUserController, didChangeCurrentUserUnreadCount: UnreadCount) {
self.unreadCount = didChangeCurrentUserUnreadCount
unreadCount = didChangeCurrentUserUnreadCount
let totalUnreadBadge = unreadCount.channels + unreadCount.threads
if #available(iOS 16.0, *) {
UNUserNotificationCenter.current().setBadgeCount(totalUnreadBadge)
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.64.0"),
.package(url: "https://github.com/GetStream/stream-chat-swift.git", from: "4.65.0"),
],
targets: [
.target(
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<p align="center">
<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>

<img id="stream-chat-swiftui-label" alt="StreamChatSwiftUI" src="https://img.shields.io/badge/StreamChatSwiftUI-7.14%20MB-blue"/>
<img id="stream-chat-swiftui-label" alt="StreamChatSwiftUI" src="https://img.shields.io/badge/StreamChatSwiftUI-7.97%20MB-blue"/>
</p>

## SwiftUI StreamChat SDK
Expand Down
32 changes: 16 additions & 16 deletions Sources/StreamChatSwiftUI/ChatChannelList/ChatChannelListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,22 +81,22 @@ public struct ChatChannelListView<Factory: ViewFactory>: View {
view.navigationViewStyle(.stack)
})
.background(
isIphone && handleTabBarVisibility ?
Color.clear.background(
TabBarAccessor { tabBar in
self.tabBar = tabBar
}
)
.allowsHitTesting(false)
: nil
)
.onReceive(viewModel.$hideTabBar) { newValue in
if isIphone && handleTabBarVisibility {
self.setupTabBarAppeareance()
self.tabBar?.isHidden = newValue
}
}
.accessibilityIdentifier("ChatChannelListView")
isIphone && handleTabBarVisibility ?
Color.clear.background(
TabBarAccessor { tabBar in
self.tabBar = tabBar
}
)
.allowsHitTesting(false)
: nil
)
.onReceive(viewModel.$hideTabBar) { newValue in
if isIphone && handleTabBarVisibility {
self.setupTabBarAppeareance()
self.tabBar?.isHidden = newValue
}
}
.accessibilityIdentifier("ChatChannelListView")
}

@ViewBuilder
Expand Down
14 changes: 8 additions & 6 deletions Sources/StreamChatSwiftUI/ChatThreadList/ChatThreadList.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public struct ThreadList<Factory: ViewFactory, HeaderView: View, FooterView: Vie
self.factory = factory
self.threads = threads
self.threadDestination = threadDestination
self._selectedThread = selectedThread
_selectedThread = selectedThread
self.onItemTap = onItemTap
self.onItemAppear = onItemAppear
self.headerView = headerView
Expand All @@ -49,7 +49,7 @@ public struct ThreadList<Factory: ViewFactory, HeaderView: View, FooterView: Vie
factory: factory,
threads: threads,
threadDestination: threadDestination,
selectedThread: $selectedThread,
selectedThread: $selectedThread,
onItemTap: onItemTap,
onItemAppear: onItemAppear
)
Expand Down Expand Up @@ -82,7 +82,7 @@ public struct ThreadsLazyVStack<Factory: ViewFactory>: View {
self.threadDestination = threadDestination
self.onItemTap = onItemTap
self.onItemAppear = onItemAppear
self._selectedThread = selectedThread
_selectedThread = selectedThread
}

public var body: some View {
Expand All @@ -93,9 +93,11 @@ public struct ThreadsLazyVStack<Factory: ViewFactory>: View {
threadDestination: threadDestination,
selectedThread: $selectedThread
)
.background(factory.makeThreadListItemBackground(
thread: thread,
isSelected: selectedThread?.id == thread.id)
.background(
factory.makeThreadListItemBackground(
thread: thread,
isSelected: selectedThread?.id == thread.id
)
)
.contentShape(Rectangle())
.onTapGesture {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public struct ChatThreadListItemViewModel {
parentMessageText = threadTitle
} else {
let formatter = InjectedValues[\.utils].messagePreviewFormatter
parentMessageText = formatter.formatContent(for: thread.parentMessage)
parentMessageText = formatter.formatContent(for: thread.parentMessage)
}
return L10n.Thread.Item.repliedTo(parentMessageText.trimmed)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public struct ChatThreadListNavigatableItem<ThreadListItem: View, ThreadDestinat
self.thread = thread
self.threadListItem = threadListItem
self.threadDestination = threadDestination
self._selectedThread = selectedThread
_selectedThread = selectedThread
self.handleTabBarVisibility = handleTabBarVisibility
}

Expand Down Expand Up @@ -55,7 +55,7 @@ public struct ThreadSelectionInfo: Identifiable {

public init(thread: ChatThread) {
self.thread = thread
self.id = thread.id
id = thread.id
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,14 @@ public struct ChatThreadListContentView<Factory: ViewFactory>: View {
ThreadList(
factory: viewFactory,
threads: viewModel.threads,
threadDestination: viewFactory.makeThreadDestination(),
threadDestination: viewFactory.makeThreadDestination(),
selectedThread: $viewModel.selectedThread,
onItemTap: { thread in
viewModel.selectedThread = .init(thread: thread)
},
onItemAppear: { index in
viewModel.didAppearThread(at: index)
},
},
headerView: {
viewFactory.makeThreadListHeaderView(viewModel: viewModel)
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ open class ChatThreadListViewModel: ObservableObject, ChatThreadListControllerDe
@Published public var hasNewThreads: Bool = false

/// The ids of the new threads available to be fetched.
private var newAvailableThreadIds: Set<MessageId> = [] {
didSet {
newThreadsCount = newAvailableThreadIds.count
hasNewThreads = newThreadsCount > 0
}
}
private var newAvailableThreadIds: Set<MessageId> = [] {
didSet {
newThreadsCount = newAvailableThreadIds.count
hasNewThreads = newThreadsCount > 0
}
}

/// Creates a view model for the `ChatThreadListView`.
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import SwiftUI
/// Default SDK implementation for the view displayed when there are no threads available.
public struct NoThreadsView: View {

public init () {}
public init() {}

public var body: some View {
NoContentView(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ extension View {
}
}


struct FloatingBannerViewModifier<BannerView: View>: ViewModifier {
let alignment: Alignment
var isPresented: Bool
Expand Down
5 changes: 2 additions & 3 deletions Sources/StreamChatSwiftUI/CommonViews/Shimmer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ struct Shimmer: ViewModifier {
)
.animation(
.linear(duration: duration)
.delay(delay)
.repeatForever(autoreverses: false),
.delay(delay)
.repeatForever(autoreverses: false),
value: isInitialState
)
.onAppear {
Expand All @@ -33,7 +33,6 @@ struct Shimmer: ViewModifier {
}
}


extension View {
/// Adds an animated shimmering effect to any view, typically to show that
/// an operation is in progress.
Expand Down
1 change: 1 addition & 0 deletions Sources/StreamChatSwiftUI/DefaultViewFactory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ extension ViewFactory {
)
}
}

public func makeMessageListModifier() -> some ViewModifier {
EmptyViewModifier()
}
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.64.0"
public static let version: String = "4.65.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.64.0</string>
<string>4.65.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.64.0'
spec.version = '4.65.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.64.0'
spec.dependency 'StreamChat-XCFramework', '~> 4.65.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.64.0'
spec.version = '4.65.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.64.0'
spec.dependency 'StreamChat', '~> 4.65.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.64.0;
minimumVersion = 4.65.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.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"}
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ class ChatThreadListViewModel_Tests: StreamChatTestCase {
viewModel.eventsController(
eventController,
didReceiveEvent: ThreadMessageNewEvent(
message: .mock(parentMessageId: .unique),
message: .mock(parentMessageId: .unique),
channel: .mock(cid: .unique),
unreadCount: .noUnread,
createdAt: .unique
Expand Down
Loading

0 comments on commit a9451bb

Please sign in to comment.