Chatterino / chatterino2

Chat client for https://twitch.tv
MIT License
2.06k stars 448 forks source link

Scrolling should behave more like browsers #3260

Open jupjohn opened 3 years ago

jupjohn commented 3 years ago

Describe your issue When scrolling through the emote picker in any tab where emote sections span multiple lines, scrolling via scrollbar dragging inconsistently scrolls depending on the scroll position.

Steps to reproduce

  1. Open the emote picker window
  2. Go to either the sub emote or channel emote tab (whatever can be scrolled)
  3. Begin scrolling by dragging scrollbar

I would expect the scrolling speed to be consistent but it jumps around depending on whether the emote section has more than 1 line of emotes.

Screenshots Was painful to demonstrate but I tried to pull the scrollbar down at a constant speed. https://user-images.githubusercontent.com/4962764/135192618-0816154d-962e-4219-96a8-cb45494164ae.mp4

OS and Chatterino Version Chatterino 2.3.4 (commit 9b9fd7d4) Arch using Linux Zen 5.14.6 + BSPWM

jupjohn commented 3 years ago

I've seen this occur since Is tarted using chatterino so it's by no means a new development - couldn't find an existing issue for it.

My best guess is that all emotes in each sub section (in the video) are treated as one line when they actually span multiple. It's most obvious when the top of the page goes from a label (e.g. Mizkif) to a large emote section.

sando commented 3 years ago

Can repro on Windows, Chatterino Nightly 2.3.4 (commit 9b9fd7d4).

Wasn't quite sure what was going on in the video at first, but trying it myself made the problem pretty obvious. 😄

jupjohn commented 3 years ago

Wasn't quite sure what was going on in the video at first, but trying it myself made the problem pretty obvious. smile

I've added some average steps to reproduce which hopefully explain it better. I'm sick at the moment and can't quite explain it so happy to edit.

Mm2PL commented 3 years ago

This should also be reproducible in normal channels since it's the same ChannelView widget. Can reproduce on 177ab0eaa7f65a49c002ba9b02a9ff3f65659d9d. It's also possible to repro this bug with middle click scrolling

jupjohn commented 3 years ago

This should also be reproducible in normal channels since it's the same ChannelView widget. Can reproduce on 177ab0e. It's also possible to repro this bug with middle click scrolling

That's what I thought a while ago but it's not noticeable since most messages are <2 lines. Just tested with some emote spam and can confirm it also occurs in standard channels.

jupjohn commented 1 year ago

Coming back to this as it's more noticeable ever since 7TV emote support was merged. The whole scrollbar implementation would need to change and I don't think I have the brains to figure that one out.

Currently scrolling is done in % of message sizes which means larger messages jump further. I suppose an alternative would be to have each message contain a message height multiplier (lines-related) and have the scrollbar sum that up. Been a while since I looked at the implementation so not sure if that'll work in all cases.

jupjohn commented 1 year ago

Here's a better visual of how scrolling works in current form:

https://github.com/Chatterino/chatterino2/assets/4962764/915efa1e-c206-4726-b003-58182664cb70