Fix scroll position not restored when doing Back on Desktop #6842
No reviewers
Labels
No labels
accessibility
app-parity
area: creator
area: daemon
area: design
area: devops
area: discovery
area: docs
area: installer
area: internal
area: livestream
area: performance
area: proposal
area: reposts
area: rewards
area: search
area: security
area: subscriptions
area: sync
area: ux
area: viewer
area: wallet
BEAMER
channel
comments
community PR
consider soon
core team
css
dependencies
electron
Epic
feature request
first-timers-only
good first issue
hacktoberfest
help wanted
hub-dependent
icebox
Invalid
level: 0
level: 1
level: 2
level: 3
level: 4
merge when green
needs: exploration
needs: grooming
needs: priority
needs: repro
needs: tech design
notifications
odysee
on hold
playlists
priority: blocker
priority: high
priority: low
priority: medium
protocol dependent
recsys
redesign
regression
resilience
sdk dependent
Tom's Wishlist
trending
type: bug
type: discussion
type: improvement
type: new feature
type: refactor
type: task
type: testing
unplanned
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: LBRYCommunity/lbry-desktop#6842
Loading…
Reference in a new issue
No description provided.
Delete branch "ip/desktop.back"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This should go into the next Desktop RC as it is very annoying.
Ticket
Closes #6743: Desktop: "Back" in Following Page no longer restores scroll position
Issue
This was a side-effect of #6609 claimListDiscover: don't re-render until query is done. That PR did not handle the case of navigating backwards, which typically would just need to display past result. It ended up always starting with a blank list on mount, so the scroll position could not be restored correctly.
I don't know why it still worked on Web/Chrome -- maybe the latest browser knows how to move to desired scroll position when the height is available.
Change
If navigating backwards, initialize the final URI list with the previous result. It is almost always correct, and if not, will be corrected in the effects. This also saves us one re-render when navigating backwards.
Tom told to test. It seems to sometimes return few pages up from where you were, when going back. Didn't see any clear consistency. But seems to happen often when you first time go back.
If scrolled down again, it seems to work like expected most of time.
Few times noticed it does similar behaviour, clicking back places you few pages "up" from where you left.
I just re-tried to rebuild
ip/desktop.back
, but couldn't replicate the issue. I've tried the steps above, but it always returns to the correct position. I've also tried the following variations:Maybe a video of your environment/replicating it could help uncover some clues.
Oh sorry, actually when download the zip from https://github.com/lbryio/lbry-desktop/tree/ip/desktop.back it works perfectly.
I originally tested by updating to current master, and then pulling the PR. Did these commands to build app.
git fetch origin pull/6842/head:go-back-fix
git checkout go-back-fix
yarn && yarn electron:compile && yarn build
Addition:
I run the linux-unpacked app on both
Should I've do some clean up in "dist" before building?
Addition2:
Deleting "dist" before building didn't make difference
I ran the app build from https://github.com/lbryio/lbry-desktop/tree/ip/desktop.back again. And after more tries I saw issue with it too. I'll get a recording of what I see.
https:odysee.com/issue:93
First try jumps back to start.
Second try works like it should.
I un-zipped the zip from https://github.com/lbryio/lbry-desktop/tree/ip/desktop.back and cd to it. Then ran
yarn && yarn compile:electron && yarn build && sudo chown root:root dist/electron/linux-unpacked/chrome-sandbox && sudo chmod 4755 dist/electron/linux-unpacked/chrome-sandbox
dist/electron/linux-unpacked/lbry
I run Gentoo, so maybe it has some problem. The installation isn't most clean.
Decided to try also with VM: Ubuntu 20.04.2 LTS
In that it always works, and I tried many times. Tested with linux-unpacked and appImage
Maybe the problem only happens on my desktop.