-
Notifications
You must be signed in to change notification settings - Fork 281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: mark channel unread #2238
Merged
Merged
Conversation
This file contains 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
…ithin ChannelPreview
…e channel is marked unread
# Conflicts: # src/components/MessageActions/MessageActionsBox.tsx
…messages-separator-wrapper
1 task
…sage list not marked unread
…rop markReadOnScrolledToBottom
…ith markReadOnMount prop
…ng to another channel
…g and unread count
# Conflicts: # src/components/Channel/Channel.tsx # src/components/MessageList/MessageList.tsx # src/components/MessageList/__tests__/MessageList.test.js # src/components/MessageList/hooks/MessageList/useMessageListElements.tsx # src/i18n/de.json # src/i18n/en.json # src/i18n/es.json # src/i18n/fr.json # src/i18n/hi.json # src/i18n/it.json # src/i18n/ja.json # src/i18n/ko.json # src/i18n/nl.json # src/i18n/pt.json # src/i18n/ru.json
…in VirtualizedMessageList
Size Change: +27.1 kB (+2%) Total Size: 1.71 MB
ℹ️ View Unchanged
|
… message to non-active channel
… mark unread request
szuperaz
approved these changes
Feb 2, 2024
oliverlaz
approved these changes
Feb 2, 2024
🎉 This PR is included in version 11.5.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
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
Support the following:
read-events
permissionnotification.mark_unread
inChannelPreview
ScrollToBottomButton
UnreadMessagesSeparator
before the message withfirst_unread_message_id
UnreadMessagesNotification
when scrolled below theUnreadMessagesSeparator
a. when
ChannelPreview
is clicked upon returning already seen unread channelb. when
UnreadMessagesNotification
button is clickeda. when
Channel
is mountedb. when
MessageList
/VirtualizedMessageList
is scrolled to the bottomc. when
ChannelPreview
is clicked upon leaving active unread channeld. when
UnreadMessagesNotification
button is clickedchannel.markRead()
calls@stream-io/stream-chat-css
stream-chat-js
Tech debt:
Todo
Thread
usesMessageList
it reports the list to be scrolled to the bottom despite being scrolled away from bottomDepends on:
🛠 Implementation details
UnreadMessagesNotification
is different in:MessageList
- theIntersectionObserver
observes, whetherUnreadMessagesSeparator
is visible in the message list container (works only with theme v2)VirtualizedMessageList
- theVirtuoso
component is provideditemsRender
handler. This handler is invoked every time the rendered items set is changed - when scrolling through the list. The handler invokes function that controls the state of showing / not showing theUnreadMessagesNotification
. The notification is shown, when there are unread messages and the first message rendered is created later than the last read message. The action is throttled.ScrollToBottomButton
will no longer try to show unread count for thread as the back-end does not support unread counts for threads.🎨 UI Changes
ML demo
ml_mark_unread.webm
VML demo
vml_mark_unread.webm