GetStream / stream-chat-js

JS / Browser Client - Build Chat with GetStream.io
https://getstream.io/chat/
Other
182 stars 76 forks source link

The ability to break down unread count by channel type #1085

Open aharwood9 opened 1 year ago

aharwood9 commented 1 year ago

Motivation A clear and concise description of what the problem/opportunity is. Ex. I'm always frustrated when [...]

hi πŸ‘‹ we use different channel types within our app I.e messaging vs live stream etc. We separate out the different functionality into different tabs and only query certain channel types within each tab. We would like to show the total unread count of each channel type on each tab. For example, lets say a user has 11 unread messages in total across all channel types. We would like to show 1 unread message on the messaging tab vs 10 on the live stream tab. This is important to bring users to those tabs to indicate something has changed. Having a single unread counter makes this very difficult as you can't even just put a red dot on the tab as you don't know if all unread messages are just from a single channel type.

Proposed solution A clear and concise description of what you want to happen.

The total unread count across all channels is still critical to app badges so that should remain but after using connectUser and accessing the OwnUserResponse you should have some way to break down the total_unread_count by channel.

The solution would also need to update the listener on client for new events. When a new event is triggered with an updated unread count, we would need to know what channel type this is so we can update the tab accordingly.

Acceptance Criteria A set of predefined requirements that must be met to mark a user story complete.

  1. Connect to a user
  2. Still be able to access the total unread count across all channels
  3. Be able to break down the total unread count across all channels by channel type.
  4. Recieve a new event on the client
  5. See the event contains the total unread count across all channels and can be broken down by channel type

P.S happy to move this to stream-chat-js if not directly related to the react native library

vanGalilea commented 1 year ago

@aharwood9 thanks for reaching out. We will add this to our internal backlog, definitely a missing feature πŸ‘πŸ»