-
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
Mobile web: Improve the way we show email address in site setup #58515
Mobile web: Improve the way we show email address in site setup #58515
Conversation
Heya there 👋 @enejb and @spraveenitpro , Thanks for the implementation. 😸
Please let me know what steps I've missed here. :) Based on the video you shared when the item is expanded,
I have attached the screenshot with two arrows. Hope this helps! 🙂 |
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.
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}} ', |
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.
We seem to have a few extra leading and trailing spaces here and there that could be removed:
'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}} ', |
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.
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.
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 point, also revising https://wpcalypso.wordpress.com/devdocs/packages/i18n-calypso/README.md to really understand this.
email: userEmail, | ||
}, | ||
components: { | ||
br: <br />, |
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.
Is the br
component 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 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 } ); |
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.
Could you please elaborate on this change?
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.
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" />, |
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.
Classname naming nit: style
in a classname is redundant.
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.
Sure, now it is site-setup-list__email
Testing Instructions:
Full Desktop Layout:Mobile Layout Collapsed:Mobile Expanded: |
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 |
} | ||
} | ||
|
||
.site-setup-list__emailbold { |
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.
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
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 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
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.
Those sound good to me, thanks 👍
} | ||
|
||
.site-setup-list__emailbold { | ||
font-weight: bolder; |
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 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.
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.
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!' + |
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.
Doesn't the button say "Resend email" to be precise?
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.
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}}', |
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.
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 { |
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.
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 /}}', { |
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.
🤔 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?
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.
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
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'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?
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 the latest commit I am displaying the email outside of the translation, hope it is acceptable.
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.
Yes, I think it looks great now!
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'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; |
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.
@@ -65,6 +65,24 @@ | |||
border-bottom: none; | |||
} | |||
} | |||
|
|||
.site-setup-list__nav-item-email { | |||
color: var( --studio-gray-50 ); |
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 colour should be --studio-gray-40 as per figma.
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! |
I see that, you are right @enejb I am trying to target
I think I got it like this: |
'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}}', |
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.
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.
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.
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!
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. |
HI @enejb , Happy to be back from holiday, please check it out and let me know if any other changes needed. |
Thanks for the fixes @spraveenitpro . But in my testing things don't work as expected anymore. Also this PR seems like its needs a rebase there is a conflct in the |
Thanks for the fixes @spraveenitpro Do you mind also rebasing this PR. So that we can merge it. |
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.
Thanks for all the changes @spraveenitpro!
They look good and the code works as expected
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. |
Translation for this Pull Request has now been finished. |
Before:
In the site setup checklist on the mobile layout under
My Home
we do not see the entered email address under theConfirm 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
Confirm your Email address
step without it being collapsedRelated to #58360
@tyxla @enejb