-
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
fix: mark channel read on scroll to bottom of the main message list #2283
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
Size Change: +5.31 kB (0%) Total Size: 1.76 MB
ℹ️ View Unchanged
|
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #2283 +/- ##
==========================================
+ Coverage 84.85% 85.02% +0.17%
==========================================
Files 344 344
Lines 7592 7675 +83
Branches 2103 2135 +32
==========================================
+ Hits 6442 6526 +84
+ Misses 807 805 -2
- Partials 343 344 +1 ☔ View full report in Codecov by Sentry. |
oliverlaz
approved these changes
Feb 21, 2024
github-actions bot
pushed a commit
that referenced
this pull request
Feb 21, 2024
## [11.9.0](v11.8.0...v11.9.0) (2024-02-21) ### Bug Fixes * add aria-expanded attribute to emoji picker and reactions selector ([#2274](#2274)) ([b15cdd5](b15cdd5)) * mark channel read on scroll to bottom of the main message list ([#2283](#2283)) ([d04d0ab](d04d0ab)) * prevent layout shifts in reactions modal ([#2272](#2272)) ([706cf3d](706cf3d)) * trap focus in opened modal ([#2278](#2278)) ([8f48b52](8f48b52)) ### Features * make aria-labels localizable ([#2282](#2282)) ([7867677](7867677)), closes [#1931](#1931) [#1994](#1994)
🎉 This PR is included in version 11.9.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
Mark channel read when:
a.
Channel
component is mounted and propmarkReadOnMount
is enabled (default)b. Scrolled to the bottom of the main message list or returned back to the bottom of the main message list
c. Document visibility changed (switch to tab with the chat app) with the main message list scrolled to the bottom
d. New message (not a thread reply) arrives from another user to the active channel and the message list is scrolled to the bottom
Increase the unread count for
UnreadMessagesSeparator
,UnreadMessagesNotification
when:a. user marks channel as unread
b. a new not own message arrives to a non-active channel
c. a new not own message arrives to the active channel while being scrolled away from the latest messages
d. a new not own message arrives to the active channel on an app running on inactive tab while being scrolled to the latest messages
e. a new not own message arrives to the active channel scrolled to the bottom that was previously marked unread
If an unread channel is opened, it is marked read, but the
UnreadMessagesSeparator
,UnreadMessagesNotification
are kept mounted with the original unread count (e.g. 5). Then if new messages arrive the unread count is increased from the original unread count (5 + 1 => 6 Unread messages)Increase the unread count in
ScrollToBottomButton
only if the user has scrolled away from the latest messages. The count should take into consideration only newly arrived eventsmessage.new
and not the initial unread count before scrolling up.Throttle unread count updates in
ChannelPreview
to prevent blinking in channels with high message frequenciesMake it optional to display unread counts on
UnreadMessagesSeparator
,UnreadMessagesNotification
by adding new propshowCount
to themAllow to configure, when
UnreadMessagesNotification
will be displayed throughMessageList
/VirtualizedMessageList
propsshowUnreadNotificationAlways
. By default the notification is visible only when viewing unread messages.Unmount
UnreadMessagesSeparator
,UnreadMessagesNotification
ever time a message list is scrolled to the bottom and marked read