Skip to content

feat: show the active member count where the UI displays a member count - #4026

Merged
isekovanic merged 1 commit into
developfrom
chore/active-member-count
Nov 25, 2026
Merged

isekovanic merged 1 commit into
developfrom
chore/active-member-count

Conversation

@isekovanic

Copy link
Copy Markdown
Contributor

🎯 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

  • New public hook useDisplayedChannelMemberCount(channel), exported from src/hooks. It reads activeMemberCount and memberCount from channel.state and returns activeMemberCount ?? memberCount.
  • useChannelDetailsMemberStatusText uses it for the "N members, M online" text.
  • useChannelDetailsMembersPreview uses it for total. hasMore still follows the total member count, since deactivated members are still listed.
  • The ChannelDetailsBottomSheet header uses it in place of the number of loaded members, so large channels no longer show the capped loaded count.
  • ChannelAvatar uses it for the count in the group accessibility label. isGroup is unchanged.
  • The SampleApp channel header (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. useChannelMemberCount is 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.ts covers the fallback to memberCount, preferring activeMemberCount (including 0), and following state changes.
  • useChannelDetailsMembersPreview, ChannelDetailsBottomSheet and ChannelAvatar tests cover the active count, and useChannelDetailsMemberStatusText tests mock the new hook.

β˜‘οΈ Checklist

  • I have signed the Stream CLA (required)
  • PR targets the develop branch
  • Documentation is updated
  • New code is tested in main example apps, including all possible scenarios
    • SampleApp iOS and Android
    • Expo iOS and Android

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.
@github-actions

Copy link
Copy Markdown

SDK Size

title develop branch diff status
js_bundle_size 2034 KB 2036 KB +1232 B 🟒
ai_components_size 353 KB 353 KB 0 B 🟒
a2ui_size 103 KB 103 KB 0 B 🟒

@oliverlaz oliverlaz changed the title chore: show the active member count where the UI displays a member count feat: show the active member count where the UI displays a member count Nov 25, 2026
@isekovanic
isekovanic merged commit f42dab7 into develop Nov 25, 2026
23 checks passed
@isekovanic
isekovanic deleted the chore/active-member-count branch November 25, 2026 12:47
@github-actions github-actions Bot mentioned this pull request Nov 25, 2026
6 tasks
@github-actions

Copy link
Copy Markdown

πŸŽ‰ This PR is included in version 10.3.0 πŸŽ‰

The release is available on:

Your semantic-release bot πŸ“¦πŸš€

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants