Skip to content

Commen Date: Convert Comment Date block settings to ToolsPanel #70248

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

himanshupathak95
Copy link
Contributor

@himanshupathak95 himanshupathak95 commented May 28, 2025

What?

Closes #70238

Refactors the Comment Date block's settings panel to use ToolsPanel instead of PanelBody for improved UI consistency and enhanced functionality.

Why?

This change aligns the Comment Date block with the ongoing effort to standardize block inspector controls across Gutenberg using ToolsPanel. The ToolsPanel component provides a better user experience with reset capabilities, improved organization, and consistent UI patterns across all blocks.

How?

  • Replaced PanelBody with ToolsPanel in the InspectorControls
  • Wrapped existing controls in ToolsPanelItem components
  • Added resetAll functionality to reset both format and link settings to their defaults
  • Added dropdown menu props for consistent UI behavior

Testing Instructions

  1. Open comments-template block
  2. Select the Comment Date block
  3. Open the block inspector
  4. Verify the "Settings" panel displays with ToolsPanel UI
  5. Test the "Date format" control - change format and verify it works
  6. Test the "Link to comment" toggle - enable/disable and verify functionality
  7. Use the reset button to reset all settings
  8. Verify both controls reset to their default values

Screenshots or screencast

Before

Screen.Recording.2025-05-29.at.20.37.28.mov

After

Screen.Recording.2025-05-29.at.20.36.44.mov

@t-hamano t-hamano added [Type] Enhancement A suggestion for improvement. [Block] Comment Date Affects the Comment Date Block labels May 29, 2025
@himanshupathak95 himanshupathak95 marked this pull request as ready for review May 29, 2025 16:13
Copy link

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: himanshupathak95 <abcd95@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>

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

Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

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

LGTM! Works as expected 👍

@t-hamano t-hamano merged commit f8f38b4 into WordPress:trunk May 30, 2025
64 checks passed
@github-actions github-actions bot added this to the Gutenberg 21.0 milestone May 30, 2025
chriszarate pushed a commit to chriszarate/gutenberg that referenced this pull request Jul 1, 2025
…ress#70248)

* Commen Date: Convert Comment Date block settings to ToolsPanel

* Comment Date: Use tools panel dropdown menu props and align with the trunk implementation

Co-authored-by: himanshupathak95 <abcd95@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Comment Date Affects the Comment Date Block [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor "Settings" panel of Comment Date block to use ToolsPanel instead of PanelBody
2 participants