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

Fix: Button: Replace remaining 40px default size violation [Edit Site 3] #65309

Merged
merged 5 commits into from
Sep 25, 2024

Conversation

hbhalodia
Copy link
Contributor

Part of - #65018

What?

Why?

  • To make the consistent button across Gutenberg, and we would have a lint rule added once fixed, all the button usage.

How?

  • Change from __next40pxDefaultSize={ false } to __next40pxDefaultSize on component.

Testing Instructions

  • Add the blocks on the page/post and check for the buttons defined.
  • Screenshot is added for individual changed files.

@@ -133,8 +133,7 @@ function TitleField( { item } ) {
title
) : (
<Button
// TODO: Switch to `true` (40px size) if possible
__next40pxDefaultSize={ false }
__next40pxDefaultSize
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This can be seen when you visit, site-editor --> check for patterns and the pattern title.

Note: It has a link variant, so there is an override style present, so before and after is same.

Before After
page-patterns-before page-patterns-after

@@ -150,8 +150,7 @@ export default function SavePanel() {
} ) }
>
<Button
// TODO: Switch to `true` (40px size) if possible
__next40pxDefaultSize={ false }
__next40pxDefaultSize
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This can be seen, when you open the save panel. It has style for screen-reader-text, hence need to remove that style to see the visual change.

Before After
open-save-panel-before Open-save-panel-after

@@ -11,8 +11,7 @@ import { Button } from '@wordpress/components';
export default function SidebarButton( props ) {
return (
<Button
// TODO: Switch to `true` (40px size) if possible
__next40pxDefaultSize={ false }
__next40pxDefaultSize
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This can be seen when you visit, site-editor --> and check for icon button in sidebar panel.

Before After
Editor-sidebar-button-before Editor-sidebar-button-after

@@ -88,8 +88,7 @@ function AddNewItemModalContent( { type, setIsAdding } ) {
/>
<HStack justify="right">
<Button
// TODO: Switch to `true` (40px size) if possible
__next40pxDefaultSize={ false }
__next40pxDefaultSize
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This can be seen when you add a custom data view and click on add new.

Before After
View-before view-after

@@ -99,8 +98,7 @@ function AddNewItemModalContent( { type, setIsAdding } ) {
</Button>

<Button
// TODO: Switch to `true` (40px size) if possible
__next40pxDefaultSize={ false }
__next40pxDefaultSize
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This can be seen when you add a custom data view and click on add new.

Before After
View-before view-after

@@ -62,8 +62,7 @@ const SiteHub = memo(
) }
>
<Button
// TODO: Switch to `true` (40px size) if possible
__next40pxDefaultSize={ false }
__next40pxDefaultSize
Copy link
Contributor Author

@hbhalodia hbhalodia Sep 16, 2024

Choose a reason for hiding this comment

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

This can be seen when you visit and check for go back button on the top left corner in site editor mode.

Note: It has fixed height, so changing this does not change before and after images.

Before After
site-hub-dashboard-before site-hub-dashboard-after

@@ -80,8 +79,7 @@ const SiteHub = memo(
<HStack>
<div className="edit-site-site-hub__title">
<Button
// TODO: Switch to `true` (40px size) if possible
__next40pxDefaultSize={ false }
__next40pxDefaultSize
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This can be seen when you visit and check for site title in site editor mode.

Note: It has link variant, hence 40px size does not affect the button.

Before After
site-hub-title-link-before site-hub-title-link-after

@@ -101,8 +99,7 @@ const SiteHub = memo(
className="edit-site-site-hub__actions"
>
<Button
// TODO: Switch to `true` (40px size) if possible
__next40pxDefaultSize={ false }
__next40pxDefaultSize
Copy link
Contributor Author

@hbhalodia hbhalodia Sep 16, 2024

Choose a reason for hiding this comment

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

This can be seen when you visit and check for search icon on the site editor mode.

Before After
site-hub-command-before site-hub-command-after

@@ -149,8 +146,7 @@ export const SiteHubMobile = memo(
) }
>
<Button
// TODO: Switch to `true` (40px size) if possible
__next40pxDefaultSize={ false }
__next40pxDefaultSize
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This can be seen when you visit and check for go to back button on top left corver in site editor mode for mobile mode.

Note: It has fixed height, so changing this does not change before and after images.

Before After
site-hub-mobile-editor-before site-hub-mobile-editor-after

@@ -186,8 +181,7 @@ export const SiteHubMobile = memo(
className="edit-site-site-hub__actions"
>
<Button
// TODO: Switch to `true` (40px size) if possible
__next40pxDefaultSize={ false }
__next40pxDefaultSize
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This can be seen when you visit and check for search icon on the site editor mode on mobile.

Before After
site-hub-mobile-command-before site-hub-mobile-command-after

@@ -170,8 +166,7 @@ export const SiteHubMobile = memo(
<HStack>
<div className="edit-site-site-hub__title">
<Button
// TODO: Switch to `true` (40px size) if possible
__next40pxDefaultSize={ false }
__next40pxDefaultSize
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This can be seen when you visit and check for site title in site editor mode for mobile.

Note: It has link variant, hence 40px size does not affect the button.

Before After
site-hub-mobile-title-before site-hub-mobile-title-after

@hbhalodia hbhalodia marked this pull request as ready for review September 16, 2024 04:55
Copy link

github-actions bot commented Sep 16, 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: hbhalodia <hbhalodia@git.wordpress.org>
Co-authored-by: mirka <0mirka00@git.wordpress.org>
Co-authored-by: tyxla <tyxla@git.wordpress.org>

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

@mirka mirka added the [Type] Code Quality Issues or PRs that relate to code quality label Sep 18, 2024
@mirka mirka requested a review from a team September 18, 2024 14:15
Copy link
Member

@mirka mirka left a comment

Choose a reason for hiding this comment

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

Looks good! 🚀

@mirka mirka enabled auto-merge (squash) September 19, 2024 09:35
@tyxla tyxla disabled auto-merge September 19, 2024 11:55
@tyxla
Copy link
Member

tyxla commented Sep 19, 2024

It appears like there are some consistently failing e2e tests. Could they be related? I'd be surprised if they are, but let's try rebasing the branch, maybe that will resolve the failures.

@mirka mirka enabled auto-merge (squash) September 24, 2024 06:42
@mirka
Copy link
Member

mirka commented Sep 25, 2024

Something is cursed about this branch, we just cannot get it to pass CI checks 😭 The failures are varied and don't seem to be related to the changes in this PR. I'm trying a clean rebase as a last resort.

@mirka mirka merged commit 4a625e5 into WordPress:trunk Sep 25, 2024
58 of 59 checks passed
@github-actions github-actions bot added this to the Gutenberg 19.4 milestone Sep 25, 2024
@mirka
Copy link
Member

mirka commented Sep 25, 2024

Yay, it worked! 🎉

@mirka mirka added the Backport to WP 6.7 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Oct 1, 2024
@noisysocks noisysocks added Backported to WP Core Pull request that has been successfully merged into WP Core and removed Backport to WP 6.7 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta labels Oct 6, 2024
noisysocks pushed a commit that referenced this pull request Oct 6, 2024
… 3] (#65309)

* Fix patterns link button title to use 40px default size

* Fix open save panel button default size to 40px

* Fix editor sidebar buttons to use 40px defualt size

* Fix data views create new views buttons to use 40px default size

* Fix site hub buttons to use 40px default button size

---------

Co-authored-by: hbhalodia <hbhalodia@git.wordpress.org>
Co-authored-by: mirka <0mirka00@git.wordpress.org>
Co-authored-by: tyxla <tyxla@git.wordpress.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backported to WP Core Pull request that has been successfully merged into WP Core [Type] Code Quality Issues or PRs that relate to code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants