You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Chat programs have a concept of "read" status for messages. But you cannot simply mark an entire message history "read" if a user taps on a conversation (naive implementation).
An intelligent implementation uses a number of heuristics such as:
Percentage of message on screen (above a watermark - ie 80% of the message is visible) then the message has been "read"
Time on screen or speed of scrolling while on screen (ie, if on screen for 5 seconds, or scrolling less than x pixels per second whilst visible
If the item just appears on the screen at all maybe is a simple heuristic
Also, providing a list of all items now "read" (ie: these 3 are now on screen even though they are marked unread by me). Rather than 3 individual notifications or callbacks.
So to achieve this, each user of chat-ui-kit-react needs to build the solution to detect on screen, duration, percentage to determine when a message has been read by this user. This logic is very similar and reusable and should be part of the library.
Solution proposed:
<Message> and <MessageList> (and any others that are relevant), should have an "onRead" callback.
The signature would be something like onRead([messages]) or likewise.
For instance, when using <MessageList> with messageContent as an array, the content may be pre-calculated, but the react view can provide an "onRead" callback to the <MessageList> component in the context of the component.
Parameters for heuristics can be passed to the <Message> or <MessageList> (or other) component as well, such as minimumReadTime=6000 (6seconds) or minimumReadPercent=0.5 (50% showing), etc.
When the message is determined "read" by the <MessageList> component, it collates and sends a list of all newly "read" messages to the callback.
The developer can then use that list to notify their server of the list of messages that this user has now read.
The text was updated successfully, but these errors were encountered:
Problem statement:
Chat programs have a concept of "read" status for messages. But you cannot simply mark an entire message history "read" if a user taps on a conversation (naive implementation).
An intelligent implementation uses a number of heuristics such as:
So to achieve this, each user of chat-ui-kit-react needs to build the solution to detect on screen, duration, percentage to determine when a message has been read by this user. This logic is very similar and reusable and should be part of the library.
Solution proposed:
<Message> and <MessageList> (and any others that are relevant), should have an "onRead" callback.
The signature would be something like onRead([messages]) or likewise.
For instance, when using <MessageList> with messageContent as an array, the content may be pre-calculated, but the react view can provide an "onRead" callback to the <MessageList> component in the context of the component.
Parameters for heuristics can be passed to the <Message> or <MessageList> (or other) component as well, such as minimumReadTime=6000 (6seconds) or minimumReadPercent=0.5 (50% showing), etc.
When the message is determined "read" by the <MessageList> component, it collates and sends a list of all newly "read" messages to the callback.
The developer can then use that list to notify their server of the list of messages that this user has now read.
The text was updated successfully, but these errors were encountered: