Skip to content

Commit a9451bb

Browse files
Merge branch 'develop' into filecdn-video
2 parents 00fd3b6 + 78bf645 commit a9451bb

22 files changed

+72
-67
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
33

44
# Upcoming
55

6+
### 🔄 Changed
7+
8+
# [4.65.0](https://github.com/GetStream/stream-chat-swiftui/releases/tag/4.65.0)
9+
_October 18, 2024_
10+
611
### ✅ Added
712
- New Thread List UI Component [#621](https://github.com/GetStream/stream-chat-swiftui/pull/621)
813
- Handles marking a thread read in `ChatChannelViewModel` [#621](https://github.com/GetStream/stream-chat-swiftui/pull/621)

DemoAppSwiftUI/DemoAppSwiftUIApp.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ struct DemoAppSwiftUIApp: App {
2727
case .notLoggedIn:
2828
LoginView()
2929
case .loggedIn:
30-
TabView {
31-
channelListView()
32-
.tabItem { Label("Chat", systemImage: "message") }
33-
.badge(appState.unreadCount.channels)
34-
threadListView()
35-
.tabItem { Label("Threads", systemImage: "text.bubble") }
36-
.badge(appState.unreadCount.threads)
37-
}
30+
TabView {
31+
channelListView()
32+
.tabItem { Label("Chat", systemImage: "message") }
33+
.badge(appState.unreadCount.channels)
34+
threadListView()
35+
.tabItem { Label("Threads", systemImage: "text.bubble") }
36+
.badge(appState.unreadCount.threads)
37+
}
3838
}
3939
}
4040
.onChange(of: appState.userState) { newValue in
@@ -104,7 +104,7 @@ class AppState: ObservableObject, CurrentChatUserControllerDelegate {
104104
private init() {}
105105

106106
func currentUserController(_ controller: CurrentChatUserController, didChangeCurrentUserUnreadCount: UnreadCount) {
107-
self.unreadCount = didChangeCurrentUserUnreadCount
107+
unreadCount = didChangeCurrentUserUnreadCount
108108
let totalUnreadBadge = unreadCount.channels + unreadCount.threads
109109
if #available(iOS 16.0, *) {
110110
UNUserNotificationCenter.current().setBadgeCount(totalUnreadBadge)

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

README.md

Lines changed: 1 addition & 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-7.14%20MB-blue"/>
8+
<img id="stream-chat-swiftui-label" alt="StreamChatSwiftUI" src="https://img.shields.io/badge/StreamChatSwiftUI-7.97%20MB-blue"/>
99
</p>
1010

1111
## SwiftUI StreamChat SDK

Sources/StreamChatSwiftUI/ChatChannelList/ChatChannelListView.swift

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -81,22 +81,22 @@ public struct ChatChannelListView<Factory: ViewFactory>: View {
8181
view.navigationViewStyle(.stack)
8282
})
8383
.background(
84-
isIphone && handleTabBarVisibility ?
85-
Color.clear.background(
86-
TabBarAccessor { tabBar in
87-
self.tabBar = tabBar
88-
}
89-
)
90-
.allowsHitTesting(false)
91-
: nil
92-
)
93-
.onReceive(viewModel.$hideTabBar) { newValue in
94-
if isIphone && handleTabBarVisibility {
95-
self.setupTabBarAppeareance()
96-
self.tabBar?.isHidden = newValue
97-
}
98-
}
99-
.accessibilityIdentifier("ChatChannelListView")
84+
isIphone && handleTabBarVisibility ?
85+
Color.clear.background(
86+
TabBarAccessor { tabBar in
87+
self.tabBar = tabBar
88+
}
89+
)
90+
.allowsHitTesting(false)
91+
: nil
92+
)
93+
.onReceive(viewModel.$hideTabBar) { newValue in
94+
if isIphone && handleTabBarVisibility {
95+
self.setupTabBarAppeareance()
96+
self.tabBar?.isHidden = newValue
97+
}
98+
}
99+
.accessibilityIdentifier("ChatChannelListView")
100100
}
101101

102102
@ViewBuilder

Sources/StreamChatSwiftUI/ChatThreadList/ChatThreadList.swift

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public struct ThreadList<Factory: ViewFactory, HeaderView: View, FooterView: Vie
3535
self.factory = factory
3636
self.threads = threads
3737
self.threadDestination = threadDestination
38-
self._selectedThread = selectedThread
38+
_selectedThread = selectedThread
3939
self.onItemTap = onItemTap
4040
self.onItemAppear = onItemAppear
4141
self.headerView = headerView
@@ -49,7 +49,7 @@ public struct ThreadList<Factory: ViewFactory, HeaderView: View, FooterView: Vie
4949
factory: factory,
5050
threads: threads,
5151
threadDestination: threadDestination,
52-
selectedThread: $selectedThread,
52+
selectedThread: $selectedThread,
5353
onItemTap: onItemTap,
5454
onItemAppear: onItemAppear
5555
)
@@ -82,7 +82,7 @@ public struct ThreadsLazyVStack<Factory: ViewFactory>: View {
8282
self.threadDestination = threadDestination
8383
self.onItemTap = onItemTap
8484
self.onItemAppear = onItemAppear
85-
self._selectedThread = selectedThread
85+
_selectedThread = selectedThread
8686
}
8787

8888
public var body: some View {
@@ -93,9 +93,11 @@ public struct ThreadsLazyVStack<Factory: ViewFactory>: View {
9393
threadDestination: threadDestination,
9494
selectedThread: $selectedThread
9595
)
96-
.background(factory.makeThreadListItemBackground(
97-
thread: thread,
98-
isSelected: selectedThread?.id == thread.id)
96+
.background(
97+
factory.makeThreadListItemBackground(
98+
thread: thread,
99+
isSelected: selectedThread?.id == thread.id
100+
)
99101
)
100102
.contentShape(Rectangle())
101103
.onTapGesture {

Sources/StreamChatSwiftUI/ChatThreadList/ChatThreadListItem.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public struct ChatThreadListItemViewModel {
5151
parentMessageText = threadTitle
5252
} else {
5353
let formatter = InjectedValues[\.utils].messagePreviewFormatter
54-
parentMessageText = formatter.formatContent(for: thread.parentMessage)
54+
parentMessageText = formatter.formatContent(for: thread.parentMessage)
5555
}
5656
return L10n.Thread.Item.repliedTo(parentMessageText.trimmed)
5757
}

Sources/StreamChatSwiftUI/ChatThreadList/ChatThreadListNavigatableItem.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public struct ChatThreadListNavigatableItem<ThreadListItem: View, ThreadDestinat
2424
self.thread = thread
2525
self.threadListItem = threadListItem
2626
self.threadDestination = threadDestination
27-
self._selectedThread = selectedThread
27+
_selectedThread = selectedThread
2828
self.handleTabBarVisibility = handleTabBarVisibility
2929
}
3030

@@ -55,7 +55,7 @@ public struct ThreadSelectionInfo: Identifiable {
5555

5656
public init(thread: ChatThread) {
5757
self.thread = thread
58-
self.id = thread.id
58+
id = thread.id
5959
}
6060
}
6161

Sources/StreamChatSwiftUI/ChatThreadList/ChatThreadListView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,14 @@ public struct ChatThreadListContentView<Factory: ViewFactory>: View {
104104
ThreadList(
105105
factory: viewFactory,
106106
threads: viewModel.threads,
107-
threadDestination: viewFactory.makeThreadDestination(),
107+
threadDestination: viewFactory.makeThreadDestination(),
108108
selectedThread: $viewModel.selectedThread,
109109
onItemTap: { thread in
110110
viewModel.selectedThread = .init(thread: thread)
111111
},
112112
onItemAppear: { index in
113113
viewModel.didAppearThread(at: index)
114-
},
114+
},
115115
headerView: {
116116
viewFactory.makeThreadListHeaderView(viewModel: viewModel)
117117
},

Sources/StreamChatSwiftUI/ChatThreadList/ChatThreadListViewModel.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ open class ChatThreadListViewModel: ObservableObject, ChatThreadListControllerDe
5555
@Published public var hasNewThreads: Bool = false
5656

5757
/// The ids of the new threads available to be fetched.
58-
private var newAvailableThreadIds: Set<MessageId> = [] {
59-
didSet {
60-
newThreadsCount = newAvailableThreadIds.count
61-
hasNewThreads = newThreadsCount > 0
62-
}
63-
}
58+
private var newAvailableThreadIds: Set<MessageId> = [] {
59+
didSet {
60+
newThreadsCount = newAvailableThreadIds.count
61+
hasNewThreads = newThreadsCount > 0
62+
}
63+
}
6464

6565
/// Creates a view model for the `ChatThreadListView`.
6666
///

0 commit comments

Comments
 (0)