Skip to content

ToggleGroupControl : Deprecate 36px default size - #66747

Merged
mirka merged 9 commits into
WordPress:trunkfrom
vipul0425:feat/issue-65751-toggle-control
Nov 20, 2024
Merged

mirka merged 9 commits into
WordPress:trunkfrom
vipul0425:feat/issue-65751-toggle-control

Conversation

@vipul0425

Copy link
Copy Markdown
Contributor

Part of #65751

What?

Deprecate the 36px default size in ToggleGroupControl.

Testing Instructions

  • Unit tests pass
  • Storybook stories should not log console warnings
  • All code snippets in documentation (JSDoc, Storybook, README) should have the __next40pxDefaultSize prop enabled

@vipul0425
vipul0425 requested a review from ajitbohra as a code owner November 5, 2024 12:36
@github-actions

github-actions Bot commented Nov 5, 2024 •

Copy link
Copy Markdown

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: mirka <0mirka00@git.wordpress.org>

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

@hbhalodia hbhalodia mentioned this pull request Nov 6, 2024
24 of 25 tasks
@t-hamano t-hamano added the [Package] Components /packages/components label Nov 8, 2024
@mirka
mirka requested a review from a team November 18, 2024 21:00
@mirka mirka added the [Type] Code Quality Issues or PRs that relate to code quality label Nov 18, 2024

@mirka mirka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looking good!

Let's also add the __next40pxDefaultSize prop to the story for the ToolsPanel component.

I also pushed a proposal for a way to opt out from the warnings so certain components don't throw redundant warnings: 1b7eeec

Comment thread packages/components/CHANGELOG.md Outdated

- `BorderBoxControl`: Deprecate 36px default size ([#65752](https://github.com/WordPress/gutenberg/pull/65752)).
- `BorderControl`: Deprecate 36px default size ([#65755](https://github.com/WordPress/gutenberg/pull/65755)).
- `ToggleGroupControl`: Deprecate 36px default size ([#66747](https://github.com/WordPress/gutenberg/pull/66747)).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's move this up to the Unreleased section.

<ToggleGroupControl
__nextHasNoMarginBottom
__next40pxDefaultSize={ __next40pxDefaultSize }
__shouldNotWarnDeprecated36pxSize

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we're also going to need a prop like this to prevent the redundant warnings when used inside another component: 1b7eeec

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hi @mirka should we also update the usage of ToggleGroupControl by adding this prop in other packages as well like block editor and library?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not that I'm aware of. We only want to suppress the warning when ToggleGroupControl's size is dependent on a parent component's size, and the parent component is responsible for logging the warning. I'm not aware of any other cases like that.

@mirka

mirka commented Nov 18, 2024

Copy link
Copy Markdown
Member

Forgot to mention, the snapshot tests also need to be updated.

@mirka mirka added the Needs Dev Note Requires a developer note for a major WordPress release cycle label Nov 18, 2024
@vipul0425
vipul0425 requested a review from mirka November 20, 2024 08:33

@mirka mirka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the follow-ups! I fixed up a few minor things that were left, but we're good to go 🚀

@mirka
mirka enabled auto-merge (squash) November 20, 2024 17:02
@mirka
mirka merged commit e79c469 into WordPress:trunk Nov 20, 2024
@github-actions github-actions Bot added this to the Gutenberg 19.8 milestone Nov 20, 2024
@Mamaduka Mamaduka mentioned this pull request Mar 12, 2025
45 of 49 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Dev Note Requires a developer note for a major WordPress release cycle [Package] Components /packages/components [Type] Code Quality Issues or PRs that relate to code quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants