Skip to content

Conversation

martinmitrevski
Copy link
Contributor

🔗 Issue Links

Resolves https://linear.app/stream/issue/IOS-1163/speakap-channel-member-info-view.

🎯 Goal

Describe why we are making this change.

📝 Summary

Provide bullet points with the most important changes in the codebase.

🛠 Implementation

Provide a detailed description of the implementation and explain your decisions if you find them relevant.

🎨 Showcase

Add relevant screenshots and/or videos/gifs to easily see what this PR changes, if applicable.

Before After
img img

🧪 Manual Testing Notes

Explain how this change can be tested manually, if applicable.

☑️ Contributor Checklist

  • I have signed the Stream CLA (required)
  • This change should be manually QAed
  • Changelog is updated with client-facing changes
  • Changelog is updated with new localization keys
  • New code is covered by unit tests
  • Documentation has been updated in the docs-content repo

@martinmitrevski martinmitrevski requested a review from a team as a code owner September 29, 2025 15:23
@martinmitrevski martinmitrevski marked this pull request as draft September 29, 2025 15:23
Copy link

github-actions bot commented Sep 29, 2025

1 Warning
⚠️ Big PR
1 Message
📖 There seems to be app changes but CHANGELOG wasn't modified.
Please include an entry if the PR includes user-facing changes.
You can find it at CHANGELOG.md.

Generated by 🚫 Danger

Copy link

github-actions bot commented Sep 29, 2025

Public Interface

+ public struct ParticipantAction: Identifiable  
+ 
+   public var id: String
+   public let title: String
+   public let iconName: String
+   public let action: () -> Void
+   public let confirmationPopup: ConfirmationPopup?
+   public let isDestructive: Bool
+   public var navigationDestination: AnyView?
+   
+ 
+   public init(title: String,iconName: String,action: @escaping () -> Void,confirmationPopup: ConfirmationPopup?,isDestructive: Bool)



- public class ChatChannelInfoViewModel: ObservableObject, ChatChannelControllerDelegate  
+ open class ChatChannelInfoViewModel: ObservableObject, ChatChannelControllerDelegate  
-   public var shouldShowLeaveConversationButton: Bool
+   @Published public var selectedParticipant: ParticipantInfo?
-   public var canRenameChannel: Bool
+   public var shouldShowLeaveConversationButton: Bool
-   public var shouldShowAddUserButton: Bool
+   public var canRenameChannel: Bool
-   public var showSingleMemberDMView: Bool
+   public var shouldShowAddUserButton: Bool
-   public var displayedParticipants: [ParticipantInfo]
+   public var showSingleMemberDMView: Bool
-   public var leaveButtonTitle: String
+   public var displayedParticipants: [ParticipantInfo]
-   public var leaveConversationDescription: String
+   public var leaveButtonTitle: String
-   public var showMoreUsersButtonTitle: String
+   public var leaveConversationDescription: String
-   public var notDisplayedParticipantsCount: Int
+   public var showMoreUsersButtonTitle: String
-   public var mutedText: String
+   public var notDisplayedParticipantsCount: Int
-   public var showMoreUsersButton: Bool
+   public var mutedText: String
-   
+   public var showMoreUsersButton: Bool
- 
+   
-   public init(channel: ChatChannel)
+ 
-   
+   public init(channel: ChatChannel)
- 
+   
-   public func onlineInfo(for user: ChatUser)-> String
+ 
-   public func onParticipantAppear(_ participantInfo: ParticipantInfo)
+   public func onlineInfo(for user: ChatUser)-> String
-   public func leaveConversationTapped(completion: @escaping () -> Void)
+   public func onParticipantAppear(_ participantInfo: ParticipantInfo)
-   public func cancelGroupRenaming()
+   public func leaveConversationTapped(completion: @escaping () -> Void)
-   public func confirmGroupRenaming()
+   public func cancelGroupRenaming()
-   public func channelController(_ channelController: ChatChannelController,didUpdateChannel channel: EntityChange<ChatChannel>)
+   public func confirmGroupRenaming()
-   public func addUserTapped(_ user: ChatUser)
+   public func channelController(_ channelController: ChatChannelController,didUpdateChannel channel: EntityChange<ChatChannel>)
+   public func addUserTapped(_ user: ChatUser)
+   open func participantActions(for participant: ParticipantInfo)-> [ParticipantAction]
+   public func muteAction(participant: ParticipantInfo,onDismiss: @escaping () -> Void,onError: @escaping (Error) -> Void)-> ParticipantAction
+   public func unmuteAction(participant: ParticipantInfo,onDismiss: @escaping () -> Void,onError: @escaping (Error) -> Void)-> ParticipantAction
+   public func removeUserAction(participant: ParticipantInfo,onDismiss: @escaping () -> Void,onError: @escaping (Error) -> Void)-> ParticipantAction

 public struct ChatInfoParticipantsView: View  
-   public init(factory: Factory = DefaultViewFactory.shared,participants: [ParticipantInfo],onItemAppear: @escaping (ParticipantInfo) -> Void)
+   public init(factory: Factory = DefaultViewFactory.shared,participants: [ParticipantInfo],onItemAppear: @escaping (ParticipantInfo) -> Void,selectedParticipant: Binding<ParticipantInfo?> = .constant(nil))

 public struct ChatChannelInfoView: View, KeyboardReadable  
-   public init(factory: Factory = DefaultViewFactory.shared,channel: ChatChannel,shownFromMessageList: Bool = false)
+   public init(factory: Factory = DefaultViewFactory.shared,viewModel: ChatChannelInfoViewModel? = nil,channel: ChatChannel,shownFromMessageList: Bool = false)

@Stream-SDK-Bot
Copy link
Collaborator

Stream-SDK-Bot commented Sep 29, 2025

SDK Size

title develop branch diff status
StreamChatSwiftUI 9.43 MB 9.48 MB +49 KB 🟢

DateUtils.timeAgo
}

open func participantActions(for participant: ParticipantInfo) -> [ParticipantAction] {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In order to keep it consistent with Android, we need to introduce the action of "Send direct message" or something like that.

Copy link
Member

@nuno-vieira nuno-vieira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks great 👌 Just added on small comment

@martinmitrevski martinmitrevski marked this pull request as ready for review September 30, 2025 15:04
Copy link

Copy link
Member

@nuno-vieira nuno-vieira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just added one small suggestion, other than that LGTM 👍

Comment on lines +134 to +141
ParticipantInfoView(
participant: selectedParticipant,
actions: viewModel.participantActions(for: selectedParticipant)
) {
withAnimation {
viewModel.selectedParticipant = nil
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we create a slot here so that customers can override the ParticipantInfoView?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually think we should not, we don't expose much slots here. We can in the future, if there's enough interest.

"channel.item.remove-user" = "Remove User";
"channel.item.remove-user-confirmation-title" = "Remove User";
"channel.item.remove-user-confirmation-message" = "Are you sure you want to remove %@ from %@?";
"channel.item.send-direct-message" = "Send direct message";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it is a title, should not it be "Send Direct Message" (like "Remove User")?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point, will do

Copy link
Contributor

@laevandus laevandus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comment about the action's title.

@martinmitrevski martinmitrevski enabled auto-merge (squash) October 1, 2025 09:30
@martinmitrevski martinmitrevski merged commit 5fc1b8d into develop Oct 1, 2025
6 of 16 checks passed
@martinmitrevski martinmitrevski deleted the participant-actions branch October 1, 2025 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants