-
-
Notifications
You must be signed in to change notification settings - Fork 52
feat(Classic Footer): "Turn reblog buttons back into links" #1931
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
Conversation
TODO: * hide the portaled reblog menu, in case it is already open * use the hidden reblog menu to navigate to the reblog form (restore green button behaviour)
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
|
@marcustyphoon I'll work on this more tomorrow; in the meantime, feel free to conduct code review to see if this mess can be written more neatly. Maybe some util extractions would be in order...? |
This comment was marked as off-topic.
This comment was marked as off-topic.
marcustyphoon <[email protected]>
Co-authored-by: marcustyphoon <[email protected]>
|
Have not checked this yet, but note to self and/or you: check behavior both on posts that cannot be reblogged which have no reblogs and posts that cannot be reblogged but which do have reblogs. edit: looks fine 👍 |
Co-authored-by: marcustyphoon <[email protected]>
hiding the reblog button makes AriaKit fail to set aria-labelledby on the div[role="menu"] so, if we only hide reblog menu portals that don't have [role="menu"][aria-labelledby]... then only menus attached to unprocessed reblog buttons are shown!
…footer/reblog-button
|
Ah, selector composition :D |
|
Interesting oddity: things like right clicking a link in Firefox and selecting the option to search the web for the text contents or dragging a link in safari and observing the tooltip will use the contents of the contained style element as the link text. This is probably minor enough to make it not worth bothering moving the style element one level up and making cleanup more annoying, but we could. |
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.
Above lint suggestion aside:
- listed tests work as expected in—for variety—desktop safari 18.5
- works on sponsored posts (that have data ids; those without are ignored by this feature even though they have a footer and can be liked)
- works on blazed posts
- works on "review flagged posts" page
- works on likes page in grid view
- works on private posts as much as redpop itself does, which is to say it opens the reblog interface even though the reblog attempt will error
- correct behavior on posts that cannot be reblogged with no reblogs
- correct behavior on posts that cannot be reblogged that have reblogs
- does not break tumblr tv
Co-authored-by: marcustyphoon <[email protected]>
To do
Description
Adds an on-by-default option in Classic Footer to disable the new reblog menu.
This is achieved, as per the original issue text, creating our own anchor element with the cloned inner HTML of Tumblr's reblog button. This anchor has all the necessary CSS to perfectly visually mimic the original button.
When the reblog link is clicked without any modifier keys active, its event listener will prevent a browser-driven navigation to the reblog form, and instead open Tumblr's reblog menu in order to click the native reblog link; this is different from simply using
navigate()in that a successful reblog from this state will turn the reblog button green.When E or W is held down, the original reblog button is shown instead of the constructed reblog link, so that Fast Reblog or Quick Queue can be used unimpeded.
Quick Reblog's actually works on the reblog link without modification, but the AlreadyReblogged tick was in a slightly different position since the reblog link makes it look like the first variant of the split notes count post footer is active. This PR consolidates the AlreadyReblogged CSS to drop the styles specific to that variant, and make the selector for the shipped variant more greedy. (Notably, this does not actually break anything if that variant is enabled.)
Testing steps
Setup & basic functionality
/reblog/URLClick behaviour
Button colour mimicking
Reblog menu hiding/unhiding
Keyboard shortcuts
Quick Reblog