Skip to content

fix(Tweaks): "Hide filtered posts entirely" breaking if endless scrolling is disabled#2285

Open
marcustyphoon wants to merge 6 commits into
masterfrom
marcustyphoon/filtered-posts-no-endless-scrolling-fix
Open

fix(Tweaks): "Hide filtered posts entirely" breaking if endless scrolling is disabled#2285
marcustyphoon wants to merge 6 commits into
masterfrom
marcustyphoon/filtered-posts-no-endless-scrolling-fix

Conversation

@marcustyphoon

Copy link
Copy Markdown
Collaborator

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 getTimelineItemWrapper twice. 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) getTimelineItemWrapper no 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.

Comment thread src/utils/interface.js Outdated
Comment thread src/utils/interface.js Outdated
Comment thread src/utils/interface.js Outdated
marcustyphoon and others added 2 commits June 12, 2026 02:00
Co-authored-by: April Sylph <28949509+AprilSylph@users.noreply.github.com>
@marcustyphoon

Copy link
Copy Markdown
Collaborator Author

Will that break on stuff with data-timeline?

@AprilSylph

Copy link
Copy Markdown
Owner

Timeline V1s don't have cells, so the existing .closest(listTimelineObjectSelector) should suffice for them. The new code is literally "find the wrapper in Timeline V2; fall back to finding the wrapper in Timeline V1". Should double-check that nothing is broken on Queue pages to be sure of this.

@marcustyphoon

Copy link
Copy Markdown
Collaborator Author

Tempted to do, like, :is(${keyToCss('cell')}, :not([class])), but maybe that's excessive.

@AprilSylph AprilSylph left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and working:

  • hide_filtered_posts on dashboard, endless scrolling enabled
  • hide_filtered_posts on dashboard, endless scrolling disabled
  • hide_filtered_posts on permalink view, endless scrolling enabled
  • hide_filtered_posts on permalink view, endless scrolling disabled
  • PostBlock on dashboard
  • PostBlock on permalink view
  • PostBlock on Queue

@marcustyphoon

Copy link
Copy Markdown
Collaborator Author

Do we need to apply that margin change to the other features that hide posts?

@AprilSylph

AprilSylph commented Jun 12, 2026

Copy link
Copy Markdown
Owner

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 hide_filtered_posts as well.

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`);

@marcustyphoon

Copy link
Copy Markdown
Collaborator Author

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 scrollContainer is optional but I don't know when that would ever be used... tumblr patio is probably normal? Surely it's fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tweaks: "Hide filtered posts entirely" breaks if endless scrolling is disabled

2 participants