-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Add preview example for comments-count
and comments-link
#71016
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
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
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.
LGTM 👍
Edit: As this is my first time, I’d like to wait for a second review to confirm everything is in order before proceeding with a merge.
The current behaviour occurs because the value is set asynchronously following an Ref:
Typically, other blocks display a reasonable default while fetching data; for instance, the Ref:
This can be addressed separately as a follow-up, so it doesn’t need to block this PR. I'll be requesting a confidence review to move this PR forward. |
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.
Looks good! Thanks, @Infinite-Null!
Part of #64707
What?
This PR adds example attributes to the Post Comments Count and Post Comments Link blocks to provide block previews in the inserter with optimized viewport width.
Testing Instructions
Screenshots
While working on this issue, I noticed a minor warning that appears briefly on reload:
Post Comments Link block: post not found.
This is not issue for preview example but as per my understanding it is related to the fact that this:
takes a moment to load. As a result, the warning gets triggered by the code at the following locations:
gutenberg/packages/block-library/src/post-comments-link/edit.js
Line 104 in 94af11b
gutenberg/packages/block-library/src/post-comments-count/edit.js
Line 75 in 94af11b
Screencast:
Screen.Recording.2025-08-01.at.4.34.13.PM.mov