Skip to content

Improve automatic scrolling behaviour when new messages arrive#564

Merged
nickvergessen merged 1 commit into
masterfrom
improve-automatic-scrolling-behaviour-when-new-messages-arrive
Jan 10, 2018
Merged

Improve automatic scrolling behaviour when new messages arrive#564
nickvergessen merged 1 commit into
masterfrom
improve-automatic-scrolling-behaviour-when-new-messages-arrive

Conversation

@danxuliu

Copy link
Copy Markdown
Member

When a new message arrives the list of messages is automatically scrolled to show the new message,
except if the list was not at the bottom in which case no scrolling is made and the current visible messages are kept at the same place. Basically this auto scrolls, except if the user is checking older messages.

There are still some details that should be improved regarding scrolling:

  • When the chat is moved between the main view and the sidebar the scroll position is not kept. Same when expanding and restoring the list of messages using Add button to expand tabs in the sidebar #558
  • If the last message is partially visible sometimes (when the message is grouped) the list is not scrolled to the new message; it seems that calling position() on a comment returns where it should be instead of where it is due to a negative margin. Not a big deal, though; it works anyway if the last message is visible even if the list is not fully scrolled to the bottom (that is, if the bottom margin of the last message is partially hidden).

@danxuliu danxuliu added 3. to review feature: chat 💬 Chat and system messages labels Jan 10, 2018
@danxuliu danxuliu added this to the 3.0 (Nextcloud 13.0.0) milestone Jan 10, 2018
@nickvergessen

Copy link
Copy Markdown
Member

I just noticed, that in the guest view, the chat is scrolled to the top, so it shows the oldest messages and not the newest

When the chat messages are shown from newest to oldest and a new message
arrives the list is automatically scrolled to keep the current visible
messages at the same place, except if the list was at the top, in which
case no scrolling is made and the new message appears.

When the chat messages are shown from oldest to newest and a new message
arrives the list is automatically scrolled to show the new message,
except if the list was not at the bottom in which case no scrolling is
made and the current visible messages are kept at the same place.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
@danxuliu danxuliu force-pushed the improve-automatic-scrolling-behaviour-when-new-messages-arrive branch from 83b8791 to 3c0587f Compare January 10, 2018 10:16
@danxuliu

Copy link
Copy Markdown
Member Author

I just noticed, that in the guest view, the chat is scrolled to the top, so it shows the oldest messages and not the newest

Fixed (a position: relative was missing).

@nickvergessen nickvergessen merged commit b867d7a into master Jan 10, 2018
@nickvergessen nickvergessen deleted the improve-automatic-scrolling-behaviour-when-new-messages-arrive branch January 10, 2018 10:29
marcoambrosini pushed a commit that referenced this pull request Oct 9, 2019
Remove code disabled actions remnants
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: chat 💬 Chat and system messages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants