Skip to content

Replace outdated size controls in core blocks #52223

Closed
@t-hamano

Description

@t-hamano

Description

ImageSizeControl (__experimentalImageSizeControl) was marked as deprecated in #51545.

However, there are two core blocks that use this component:

Just as this API in the image block was replaced by another API in #51545, I think it needs to be replaced by another API in these two blocks as well.

This issue has had its tasks/objectives updated. See this comment.

Step-by-step reproduction instructions

N/A

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

Activity

added
[Type] TaskIssues or PRs that have been broken down into an individual action to take
on Jul 18, 2023
self-assigned this
on Jan 4, 2024
removed their assignment
on Aug 6, 2024
mirka

mirka commented on Aug 7, 2024

@mirka
Member

I've noticed that when you search for the string 25, 50, 75, 100, there are also two other blocks that implement a custom version of this outdated control:

Small width percentage picker

These should probably also be switched to DimensionTool, is that correct?

I'm going to go ahead and change the title of this issue so it reflects that __experimentalImageSizeControl is not currently deprecated anymore, and that there are other blocks to be switched over as well.

changed the title Don't use deprecated `__experimentalImageSizeControl` in core blocks Replace outdated size controls in core blocks on Aug 7, 2024
t-hamano

t-hamano commented on Aug 8, 2024

@t-hamano
ContributorAuthor

I'm going to go ahead and change the title of this issue so it reflects that __experimentalImageSizeControl is not currently deprecated anymore, and that there are other blocks to be switched over as well.

Yes, thanks for the update!

These should probably also be switched to DimensionTool, is that correct?

Since the only setting is the width, I don't think it needs to be switched to the DimensionsPanel. I think we can simply replace it with the recommended component.

Is the recommended component here the ToggleGroupControl? If so, I imagine it would look something like this:
button-width

I think the important bit is that we explicitly add an Auto ( or None) option so that we can reset the width.

mirka

mirka commented on Aug 12, 2024

@mirka
Member

I'm not against switching to ToggleGroupControl, since that's already better than what's in trunk. I was just thinking we might as well switch to a more standard UI pattern that also allows arbitrary values, for example as requested in #62247.

8 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Block] Latest PostsAffects the Latest Posts Block[Package] Block library/packages/block-library[Type] TaskIssues or PRs that have been broken down into an individual action to take

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

      Participants

      @Mamaduka@mirka@jordesign@carolinan@t-hamano

      Issue actions

        Replace outdated size controls in core blocks · Issue #52223 · WordPress/gutenberg