Skip to content

Conversation

@prasadkarmalkar
Copy link
Contributor

What?

Part of Issue- #74248

Why?

  • Remove extra divs and eliminate the extra CSS required to match the frontend and editor UI

How?

  • Uses the HTMLRenderer component and useServerSideRender() hook to eliminate these extra divs and make the HTML on the front end and editor match for Latest Comments Block.

Testing Instructions

  1. Edit a Post/Page
  2. Add the Latest block
  3. Save and Check UI on both frontend and editor

Testing Instructions for Keyboard

Screenshots or screencast

Screen.Recording.2025-12-30.at.4.16.25.PM.mov

@github-actions github-actions bot added the [Package] Block library /packages/block-library label Dec 30, 2025
@github-actions
Copy link

github-actions bot commented Dec 30, 2025

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: prasadkarmalkar <[email protected]>
Co-authored-by: hbhalodia <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

const dropdownMenuProps = useToolsPanelDropdownMenuProps();

const { content, status, error } = useServerSideRender( {
attributes,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
attributes,
attributes: serverSideAttributes,

Should'nt be this? why to remove serverSideAttributes variable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @hbhalodia , I initially thought about removing the serverSideAttributes variable since HtmlRenderer merges both the server-rendered attributes and wrapperProps, and during my testing it didn't seem to cause any visual issues. I've reverted changes to keep serverSideAttributes.

@t-hamano t-hamano added the [Block] Latest Comments Affects the Latest Comments Block label Dec 31, 2025
@t-hamano t-hamano added the [Type] Enhancement A suggestion for improvement. label Dec 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Latest Comments Affects the Latest Comments Block [Package] Block library /packages/block-library [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants