Repository navigation
feat: show the active member count where the UI displays a member count - #4026
Merged
Merged
Conversation
Adds `useDisplayedChannelMemberCount`, which returns `activeMemberCount ?? memberCount` from `channel.state`, and uses it for the displayed counts in channel details, the channel details bottom sheet header and the channel avatar's accessibility label. Direct chat checks keep using the total member count.
SDK Size
|
oliverlaz
approved these changes
Nov 25, 2026
|
π This PR is included in version 10.3.0 π The release is available on:
Your semantic-release bot π¦π |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
π― Goal
Ticket: https://linear.app/stream/issue/REACT-1376
The React Native counterpart of GetStream/stream-chat-react#3413. When channels are queried with
include_active_member_count: true, the member counts the UI displays use the active member count (members who are not deactivated or deleted). Without the option nothing changes.π Implementation details
useDisplayedChannelMemberCount(channel), exported fromsrc/hooks. It readsactiveMemberCountandmemberCountfromchannel.stateand returnsactiveMemberCount ?? memberCount.useChannelDetailsMemberStatusTextuses it for the "N members, M online" text.useChannelDetailsMembersPreviewuses it fortotal.hasMorestill follows the total member count, since deactivated members are still listed.ChannelDetailsBottomSheetheader uses it in place of the number of loaded members, so large channels no longer show the capped loaded count.ChannelAvataruses it for the count in the group accessibility label.isGroupis unchanged.useChannelMembersStatus) now reads everything through the SDK hooks and shows the displayed count.Direct chat checks are unchanged, so a DM whose other member is deactivated stays a DM.
useChannelMemberCountis unchanged and keeps returning the total.π¨ UI Changes
No visible change unless the app queries channels with
include_active_member_count: true. The SampleApp does not.π§ͺ Testing
useDisplayedChannelMemberCount.test.tscovers the fallback tomemberCount, preferringactiveMemberCount(including 0), and following state changes.useChannelDetailsMembersPreview,ChannelDetailsBottomSheetandChannelAvatartests cover the active count, anduseChannelDetailsMemberStatusTexttests mock the new hook.βοΈ Checklist
developbranch