Skip to content
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

Post and comment likes: make them fully block-based #41668

Open
jsnajdr opened this issue Feb 10, 2025 · 5 comments
Open

Post and comment likes: make them fully block-based #41668

jsnajdr opened this issue Feb 10, 2025 · 5 comments
Labels
[Experiment] AI labels added [Feature] Comment Likes [Feature Group] User Interaction & Engagement Tools and features for site owners to share, promote, and manage engagement with their audiences. [Feature] Likes [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it

Comments

@jsnajdr
Copy link
Member

jsnajdr commented Feb 10, 2025

Impacted plugin

Jetpack

What

Fully support Like and Comment Like blocks instead of the_content/comment_text filters

How

If you go to Jetpack Sharing settings, the "Sharing buttons" feature warns you that you're dealing with a legacy feature and that you should use the "Sharing Buttons" block.

The "Like buttons" feature doesn't show such a warning. But it should 🙂

Image

When I enable the likes or comment-likes module/feature, two things happen:

  1. the module extends the wp-admin view for posts/comments by adding a column with likes.
  2. the module hooks into the the_content/the_excerpt/comment_text filters and adds the post/comment Like widget to the markup.

There should be a possibility to:

  1. Keep the wp-admin extensions.
  2. Disable the filters and add the "Like" and "Comment Like" buttons by adding the respective blocks to my templates.

Currently this is not possible: if I have "Like buttons" enabled and I add the "Like" block to my template, I will see the "Like" button twice. The "legacy" and "block-based" Likes don't work together well.

Additionally, the "Comment Like" block currently doesn't exist at all, it's a feature gap.

@jsnajdr jsnajdr added the [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it label Feb 10, 2025
@github-actions github-actions bot added [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Feature Group] User Interaction & Engagement Tools and features for site owners to share, promote, and manage engagement with their audiences. labels Feb 10, 2025
Copy link
Contributor

OpenAI suggested the following labels for this issue:

  • [Feature Group] User Interaction & Engagement: The issue revolves around enhancing user engagement through likes and comments.
  • [Feature] Likes: The primary focus is on the Like functionality for posts and comments.
  • [Feature] Comment Likes: The issue specifically points out the need for a Comment Like feature, indicating a gap in current functionality.

Copy link
Contributor

This issue could use some more labels, to help prioritize and categorize our work. Could you please add at least a [Type], a [Feature], and a [Pri] label?

@ivan-ottinger
Copy link
Contributor

Hey, Jarda! 👋🏼 🙂

I agree with the issue you are outlining above.

Below I would like to add just a couple notes from the initial Like block project we worked on previously. I also need to mention up-front that it has been quite some time since I worked with the Like block and there might have been some recent developments in Jetpack that I might be missing.


When I enable the likes or comment-likes module/feature, two things happen:

  1. the module extends the wp-admin view for posts/comments by adding a column with likes.
  2. the module hooks into the the_content/the_excerpt/comment_text filters and adds the post/comment Like widget to the markup.

Originally, we aimed to automatically replace the legacy Like button with the new Like block (if a site is using a block-based theme). Unfortunately, back then we run into technical limitations of the Blocks API (details can be found in the following discussions: pdDOJh-2JP-p2#comment-2175 & p7DVsv-jKP-p2#comment-48980). Since that was in 2023, I suspect there might have been some changes to the Blocks API in the meantime which may allow for easier way forward today.

Currently this is not possible: if I have "Like buttons" enabled and I add the "Like" block to my template, I will see the "Like" button twice. The "legacy" and "block-based" Likes don't work together well.

Yes, it would be great if users could keep the Like column on the Posts page in WP Admin even with the legacy Like button disabled, not forcing the user to keep the old Like button in the post markup if they want to rely on the Like block only.

Additionally, the "Comment Like" block currently doesn't exist at all, it's a feature gap.

That's right. This is something we did not cover as a part of the project where the Like block was created (pdDOJh-2JP-p2).

@jsnajdr
Copy link
Member Author

jsnajdr commented Feb 11, 2025

Originally, we aimed to automatically replace the legacy Like button with the new Like block (if a site is using a block-based theme). Unfortunately, back then we run into technical limitations of the Blocks API

I think this shoudn't be a major blocker that completely stops the project. Even without the auto-replacement with hooks API, we can still make Likes fully compatible with a 100% block-based workflow:

  • support fully functional Like and Comment Like blocks. I'm expected to add them manually to my theme's templates, just like any other custom block.
  • disable the auto-insertion in the the_content and comment_text filters. I want the site to render the blocks that are in the templates, and nothing else. Disable all the magic. Maybe some advanced option for power users?
  • keep the admin extensions in Posts and Comments view: we can't completely disable the Likes and Comment Likes modules because of this.

@jeherve
Copy link
Member

jeherve commented Feb 12, 2025

Related Epic and discussion: #36382

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Experiment] AI labels added [Feature] Comment Likes [Feature Group] User Interaction & Engagement Tools and features for site owners to share, promote, and manage engagement with their audiences. [Feature] Likes [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it
Projects
None yet
Development

No branches or pull requests

3 participants