tigase / beagle-im

(M) XMPP client for macOS based on TigaseSwift XMPP library
GNU General Public License v3.0
181 stars 21 forks source link

non-smooth scrolling #135

Open free-electrician opened 1 year ago

free-electrician commented 1 year ago

Scrolling down in the conversation view is not smooth, sometimes several lines are skipped at once.

To Reproduce Steps to reproduce the behavior:

  1. Join an active channel from https://search.jabber.network
  2. Select another room or contact in the conversations list
  3. Wait for the unread messages number to pile-up to a couple hundred messages
  4. Select the room in the conversations list again
  5. Slowly scroll down and observe occasional jumpy, non-smooth scrolling

Expected behavior Scrolling should always be smooth

Desktop:

hantu85 commented 1 year ago

Scrolling will never be smooth as during scrolling data is loaded (ie. preview for links) and then the view is updated. The size of the preview can be determined only after the linked site is fetched and that is done when you actually are about to see the message containing the link.

This is done this way to not fetch all links at once when message history is fetched (especially if someone may decide not to look at links at all).

The same goes for attachments.

However, the root cause of that is Apple AppKit (framework for UI on macOS) which decides that if the size of a message in the conversation log changes, then it doesn't keep the correct location on the screen during scrolling.

We have planned to switch from AppKit to SwiftUI in future versions and that may change this behavior. Due that and the fact that is it "inconvenience" and not critical issue, this will not be worked on currently.

free-electrician commented 1 year ago

Thank you for your answer. Is it possible to somehow mitigate this inconvenience? It still happens when link previews and attachments are disabled.

hantu85 commented 1 year ago

It still will be happening if you have messages which are multiline (the text of the message is wrapped). That is also causing resizing of the message just before it is displayed causing scrolling issues.

hantu85 commented 1 year ago

And there is no solution for that.