Bug 463235 - Message queue is jumping during downward scrolling
Summary: Message queue is jumping during downward scrolling
Status: RESOLVED FIXED
Alias: None
Product: NeoChat
Classification: Applications
Component: General (other bugs)
Version First Reported In: unspecified
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Tobias Fella
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-12-19 14:39 UTC by Gergely HORVÁTH
Modified: 2023-10-16 19:19 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Msg queue wiggling (2.65 MB, video/mp4)
2022-12-19 14:39 UTC, Gergely HORVÁTH
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gergely HORVÁTH 2022-12-19 14:39:21 UTC
Created attachment 154694 [details]
Msg queue wiggling

Hello,

when scrolling on timelines I see some weird wiggle or jumping. I don't really know what is triggering it, I try to attach a video where I reproduced. In the noechat or plasma mobile rooms I usually see this happening. Maybe it is the multiple users, or the images, maybe the enabled url preview. It seems like there is some issue with the calculation of the message heights and it somehow always throws me up a bit, while I'm trying to scroll downwards.

I hope the video helps understanding what I tried to explain.

Best regards,

Operating System: Arch Linux
KDE Plasma Version: 5.26.4
KDE Frameworks Version: 5.100.0
Qt Version: 5.15.7
Kernel Version: 6.0.11-arch1-1 (64-bit)
Graphics Platform: X11
Processors: 8 × 11th Gen Intel® Core™ i7-11370H @ 3.30GHz
Memory: 15,4 GiB of RAM
Graphics Processor: Mesa Intel® Xe Graphics
Manufacturer: TUXEDO
Product Name: TUXEDO InfinityBook Pro 14 Gen6

```sh
$ pacman -Qs neochat
local/neochat 22.11-1
    A client for matrix, the decentralized communication protocol
```
Comment 1 Gergely HORVÁTH 2022-12-19 14:57:15 UTC
Almost forgot: beside the regular console log msgs (quotient.jobs: Sent GET https://matrix.horvath.club/... and  quotient.jobs: 200 <- GET ...) I see the following logs around scrolling, but haven't been spammed and also switching to console, checking it, switchin to neochat reproducing the wiggle, switching back also does not reproduce the log messages, so I don't really think they are connected, yet I'm not familiar with the code, so better paste them here:

```sh
Connected to room "!HASH2:kde.org" as "@gergely:horvath.club"                                                                                                                                                                  
qrc:/RoomPage.qml:263:13: Unable to assign [undefined] to bool                                                                                                                                                                              
qrc:/RoomPage.qml:263:13: Unable to assign [undefined] to bool                                                                                                                                                                              
quotient.jobs: Sent PUT https://matrix.horvath.club/_matrix/client/r0/rooms/HASH1:kde.org/typing/@gergely:horvath.club                                                                                                        
quotient.jobs: Sent GET https://matrix.horvath.club/_matrix/client/r0/rooms/HASH2:kde.org/messages                                                                                                                            
quotient.jobs: 200 <- PUT https://matrix.horvath.club/_matrix/client/r0/rooms/HASH1:kde.org/typing/@gergely:horvath.club                                                                                                      
quotient.jobs: 200 <- GET https://matrix.horvath.club/_matrix/client/r0/rooms/HASH2:kde.org/messages                                                                                                                          
Trying to refresh inexistent event: "$HASH3"                                                                                                                                                          

...

Trying to refresh inexistent event: "$HASH4"
Trying to refresh inexistent event: "$HASH5"
```
Comment 2 James Graham 2022-12-28 10:24:13 UTC
https://invent.kde.org/network/neochat/-/merge_requests/720 seems to have fixed the issue. I haven't had it recur since. Any testing of the current master would be appreciated as I'm hesitant to close it as this was intermittent and the linked mr may only have improved but not fully solved it.
Comment 3 Jack Hill 2023-02-03 11:27:30 UTC
(In reply to James Graham from comment #2)
> https://invent.kde.org/network/neochat/-/merge_requests/720 seems to have
> fixed the issue. I haven't had it recur since. Any testing of the current
> master would be appreciated as I'm hesitant to close it as this was
> intermittent and the linked mr may only have improved but not fully solved
> it.

This seems to have fixed the issue with regards to images. However I still get problems with urls sent in chat. It seems like messages that contain urls currently fix the location of the bottom of the message, so when they expand they end up pushing all messages upwards.

This has the undesired effect of off-screen messages pushing all viewable messages upwards for seemingly no reason.

 Maybe you could change it so that url previews that load off-screen (and below the viewable messages) expand downwards instead?
Comment 4 James Graham 2023-02-03 13:21:24 UTC
(In reply to Jack Hill from comment #3)
> (In reply to James Graham from comment #2)
> > https://invent.kde.org/network/neochat/-/merge_requests/720 seems to have
> > fixed the issue. I haven't had it recur since. Any testing of the current
> > master would be appreciated as I'm hesitant to close it as this was
> > intermittent and the linked mr may only have improved but not fully solved
> > it.
> 
> This seems to have fixed the issue with regards to images. However I still
> get problems with urls sent in chat. It seems like messages that contain
> urls currently fix the location of the bottom of the message, so when they
> expand they end up pushing all messages upwards.
> 
> This has the undesired effect of off-screen messages pushing all viewable
> messages upwards for seemingly no reason.
> 
>  Maybe you could change it so that url previews that load off-screen (and
> below the viewable messages) expand downwards instead?

Thanks for this  you're right. What's actually happening is the link preview is invisible until all the data is loaded which can take a couple of seconds then it's popping into view. The solution here might be to put a placeholder in there to stop the resizing.
Comment 5 Jack Hill 2023-02-04 15:10:01 UTC
(In reply to James Graham from comment #4)
> The solution here might be to put a placeholder
> in there to stop the resizing.

This could work well. One thing to take note though is that you'll have to fix the size of url previews. Currently it seems like the preview size is based on the amount of text in the first sentence of the url, so some previews are longer than others. If the actual preview is larger than the placeholder, then the message will be resized and all messages will be pushed upwards anyway. I'm not sure how you could match the size of the placeholder to the size of the preview without already having the preview in the first place.
Comment 6 James Graham 2023-02-04 16:12:03 UTC
(In reply to Jack Hill from comment #5)
> (In reply to James Graham from comment #4)
> > The solution here might be to put a placeholder
> > in there to stop the resizing.
> 
> This could work well. One thing to take note though is that you'll have to
> fix the size of url previews. Currently it seems like the preview size is
> based on the amount of text in the first sentence of the url, so some
> previews are longer than others. If the actual preview is larger than the
> placeholder, then the message will be resized and all messages will be
> pushed upwards anyway. I'm not sure how you could match the size of the
> placeholder to the size of the preview without already having the preview in
> the first place.

I already put something together https://invent.kde.org/network/neochat/-/merge_requests/783. They all start with a set size and can be expanded if longer
Comment 7 Jack Hill 2023-09-10 15:13:28 UTC
This seems to have gotten significantly worse in 23.08.0
Comment 8 Nate Graham 2023-09-26 13:51:11 UTC
Data point: I just turned off join/leave events, name change events, and avatar change events, and now scrolling works smoothly and properly. The bar itself is still a bit jumpy, but that's a visual glitch, not a functional glitch, so I'm comfortable ignoring it for now and using NeoChat again.
Comment 9 Alessandro Astone 2023-09-26 16:23:34 UTC
This is still happening in "Compact" mode (Configure > Appearance > General theme). It is pretty unusable.
"Bubbles" mode works fine.
Comment 10 Alessandro Astone 2023-10-05 15:39:28 UTC
(In reply to Alessandro Astone from comment #9)
> This is still happening in "Compact" mode (Configure > Appearance > General
> theme). It is pretty unusable.
> "Bubbles" mode works fine.

Seems to be fixed in Gear 23.08.1?
Comment 11 Nate Graham 2023-10-05 15:44:08 UTC
Yeah I also can't reproduce it anymore with current git master, even with all the stuff I turned off turned back on again.
Comment 12 James Graham 2023-10-05 18:26:37 UTC
That scare me a little for 23.08.1 as I have no idea why. For master I managed to swat a bunch of polish loops that were causing a bunch of problems
Comment 13 Alessandro Astone 2023-10-05 19:59:08 UTC
(In reply to James Graham from comment #12)
> That scare me a little for 23.08.1 as I have no idea why. For master I
> managed to swat a bunch of polish loops that were causing a bunch of problems

Well, it was actually fixed for me after upgrading Fedora 38 -> Fedora 39, where the relevant changes are gear-23.08.1 and kf5.110
So maybe frameworks update helped?
Comment 14 Jack Hill 2023-10-05 20:15:21 UTC
For me it seems like some stuff in NeoChat has been reverted. I don't have url previews, and this bug has shown up again since the image delegates are resizing themselves /after/ the image loads, rather than before. What's weird is that I also have the stuff new to 23.08 like the spaces sidebar.

I have no idea if this is an upstream KDE issue or downstream openSUSE (I'm using the packaged neochat). Maybe openSUSE is patching some stuff out? For reference this issue started occurring again when I updated to 23.08.0 and hasn't been fixed with 23.08.1
Comment 15 Marco Parillo 2023-10-11 09:23:56 UTC
It seems greatly improved to me recently.
Bubbles mode.
NeoChat6 version:  23.08.1-2

Operating System: KaOS (2023) 
KDE Plasma Version: 5.27.80
KDE Frameworks Version: 5.240.0
Qt Version: 6.6.0
Kernel Version: 6.4.16-1 (64-bit)
Graphics Platform: Wayland
Comment 16 Tobias Fella 2023-10-16 19:19:01 UTC
I haven't noticed major problems here as well lately. Let's consider this fixed until someone notices it again