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

Mobile web: Improve the way we show email address in site setup #58515

Merged
merged 10 commits into from
Jan 11, 2022
Merged

Mobile web: Improve the way we show email address in site setup #58515

merged 10 commits into from
Jan 11, 2022

Conversation

spraveenitpro
Copy link
Contributor

@spraveenitpro spraveenitpro commented Nov 25, 2021

Before:

In the site setup checklist on the mobile layout under My Home we do not see the entered email address under the Confirm your email address step:


Direct Link

After:


Direct Link

We can here see the email address which is viewable without the user needing to click on the Confirm your email address step.

Testing instructions

  1. Create a new WordPress.com site with a new account
  2. Goto https://wordpress.com/home/:site on a mobile layout to see the site setup checklist
  3. We should now see the user email under the Confirm your Email address step without it being collapsed

Related to #58360

@tyxla @enejb

@spraveenitpro spraveenitpro added the [Type] Feature Request Feature requests label Nov 25, 2021
@spraveenitpro spraveenitpro requested a review from a team as a code owner November 25, 2021 14:46
@spraveenitpro spraveenitpro removed the request for review from a team November 25, 2021 22:07
@annchichi
Copy link

annchichi commented Nov 26, 2021

Heya there 👋 @enejb and @spraveenitpro ,

Thanks for the implementation. 😸

  • I was not able to see the email address showing in step 2 (Goto https://wordpress.com/home/:site on a mobile layout to see the site setup checklist) you mentioned.
  • I signed up as a new user in an incognito mode and went through the free domain, free site, and design theme. In the homepage, I was not able to see that as well.

Please let me know what steps I've missed here. :)

Based on the video you shared when the item is expanded,

  • the copy should be: "We have sent an email to this address to verify your account. Not in inbox or spam folder? Tap the Resend button!"
  • the email address as a subtitle will be hidden. And it will show after the copy.

I have attached the screenshot with two arrows. Hope this helps! 🙂
Screen Shot 2021-11-26 at 4 40 40 PM

Copy link
Member

@tyxla tyxla left a comment

Choose a reason for hiding this comment

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

Thanks for spinning up a PR on this one, @spraveenitpro!

On top of the review by @annchichi, I've added some feedback and questions.

@@ -79,7 +79,18 @@ export const getTask = (
case CHECKLIST_KNOWN_TASKS.EMAIL_VERIFIED:
taskData = {
timing: 1,
title: translate( 'Confirm your email address' ),
title: translate(
'Confirm your email address {{emailWrapper}} %(email)s {{/emailWrapper}} ',
Copy link
Member

Choose a reason for hiding this comment

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

We seem to have a few extra leading and trailing spaces here and there that could be removed:

Suggested change
'Confirm your email address {{emailWrapper}} %(email)s {{/emailWrapper}} ',
'Confirm your email address {{emailWrapper}}%(email)s{{/emailWrapper}}',

@@ -79,7 +79,18 @@ export const getTask = (
case CHECKLIST_KNOWN_TASKS.EMAIL_VERIFIED:
taskData = {
timing: 1,
title: translate( 'Confirm your email address' ),
title: translate(
'Confirm your email address {{emailWrapper}} %(email)s {{/emailWrapper}} ',
Copy link
Member

Choose a reason for hiding this comment

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

If we put the email inside the emailWrapper component, we could have a stronger string, something like 'Confirm your email address {{emailAddress}}. It would also help make translating the string a bit easier and less error prone.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, also revising https://wpcalypso.wordpress.com/devdocs/packages/i18n-calypso/README.md to really understand this.

email: userEmail,
},
components: {
br: <br />,
Copy link
Member

Choose a reason for hiding this comment

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

Is the br component necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have refactored and removed it.

@@ -251,7 +251,7 @@ const SiteSetupList = ( {
<CardHeading>{ translate( 'Site setup' ) }</CardHeading>
<ul className="site-setup-list__list">
{ tasks.map( ( task ) => {
const enhancedTask = getTask( task );
const enhancedTask = getTask( task, { userEmail } );
Copy link
Member

Choose a reason for hiding this comment

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

Could you please elaborate on this change?

Copy link
Contributor Author

@spraveenitpro spraveenitpro Dec 1, 2021

Choose a reason for hiding this comment

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

Here I am destructuring and including userEmail as a parameter while calling the getTask function. Now, within the getTask function, under the conditional check of task.id, if it is CHECKLIST_KNOWN_TASKS.EMAIL_VERIFIED then we use/display the user email in the Title and the description:

},
components: {
br: <br />,
emailWrapper: <span className="site-setup-list__emailstyle" />,
Copy link
Member

Choose a reason for hiding this comment

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

Classname naming nit: style in a classname is redundant.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, now it is site-setup-list__email

@spraveenitpro
Copy link
Contributor Author

Testing Instructions:

  1. Created a new account on WordPress.com
  2. Signed in to the newly created site at http://calypso.localhost:3000/home/:Site , in my case this site
  3. On the home page, we see the below during the desktop and mobile layout testing:

Full Desktop Layout:


Direct Link

Mobile Layout Collapsed:


Direct Link

Mobile Expanded:


Direct Link

@tyxla @annchichi

@spraveenitpro
Copy link
Contributor Author

Hi @annchichi

Great points, I have just made the copy changes you requested, I have also listed the exact testing steps above, You will have to switch to the branch add/show-email-address-inline-in-site-setup, any other questions then let me know 🙌🏽

}
}

.site-setup-list__emailbold {
Copy link
Member

Choose a reason for hiding this comment

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

What if we decide that the email will be with a larger font size instead of bold? Or make it with red color? Then we'll have to change the class name to reflect that.

That's an example of why we don't name our classes based on the positioning or visual appearance. You can read more about that here:

https://github.com/Automattic/wp-calypso/blob/trunk/docs/coding-guidelines/css.md#classes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have changed the class names to .site-setup-list__nav-item-email and .site-setup-list__task-description-email so that it shows the relationship to the parent component as per documentation. Let me know if that is alright

Copy link
Member

Choose a reason for hiding this comment

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

Those sound good to me, thanks 👍

}

.site-setup-list__emailbold {
font-weight: bolder;
Copy link
Member

Choose a reason for hiding this comment

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

I haven't seen bolder used in a while 😅

I'd recommend using a numeric value. bolder can be relative to the parent, and using a non-relative value makes it easier to reason about. Also, we mostly use numeric values all throughout Calypso.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is correct, Just looked around.

description: translate(
'Please click the link in the email we sent to %(email)s. ' +
'Typo in your email address? {{changeButton}}Change it here{{/changeButton}}.',
'We have sent an email to this address to verify your account. Not in inbox or spam folder? Tap the Resend button!' +
Copy link
Member

Choose a reason for hiding this comment

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

Doesn't the button say "Resend email" to be precise?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right, I used the exact copy provided, will change.

'Please click the link in the email we sent to %(email)s. ' +
'Typo in your email address? {{changeButton}}Change it here{{/changeButton}}.',
'We have sent an email to this address to verify your account. Not in inbox or spam folder? Tap the Resend button!' +
'{{emailWrapperBold}} %(email)s {{/emailWrapperBold}} {{changeButton}} Change {{/changeButton}}',
Copy link
Member

Choose a reason for hiding this comment

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

Let's keep an eye on those extra leading and trailing spaces inside the components. They're in a translatable string and it's easy for the translator to miss them if we're relying on them for some reason. See how we didn't have spaces there in the previous version of the string.

@@ -65,6 +65,20 @@
border-bottom: none;
}
}

.site-setup-list__email {
Copy link
Member

Choose a reason for hiding this comment

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

Can we try to think of a better classname that serves the purpose of this? Seems like it's the class name that's in the title.

@@ -79,17 +79,21 @@ export const getTask = (
case CHECKLIST_KNOWN_TASKS.EMAIL_VERIFIED:
taskData = {
timing: 1,
title: translate( 'Confirm your email address' ),
title: translate( 'Confirm your email address {{emailAddress /}}', {
Copy link
Member

Choose a reason for hiding this comment

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

🤔 What will happen if the translator decides that the place of the emailAddress component is in the beginning of the string? That may be true for some languages. Should it be positioned outside of the translatable string?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That will lead to the email displaying above the actual title Confirm your email address which is not what we want,

Should it be positioned outside of the translatable string?, it should still be part of the title key in the taskData object, but moving it out like title: translate( 'Confirm your email address' ) + userEmail, will not help as we then can not target the email with css, so how/what would you suggest? @tyxla

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 not sure I understand what you mean - by moving it outside of the translate() call to the end of the expression it still remains part of the title property? So we should be able to style it? Or am I misunderstanding you?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

in the latest commit I am displaying the email outside of the translation, hope it is acceptable.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, I think it looks great now!

Copy link
Member

@tyxla tyxla left a comment

Choose a reason for hiding this comment

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

I'm happy with the code and this looks great to me!

There's just one minor change I'd recommend - making the email non-bold on desktop. I believe this is going to be ready to ship afterwards!

I'd also like to ask @enejb for his feedback from a mobile web perspective.

Thanks @spraveenitpro!


.site-setup-list__nav-item-email {
color: var( --studio-gray-50 );
display: block;
Copy link
Member

Choose a reason for hiding this comment

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

I think on desktop it would be better if the email is not bold:

This PR:

My suggestion:

@@ -65,6 +65,24 @@
border-bottom: none;
}
}

.site-setup-list__nav-item-email {
color: var( --studio-gray-50 );
Copy link
Member

Choose a reason for hiding this comment

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

This colour should be --studio-gray-40 as per figma.

@enejb
Copy link
Member

enejb commented Dec 9, 2021

Nice work @spraveenitpro

I notice that the circle and the checkmarks are not center aligned. Can we make them top aligned so that they don't move around when you expand the accordion? Just as the screenshot at the very top indicates?

Also when the accordion is expended the email address shouldn't be bold.

Thanks for all your work on this. We are super close!

@spraveenitpro
Copy link
Contributor Author

I notice that the circle and the checkmarks are not center aligned. Can we make them top aligned so that they don't move around when you expand the accordion? Just as the screenshot at the very top indicates?

I see that, you are right @enejb I am trying to target .site-setup-list .nav-item__status to align it to top [vertical align] but something is inhibiting, Let me dig into this.

Also when the accordion is expended the email address shouldn't be bold.

I think I got it like this:


Direct Link

'Please click the link in the email we sent to %(email)s. ' +
'Typo in your email address? {{changeButton}}Change it here{{/changeButton}}.',
'We have sent an email to this address to verify your account. Not in inbox or spam folder? Tap the Resend email button! ' +
'{{emailWrapper}}%(email)s{{/emailWrapper}} {{changeButton}}Change{{/changeButton}}',
Copy link
Member

Choose a reason for hiding this comment

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

Noting that as the email and change button parts are at the end of the string, they're making it needlessly more complex for the translators. I'd suggest moving them out of the string to simplify the localization for translators.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @tyxla I have removed the components from appearing within the translation function, going forward I will remember not to do this. Great to be back from holiday!

@enejb
Copy link
Member

enejb commented Dec 23, 2021

Thanks for the PR @spraveenitpro We are so close.

The only thing that I see is that the email now shows up in the H2 on desktop. So you end up with something like this. When the email is extra long. Also notice that the address is right next to the users's email.

There should be a space there.

See
Screen_Shot_2021-12-23_at_1_54_21_PM

I think we should have this instead
Screen_Shot_2021-12-23_at_2_01_25_PM

@spraveenitpro
Copy link
Contributor Author

spraveenitpro commented Jan 7, 2022

The only thing that I see is that the email now shows up in the H2 on desktop. So you end up with something like this. When the email is extra long. Also notice that the address is right next to the users's email.

HI @enejb , Happy to be back from holiday, please check it out and let me know if any other changes needed.

@enejb
Copy link
Member

enejb commented Jan 8, 2022

Thanks for the fixes @spraveenitpro .
The issue that I have reported is fixed 🥳

But in my testing things don't work as expected anymore.
The email is now only showing up when the "Confirm your email" tab is.
I would expect the email to always be visible even in the tab even if the tab is not selected.

See:
Screen Shot 2022-01-07 at 4 21 56 PM

Also this PR seems like its needs a rebase there is a conflct in the client/my-sites/customer-home/cards/tasks/site-setup-list/index.jsx file.

@enejb
Copy link
Member

enejb commented Jan 10, 2022

Thanks for the fixes @spraveenitpro Do you mind also rebasing this PR. So that we can merge it.

This is what I am currently seeing. Thanks!
Screen Shot 2022-01-10 at 2 46 15 PM

Copy link
Member

@enejb enejb left a comment

Choose a reason for hiding this comment

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

Thanks for all the changes @spraveenitpro!

They look good and the code works as expected

@enejb enejb merged commit 377fec7 into Automattic:trunk Jan 11, 2022
@a8ci18n
Copy link

a8ci18n commented Jan 11, 2022

This Pull Request is now available for translation here: https://translate.wordpress.com/deliverables/7079497

Thank you @spraveenitpro for including a screenshot in the description! This is really helpful for our translators.

@a8ci18n
Copy link

a8ci18n commented Jan 24, 2022

Translation for this Pull Request has now been finished.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants