Gocnak / Botnak

A Java-based IRC chat client with focus on Twitch.tv streams.
https://gocnak.github.io/Botnak
MIT License
67 stars 28 forks source link

Auto-scrolling after Timeout #99

Closed ChristopherWirtOfficial closed 9 years ago

ChristopherWirtOfficial commented 9 years ago

I implemented auto-scrolling without the need for an additional thread or listener. Since we only really care about scrolling back down if we're receiving messages, we only want to scroll down to the bottom after 10 seconds while receiving messages. So when we check if we should maybeScrollDown and decide we're not at the bottom, we start the timeout. Then, every time we do that same check:

There are drawbacks to this, because it required people to be chatting (or some other calls to maybeScrollToBottom), but this is a case that will not appear often and also matter. If no one is chatting, there's no need to scroll down anyway. The benefits of not adding another thread or listener outweigh these drawbacks.

Gocnak commented 9 years ago

Great work.