-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Spacing control: Replace sides dropdwon with link button #65193
Conversation
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: -11.1 kB (-0.62%) Total Size: 1.77 MB
ℹ️ View Unchanged
|
Flaky tests detected in 981583a. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/10791432670
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code-wise LGTM, and it works as advertised; thank you!
I left a comment regarding the wording of the label.
packages/block-editor/src/components/spacing-sizes-control/linked-button.js
Show resolved
Hide resolved
packages/block-editor/src/components/spacing-sizes-control/linked-button.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feels much simpler. Like it.
One tiny detail: let's make the "Margin" and "Padding" labels in the tooltip lowercase, to match others.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is working well for me 🎉
- The controls still work as expected in my testing ✅
- I can see "padding" and "margin" are both lowercase in the button tooltip ✅
This PR appears to have made the block spacing UI unavailable if the theme defines a default gap for blocks. For example, the TT4 theme defines a default block gap for the Buttons block. If you access the global styles for the Buttons block, you’ll see something like this: Before this PR was merged, it looked like this: However, this is not ideal, and since the Buttons block supports the axial gap, it should look like this: This issue has also been reported here: #64971 (review) My guess is that it has to do with updating the |
@t-hamano Your are right. It is because the function In #65371 the function is restored to its original code and included additional condition and it should now be fixed. |
I stumbled upon this PR after spotting an incorrect translation submitted via GlotPress for my main locale (pt_PT). The way that strings are built in this PR (as well as preceding strings that the PR is built atop) lends itself to translation mistakes for a few reasons. The term link is almost always used in the hypertextual sense, so translators will struggle to understand We also need syntagmatic information to understand the "link" lexeme: is it a noun? a verb? infinitive or imperative? Few languages are as weakly inflected as English, and using Furthermore, as always, stringing together strings with variables works in English but lends itself to fragile translations in many languages. I'm referring to the fact that we call
The above may or may not apply to this PR, I'll leave that up to you, since it depends on how generic and reusable you want some of the components to be. Finally, but most importantly: is "Link padding" even the right string for the UI in question? That's not how I would describe that button's effect. It's more along the lines of "Link sides", "Link directions", "Link properties", etc. Actually, maybe not so much "link" as "group". My point here is that I suspect that we can come up with a better label that conveniently also does not depend on the property being manipulated. @madhusudhand @mikachan let me know if you need my help. |
@mcsf Thanks for the feedback.
I agree with you.
I prefer a hard-coded label of |
What?
This changes removes sides dropdown from the
SpacingSizesControl
(Padding and Margin), and replaces it with a link button.Fixed #63963 (partially)
Note: no updates to icons in this iteration.
Testing Instructions
horizontal & vertical
view andall sides
custom view.Testing Instructions for Keyboard
Screenshots or screencast