-
Notifications
You must be signed in to change notification settings - Fork 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
Signup form: use TextControl
from @wordpress/components
#99187
Signup form: use TextControl
from @wordpress/components
#99187
Conversation
Jetpack Cloud live (direct link)
Automattic for Agencies live (direct link)
|
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: App Entrypoints (~162 bytes removed 📉 [gzipped])
Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used. Sections (~540 bytes removed 📉 [gzipped])
Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to. Async-loaded Components (~715 bytes removed 📉 [gzipped])
React components that are loaded lazily, when a certain part of UI is displayed for the first time. Legend What is parsed and gzip size?Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory. Generated by performance advisor bot at iscalypsofastyet.com. |
19b6b0c
to
5fdd94e
Compare
.logged-out-form input:focus { | ||
border: 0; | ||
box-shadow: none; | ||
} | ||
|
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 think it's fine to delete those changes because they are scoped under is-jetpack-woocommerce-flow
or is-jetpack-woo-dna-flow
, but I'd ask to the PR reviewers (especially the ones with more knowledge about all possible flows) to thoroughly check in case these styles are still necessary.
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 sniffed around the code and figured out that you can add woodna_service_name=foo
to the query params for the URL in your testing instructions to get this, which has the is-jetpack-woo-dna-flow
class:
![Woo DNA flow](https://private-user-images.githubusercontent.com/555336/409237023-289326f4-c0c3-4048-89be-8e778835f73a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwNzk5NzYsIm5iZiI6MTczOTA3OTY3NiwicGF0aCI6Ii81NTUzMzYvNDA5MjM3MDIzLTI4OTMyNmY0LWMwYzMtNDA0OC04OWJlLThlNzc4ODM1ZjczYS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjA5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIwOVQwNTQxMTZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0wOWE0YWFmOGIyYmE2MTNjNDYxZWIyZDdlOGM2NWU3OTlkMDQ3ZTY4YWQwNzllYWY0MmI1NDMzODljYmM5MThjJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.R3pWERL5jERc43PMw1scZT_9j-eabECLlc0hML01dFg)
Different screen, and doesn't have a logged-out-form
class. Looks fine, including the focus state.
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.
Works as expected, but may be cleaner with a flex gap?
.logged-out-form input:focus { | ||
border: 0; | ||
box-shadow: none; | ||
} | ||
|
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 sniffed around the code and figured out that you can add woodna_service_name=foo
to the query params for the URL in your testing instructions to get this, which has the is-jetpack-woo-dna-flow
class:
![Woo DNA flow](https://private-user-images.githubusercontent.com/555336/409237023-289326f4-c0c3-4048-89be-8e778835f73a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwNzk5NzYsIm5iZiI6MTczOTA3OTY3NiwicGF0aCI6Ii81NTUzMzYvNDA5MjM3MDIzLTI4OTMyNmY0LWMwYzMtNDA0OC04OWJlLThlNzc4ODM1ZjczYS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjA5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIwOVQwNTQxMTZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0wOWE0YWFmOGIyYmE2MTNjNDYxZWIyZDdlOGM2NWU3OTlkMDQ3ZTY4YWQwNzllYWY0MmI1NDMzODljYmM5MThjJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.R3pWERL5jERc43PMw1scZT_9j-eabECLlc0hML01dFg)
Different screen, and doesn't have a logged-out-form
class. Looks fine, including the focus state.
client/blocks/signup-form/index.jsx
Outdated
// As we migrate more inputs to @wordpress/components' <TextControl />, | ||
// we should extend this classname and realted styles for better coherency. | ||
const inputClassName = 'signup-form__woo-input'; | ||
return ( | ||
<div> |
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 see you opted to keep CSS changes from the original to a minimum, but I think this would be a lot cleaner if we dropped the input-level class and instead spaced them all with a flex gap on the container div. With just a bit of top padding to compensate.
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.
Yeah, I was trying to keep changes to a minimum, although your suggestion makes sense!
Feedback addressed in 87fa8fd
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 and tested well! 👍
We've added a passwordless signup to the Woo DNA flow, so most users shouldn't see the signup form. The only way to see it is by using an account that needs to enter a password and then click on Create a new account.
Screen.Recording.2025-02-04.at.11.31.29.mov
This form is also rendered in the so-called "jetpack woo DNA flow", although I wasn't able to find up to date testing instructions for this flow easily around the repo (PRs often lack testing instructions)
You can test the Woo DNA flow by visiting the following path:
/jetpack/connect/authorize?client_id=239804800&redirect_uri=https%3A%2F%2Fcarp-of-turtles.jurassic.ninja%2Fwp-admin%2Fadmin.php%3Fhandler%3Djetpack-connection-webhooks%26action%3Dauthorize%26_wpnonce%3Dfa2483e781%26redirect%3Dhttps%253A%252F%252Fcarp-of-turtles.jurassic.ninja%252Fwp-admin%252Fadmin.php%253Fpage%253Dwc-settings%2526tab%253Dshipping%2526section%253Dwoocommerce-services-settings&state=1&scope=administrator%3A1234&user_email=user%40email.com&user_login=user&jp_version=14.2-a.1&secret=na&blogname=Carp+Of+Turtles&site_url=https%3A%2F%2Fcarp-of-turtles.jurassic.ninja&home_url=https%3A%2F%2Fcarp-of-turtles.jurassic.ninja&site_icon&site_lang=en_US&site_created=2024-12-11+04%3A19%3A54&allow_site_connection=1&calypso_env&source&_as=wp-cli&from=woocommerce-services&_ui=189375772&_ut=wpcom%3Auser_id&purchase_nonce=qUjMAC7v&woodna_service_name=WooCommerce+Shipping+%26+Tax&woodna_help_url=https%3A%2F%2Fwoocommerce.com%2Fdocument%2Fwoocommerce-shipping-and-tax%2F&_wp_nonce=1e563eb72b&redirect_after_auth=https%3A%2F%2Fcarp-of-turtles.jurassic.ninja%2Fwp-admin%2Fadmin.php%3Fpage%3Dwc-settings%26tab%3Dshipping%26section%3Dwoocommerce-services-settings&site=https%3A%2F%2Fcarp-of-turtles.jurassic.ninja
5fdd94e
to
328aab3
Compare
.signup-form__woocommerce-wrapper { | ||
text-align: center; | ||
border-bottom: 1px solid var(--color-neutral-50); | ||
position: absolute; | ||
left: 0; | ||
top: 0; | ||
width: 100%; | ||
height: 56px; | ||
|
||
svg > g { | ||
transform: translateX(50%); | ||
} | ||
} | ||
|
||
.signup-form__woocommerce-logo { | ||
margin: 0; | ||
text-align: center; | ||
margin-right: auto; | ||
margin-left: auto; | ||
padding-left: 0; | ||
display: block; | ||
height: 56px; | ||
border-bottom: 1px solid var(--color-woocommerce-header-border); | ||
background: var(--color-text-inverted); | ||
|
||
svg { | ||
margin-top: 15px; | ||
} | ||
} | ||
|
||
.signup-form__woocommerce-heading { | ||
margin-top: 32px; | ||
} | ||
|
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.
While working on addressing the PR's feedback, I noticed that these styles are associated with classnames that don't seem to be used anymore across the codebase (I was able to trace the classnames being removed from the DOM in #65480)
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.
Always nice to see some red!
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.
Wait until you see #99189 :D
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.
Great cleanup 🚀
.signup-form__woocommerce-wrapper { | ||
text-align: center; | ||
border-bottom: 1px solid var(--color-neutral-50); | ||
position: absolute; | ||
left: 0; | ||
top: 0; | ||
width: 100%; | ||
height: 56px; | ||
|
||
svg > g { | ||
transform: translateX(50%); | ||
} | ||
} | ||
|
||
.signup-form__woocommerce-logo { | ||
margin: 0; | ||
text-align: center; | ||
margin-right: auto; | ||
margin-left: auto; | ||
padding-left: 0; | ||
display: block; | ||
height: 56px; | ||
border-bottom: 1px solid var(--color-woocommerce-header-border); | ||
background: var(--color-text-inverted); | ||
|
||
svg { | ||
margin-top: 15px; | ||
} | ||
} | ||
|
||
.signup-form__woocommerce-heading { | ||
margin-top: 32px; | ||
} | ||
|
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.
Always nice to see some red!
Proposed Changes
TextControl
fromclient/components
withTextControl
from@wordpress/components
in the signup formWhy are these changes being made?
Testing Instructions
http://calypso.localhost:3000/jetpack/connect/authorize?from=woocommerce-onboarding&_wp_nonce=foobar&blogname=Just%20Another%20WordPress.com%20Site&client_id=12345&close_window_after_login=0&close_window_after_auth=0&home_url=https://yourjetpack.blog&redirect_uri=https://yourjetpack.blog/wp-admin/admin.php&scope=administrator:34579bf2a3185a47d1b31aab30125d&secret=640fdbd69f96a8ca9e61&site=https://yourjetpack.blog&site_url=https://yourjetpack.blog&state=1&allow_site_connection=1&installed_ext_success=1&
Notes:
Pre-merge Checklist