Skip to content

Commit b3dff04

Browse files
committed
Merge branch 'develop' into v5
2 parents b6e91d1 + 8c5eda2 commit b3dff04

File tree

117 files changed

+230
-171
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+230
-171
lines changed

.github/workflows/cron-checks.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ jobs:
2121
strategy:
2222
matrix:
2323
include:
24-
- ios: 18.3
25-
xcode: 16.3
24+
- ios: 18.5
25+
xcode: 16.4
2626
os: macos-15
2727
device: "iPhone 16 Pro"
2828
setup_runtime: false
@@ -91,14 +91,10 @@ jobs:
9191
strategy:
9292
matrix:
9393
include:
94-
- xcode: 16.3
95-
os: macos-15
96-
- xcode: 16.2
94+
- xcode: 16.4
9795
os: macos-15
9896
- xcode: 16.1
99-
os: macos-15
100-
- xcode: 16.0
101-
os: macos-15
97+
os: macos-14
10298
fail-fast: false
10399
runs-on: ${{ matrix.os }}
104100
steps:

.github/workflows/smoke-checks.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,15 @@ concurrency:
2020

2121
env:
2222
HOMEBREW_NO_INSTALL_CLEANUP: 1 # Disable cleanup for homebrew, we don't need it on CI
23-
IOS_SIMULATOR_DEVICE: "iPhone 16 Pro (18.3)"
23+
IOS_SIMULATOR_DEVICE: "iPhone 16 Pro (18.5)"
2424
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2525
GITHUB_PR_NUM: ${{ github.event.pull_request.number }}
2626

2727
jobs:
2828
build-test-app-and-frameworks:
2929
name: Build Test App and Frameworks
3030
runs-on: macos-15
31+
if: ${{ github.event.inputs.record_snapshots != 'true' }}
3132
steps:
3233
- uses: actions/checkout@v4.1.1
3334
- uses: ./.github/actions/ruby-cache

CHANGELOG.md

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

44
# Upcoming
55

6+
### 🐞 Fixed
7+
- Fix inconsistencies in gallery view displaying images and videos [927](https://github.com/GetStream/stream-chat-swiftui/pull/927)
8+
- Prevent audio messages increasing width in reply mode [#926](https://github.com/GetStream/stream-chat-swiftui/pull/926)
9+
10+
# [4.85.0](https://github.com/GetStream/stream-chat-swiftui/releases/tag/4.85.0)
11+
_August 13, 2025_
12+
13+
### ✅ Added
14+
- Add support for customizing AddUsersView [#911)(https://github.com/GetStream/stream-chat-swiftui/pull/911)
15+
16+
# [4.84.0](https://github.com/GetStream/stream-chat-swiftui/releases/tag/4.84.0)
17+
_August 07, 2025_
18+
19+
### ✅ Added
20+
- Make `AddUsersView` used by `ChatChannelInfoView` public for creating custom info views through composition [#906](https://github.com/GetStream/stream-chat-swiftui/pull/906)
21+
- Expose `ChannelAvatarViewOptions.init` [#908](https://github.com/GetStream/stream-chat-swiftui/pull/908)
622
### 🐞 Fixed
723
- Fix WebView error handling to enable mp3 attachments loading [#904](https://github.com/GetStream/stream-chat-swiftui/pull/904)
824

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

Sources/StreamChatSwiftUI/ChatChannel/ChannelInfo/AddUsersView.swift

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import StreamChat
66
import SwiftUI
77

88
/// View for the add users popup.
9-
struct AddUsersView<Factory: ViewFactory>: View {
9+
public struct AddUsersView<Factory: ViewFactory>: View {
1010
@Injected(\.fonts) private var fonts
1111
@Injected(\.colors) private var colors
1212

@@ -24,7 +24,7 @@ struct AddUsersView<Factory: ViewFactory>: View {
2424
@StateObject private var viewModel: AddUsersViewModel
2525
var onUserTap: (ChatUser) -> Void
2626

27-
init(
27+
public init(
2828
factory: Factory = DefaultViewFactory.shared,
2929
loadedUserIds: [String],
3030
onUserTap: @escaping (ChatUser) -> Void
@@ -48,7 +48,7 @@ struct AddUsersView<Factory: ViewFactory>: View {
4848
self.factory = factory
4949
}
5050

51-
var body: some View {
51+
public var body: some View {
5252
VStack {
5353
SearchBar(text: $viewModel.searchText)
5454

@@ -92,3 +92,12 @@ struct AddUsersView<Factory: ViewFactory>: View {
9292
.padding()
9393
}
9494
}
95+
96+
/// Options used in the add users view.
97+
public struct AddUsersOptions {
98+
public let loadedUsers: [ChatUser]
99+
100+
public init(loadedUsers: [ChatUser]) {
101+
self.loadedUsers = loadedUsers
102+
}
103+
}

Sources/StreamChatSwiftUI/ChatChannel/ChannelInfo/ChatChannelInfoView.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ public struct ChatChannelInfoView<Factory: ViewFactory>: View, KeyboardReadable
124124
.accessibilityAction {
125125
viewModel.addUsersShown = false
126126
}
127-
AddUsersView(
128-
factory: factory,
129-
loadedUserIds: viewModel.participants.map(\.id),
127+
128+
factory.makeAddUsersView(
129+
options: .init(loadedUsers: viewModel.participants.map(\.chatUser)),
130130
onUserTap: viewModel.addUserTapped(_:)
131131
)
132132
}

Sources/StreamChatSwiftUI/ChatChannel/ChannelInfo/MediaAttachmentsView.swift

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -54,25 +54,17 @@ public struct MediaAttachmentsView<Factory: ViewFactory>: View {
5454
ForEach(0..<viewModel.mediaItems.count, id: \.self) { mediaItemIndex in
5555
let mediaItem = viewModel.mediaItems[mediaItemIndex]
5656
ZStack {
57-
if !mediaItem.isVideo, let imageAttachment = mediaItem.imageAttachment {
58-
let index = viewModel.allImageAttachments.firstIndex { $0.id == imageAttachment.id } ?? 0
59-
ImageAttachmentContentView(
57+
if let mediaAttachment = mediaItem.mediaAttachment {
58+
let index = viewModel.allMediaAttachments.firstIndex { $0.id == mediaAttachment.id
59+
} ?? 0
60+
MediaAttachmentContentView(
6061
factory: factory,
6162
mediaItem: mediaItem,
62-
imageAttachment: imageAttachment,
63-
allImageAttachments: viewModel.allImageAttachments,
63+
mediaAttachment: mediaAttachment,
64+
allMediaAttachments: viewModel.allMediaAttachments,
6465
itemWidth: Self.itemWidth,
6566
index: index
6667
)
67-
} else if let videoAttachment = mediaItem.videoAttachment {
68-
VideoAttachmentContentView(
69-
factory: factory,
70-
attachment: videoAttachment,
71-
message: mediaItem.message,
72-
width: Self.itemWidth,
73-
ratio: 1,
74-
cornerRadius: 0
75-
)
7668
}
7769
}
7870
.overlay(
@@ -110,13 +102,13 @@ public struct MediaAttachmentsView<Factory: ViewFactory>: View {
110102
}
111103
}
112104

113-
struct ImageAttachmentContentView<Factory: ViewFactory>: View {
105+
struct MediaAttachmentContentView<Factory: ViewFactory>: View {
114106
@State private var galleryShown = false
115107

116108
let factory: Factory
117109
let mediaItem: MediaItem
118-
let imageAttachment: ChatMessageImageAttachment
119-
let allImageAttachments: [ChatMessageImageAttachment]
110+
let mediaAttachment: MediaAttachment
111+
let allMediaAttachments: [MediaAttachment]
120112
let itemWidth: CGFloat
121113
let index: Int
122114

@@ -125,7 +117,7 @@ struct ImageAttachmentContentView<Factory: ViewFactory>: View {
125117
galleryShown = true
126118
} label: {
127119
LazyLoadingImage(
128-
source: MediaAttachment(url: imageAttachment.imageURL, type: .image),
120+
source: mediaAttachment,
129121
width: itemWidth,
130122
height: itemWidth
131123
)
@@ -137,7 +129,7 @@ struct ImageAttachmentContentView<Factory: ViewFactory>: View {
137129
}
138130
.fullScreenCover(isPresented: $galleryShown) {
139131
factory.makeGalleryView(
140-
mediaAttachments: allImageAttachments.map { MediaAttachment(from: $0) },
132+
mediaAttachments: allMediaAttachments,
141133
message: mediaItem.message,
142134
isShown: $galleryShown,
143135
options: .init(selectedIndex: index)

Sources/StreamChatSwiftUI/ChatChannel/ChannelInfo/MediaAttachmentsViewModel.swift

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ class MediaAttachmentsViewModel: ObservableObject, ChatMessageSearchControllerDe
1919

2020
private var loadingNextMessages = false
2121

22-
var allImageAttachments: [ChatMessageImageAttachment] {
23-
mediaItems.compactMap(\.imageAttachment)
22+
var allMediaAttachments: [MediaAttachment] {
23+
mediaItems.compactMap(\.mediaAttachment)
2424
}
2525

2626
init(channel: ChatChannel) {
@@ -113,4 +113,13 @@ struct MediaItem: Identifiable {
113113

114114
var videoAttachment: ChatMessageVideoAttachment?
115115
var imageAttachment: ChatMessageImageAttachment?
116+
117+
var mediaAttachment: MediaAttachment? {
118+
if let videoAttachment {
119+
return MediaAttachment(url: videoAttachment.videoURL, type: .video)
120+
} else if let imageAttachment {
121+
return MediaAttachment(url: imageAttachment.imageURL, type: .image)
122+
}
123+
return nil
124+
}
116125
}

Sources/StreamChatSwiftUI/ChatChannel/Gallery/GalleryView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ public struct GalleryView<Factory: ViewFactory>: View {
127127
.foregroundColor(Color(colors.text))
128128
}
129129
.sheet(isPresented: $gridShown) {
130-
GridPhotosView(
131-
imageURLs: mediaAttachments.filter { $0.type == .image }.map(\.url),
130+
GridMediaView(
131+
attachments: mediaAttachments,
132132
isShown: $gridShown
133133
)
134134
}

Sources/StreamChatSwiftUI/ChatChannel/Gallery/GridPhotosView.swift renamed to Sources/StreamChatSwiftUI/ChatChannel/Gallery/GridMediaView.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
import StreamChat
66
import SwiftUI
77

8-
/// View used for displaying photos in a grid.
9-
struct GridPhotosView: View {
10-
var imageURLs: [URL]
8+
/// View used for displaying media in a grid.
9+
struct GridMediaView: View {
10+
var attachments: [MediaAttachment]
1111
@Binding var isShown: Bool
1212

1313
private static let spacing: CGFloat = 2
@@ -30,9 +30,9 @@ struct GridPhotosView: View {
3030
)
3131
ScrollView {
3232
LazyVGrid(columns: columns, spacing: 2) {
33-
ForEach(imageURLs, id: \.self) { url in
33+
ForEach(attachments) { attachment in
3434
LazyLoadingImage(
35-
source: MediaAttachment(url: url, type: .image),
35+
source: attachment,
3636
width: Self.itemWidth,
3737
height: Self.itemWidth
3838
)

0 commit comments

Comments
 (0)