-
Notifications
You must be signed in to change notification settings - Fork 77
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
Add a reaction block #1070
Add a reaction block #1070
Conversation
Awesome!! 🎉 Maybe one first little feedback: Maybe we should have a line break after the label (and use it more as a headline) so that the icon lists are all aligned? |
a7f99a3
to
95af3b1
Compare
They should definitely be aligned! I'd prefer to keep them on a single line, maybe responsively moving to separate lines on smaller screens. Or I guess we could give some layout options, but that could be a future iteration. 🤔 |
Nice! I believe this would fix #235 as well? |
@mattwiebe what about icons at the beginning of each line https://wordpress.github.io/gutenberg/?path=/docs/icons-icon--docs ???
We could use the icon attribute for that. Either store the
|
6c6f6f2
to
85b7e44
Compare
85b7e44
to
6202b41
Compare
Is it possible to use the comment type registry instead of hardcoding to the two types? So that it is easier to add new types, either in the plugin or an external one? |
Does not have to be in the first iteration! |
Remaining Tasks
|
@Automattic/fediverse Ready to test some more, I think everything should be addressed! |
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.
tests are failing
public static function is_reactions_enabled( $post_id = 0 ) { | ||
// Check global setting first - if disabled globally, return false. | ||
if ( ! self::is_reactions_globally_enabled() ) { | ||
return false; |
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.
This will still prevent, that the block will load outside of the post.
It looks like aab821d broke the unit test that checked whether reactions are enabled for an individual post while they are deactivated globally. |
If we want to have a setting that deactivates the feature globally then we need to have a different setting to add/remove the reactions to the post, these two should not be implicit! |
…add/like-and-boost-blocks
It's not yet ready for prime time.
We've removed support for auto-appending the Reactions block to classic themes. Those users can either insert the block manually, or edit their PHP templates to output the block like: do_blocks( '<!-- wp:activitypub/reactions {"title":"Fediverse Reactions"} /-->' ); We may revisit this, but it was getting too complex and blocking shipping |
This will add a block to display Likes and Reposts in a single block.
Fixes #1057
Proposed changes:
A (not quite up to date) video of it in action:
Screen.Recording.2024-12-11.at.22.24.36.mov
Other information:
Testing instructions:
With this PR active, view a post on the frontend that already has a number of Likes and Reposts. The reactions block should be inserted directly after the post content:
The block is automatically added via a block hook. It should be opted in, and can be disabled in the Single Post template in the Site Editor: (also note the dummy content in the Editor)
Every row of icons, if there are too many to fit the width, should limit the number of avatars shown so that none are cut off.
Avatars and names are shown if you click on the n reposts (or likes) label to the right of the avatars:
On a post with no likes or reposts, nothing will be shown, not even the title.
The title ("Fediverse reactions" by default) is editable.