wordpress-activitypub
wordpress-activitypub copied to clipboard
Remote Reply doesn't work
Quick summary
A recent update has added a "Reply on the Fediverse" button to comments which have been made on the Fediverse and syndicated to my blog.
Pressing the button launches a modal dialogue, but the actions it contains don't work.
Steps to reproduce
-
View the comments at https://shkspr.mobi/blog/2024/04/fixing-broken-suspend-on-pop_os/#comments
-
Clicking the reply button says "invalid"
-
View the comments on an older post at https://shkspr.mobi/blog/2023/09/why-is-it-so-hard-to-watch-foreign-tv-in-the-streaming-era/#div-comment-316308
-
Clicking the reply button shows links which do not resolve to the comment.
- This shows
https://shkspr.mobi/blog/?c=316310but the actual comment link is https://mastodon.social/@scaseynz/111093492329755997
What you expected to happen
Modal dialogue should have buttons that work and contain valid links.
What actually happened
Interacting with the modal did not allow me to reply on the fediverse.
Impact
One
Available workarounds?
No but the platform is still usable
Logs or notes
No response
The first issue is caused by CSS. There is a text box there, but I couldn't see it because it uses invalid colours:
activitypub__dialog .activitypub-dialog__button-group input {
background-color: var(--wp--preset--color--white);
border: 1px solid var(--wp--preset--color--black);
color: var(--wp--preset--color--black);
...
}
My theme doesn't have those --wp--preset variables.
Additionally, the modal doesn't respect the dark / light mode of the theme:
I can raise a separate bug for that if necessary?
Is this an older comment? The code uses the source_id if there is one and only uses the internal ID otherwise... https://github.com/Automattic/wordpress-activitypub/blob/master/includes/rest/class-comment.php#L78
I can raise a separate bug for that if necessary?
I would prefer a separate bug for that. That makes it easier to track the issue.
I also saw some "curious" CSS being applied, turned out Gutenberg components have a lot of "hardcoded" (e.g., 13px, etc.) font sizes and so on. Also, the close button turns white on hover, rendering it nearly invisible against a light gray background. (Now wondering if a more minimal script, with minimal styling, might be the "better" choice, i.e., more respecting of theme styles.)
Guessing those variables aren't there (they do exist for me) because you're not using a block theme ...
Is this an older comment?
Looks like September '23. :-) Maybe "internal/non-pretty comment URLs" should only be used for "native" comments?
If no source_id can be determined, maybe not show a "Fediverse reply link"? (What happens if it isn't there? Does the plugin assume a "native" comment? Maybe it shouldn't ...)
older comment
It is from 2023-09-19 20:36
If I do get_comment_link( $comment_id ) that shows the correct Fediverse link.
I'll open an issue for the CSS.
Ok, then it might be that. get_comment_link( $comment_id ) works, because it uses the source_url as a fallback (source_id might be introduced after the comment was posted)... I will add that also to the remote-reply feature...
Thanks for figuring that out @edent
Here's what I've ended up with:
In class-comment.php
public static function init() {
// \add_filter( 'comment_reply_link', array( self::class, 'comment_reply_link' ), 10, 3 );
\add_filter( 'comment_class', array( self::class, 'comment_class' ), 10, 3 );
\add_filter( 'get_comment_link', array( self::class, 'remote_comment_link' ), 11, 3 );
// \add_action( 'wp_enqueue_scripts', array( self::class, 'enqueue_scripts' ) );
}
That stops all the weird stuff loading into my site.
Then, in my comments walker, I check to see if the comment URL is from my domain. If it isn't, I add a new reply link.
As I said, I appreciate what you're trying to do with this. But loading up a bunch of JS and CSS just isn't necessary for lots of sites and does degrade the user experience.
It would be really helpful if there was a simple toggle so that site owners could decide how they want to handle replies.
This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 5 days.