-
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
Navigation: Upsize back buttons #68157
Conversation
Flaky tests detected in 0453580. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12423459183
|
__next40pxDefaultSize: | ||
'as' in restProps ? restProps.as === undefined : 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.
This is just to ensure that this usage is safe for the 40px default size, and won't log deprecation warnings. There should be no visual changes to the navigation items, as their sizes are already overridden.
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.
Makes sense, we want to apply __next40pxDefaultSize
only for Button
.
To be extra safe, should we also set it to true
when restProps.as
is Button
? (just in case a consumer sets it explicitly, not sure why)
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.
Good edge case thinking 😄
The reasoning here is that, if there's a Button size violation the console warning will say "wp.components.Button", even if it came from within the NavigationItem black box. That can be confusing to a consumer because for all they know, they just used a NavigationItem
and may not even have a single Button instance in their code. But as long as they did an explicit as={ Button }
, that Button instance comes from their own code and not from within the NavigationItem black box, and is therefore "discoverable".
@@ -49,6 +49,7 @@ function UnforwardedNavigationBackButton( | |||
const icon = isRTL() ? chevronRight : chevronLeft; | |||
return ( | |||
<MenuBackButtonUI | |||
__next40pxDefaultSize |
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 back buttons should now have 40px height.
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.
🚀 LGTM
Left a little comment but it's not blocking.
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.
Looking good 👍
@@ -49,6 +49,7 @@ function UnforwardedNavigationBackButton( | |||
const icon = isRTL() ? chevronRight : chevronLeft; | |||
return ( | |||
<MenuBackButtonUI | |||
__next40pxDefaultSize |
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.
In preparation for #65751
What?
Upsizes the back buttons (
NavigationBackButton
) ofNavigation
.Why?
So it's consistent with the new default Button sizes, and won't log deprecation warnings when we start logging them for Button.
Testing Instructions
See Storybook for Navigation.