AprilSylph / XKit-Rewritten

🧰 The enhancement suite for Tumblr's new web interface
GNU General Public License v3.0
274 stars 44 forks source link

Experiment: Unified exhaustive `data-timeline-id` parsing #1485

Open marcustyphoon opened 3 weeks ago

marcustyphoon commented 3 weeks ago

Description

This is the most horrifying thing I have ever created using javascript. I wanted to give it a try, though, as I figured I could cherry-pick snippets/solutions/concepts from it for whatever we actually wind up implementing.

I did wind up kind of liking passing a filter function directly into filterPostElements. Pretty much all of the "generate multiple outputs from one set of source data that describes the timeline ids" code isn't worthwhile, though, or at least I couldn't figure out a form for it that's any good.

Testing steps

marcustyphoon commented 3 weeks ago

It's not getting better. It's not getting better!

marcustyphoon commented 1 week ago

Aw, man. Tagged pages break this paradigm, as you have to be able to treat data-timeline-id="hubsTimeline-some tag-recent-search_box_suggestion_followed_tag" and data-timeline-id="hubsTimeline-some tag-recent-undefined" the same way, which would have to become a [data-timeline-id^="etc"] CSS selector only in that specific case, which is hard to automate.

I mean, maybe you could ^= all of them, particularly with the fixes to patio timeline ids I'm waiting on? That would probably break in certain scenarios in the engineered cases like "my blog name is undefined-undefined" unless ids are tweaked further, but I mean, who really cares.

marcustyphoon commented 2 days ago

collection:

regular, v1; patio, v1: data-timeline="/v2/timeline" data-which="pack" patio, v2: data-timeline-id=collection-[columnid]-collectionid