Bug 501936 - Page Up / Page Down can cause posts to disappear
Summary: Page Up / Page Down can cause posts to disappear
Status: RESOLVED FIXED
Alias: None
Product: Tokodon
Classification: Applications
Component: general (other bugs)
Version First Reported In: 24.12.2
Platform: Arch Linux Linux
: NOR minor
Target Milestone: ---
Assignee: Unassigned bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-03-24 10:44 UTC by huguesross
Modified: 2025-05-26 00:26 UTC (History)
2 users (show)

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


Attachments
Pair of screenshots showing the timeline before & after reproducing this bug (184.17 KB, image/png)
2025-03-24 10:44 UTC, huguesross
Details

Note You need to log in before you can comment on or make changes to this bug.
Description huguesross 2025-03-24 10:44:05 UTC
Created attachment 179688 [details]
Pair of screenshots showing the timeline before & after reproducing this bug

***
If you're not sure this is actually a bug, instead post about it at https://discuss.kde.org

If you're reporting a crash, attach a backtrace with debug symbols; see https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports

Please remove this comment after reading and before submitting - thanks!
***

SUMMARY


STEPS TO REPRODUCE
1. Open your timeline. You must be able to see two or more posts to reproduce the issue
2. Scroll down as little as possible, just enough for scrolling up to be possible
3. Press Page Up (This bug can also be reproduced at the bottom of a thread using Page Down)

OBSERVED RESULT
The bottom-most post disappears (that is to say, it becomes an empty space) until you scroll again, at which point it re-appears.

EXPECTED RESULT
The bottom-most post remains visible, as it is still in the viewport.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
(available in the Info Center app, or by running `kinfo` in a terminal window)
Linux/KDE Plasma: 
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
This is a 100% repro on my system, I can easily do it on command if more info is needed

I know nothing about the structure of this software, but as a software developer I have a suspicion about its origins:
- When Page Up is pressed, the offset of the viewport is clamped by the upper bounds of the page
- ...but the process that determines which widgets to render / cull receives the original un-clamped value
- As such, the bottom-most post appears to be "off the page" to this algorithm and is no longer rendered until the viewport scrolls again
Comment 1 huguesross 2025-03-24 10:53:00 UTC
Additional note since I missed the relevant field when reporting and can't update the description:
- KDE Frameworks Version: 6.11.0
- QT Version: 6.8.2
Comment 2 Bug Janitor Service 2025-04-18 22:05:20 UTC
A possibly relevant merge request was started @ https://invent.kde.org/network/tokodon/-/merge_requests/726
Comment 3 Joshua Goins 2025-04-18 22:17:09 UTC
Git commit a43ec02c1a3e884e4f428bfba0707227cd60da92 by Joshua Goins.
Committed on 18/04/2025 at 22:17.
Pushed by redstrate into branch 'master'.

Clamp contentY when using the PageUp key

This can end up going way below 0, and causes all sorts of issues like
missing posts.
VERSION-FIXED-IN: 25.04.1

M  +3    -0    src/content/ui/Components/TimelineView.qml

https://invent.kde.org/network/tokodon/-/commit/a43ec02c1a3e884e4f428bfba0707227cd60da92
Comment 4 Joshua Goins 2025-04-18 23:25:18 UTC
Git commit b904f9d2db670f983ef15e2c734c7fb9380e9115 by Joshua Goins.
Committed on 18/04/2025 at 22:18.
Pushed by redstrate into branch 'release/25.04'.

Clamp contentY when using the PageUp key

This can end up going way below 0, and causes all sorts of issues like
missing posts.
VERSION-FIXED-IN: 25.04.1
(cherry picked from commit a43ec02c1a3e884e4f428bfba0707227cd60da92)

M  +3    -0    src/content/ui/Components/TimelineView.qml

https://invent.kde.org/network/tokodon/-/commit/b904f9d2db670f983ef15e2c734c7fb9380e9115
Comment 5 huguesross 2025-04-19 00:49:29 UTC
While the fix you've just made looks like it ought to work, I should note that as alluded to in the title of the thread--the same bug can also be performed by scrolling past the end of a finite page with Page Down. Reading back at my report, I apparently *only* put this in the title and not the body...sorry about that, that's on me.

Same idea, just a somewhat harder to repro. Looking at your commit, I believe it's just a matter of clamping the value of root.contentY to not exceed the bottom of the page (maybe minus the viewport height? I don't work with Qt so I can only speculate here) in the other callback.
Comment 6 Joshua Goins 2025-05-26 00:26:40 UTC
Git commit 66c2aa98a448e58ad295b97a277d23ce07c278fd by Joshua Goins.
Committed on 26/05/2025 at 00:26.
Pushed by redstrate into branch 'master'.

Clamp contentY in both directions

M  +1    -3    src/content/ui/Components/TimelineView.qml

https://invent.kde.org/network/tokodon/-/commit/66c2aa98a448e58ad295b97a277d23ce07c278fd