-
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
Emails: Mailbox list and add/remove button design changes #55529
Emails: Mailbox list and add/remove button design changes #55529
Conversation
{ index > 0 && ( | ||
<Button onClick={ onMailboxRemove( mailboxes, mailbox.uuid ) }> | ||
<Gridicon icon="trash" /> | ||
<span>{ translate( 'Remove this mailbox' ) }</span> |
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.
ℹ️ String reuse speeds up translation and improves consistency. The following string might make a good alternative and has already been translated 18 times:
translate( 'Remove mailbox' )
ES Score: 6
</div> | ||
<FormFieldset> | ||
<FormLabel> | ||
{ showLabels && translate( 'Email address' ) } | ||
<FormTextInputWithAffixes | ||
placeholder={ translate( 'Email' ) } | ||
placeholder={ translate( 'Email address' ) } |
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.
Just an idea but instead of repeating the label just above, we could actually provide the user with a suggestion: e.g. contact
. We already do that for email forwards:
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.
Not related to this PR, but just a small note on copies is that would be great to start each with uppercase and then use lowercase, similar to Professional Email detail pages.
"Emails sent to"
"Will be forwarded to"
"Your existing email address"
And separately I think we should also tweak the CTA copy to be "Add new email forwarding" instead of "Add new email address" for clarity.
Being looked at in Automattic#55529
* Use EmailProvidersComparison for upsell page * Hide email forwarding and header cards * Add header title and description prop * Extract out titan mailbox components to fix styles * Add skip button to header cake * Change email placeholder text * Change style and layout for mailbox add/remove * Fix ordering * Add position="left" to main HeaderCakeBack * Remover previous trash icon button * Remove unused button classname * Change button prop name to iconPosition * Handle back button click * Use actionButton prop for skip * Add cartDomainName prop * skip checks if cartDomainName is present * Fix import ordering * Remove unnecessary fragment * Pass title and description props as strings * Remove "from" to avoid re-translation * Sort and clean-up propTypes definitions * Rename is* props to hide* * Remove promoHeaderDescription prop * Rename isSkippable to showSkipButton * Add domainName to propTypes * Add back style.scss import in titan-add-mailboxes * Don't pass domains prop if `domain` prop is absent * Add hasCartDomain dervied prop * Revert titan mailbox submit button text * Undo mailbox form UX changes - being looked at in #55529 * Pass empty array to getItemsForCart if domain is undefined * Fix variable ordering
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.
Overall, this is really close, but there are some CSS fixes that are still needed.
tagName="h3" | ||
size={ 20 } | ||
> | ||
Mailbox { String( index + 1 ).padStart( 2, '0' ) } |
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 string should be wrapped in a translate()
call with the mailbox number substituted in.
I am also thinking that the 0-padding is unusual -- extremely few users are going to buy more than 9 mailboxes at a time. @saygunnyc, please chime in if you think this is something you think we should keep as 02
, 03
, etc. I would prefer just 2
/3
/etc.
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.
Missed adding that, thanks for catch. Have added transalte()
around this.
On a side note, I agree with omitting the 0
as well.
@@ -23,3 +23,13 @@ | |||
} |
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 we also need to add some left/right padding to the buttons for non-mobile displays when we're outside the email comparison page. The screenshot below was on Chrome at desktop width looking at the add mailbox page.
For this use case, I think it might make sense to use something like the following as the default styling:
@include break-mobile {
.button + .button { /* this could also be a :not:first-child selector */
margin-left: 1.5em;
}
}
We can then override that for the email comparison page, where we're currently specifying justify-content: space-between
for the wrapping/container element set to flex.
We also have a similar issue for that same page in mobile, where we're not switching the Cancel and Continue buttons to flex-direction: column;
:
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 took a different direction for this with 15ca39a by adding a wrapper for the children
and giving it the same styles as the existing action buttons. This seems to work well on /titan/new
, /purchase
and the new /email
routes which I've checked so far. I'll expand further on this, think a bit more next week.
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.
…mailbox-design-changes
Few things that popped up while I was working on Dale's comments:
|
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.
Overall, I think this is looking really good - I think my only blocking comment is around the Mailbox N
translation.
Beyond that, I think we're going to need @saygunnyc to explore some of the UX pieces, may be a bit difficult due to us not getting a live branch/build due to security limitations.
@saygunnyc, could you propose an approach that would give you a feel for the UX across the various components? Might it make sense for you and I to pair on this?
Sangeeth, I'll also address your questions in a dedicated comment.
{ translate( 'Mailbox %(index)s', { | ||
args: { index: String( index + 1 ).padStart( 2, '0' ) }, | ||
} ) } |
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 adding the translate()
wrapper!
Could you also add a comment for translators? It may also be clearer to call this %(position)s
for the purposes of translation.
{ translate( 'Mailbox %(index)s', { | |
args: { index: String( index + 1 ).padStart( 2, '0' ) }, | |
} ) } | |
{ translate( 'Mailbox %(position)s', { | |
args: { position: String( index + 1 ).padStart( 2, '0' ) }, | |
comment: '%(position)s is the position of the mailbox in a list, e.g. Mailbox 1, Mailbox 2, etc', | |
} ) } |
Also, let's drop the padding to start with -- unless we hear strong objections from @saygunnyc, I'd prefer to make this mainstream. (We can easily change it to match the design if and when he weighs in.)
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 the feedback. Have incorporated these suggestions.
@@ -110,7 +110,7 @@ const TitanNewMailboxList = ( { | |||
</React.Fragment> | |||
) ) } | |||
|
|||
{ children } | |||
<div className="titan-new-mailbox-list__parent-actions">{ children }</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.
Calling this parent-actions
feels weird to me, but I can't put my finger on why!
Might supplied-actions
be a bit more self-descriptive?
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.
Yea, didn't feel 💯 sure about naming it like that. I think supplied-actions
sound better.
display: flex; | ||
flex-direction: column; | ||
flex-direction: column-reverse; | ||
justify-content: space-between; | ||
|
||
@include break-mobile { | ||
flex-direction: row; |
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.
Should we not revert/override the justify-content
directive here as well?
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.
Maybe the way I've written this was confusing. The Figma design under Domain Purchase Flow i1 > Revisit section shows:
So for the main Continue/Cancel button section, in desktop mode, it seems like the default should be justify-content: start
. For the Add mailbox/Remove mailbox section, we needed space-between
.
At mobile configuration (i.e column
), justify-content
can remain the default value for both sections and it doesn't seem to matter.
I refactored this part slightly to reflect this better. Let me know if you still think something's amiss. @daledupreez
|
||
@include break-mobile { | ||
margin-bottom: 0; | ||
margin-top: 0; | ||
margin-right: 1.5em; |
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 worry about this triggering weird overflow conditions at specific sizes. I'll test this out to see how it behaves in practice.
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.
Nope, looks OK to me. The one weird thing is that the main buttons for save/continue are not using justify-content
until we're hitting mobile widths.
@saygunnyc, do you have a strong preference for this display order? I don't -- I'd prefer to prioritise accessibility. That said, this should only occur on mobile devices, I don't know how many accessibility tools exist in that context.
Let us know if this is still something you plan to tackle. I think we may be able to use the Material icons for this. @saygunnyc, let us know if this should be taken on here or in a follow-up PR. |
I've addressed this in 9429660. But I do have one query after making this change. In the following case where there are two additional mailboxes: Should the additional mailboxes (excluding the last one) have the remove button on the left (present implementation) or the right? The Figma file doesn't seem to have this case. |
Apologies for the delay, @sangeeth96! Regarding your question about how we should display the Remove button when it's the only button, I prefer it being on the right and in the same location regardless of whether the "add mailbox" button is visible. Having the location change depending on other state feels really confusing and unexpected to me. I also played with implementing the above and think the simplest approach would be to declare a class on the remove button (something like .titan-new-mailbox-list__actions {
@include break-mobile {
justify-content: space-between;
+
+ .titan-new-mailbox-list__action-remove {
+ margin-left: auto;
+ }
}
} I also thought more about the trash icon, and the icon can be added using |
@sangeeth96 great progress here already!! 🍾 Apologies for just getting here. @daledupreez that would be great to briefly connect about this tomorrow, if you happen to have the time. A few notes in the meanwhile,
|
@saygunnyc, feel free to ping me when you get in today. I do have some responses to your comments:
I think we should take this on in a follow-up PR, for two reasons:
We have this in place, so we're good to go! |
@daledupreez have updated the screenshots with changes from latest commit (bb84b0b) cc @saygunnyc |
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 is LGTM! I've just connected with Saygun and we have two follow-up PRs that we'll take on:
- Fix the icons in the buttons
- Move the "Add another mailbox button" back out of the main list, and left-align the "Remove this mailbox" buttons
Thanks a lot @daledupreez @saygunnyc taking the time to iron this out.
If I understand correctly, this will make that button fall on the same line as "Add professional email" CTA?
@saygunnyc would love it if I could get updated Figma designs for this with "two additional mailboxes" scenario which should cover those use cases as well. @daledupreez @saygunnyc hope you folks also managed to discuss the additional skip button and Figma designs for those as well. |
Hey @sangeeth96 ! Single Mailbox Multiple Mailboxes Within the Figma file Hope this is helpful! |
This Pull Request is now available for translation here: https://translate.wordpress.com/deliverables/6486348 Thank you @sangeeth96 for including a screenshot in the description! This is really helpful for our translators. |
Translation for this Pull Request has now been finished. |
Changes proposed in this Pull Request
Related to #55183
This PR introduces design changes as per Figma mockups (see P2 for Figma link and details) for Professional Email's mailbox list form components. Specifically:
Testing instructions
http://calypso.localhost:3000/email/:siteSlug
Screenshots
Click/tap on this section to see screenshots
Mobile (/email/:domain/purchase/:siteSlug)
Desktop (/email/:domain/purchase/:siteSlug)
Mobile (/email/:domain/titan/new/:siteSlug)
Desktop (/email/:domain/titan/new/:siteSlug)
CC @daledupreez