LiveTL / HyperChat

Improved YouTube chat with CPU/RAM optimizations, customization options, and cutting-edge features!
https://livetl.app/hyperchat
GNU Affero General Public License v3.0
253 stars 24 forks source link

[Feature]: Smooth scrolling #104

Open hjgyuhuk opened 2 years ago

hjgyuhuk commented 2 years ago

Checklist

Is your feature request related to a problem? Please describe.

Auto-scrolling is janky when new messages appear

Describe the solution you'd like

Scrolling should be smoother for the visual coherence

Expected behavior

From 1

To 2

Describe alternatives you've considered

No response

Anything else?

No response

KentoNishi commented 2 years ago

smooth scrolling takes a fairly large toll on performance, and that's why twitch and youtube (when chat is fast) don't do smooth scrolling by default either. it's also especially hard to make transitions blend together when messages are of uneven length and are arriving on uneven intervals. i could consider adding an option like this, but it'll be low on the priority list

hjgyuhuk commented 2 years ago

Actually Using like scrollIntoView api which is browser-built in function, I maked better performance than 'scrolltobottom' which is library functions

scrollIntoView

screenshot 2022-10-16 111324

KentoNishi commented 2 years ago
  1. it's not really fair to compare to regular ytc, u have to compare hyperchat with smooth scrolling vs hyperchat without smooth scrolling
  2. try scrolling up while the chat is moving. the problem with the scrollintoview api is that it tries to keep scrolling even when the user scrolls up. terminating scrollintoview on user scroll is not very straightforward as far as i know. if you can figure it out though, pls do make a pr, id be happy to merge it
hjgyuhuk commented 2 years ago

Thank you very much for your reply and explanation, I will look into it