Skip to content
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

Auto jump to newest messages instead of readmarker at X unread messages? #4285

Open
nickvergessen opened this issue Oct 5, 2020 · 9 comments
Labels
Milestone

Comments

@nickvergessen
Copy link
Member

Steps to reproduce

  1. Join the Nextcloud conference 🛰️ chat on friday
  2. Be busy on saturday
  3. Join on sunday with ~2k unread messages

Expected behaviour

You load in and start participating

Actual behaviour

You join with the chat on friday and start loading the 2k messages in 200 junks.

The main issue is you would jump over mentions, I guess you could use the search, or we simply need a "jump to my next/previous mention" feature that is easily accessible.

cc @nextcloud/designers-talk

@marcoambrosini
Copy link
Member

for the time being, I would:

  1. load the messages list @ the last read message;
  2. Display the scroll to bottom button;
  3. Upon clicking at the scroll to bottom button load the last 200 messages of the conversation and scroll to the bottom;

@PVince81
Copy link
Member

should be covered by #1164

the PR linked there seems to always start loading the conversation where the read marker is located

@PVince81
Copy link
Member

PVince81 commented Mar 8, 2021

did we have a ticket for virtual scrolling though ?

@nickvergessen
Copy link
Member Author

the PR linked there seems to always start loading the conversation where the read marker is located

That is exactly the problem. if the readmarker is 2k messages above you dont want to start there. it's totally unrelated.
It might be solved by the "mark chat as read" feature and then enter. But with thousands of new messages I think we should somehow offer a "jump to latest and skip the time you missed".

We could also bring up the "settings dialog" modal thingy and show messages where you were mentioned personally/by group/by "all" as an overview what you missed or something.

@PVince81
Copy link
Member

PVince81 commented Mar 9, 2021

jump to latest and skip the time you missed

that would be the "scroll to bottom" button.

Maybe in the case of lots of messages we can cancel all requests and teleport the user to bottom as if they joined after marking chat as read, which means that we only call getMessages() for old messages starting from the bottom-most time and ignore the other pages between the former read marker and the bottom.

So the logic would look as follows when the user clicks "scroll to bottom":

  • cancel all pending getMessages() calls
  • clear read marker (aka set it to the last message)
  • clear the messages list: this will remove all visible messages
  • scroll to bottom
  • start loading messages from the bottom

Additionally, I noticed that there's some kind of iteration on getNewMessages() after a timeout that will continuously load the next page of results even when the user doesn't scroll. Maybe we should limit that to 1-2 pages and then stop. And only when the user scrolls down we load the next page. (that is, until we have virtual scrolling of some sorts)

@PVince81
Copy link
Member

PVince81 commented Jul 5, 2021

in theory, now the user could first click "mark conversation as read" before entering it, and then when opening the conversation they'd be directly at the bottom

so not sure if we need to do anything on top of this

@nickvergessen
Copy link
Member Author

We still immediately start loading all messages? Or are we already having logic so it only loads more messages when we scrolled down far enough?

@PVince81
Copy link
Member

PVince81 commented Jul 5, 2021

We still immediately start loading all messages? Or are we already having logic so it only loads more messages when we scrolled down far enough?

I think we didn't change anything there, the lookForNewMessages call will still load everything. So probably we'll need to adjust it to only load 1-2 pages forward and load the next when scrolling down.

@mejo-
Copy link
Member

mejo- commented Dec 20, 2023

we simply need a "jump to my next/previous mention" feature that is easily accessible.

That would be really helpful in any case!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants