Skip to content

Conversation

vipul0425
Copy link
Contributor

Fixes: #65647

What?

This PR has changes covered in #65729 with new ToolsPanelItem wrapper and it also resolves other merge conflicts present there.

Why?

The Social Icons block has a 'size' setting that is placed in a toolbar dropdown menu labeled 'Size', but in other blocks it is there in inspector controls.

How?

This PR moves the size settings to inspector controls.

Testing Instructions

  1. Add the Social Icons Block.
  2. Size settings should be available in the inspector controls panel instead on block toolbar.

Screenshots or screencast

Screen.Recording.2025-05-22.at.9.26.36.PM.mov

Copy link

github-actions bot commented May 22, 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: vipul0425 <vipulgupta003@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: hanneslsm <hanneslsm@git.wordpress.org>
Co-authored-by: richtabor <richtabor@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: jameskoster <jameskoster@git.wordpress.org>
Co-authored-by: carolinan <poena@git.wordpress.org>
Co-authored-by: Infinite-Null <ankitkumarshah@git.wordpress.org>
Co-authored-by: afercia <afercia@git.wordpress.org>

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

@hanneslsm
Copy link

hanneslsm commented May 22, 2025

Thanks for the PR @vipul0425

Let's change the order of the toggles:

  • Icon Size
  • Show text
  • Open links in new tab

This way the Icon Size is followed by the Show text toggle (both visual) and then comes the new tab setting (behavior). Is easier to understand, I think.

Other than that Design LGTM

@shail-mehta shail-mehta added [Type] Bug An existing feature does not function as intended [Package] Block library /packages/block-library [Block] Social Affects the Social Block - used to display Social Media accounts labels May 22, 2025
@amitraj2203 amitraj2203 requested a review from Mamaduka May 23, 2025 04:16
@Mamaduka Mamaduka changed the title Moves size settings to inspector controls. Social: Moves size settings to inspector controls May 23, 2025
@Mamaduka
Copy link
Member

I noticed that resetting values for this setting doesn't work correctly.

Screencast

CleanShot.2025-05-23.at.11.54.09.mp4

@vipul0425
Copy link
Contributor Author

Hi @Mamaduka, @hanneslsm I have update the reset filter code and also order of the options. 🙇

Copy link
Member

@Mamaduka Mamaduka left a comment

Choose a reason for hiding this comment

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

Thank you, @vipul0425!

I think it needs a little more polish, and we're ready to merge. See my review comments.

} );
} }
dropdownMenuProps={ dropdownMenuProps }
>
<ToolsPanelItem
isShownByDefault
label={ __( 'Open links in new tab' ) }
hasValue={ () => !! openInNewTab }
hasValue={ () => size !== 'has-normal-icon-size' }
Copy link
Member

Choose a reason for hiding this comment

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

hasValue={ () => !! size && size !== 'has-normal-icon-size' }

Otherwise, the newly inserted Social Icons block already has a resettable value.

CleanShot 2025-05-23 at 13 01 15

checked={ openInNewTab }
onChange={ () =>
label={ __( 'Icon Size' ) }
onChange={ ( entry ) => {
Copy link
Member

Choose a reason for hiding this comment

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

Nit: The entry is too generic, let's use something more specific like newSize.

@vipul0425 vipul0425 requested a review from Mamaduka May 23, 2025 10:57
Copy link
Member

@Mamaduka Mamaduka left a comment

Choose a reason for hiding this comment

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

Thank you, @vipul0425!

@Mamaduka Mamaduka merged commit 874197b into WordPress:trunk May 23, 2025
61 checks passed
@github-actions github-actions bot added this to the Gutenberg 21.0 milestone May 23, 2025
chriszarate pushed a commit to chriszarate/gutenberg that referenced this pull request Jul 1, 2025
Co-authored-by: vipul0425 <vipulgupta003@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: hanneslsm <hanneslsm@git.wordpress.org>
Co-authored-by: richtabor <richtabor@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: jameskoster <jameskoster@git.wordpress.org>
Co-authored-by: carolinan <poena@git.wordpress.org>
Co-authored-by: Infinite-Null <ankitkumarshah@git.wordpress.org>
Co-authored-by: afercia <afercia@git.wordpress.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Social Affects the Social Block - used to display Social Media accounts [Package] Block library /packages/block-library [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move Social Icons size setting to the inspector
4 participants