XKit-Rewritten icon indicating copy to clipboard operation
XKit-Rewritten copied to clipboard

Scroll to Bottom stays stuck "on" between pages

Open arcanetrivia opened this issue 2 years ago • 5 comments

Platform

Windows 10

Browser

Firefox 100.0.2 (64 bit)

Addon version

v0.19.4

Details

When I hit the Scroll to Bottom arrow, it turns yellow and does its thing. Cool. But then if I change pages, say going from my queue to my drafts, the arrow is still yellow upon page load and immediately scrolls the page down to the bottom without me interacting with it. I can work around this by remembering to click the arrow again before changing pages, but I feel like this script didn't used to behave like a cross-page toggle, and would always begin in the "off" state when a page where it could apply was loaded. (I don't remember for sure when I updated from 0.19.3 to 0.19.4, although it was within the past 10 days most likely. Unfortunately I think I also applied a Firefox update within the same timeframe, so that possibly muddies the waters.)

I noticed also that at first (meaning right after one or the other update) the down arrow was duplicated on the pages where it appears. That was fixed by turning off the toggle for the script and then turning it on again (I haven't seen it since).

arcanetrivia avatar May 26 '22 16:05 arcanetrivia

Hmm, I think I remember the feature turning itself off successfully on navigation before, so I think you're right. Based on our current code (which turns off the feature if the button that we add is removed from the page), my guess is that a slight change to Tumblr's code results in the button no longer being removed, and so we need a different way to detect this.

marcustyphoon avatar May 26 '22 20:05 marcustyphoon

Ah, if Tumblr changed something slightly then it might not be related to either extension or browser update. I just remember seeing it start to happen sometime within the past few days on two different computers (but both Win/Firefox of similar versions).

arcanetrivia avatar May 26 '22 20:05 arcanetrivia

It looks like the main problem here is that scrolling doesn't stop when there are no more posts on the page. I just experienced this after loading my whole queue, then going to a different page. When all posts are loaded, scrolling should stop.

https://github.com/AprilSylph/XKit-Rewritten/blob/e764557adf7d1f8212ecec8141bb74129f97d8b9/src/scripts/scroll_to_bottom.js#L23-L25

AprilSylph avatar May 30 '22 10:05 AprilSylph

Hmm, so we seem to have a few problems:

  • scrollToBottom immediately (synchronously) checks if the loader is gone immediately after it scrolls; this doesn't appear to work. Not sure how to reliably detect the loader asynchronously disappearing, though.
  • It does look like our selector is hitting loaders inside carousels now; it may need to be updated to e.g. main ${keyToCss('timeline')} > ${keyToCss('loader')} ${keyToCss('knightRiderLoader')}.
  • The button isn't being removed when you navigate, as mentioned.

marcustyphoon avatar Jun 01 '22 05:06 marcustyphoon

This issue is not, strictly speaking, fixed; #713 fixes the issue that April mentioned in which Scroll to Bottom stayed "active" once it got to the "bottom" of the page.

With this fix, the issue is only possible to observe if you navigate to another page while Scroll to Bottom is actively repeatedly moving the UI. This seems pretty niche, so practically speaking, this seems basically fixed.

marcustyphoon avatar Aug 29 '22 19:08 marcustyphoon

This issue is unconfirmed, and has been labelled as stale due to inactivity. It will be closed automatically if no further activity occurs.

A project maintainer can mark an issue as confirmed by adding the help wanted label, the wontfix label, or an assignee.

stale[bot] avatar Jan 07 '23 05:01 stale[bot]