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

Seen Posts: Only register posts that appear on screen

Open marcustyphoon opened this issue 3 years ago • 2 comments

Concept

Seen Posts currently remembers any post that has been loaded while the script is running, even if you never scrolled down to the post in question. As per the script title, it makes sense to only mark posts the user has, well, seen.

This is pretty easy using an intersection observer, but there are some notes:

  • Should scrolling past posts rapidly mark them all as seen, or should the post need to be visible for more than a few milliseconds? (Or should this be a preference?) I can see the logic of both; the latter implements the script name more literally. Similarly, should any pixels of a post becoming visible count as seeing it, or should the center of the post be visible? I am a user of this script but not a passionate one (partially for reasons this issue addresses) and I would like to know what passionate users would prefer.
  • Should posts hidden by extensions be marked as seen? This seems like a clear "no" - you haven't seen them! This basically happens anyway, in the simplest implementation (display:none means an element does not intersect the viewport), though ensuring it is reliable would require some complexity if MV3 eventually forces us to process mutations asynchronously.
  • Do we use Tumblr's hiddenObserverMiddlePoint element, or is that getting too cute?

marcustyphoon avatar May 12 '22 04:05 marcustyphoon

I believe the hiddenObserverMiddlePoint is how the dashboard tracks where to put you with the "where were we?" button, and consistency would be nice.

AprilSylph avatar May 12 '22 06:05 AprilSylph

Interesting side effect of this: posts taller than 2x viewport height are not marked as seen if you j/k scroll through them and are not intrigued enough to scroll down.

marcustyphoon avatar May 12 '22 17:05 marcustyphoon