Skip to content

Make AddUsersView public for being able to duplicate ChatChannelInfoView #906

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

Merged
merged 4 commits into from
Aug 6, 2025
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
# Upcoming

### ✅ Added
- Make `AddUsersView` used by `ChatChannelInfoView` public for creating custom info views through composition [#906](https://github.com/GetStream/stream-chat-swiftui/pull/906)
- Expose `ChannelAvatarViewOptions.init` [#908](https://github.com/GetStream/stream-chat-swiftui/pull/908)
### 🐞 Fixed
- Fix WebView error handling to enable mp3 attachments loading [#904](https://github.com/GetStream/stream-chat-swiftui/pull/904)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import StreamChat
import SwiftUI

/// View for the add users popup.
struct AddUsersView<Factory: ViewFactory>: View {
public struct AddUsersView<Factory: ViewFactory>: View {
@Injected(\.fonts) private var fonts
@Injected(\.colors) private var colors

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

init(
public init(
factory: Factory = DefaultViewFactory.shared,
loadedUserIds: [String],
onUserTap: @escaping (ChatUser) -> Void
Expand All @@ -48,7 +48,7 @@ struct AddUsersView<Factory: ViewFactory>: View {
self.factory = factory
}

var body: some View {
public var body: some View {
VStack {
SearchBar(text: $viewModel.searchText)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,46 +374,6 @@ class MessageActions_Tests: StreamChatTestCase {
// Then
XCTAssertTrue(messageActions.contains(where: { $0.title == "Edit Message" }))
}

func test_messageActions_currentUser_unmuteUser() throws {
// Given
// Note: internally creates current user controller
let mutedUserId = UserId.unique
try chatClient.databaseContainer.writeSynchronously { session in
try session.saveCurrentUser(
payload: .dummy(
userId: .unique,
role: .admin,
mutedUsers: [
.dummy(userId: mutedUserId)
]
)
)
}

let channel = ChatChannel.mockDMChannel(config: .mock(mutesEnabled: true))
let message = ChatMessage.mock(
id: .unique,
cid: channel.cid,
text: "Test",
author: .mock(id: mutedUserId),
isSentByCurrentUser: false
)
let factory = DefaultViewFactory.shared

// When
let messageActions = MessageAction.defaultActions(
factory: factory,
for: message,
channel: channel,
chatClient: chatClient,
onFinish: { _ in },
onError: { _ in }
)

// Then
XCTAssertTrue(messageActions.contains(where: { $0.title == "Unmute User" }))
}

// MARK: - Private

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading