-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
FormTokenField: Deprecate bottom margin #63491
Conversation
Size Change: +93 B (+0.01%) Total Size: 1.75 MB
ℹ️ View Unchanged
|
p:not(.components-base-control__help, .components-form-token-field__help) { | ||
margin-top: 0; | ||
} |
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.
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.
The PostTaxonomies
component is used in two places:
gutenberg/packages/editor/src/components/preferences-modal/index.js
Lines 105 to 111 in 9f8014a
<PostTaxonomies | |
taxonomyWrapper={ ( content, taxonomy ) => ( | |
<EnablePanelOption | |
label={ taxonomy.labels.menu_name } | |
panelName={ `taxonomy-panel-${ taxonomy.slug }` } | |
/> | |
) } |
The usage in the Preferences modal is very strange — the callback parameters are used to render toggles 😅 Anyway, our margin changes don't affect this use case.
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.
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. |
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.
I spent some time testing thoroughly in Storybook and in the post/site editor, everything tests well. ✅
I also took some time to confirm all instances in the codebase have been addressed. 👍
LGTM 🚀
deprecated( | ||
'Bottom margin styles for wp.editor.PostTaxonomiesFlatTermSelector', | ||
{ | ||
since: '6.7', |
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.
Is this going to land in 6.7 actually?
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.
Yes, too late to land in 6.6.
@@ -49,15 +49,6 @@ | |||
} | |||
} | |||
|
|||
.block-library-query-toolspanel__filters { |
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.
We're still rendering the original classname for backward compatibility, right?
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.
Correct. I added a code comment b912e8b
@@ -99,6 +100,7 @@ export const Async: StoryFn< typeof FormTokenField > = ( { | |||
Async.args = { | |||
label: 'Type a continent', | |||
suggestions: continents, | |||
__nextHasNoMarginBottom: true, |
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.
Confirmed that all stories inherit args from either of the 2 definitions that define __nextHasNoMarginBottom: true
.
# Conflicts: # packages/block-library/src/query/edit/inspector-controls/author-control.js # packages/block-library/src/query/edit/inspector-controls/taxonomy-controls.js
* Migrate in Query Loop block inspector * Update docs * PostTaxonomiesFlatTermSelector: Deprecate bottom margin * FormTokenField: Log deprecation warning * Fixup * Add changelogs * Add comment about unused CSS class Co-authored-by: mirka <0mirka00@git.wordpress.org> Co-authored-by: tyxla <tyxla@git.wordpress.org>
Part of #39358
What?
Officially start the deprecation period for the bottom margin on
FormTokenField
. And by extension, also onPostTaxonomiesFlatTermSelector
in@wordpress/editor
.Why?
All the unwanted margins on non-BaseControl-based components have already been hard deprecated, but this one was straggling.
How?
The dependants of FormTokenField in this repo are the following:
wp.editor.PostTaxonomiesFlatTermSelector
(publicly exported as component)wp.editor.PostTaxonomies
(publicly exported as component)Out of these, changing FormTokenField margins would only affect third-party consumers in the case of
PostTaxonomiesFlatTermSelector
. So for that component, we are also doing a deprecation.Testing Instructions
Screenshots or screencast
Query Loop block
You may need this diff to show all the "Filters" options in the block inspector sidebar:
The gutters in between used to be uneven and wrong. It is now uniform and correct (16px).
PostTaxonomiesFlatTermSelector
In Post sidebar:
There used to be an extra bottom margin. Now it is gone.
✍️ Dev Note
See Dev Note in #39358.