thunder-app / thunder

Thunder - An open-source cross-platform Lemmy client for iOS and Android built with Flutter
https://thunderapp.dev
GNU Affero General Public License v3.0
712 stars 62 forks source link

Improve the comment context jumping #1319

Closed micahmo closed 4 days ago

micahmo commented 4 weeks ago

Pull Request Description

This PR is a followup to #1252. There I added automatic scrolling to the comments when viewing comment context. Unfortunately it didn't account for slow loading, so unless the comments loaded immediately, it wouldn't work that well. Now I've adjusted the logic to ensure that the scrolling does not occur until the comments are loaded. I also added a little extra room at the bottom so that, in case the comment chain isn't long, it can still be scrolled to the top. Essentially the bottom spacer will now occupy enough room (the height of the list minus the height of the last comment) so that the last comment can always be scrolled to the top.

Issue Being Fixed

Issue Number: N/A

Screenshots / Recordings

Before

https://github.com/thunder-app/thunder/assets/7417301/b4cd16ed-a65a-413f-a06c-a0c694466cbc

After

https://github.com/thunder-app/thunder/assets/7417301/95331a1d-fea5-491e-9253-ec2cdbfce27f

Checklist