-
Notifications
You must be signed in to change notification settings - Fork 435
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
Add unread message marker in the chat view #3825
Conversation
what's missing ? from reading the code it seems like it could already work. let me know if I should take over |
Handling the update of the value is still missing. once the next bunch of messages is loaded and the room list refreshes, the read marker will be on the newest message |
rebased |
79f897c
to
4bcb0f8
Compare
Seems there's more to it. |
I had a quick look at ways for detecting the element visible at the top:
|
I'll go with Next up: tracking whether the unread marker was actually visible on screen or notaccount Then we only update the unread marker position if the marker was seen at least one and the detected top element is below the marker. Extra: assume that unread marker was not seen if window was not focused when it happened |
We have |
Yes. But I won't set it on all the message elements as observing them all won't scale. |
I've pushed some experiment which currently works for me in Chromium. TODOs:
|
|
Signed-off-by: Joas Schilling <coding@schilljs.com>
Moved marker behavior from server to client by passing setReadMarker=0 to queries. Added scroll handler that detects whether the read marker was seen and scrolled past, if yes it will set the read marker to the first message visible at the top. Keep the marker when the document is not focussed. When opening a conversation, scrolls to the read marker. The lastMessage attribute of a conversation is now updated earlier to make sure the read marker can update properly when there are new messages appended. Instead of waiting for the next refresh cycle, this fix immediately updates lastMessage and lastReadMessage after posting a message. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
When joining a conversation, don't mark it as read any more. The only moment will be when scrolling down to the bottom of a conversation and when clearing the read marker, in which case we immediately update the store. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Adjust design a bit of the marker. Debounce read marker processor on focus to delay it a bit. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
When no scrolling is possible, add delay before clearing. Small related code cleanup. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Use int instead of string for lastReadMessage update. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
This will move the unread marker to a specific position. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
To avoid jumping around when updating the lastReadMessage property, its last value is now cached in visualLastReadMessageId in the messagesStore. The marker always keeps its position until the user focusses away then back. In the latter case the marker position is refreshed based on the last backend/store state. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Added props for previous and next message id in MessagesGroup and Message components. Now using the previous message id when marking as unread. Since now the next message id is available on all message components, the logic in MessagesList that iterates over the next messages is now using the next message id attribute instead of handling the DOM tree on its own. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
When posting new messages, the read marker UI will also be updated. Fixed read marker update when scrolled to bottom. Fixed warnings related to temporary message id being a string. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
fde7613
to
c26d5e3
Compare
Fixed case where posting new messages: the read marker is now updated. Also fixed issue with marker update when being scrolled to bottom, blur then focus again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌
Fix #1788Fixes #1164