Skip to content
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
3 changes: 3 additions & 0 deletions .github/workflows/smoke-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ jobs:
steps:
- uses: actions/[email protected]
- uses: ./.github/actions/bootstrap
env:
INSTALL_INTERFACE_ANALYZER: true
- run: bundle exec fastlane validate_public_interface
- run: bundle exec fastlane lint_pr
- run: bundle exec fastlane rubocop
- run: bundle exec fastlane run_swift_format strict:true
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ StreamChatSwiftUI.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.res
build/
DerivedData/

# Interface Analyser
stream-module-interface-analyser/
interface-analyser-report.md
public_interface_current.*
public_interface_previous.*

## Various settings
*.pbxuser
!default.pbxuser
Expand Down
3 changes: 3 additions & 0 deletions .swiftformat
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@
--wraparguments before-first
--wrapparameters before-first
--wrapcollections before-first

# Exclude paths
--exclude Sources/StreamChatSwiftUI/Generated,Sources/StreamChatSwiftUI/StreamSwiftyGif,Sources/StreamChatSwiftUI/StreamNuke
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,23 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### πŸ”„ Changed

# [4.83.0](https://github.com/GetStream/stream-chat-swiftui/releases/tag/4.83.0)
_July 29, 2025_

### βœ… Added
- Add support for showing current poll comment on alert [#891](https://github.com/GetStream/stream-chat-swiftui/pull/891)

### 🐞 Fixed
- Fix polls multiple answers minimum value being 1 instead of 2 [#898](https://github.com/GetStream/stream-chat-swiftui/pull/898)

### πŸ”„ Changed
- Make `ChatChannelInfoView` subviews public for creating custom info views through composition [#892](https://github.com/GetStream/stream-chat-swiftui/pull/892)
- `ChannelTitleView`
- `ChannelInfoDivider`
- `ChatInfoDirectChannelView`
- `ChatInfoParticipantsView`
- Make `MediaViewsOptions` initializer public [#899](https://github.com/GetStream/stream-chat-swiftui/pull/899)

# [4.82.0](https://github.com/GetStream/stream-chat-swiftui/releases/tag/4.82.0)
_July 16, 2025_

Expand Down
6 changes: 0 additions & 6 deletions DemoAppSwiftUI/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Copyright Β© 2025 Stream.io Inc. All rights reserved.
//

import Network
import Sentry
import StreamChat
import StreamChatSwiftUI
Expand All @@ -25,11 +24,6 @@ class AppDelegate: NSObject, UIApplicationDelegate {
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
) -> Bool {
// Xcode 26 beta workaround
if #available(iOS 26.0, *) {
nw_tls_create_options()
}

/*
//Customizations, uncomment to customize.
var colors = ColorPalette()
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ GEM
netrc (0.11.0)
nio4r (2.7.4)
nkf (0.2.0)
nokogiri (1.18.8)
nokogiri (1.18.9)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
octokit (10.0.0)
Expand Down
1 change: 1 addition & 0 deletions Githubfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ export YEETD_VERSION='1.0'
export MINT_VERSION='0.17.5'
export SONAR_VERSION='6.2.1.4610'
export IPSW_VERSION='3.1.592'
export INTERFACE_ANALYZER_VERSION='1.0.7'
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.82.0"),
.package(url: "https://github.com/GetStream/stream-chat-swift.git", from: "4.83.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-9.2%20MB-blue"/>
<img id="stream-chat-swiftui-label" alt="StreamChatSwiftUI" src="https://img.shields.io/badge/StreamChatSwiftUI-9.22%20MB-blue"/>
</p>

## SwiftUI StreamChat SDK
Expand Down
8 changes: 8 additions & 0 deletions Scripts/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,11 @@ if [[ ${INSTALL_IPSW-default} == true ]]; then
chmod +x ipsw
sudo mv ipsw /usr/local/bin/
fi

if [[ ${INSTALL_INTERFACE_ANALYZER-default} == true ]]; then
puts "Install interface-analyser v${INTERFACE_ANALYZER_VERSION}"
FILE="interface-analyser"
wget "https://github.com/GetStream/stream-module-interface-analyser/releases/download/v${INTERFACE_ANALYZER_VERSION}/${FILE}"
chmod +x ${FILE}
sudo mv ${FILE} /usr/local/bin/
fi
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,20 @@ public struct DefaultChannelHeaderModifier<Factory: ViewFactory>: ChatChannelHea
}
}

struct ChannelTitleView: View {
public struct ChannelTitleView: View {
@Injected(\.fonts) private var fonts
@Injected(\.utils) private var utils
@Injected(\.colors) private var colors
@Injected(\.chatClient) private var chatClient

var channel: ChatChannel
var shouldShowTypingIndicator: Bool
let channel: ChatChannel
let shouldShowTypingIndicator: Bool

public init(channel: ChatChannel, shouldShowTypingIndicator: Bool) {
self.channel = channel
self.shouldShowTypingIndicator = shouldShowTypingIndicator
}

private var currentUserId: String {
chatClient.currentUserId ?? ""
}
Expand All @@ -136,7 +141,7 @@ struct ChannelTitleView: View {
utils.channelNamer
}

var body: some View {
public var body: some View {
VStack(spacing: 2) {
Text(channelNamer(channel, currentUserId) ?? "")
.font(fonts.bodyBold)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@ public struct ChatChannelInfoButton: View {
}
}

struct ChannelInfoDivider: View {
public struct ChannelInfoDivider: View {
@Injected(\.colors) private var colors

var body: some View {
public init() {}

public var body: some View {
Rectangle()
.fill(Color(colors.innerBorder))
.frame(height: 8)
Expand Down Expand Up @@ -240,19 +242,19 @@ public struct ChannelInfoItemView<TrailingView: View>: View {
}
}

struct ChatInfoDirectChannelView<Factory: ViewFactory>: View {
public struct ChatInfoDirectChannelView<Factory: ViewFactory>: View {
@Injected(\.fonts) private var fonts
@Injected(\.colors) private var colors

let factory: Factory
var participant: ParticipantInfo?

init(factory: Factory = DefaultViewFactory.shared, participant: ParticipantInfo?) {
public init(factory: Factory = DefaultViewFactory.shared, participant: ParticipantInfo?) {
self.factory = factory
self.participant = participant
}

var body: some View {
public var body: some View {
VStack {
let displayInfo = UserDisplayInfo(
id: participant?.chatUser.id ?? "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public struct ChatChannelInfoView<Factory: ViewFactory>: View, KeyboardReadable

if viewModel.showMoreUsersButton {
ChatChannelInfoButton(
title: L10n.ChatInfo.Users.loadMore(viewModel.notDisplayedParticipantsCount),
title: viewModel.showMoreUsersButtonTitle,
iconName: "chevron.down",
foregroundColor: Color(colors.textLowEmphasis)
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ public class ChatChannelInfoViewModel: ObservableObject, ChatChannelControllerDe
return L10n.Alert.Actions.leaveGroupMessage
}
}

public var showMoreUsersButtonTitle: String {
L10n.ChatInfo.Users.loadMore(notDisplayedParticipantsCount)
}

public var notDisplayedParticipantsCount: Int {
let total = channel.memberCount
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import StreamChat
import SwiftUI

/// View for the chat info participants.
struct ChatInfoParticipantsView<Factory: ViewFactory>: View {
public struct ChatInfoParticipantsView<Factory: ViewFactory>: View {
@Injected(\.fonts) private var fonts
@Injected(\.colors) private var colors

let factory: Factory
var participants: [ParticipantInfo]
var onItemAppear: (ParticipantInfo) -> Void

init(
public init(
factory: Factory = DefaultViewFactory.shared,
participants: [ParticipantInfo],
onItemAppear: @escaping (ParticipantInfo) -> Void
Expand All @@ -24,7 +24,7 @@ struct ChatInfoParticipantsView<Factory: ViewFactory>: View {
self.onItemAppear = onItemAppear
}

var body: some View {
public var body: some View {
LazyVStack {
ForEach(participants) { participant in
HStack {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -484,4 +484,8 @@ enum MediaAttachmentType {
public struct MediaViewsOptions {
/// The index of the selected media item.
public let selectedIndex: Int

public init(selectedIndex: Int) {
self.selectedIndex = selectedIndex
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ struct PollCommentsView<Factory: ViewFactory>: View {
}
.padding()
}
.background(Color(colors.background).ignoresSafeArea())
.alertBanner(
isPresented: $viewModel.errorShown,
action: viewModel.refresh
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ class PollCommentsViewModel: ObservableObject, PollVoteListControllerDelegate {
self?.errorShown = true
}
}
newCommentText = ""
}

func onAppear(comment: PollVote) {
Expand All @@ -93,13 +92,18 @@ class PollCommentsViewModel: ObservableObject, PollVoteListControllerDelegate {
) {
if animateChanges {
withAnimation {
self.comments = Array(self.commentsController.votes)
self.updateCommentList()
}
} else {
comments = Array(commentsController.votes)
updateCommentList()
}
}

private func updateCommentList() {
comments = Array(commentsController.votes)
newCommentText = comments.first(where: { $0.user?.id == chatClient.currentUserId })?.answerText ?? ""
}

private func loadComments() {
guard !loadingComments, !commentsController.hasLoadedAllVotes else { return }
loadingComments = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public struct CreatePollView: View {
if viewModel.multipleAnswers {
HStack(alignment: .textFieldToggle) {
VStack(alignment: .leading, spacing: 6) {
Text(L10n.Composer.Polls.typeNumberFrom1And10)
Text(L10n.Composer.Polls.typeNumberMinMaxRange)
.foregroundColor(Color(colors.alert))
.font(fonts.caption1)
.offset(y: viewModel.showsMaxVotesError ? 0 : 6)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class CreatePollViewModel: ObservableObject {
.map { text in
guard !text.isEmpty else { return false }
let intValue = Int(text) ?? 0
return intValue < 1 || intValue > 10
return intValue < 2 || intValue > 10
}
.combineLatest($maxVotesEnabled)
.map { $0 && $1 }
Expand Down Expand Up @@ -132,6 +132,7 @@ class CreatePollViewModel: ObservableObject {
guard optionsErrorIndices.isEmpty else { return false }
guard !showsMaxVotesError else { return false }
guard options.contains(where: { !$0.trimmed.isEmpty }) else { return false }
guard !(maxVotesEnabled && maxVotes.trimmed.isEmpty) else { return false }
return true
}

Expand Down
4 changes: 2 additions & 2 deletions Sources/StreamChatSwiftUI/Generated/L10n.swift
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,8 @@ internal enum L10n {
internal static var question: String { L10n.tr("Localizable", "composer.polls.question") }
/// Suggest an option
internal static var suggestOption: String { L10n.tr("Localizable", "composer.polls.suggest-option") }
/// Type a number from 1 and 10
internal static var typeNumberFrom1And10: String { L10n.tr("Localizable", "composer.polls.type-number-from-1-and-10") }
/// Type a number from 2 and 10
internal static var typeNumberMinMaxRange: String { L10n.tr("Localizable", "composer.polls.type-number-min-max-range") }
}
internal enum Quoted {
/// Giphy
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.82.0"
public static let version: String = "4.83.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.82.0</string>
<string>4.83.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPhotoLibraryUsageDescription</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
"composer.polls.duplicate-option" = "This is already an option";
"composer.polls.multiple-answers" = "Multiple answers";
"composer.polls.suggest-option" = "Suggest an option";
"composer.polls.type-number-from-1-and-10" = "Type a number from 1 and 10";
"composer.polls.type-number-min-max-range" = "Type a number from 2 and 10";
"composer.audio-recording.start" = "Start recording audio message";
"composer.audio-recording.stop" = "Stop recording audio message";

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.82.0'
spec.version = '4.83.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.82.0'
spec.dependency 'StreamChat-XCFramework', '~> 4.83.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.82.0'
spec.version = '4.83.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.82.0'
spec.dependency 'StreamChat', '~> 4.83.0'
end
2 changes: 1 addition & 1 deletion StreamChatSwiftUI.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3908,7 +3908,7 @@
repositoryURL = "https://github.com/GetStream/stream-chat-swift.git";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 4.82.0;
minimumVersion = 4.83.0;
};
};
E3A1C01A282BAC66002D1E26 /* XCRemoteSwiftPackageReference "sentry-cocoa" */ = {
Expand Down
Loading
Loading