Skip to content

Conversation

@tellthemachines
Copy link
Contributor

Follow-up from #102811 and #102353.

As per @jsnajdr's comment, a few of the Woo login screens look a bit broken after my recent changes.

This PR fixes those issues by making sure WooJPC screens don't accidentally get treated as isWhiteLogin. It also fixes the faulty switch statement that was causing some incorrect headings.

The screens in question can be directly reached with the following URLs:

http://calypso.localhost:3000/log-in?from=woocommerce-onboarding&lostpassword_flow=true

http://calypso.localhost:3000/log-in?from=woocommerce-core-profiler

Because I don't know how a regular user would reach these URLs (they're different from both login and get started > wordpress.com flows available from https://woocommerce.com/), I'm not sure if they would ever display exactly in that shape. Given one of the conditions for isWhiteLogin to be true is the query not containing a client_id, if the path to those screens were to inject that query parameter they would display differently.

Testing Instructions

  • Check that the above linked screens display with only one header and that their headings make sense:
Screenshot 2025-05-15 at 12 49 34 pm Screenshot 2025-05-15 at 12 53 37 pm

(The weird blue line at the top of the second one is a masterbar__progress-bar and I'm not sure why it displays there but it seems unrelated to my PRs)

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
    • For UI changes, have we tested the change in various languages (for example, ES, PT, FR, or DE)? The length of text and words vary significantly between languages.
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

@tellthemachines tellthemachines requested review from a team, chihsuan, elazzabi and jsnajdr May 15, 2025 02:59
@tellthemachines tellthemachines self-assigned this May 15, 2025
@matticbot matticbot added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels May 15, 2025
@github-actions
Copy link

github-actions bot commented May 15, 2025

@matticbot
Copy link
Contributor

matticbot commented May 15, 2025

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

App Entrypoints (~12 bytes removed 📉 [gzipped])

Details
name         parsed_size           gzip_size
entry-login        -92 B  (-0.0%)      -12 B  (-0.0%)

Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used.

Sections (~33 bytes removed 📉 [gzipped])

Details
name             parsed_size           gzip_size
jetpack-connect       -129 B  (-0.0%)      -33 B  (-0.0%)

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 (~33 bytes removed 📉 [gzipped])

Details
name                      parsed_size           gzip_size
async-load-design-blocks       -129 B  (-0.0%)      -33 B  (-0.0%)

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.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

@tellthemachines
Copy link
Contributor Author

@elazzabi and @chihsuan I added you here in hopes you can help with locating the flows that lead to the login screens pictured above 🙏

@chihsuan
Copy link
Member

@elazzabi and @chihsuan I added you here in hopes you can help with locating the flows that lead to the login screens pictured above 🙏

Hey @tellthemachines, thanks for the ping! The flow is triggered when a user complete onboarding wizard in a WooCommerce store.

Steps for the flow:

  1. Create a JN site with WooCommerce installed
  2. Go to WooCommerce if it's not redirected to onboarding wizard
  3. Complete onboarding wizard with Jetpack installed
  4. See the login screens

This is full URL that it would be like:

https://wordpress.com/jetpack/connect/authorize?client_id=244540207&redirect_uri=https%3A%2F%2Fsecretly-magic.jurassic.ninja%2Fwp-admin%2Fadmin.php%3Fhandler%3Djetpack-connection-webhooks%26action%3Dauthorize%26_wpnonce%3De405117e02%26redirect%3Dhttps%253A%252F%252Fsecretly-magic.jurassic.ninja%252Fwp-admin%252Fadmin.php%253Fpage%253Dwc-admin&state=1&scope=administrator%3A917cc5535fdb393debecd6182ce19f28&[email protected]&user_login=test&jp_version=14.7-a.1&secret=0c8xDeTxWgs9leDz088Ecg68WkNA9NKY&blogname=Secretly%20Magic&site_url=https%3A%2F%2Fsecretly-magic.jurassic.ninja&home_url=https%3A%2F%2Fsecretly-magic.jurassic.ninja&site_icon=&site_lang=en_US&site_created=2025-05-15%2003%3A20%3A29&allow_site_connection=1&calypso_env=production&source=&_as=wp-cli&locale=en&from=woocommerce-core-profiler&plugin_name=woocommerce-payments&color_scheme=default&_ui=42367338&_ut=wpcom%3Auser_id&purchase_nonce=iKUqeUq0&_wp_nonce=35fc1cbdf1&redirect_after_auth=https%3A%2F%2Fsecretly-magic.jurassic.ninja%2Fwp-admin%2Fadmin.php%3Fpage%3Dwc-admin&site=https%3A%2F%2Fsecretly-magic.jurassic.ninja

I think it's unrelated to your PRs, but the button colors are incorrect. They should be wp theme color (blue), depending on the store's primary color.

(The weird blue line at the top of the second one is a masterbar__progress-bar and I'm not sure why it displays there but it seems unrelated to my PRs)

Showing the progress bar is expected.

Copy link
Member

@andrewserong andrewserong left a comment

Choose a reason for hiding this comment

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

LGTM! I did a quick check of WordPress.com, Blaze, Jetpack, and A4A logins, and they were all looking good.

I found one more login while playing around with WooCommerce after installing on a Jurassic Ninja site. It appears when you click to on "Connect Jetpack" from the Stats card after finishing the WooCommerce onboarding (this is the button):

image

It looks like it's a styled version of the Jetpack login? A simplified test URL that appears to get to this login state is this one: https://wordpress.com/log-in/jetpack?from=woocommerce-onboarding

It displays the login form and social icons stacked, with the OR text in the wrong position:

image

That could be looked at separately to this PR, though.

I think it's unrelated to your PRs, but the button colors are incorrect. They should be wp theme color (blue), depending on the store's primary color.

Similarly, this feels like a lower priority issue to me (but thanks for flagging it!)

I reckon this PR will be good to get in 🚀

@tellthemachines
Copy link
Contributor Author

Thanks for the detailed instructions @chihsuan! I don't think those are the exact same screens though.

Setting up a JN site and going through the WooCommerce onboarding (after setup I was taken to wp-admin so had to click on "WooCommerce" in the sidebar) this is what I'm getting:

"Create an account" looks like it belongs to the same family design-wise, but it doesn't appear broken in production like the screens @jsnajdr found:
Screenshot 2025-05-15 at 2 37 22 pm

This is login:
Screenshot 2025-05-15 at 2 38 28 pm
Note the single column layout (it looks like something's slightly off with the center alignment of the content btw)

And this is lost password:
Screenshot 2025-05-15 at 2 39 51 pm

The lost password screen I'm looking for should say "You've got mail" in the heading.

It would be great to get to the bottom of this, because if by any chance those screens aren't in use any more, there's a bunch of logic we can remove from the login components 😄

@tellthemachines
Copy link
Contributor Author

Update: just realised I borked the lost password heading in extracting getHeaderText in #102811 so pushed a commit to fix that.

@matticbot
Copy link
Contributor

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • notifications
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug fix/woo-login-screens on your sandbox.

@chihsuan
Copy link
Member

Thanks for the detailed instructions @chihsuan! I don't think those are the exact same screens though.

Setting up a JN site and going through the WooCommerce onboarding (after setup I was taken to wp-admin so had to click on "WooCommerce" in the sidebar) this is what I'm getting:

To clarify, the isWooJPC flag is used to determine if it's a Woo-branded Jetpack connection flow. The flow are currently used for the following:

  1. WooCommerce onboarding jetpack connection flow: include woocommerce-core-profiler or woocommerce-onboarding (This has been deprecated, just for backward compatibility) in the URL
  2. WooPayments plugin jetpack connection flow: Include woocommerce-payments in the URL

This is login:

I'm not sure what's going on, but the screens look completely broken. 😢

The login screen should be look like this:

image-4

And create an account screen:

_Core Profiler - Create an account

The lost password screen I'm looking for should say "You've got mail" in the heading.

It should display "Forgot your password?" in the heading.

04  Jetpack connection - Logged in user _ Sign in as a different user _ Forgot password@2x

And after users enter their email address and click on the reset button, it should be changed to "You've got mail".

@tellthemachines
Copy link
Contributor Author

I think it's unrelated to your PRs, but the button colors are incorrect. They should be wp theme color (blue), depending on the store's primary color.

Looks like the button colors changed in #102639, because these screens also have the is-woo-passwordless classname. Cc @adamwoodnz guess what... we've found some more screens 😅

@tellthemachines
Copy link
Contributor Author

This is login:

I'm not sure what's going on, but the screens look completely broken. 😢

Looks like it's been broken for a while. I checked out a local branch from early last week, and this is what it looks like:

Screenshot 2025-05-15 at 4 04 09 pm

It doesn't reflow to 2 cols on widening the screen, and it doesn't center the content properly either - that big top margin stays in place if I reduce the height.

@tellthemachines
Copy link
Contributor Author

Ok the bad layout seems to mostly be due to a wrapper added around the form contents so they no longer get the flex rules applied to the form element:

Screenshot 2025-05-15 at 4 17 02 pm

Those changes were introduced in #102877, which updated the Jetpack login so they were probably not meant to also affect this screen.

@chihsuan
Copy link
Member

Those changes were introduced in #102877, which updated the Jetpack login so they were probably not meant to also affect this screen.

Thanks for looking into it! 🙏 @tellthemachines FYI, the team in Woo who maintain these screens is gone, I'm also not working on this anymore. However, please feel free to let me know if anything requires review or testing. I have also raised the issue with my team lead to see if we can get some help on this.

}

if ( isFromMigrationPlugin ) {
} else if ( isFromMigrationPlugin ) {
Copy link
Member

Choose a reason for hiding this comment

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

I'm curious about this "migration plugin" flow. It's active when there is a from=wpcom-migration query param, and its layout is now also broken.

@jeherve @anomiex Is this wpcom-migration plugin and the redirects to /log-in?from=wpcom-migration (or Jetpack Connect with the same query param) still active? I see that the Automattic/wpcom-migration repo has been archived a few months ago, the "Move to WordPress.com" plugin is no longer in the .org repo, and there is only a "Migrate to WordPress.com" plugin based on BlogVault.

That sounds almost like this flow is no longer used and could be removed.

Copy link
Member

Choose a reason for hiding this comment

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

The version of the plugin that connected to WordPress.com via this flow is indeed no longer in use. The new version of the plugin doesn't use that flow. I think we could remove it.

Copy link
Contributor

Choose a reason for hiding this comment

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

All I know about the wpcom-migration is that it was created in the monorepo, had a few releases, then nothing for a while until apparently they decided to replace it with a reskin of an existing (external) plugin. Whether this code path is still used from somewhere (e.g. the existing plugin from the external partner) I have no idea.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds like a good candidate for a follow-up PR!

Copy link
Member

Choose a reason for hiding this comment

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

Following up in #103766 which removes most of the wpcom-migration customizations.

@elazzabi
Copy link
Member

Thanks for the ping @tellthemachines ! I'll review this from our end and see if I can spot anything.

I'll also double-check if any flow is deprecated so we can remove it.

@tellthemachines
Copy link
Contributor Author

@elazzabi thanks, that would be very helpful!

I tried testing the lost password screen again based on what @chihsuan mentioned above:

And after users enter their email address and click on the reset button, it should be changed to "You've got mail".

After entering email and clicking reset this is what I'm seeing:

Screenshot 2025-05-16 at 1 23 55 pm

The URL for this screen is /log-in/jetpack/link followed by a query string including from=woocommerce-core-profiler.

So it's not exactly the same screen we get with /log-in?from=woocommerce-onboarding&lostpassword_flow=true.

Are we still using any non-Jetpack login for Woocommerce? If not, we should be able to remove some of the conditionals from the Login components.

@tellthemachines
Copy link
Contributor Author

Thanks everyone for the feedback and suggestions on this PR! Whether those particular screens are in use or not, this still fixes logic that is causing some lost password screens to get the wrong heading, so would be good to merge soon. If Woo folks are happy with the changes, feel free to go ahead and merge it, otherwise I'll leave it until Monday. It's already Friday afternoon here, which is an inauspicious time for deployments 😅

@andrewserong
Copy link
Member

If Woo folks are happy with the changes, feel free to go ahead and merge it, otherwise I'll leave it until Monday. It's already Friday afternoon here, which is an inauspicious time for deployments 😅

Sounds great. +1 to merging this on Monday if it's still open by then. Thanks for the follow-up work here!

@chihsuan
Copy link
Member

Are we still using any non-Jetpack login for Woocommerce? If not, we should be able to remove some of the conditionals from the Login components.

We're using non-Jetpack login for WooCommerce.com link but not for core profiler/onboarding flows that coming from WooCommerce plugins.

We don't need to fix anything for the /log-in?from=woocommerce-onboarding&lostpassword_flow=true or /log-in?from=woocommerce-core-profiler. Regular users shouldn't see these pages.

}
);
if ( isLostPasswordFlow ) {
header = <h3>{ headerText }</h3>;
Copy link
Member

Choose a reason for hiding this comment

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

Here the header assignment can be extracted out of the condition, it's always the same. Only the subtitle is conditional.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

Copy link
Member

@elazzabi elazzabi left a comment

Choose a reason for hiding this comment

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

Tried it for WooPayments onboarding, looks good (other than the misalignment of the OR in the login page)
CleanShot 2025-05-16 at 09 16 15@2x

CleanShot 2025-05-16 at 09 18 00@2x

@jsnajdr
Copy link
Member

jsnajdr commented May 16, 2025

The "lost password" flow still has a broken <ContinueAsUser> layout, as reported in #102811 (comment):

Screenshot 2025-05-14 at 9 00 13

This is probably not a realistic scenario: going through the lost password flow while being logged in. But the reason for the breakage is interesting: it's the .woo .continue-as-user style overrides in client/layout/masterbar/woo.scss. This file has 2300 lines of CSS overrides, mostly not really related to any masterbar. We should aim for most of these style overrides to be removed. It's not justified that a Woo variant of a page implements a completely different CSS layout for certain markup (using grid for example). The overrides should be limited only to styles related to the brand: fonts, colors, logos.

@tellthemachines
Copy link
Contributor Author

The "lost password" flow still has a broken <ContinueAsUser> layout, as reported in #102811 (comment):

That breakage wasn't introduced in that PR though. Blame shows the styles causing breakage have been around for over a year, probably from when the current passwordless screen was designed.

In any case, the double header is now fixed:

Screenshot 2025-05-19 at 11 09 18 am

The overrides should be limited only to styles related to the brand: fonts, colors, logos.

Yes, and I believe there's some ongoing design work for unifying all these screens across brands. Even before that there's probably some cleanup that can be done on those styles while preserving the current designs. It's better addressed as a follow-up PR though.

looks good (other than the misalignment of the OR in the login page)

The single-column layout with the 'OR' misaligned was introduced in #102877 and should be fixed separately as it'll require making sure both the Woo and the Jetpack logins are unaffected. Cc @gmjuhasz

If all else is good, I'll go ahead and deploy this in the next couple of hours.

@tellthemachines tellthemachines merged commit 8e23cf7 into trunk May 19, 2025
14 checks passed
@tellthemachines tellthemachines deleted the fix/woo-login-screens branch May 19, 2025 03:16
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label May 19, 2025
@gmovr gmovr mentioned this pull request May 20, 2025
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants