-
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
FormTokenField: Add prop to remove bottom margin #48609
Conversation
6e70bc4
to
f8c394b
Compare
Size Change: -24 B (0%) Total Size: 1.34 MB
ℹ️ View Unchanged
|
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.
Thanks for this!
I haven't done a full review yet, but let's get the FormTokenField itself in good shape first before I start looking at the consumer code. I noticed a few more cases that need to be addressed:
- The bottom margin is gone even when
__nextHasNoMarginBottom = false
. This needs to be maintained for back compat. (cf. current trunk) __experimentalShowHowTo = false
&&__nextHasNoMarginBottom = true
still shows a bottom margin.
Thank you for the initial review and for catching those mistakes! 🙇♀️ I've resolved your initial findings! |
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.
Note that we still need to maintain the margin when __experimentalShowHowTo = false
&& __nextHasNoMarginBottom = false
.
By the way it might be good to reduce/redefine the scope of this PR to "FormTokenField: Add prop to remove bottom margin". We can focus on the FormTokenField itself, and merge quicker 👍 The consumer components can be addressed separately.
Ah, I thought we'd want to remove the margin-bottom there for the same reason. Thanks for pointing this out.
Makes sense! |
9343c2c
to
1103913
Compare
Flaky tests detected in bcf1a9f. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4545977854
|
Are we going to reduce the scope of this PR? That means to move out the consumer changes (LatestPosts, QueryControls, HierarchicalTermSelector) into a separate PR so they can be reviewed better 🙂 It's actually how we did the rest of the components (as outlined in #38730 — Step 1: Implement the prop without adding a deprecation warning. Step 2: Migrate the usages in the codebase). I think it's especially worth it in this case because both concerns have some complexity involved. |
Ahh, thanks for clarifying! I think this might be a mistake in how I created this branch, which was a branch off of this one: #47515 So initially, the consumer changes were separated in the above PR. However, we need to deprecate the margin bottom from I'd love to hear your thoughts / if you have advice on how to proceed with the branches before I make further assumptions. 🙇♀️ |
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.
Looks good! I just pushed a small tweak to the changelog to reflect the new scope of our changes.
Part of #39358
What?
Adds a
__nextHasNoMarginBottom
prop to remove the bottom margin fromFormTokenField
's help text.Why?
For easier reuse and consistency in spacing. This is also needed for #47515, where the removed margins cause spacing issues with the help text.
How?
This PR adds the flags and replaces the paragraph tag with
StyledHelp
. The in-repo migration and official deprecation tasks will continue to be tracked at https://github.com/WordPress/gutenberg/issues/39358.]Additional Notes
I found that only QueryControls has
__experimentalShowHowTo
enabled in Gutenberg.Testing Instructions
npm run storybook:dev
FormFieldToken