-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Tweak: Force the default dashboard tab to "Following" #1134
New Tweak: Force the default dashboard tab to "Following" #1134
Conversation
going to test this tonight |
only matters when enabled on a pre-may-8 blog, but still
Can you explain the performance optimization commit? I'm not sure I understand how it improves performance |
that is not how a parent selector works.
Went to write an answer to that and realized that I messed it up (yes it did improve it; no it did not improve it by the amount desired). Fixing... |
Take two: Sure! querySelector calls stop searching once they find an element that matches the whole selector—which, notably, means that they don't short-circuit if such an element doesn't exist, and will check every element on the page against the rightmost selector in their query string. On a Tumblr page, this can easily be hundreds of thousands of elements. The tweaked code finds the timeline element quickly no matter how many posts are loaded (querySelector starts at the top of the DOM tree) and no matter what the currently-logged-in account's default dashboard tab is, putting a ceiling on execution time at a small fraction of a millisecond. This could be optimized more by stealing more code out of mutations.js (rAF throttle), but it's plenty fast enough and this tweak will be obsolete soon anyway. |
This could also include click handlers on the home button and tumblr logo that go straight to the following tab to skip an extra api request, now that I think of it. But also, like, how many people will actually use this between when it hypothetically gets released and when it hypothetically gets retired (and/or optimized, if this isn't on the redpop roadmap)? Probably not worth the extra testing and review? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't have an account that is capable of testing this, but code looks good.
Is Staff planning to add a feature that makes your first dashboard tab customizable and the default (or that remembers your last-selected dashboard tab or something) any time soon? If yes, this is obviously pointless. I, however, was not sure if that was the implication of
Description
Adds a tweak that forces navigation to tumblr.com and tumblr.com/dashboard to actually point to the "Following" dashboard tab instead of the "For You" dashboard tab, as it does for accounts created after May 8th, 2023.
I will probably publish an equivalent to this as a userscript (already written) and then no-op it when it is no longer needed if we don't want to add it to XKit and the behavior is not expected to be implemented natively soon.
Resolves #1158
Testing steps
Load the new tweak on a blog created after May 8th, 2023.
Also, perform the above actions in the mobile layout.
In each case, it should appear that the "Following" tab is the target of said navigation actions.