Skip to content
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

BoxControl: Refactor and unify the different sides implementation #67626

Merged
merged 11 commits into from
Dec 10, 2024

Conversation

youknowriad
Copy link
Contributor

Related #67625

What?

In order to implement #67625, I need first to simplify the code of the BoxControl component. It contains three duplicated subcomponents that can be easily merged in one by adding an extra side prop.

This PR does that.

Testing Instructions

There should be no functional or visual change in this PR. You can test this PR in storybook (the different BoxControl stories) and ensure they look and behave exactly like trunk.

@youknowriad youknowriad added [Feature] UI Components Impacts or related to the UI component system [Type] Code Quality Issues or PRs that relate to code quality labels Dec 5, 2024
@youknowriad youknowriad requested a review from a team December 5, 2024 12:13
@youknowriad youknowriad self-assigned this Dec 5, 2024
Copy link

github-actions bot commented Dec 5, 2024

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: youknowriad <[email protected]>
Co-authored-by: tyxla <[email protected]>

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

Copy link
Member

@tyxla tyxla left a comment

Choose a reason for hiding this comment

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

Thanks for the great unification work @youknowriad 🙌

Did some testing, and according to the stories, there might be a few regressions. Please take a look at the individual comments.

Copy link

github-actions bot commented Dec 6, 2024

Flaky tests detected in df9490d.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12199987455
📝 Reported issues:

@youknowriad youknowriad force-pushed the update/refactor-box-control branch from 5160b8b to df9490d Compare December 6, 2024 13:52
Copy link
Member

@tyxla tyxla left a comment

Choose a reason for hiding this comment

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

Here's another edge case that looks broken:

On trunk: You'll see Mixed without the unit:
Screenshot 2024-12-09 at 16 55 33

In this branch: You'll see Mixed but with a px unit, even if some of the units are em:
Screenshot 2024-12-09 at 16 55 29

Note that even if I select em unit for all sides, I still see px after linking them back.

@youknowriad
Copy link
Contributor Author

I think the best path is to consider "mixed units" as "mixed value" and disable the unit like in trunk. It should be done now.

@youknowriad youknowriad force-pushed the update/refactor-box-control branch from f15066c to 5c8d201 Compare December 9, 2024 16:19
Copy link
Member

@tyxla tyxla left a comment

Choose a reason for hiding this comment

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

Code looks good, and this tests well, with no visible changes. Amazing unification work @youknowriad 🚀

Left a few last nits, feel free to ship afterwards.

Thank you 🙌

packages/components/CHANGELOG.md Outdated Show resolved Hide resolved
packages/components/src/box-control/utils.ts Outdated Show resolved Hide resolved
@youknowriad youknowriad enabled auto-merge (squash) December 10, 2024 08:50
@youknowriad youknowriad merged commit 7649b99 into trunk Dec 10, 2024
62 of 64 checks passed
@youknowriad youknowriad deleted the update/refactor-box-control branch December 10, 2024 09:25
@github-actions github-actions bot added this to the Gutenberg 19.9 milestone Dec 10, 2024
@youknowriad
Copy link
Contributor Author

Thanks for the review Marin

yogeshbhutkar pushed a commit to yogeshbhutkar/gutenberg that referenced this pull request Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] UI Components Impacts or related to the UI component system [Type] Code Quality Issues or PRs that relate to code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants