fix(Tweaks): "Hide filtered posts entirely" breaking if endless scrolling is disabled#2285
fix(Tweaks): "Hide filtered posts entirely" breaking if endless scrolling is disabled#2285marcustyphoon wants to merge 6 commits into
Conversation
Co-authored-by: April Sylph <28949509+AprilSylph@users.noreply.github.com>
|
Will that break on stuff with |
|
Timeline V1s don't have cells, so the existing |
|
Tempted to do, like, |
AprilSylph
left a comment
There was a problem hiding this comment.
Tested and working:
-
hide_filtered_postson dashboard, endless scrolling enabled -
hide_filtered_postson dashboard, endless scrolling disabled -
hide_filtered_postson permalink view, endless scrolling enabled -
hide_filtered_postson permalink view, endless scrolling disabled - PostBlock on dashboard
- PostBlock on permalink view
- PostBlock on Queue
|
Do we need to apply that margin change to the other features that hide posts? |
|
Only PostBlock needs the margin override, but only by coincidence—no other post-hiding feature targets elements found in the queue. If Tumblr decided to start showing filtered screens on your own posts, it would be needed for TIL: Timeline V1s that are not the queue (e.g. https://www.tumblr.com/timeline/blog_subscriptions) are also using virtualisation now?? Seems we could simplify even further: export const getTimelineItemWrapper = element => element.closest(`${timelineSelector} > div > div`); |
|
Hm, I don't know how to be confident about this. I guess we have grid, masonry, queue, endless scrolling on and off for each... I think the code technically implies that |
Description
This fixes filtered posts not being hidden if endless scrolling is disabled.
The cause for this was that (as I noted in #2132) the code was, to appear more semantically correct, calling
getTimelineItemWrappertwice. I thought the utility function was idempotent (could be called repeatedly with the same result), and when the resulting code worked I didn't think about it further, but it actually wasn't idempotent with endless scrolling disabled.This PR makes two changes, either of which fix the problem alone: a)
getTimelineItemWrapperno longer crashes if called multiple times with endless scrolling disabled, and b) the filtered post hiding feature no longer calls it multiple times.Resolves #2284.
Testing steps
Confirm that filtered posts are hidden both with and without endless scrolling enabled.