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

Gutenboarding: Fix "Choose a domain I own" layout on mobile #49249

Merged
merged 10 commits into from Jan 29, 2021

Conversation

StefanNieuwenhuis
Copy link
Contributor

@StefanNieuwenhuis StefanNieuwenhuis commented Jan 25, 2021

Changes proposed in this Pull Request

The copy of the "Choose a domain I own" row on the Domain Picker is unreadable on mobile devices because the CTA-link is on the same row. This PR contains a fix that stacks (i.e. placed on separate rows) both on mobile viewports.

Technical changes

Expected Result

Mobile
Screenshot 2021-01-25 at 14 07 32

Desktop

Screenshot 2021-01-25 at 15 22 13

Testing instructions

Gutenboarding

  1. Go to /new/domains-modal
  2. Confirm that:
    • Both copy & CTA-link are on the same row
    • The complete row is clickable and clicking redirects you to the domain's transfer/mapping view
    • Clicking the CTA-link redirects you to the domain's transfer/mapping view.
  3. Open DevTools and switch to a mobile viewport (e.g. iPhone X).
  4. Revisit /new/domains-modal.
  5. Confirm that:
    • Copy & CTA-link are stacked and readable
    • The complete row is clickable and clicking redirects you to the domain's transfer/mapping view.
    • Clicking the CTA-link redirects you to the domain's transfer/mapping view
  6. Switch from English to a more verbose language (e.g French) and repeat steps 1-6.

Focused Launch

  1. Go to /page/[UNLAUNCHED_SITE_ID].wordpress.com/home?flags=create/focused-launch-flow.
  2. Click "Launch" to open the Focused Launch flow.
  3. Click on "View All Domains".
  4. Confirm that:
    • Both copy & CTA-link are on the same row
    • The complete row is clickable and clicking redirects you to the domain's transfer/mapping view.
    • Clicking the CTA-link redirects you to the domain's transfer/mapping view.
  5. Open DevTools and switch to a mobile viewport (e.g. iPhone X).
  6. Revisit /page/[UNLAUNCHED_SITE_ID].wordpress.com/home?flags=create/focused-launch-flow.
  7. Confirm that:
    • Copy & CTA-link are stacked and readable
    • The complete row is clickable and clicking redirects you to the domain's transfer/mapping view
    • Clicking the CTA-link redirects you to the domain's transfer/mapping view.
  8. Switch from English to a more verbose language (e.g French) and repeat steps 1-7.

Fixes #49171

@StefanNieuwenhuis StefanNieuwenhuis added [Pri] High [Goal] New Onboarding previously called Gutenboarding labels Jan 25, 2021
@StefanNieuwenhuis StefanNieuwenhuis self-assigned this Jan 25, 2021
@matticbot
Copy link
Contributor

@matticbot
Copy link
Contributor

matticbot commented Jan 25, 2021

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

App Entrypoints (~2 bytes added 📈 [gzipped])

name                 parsed_size           gzip_size
entry-gutenboarding        +15 B  (+0.0%)       +2 B  (+0.0%)

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

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.

@StefanNieuwenhuis StefanNieuwenhuis requested a review from a team January 25, 2021 13:41
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Jan 25, 2021
@StefanNieuwenhuis StefanNieuwenhuis marked this pull request as ready for review January 25, 2021 13:41
@ciampo ciampo self-requested a review January 26, 2021 10:47
@@ -92,6 +92,9 @@ button.action_buttons__button.components-button {
font-weight: 500;
color: var( --mainColor );

// @TODO: We have to revisit the ArrowButton's padding when we pick up #48568 (https://github.com/Automattic/wp-calypso/issues/48568)
padding-left: 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

Just leaving this comment here to mark the TODO item

@ciampo ciampo self-requested a review January 26, 2021 11:08
Copy link
Contributor

@ciampo ciampo left a comment

Choose a reason for hiding this comment

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

Thank you for improving the layout! It looks much better on mobile now :)

I left some comments, and here's some additional feedback from my first round of review:

  • Can we improve the vertical alignment of text and arrow?

  • Can we align the "Use a domain I own >" button to the right, similarly to the items above?

  • While following the testing instructions, whenever I click and get redirected, the query params in the "redirected" URL are different from the testing instructions (maybe you just forgot to update them?):
    • From gutenboarding, I got redirected to /start/domains/use-your-domain?source=http://calypso.localhost:3000/new/domains
    • From Focused Launch, I got redirected to https://wordpress.com/start/new-launch/domains-launch/use-your-domain?siteSlug=teststart366187286.wordpress.com&source=http://calypso.localhost:3000/page/teststart366187286.wordpress.com/home?flags=create/focused-launch-flow — note that I got redirected to wordpress.com, even though I was testing on my local machine, and that the source query param contains the full URL (and not just the path)

packages/domain-picker/src/domain-picker/style.scss Outdated Show resolved Hide resolved
Comment on lines 18 to 20
<label className="domain-picker__suggestion-item contains-link">
/* eslint-disable jsx-a11y/click-events-have-key-events */
/* eslint-disable jsx-a11y/interactive-supports-focus */
<div role="button" className="domain-picker__suggestion-item type-link" onClick={ onClick }>
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks very hacky (and it looked hacky as well prior to this PR).

  • Why are we not using a <button />? Is it because there's another <button /> nested inside?
  • In general, nesting interactive HTML elements within each other (e.g button inside a label, or button inside a button) goes against the HTML spec
  • We may want to consider that the rest of the domain suggestion items have a different wrapping HTML element based on a prop — should we have this component behave the same way, so that it's always aligned with the rest of the items?

@StefanNieuwenhuis
Copy link
Contributor Author

StefanNieuwenhuis commented Jan 27, 2021

Can we improve the vertical alignment of text and arrow?

Absolutely and thanks for addressing this 👍 I've updated the component by aligning the icon with the copy's baseline w/ a negative margin since the svg contains whitespace (5px) around the chevron's path.

Can we align the "Use a domain I own >" button to the right, similarly to the items above?

Sure! I've updated the component.

While following the testing instructions, whenever I click and get redirected, the query params in the "redirected" URL are different from the testing instructions (maybe you just forgot to update them?):

I've updated the testing instructions.

@ciampo
Copy link
Contributor

ciampo commented Jan 27, 2021

I started testing and noticed that on mobile the "Use a domain I own" button doesn't align correctly to the left

Also, what do you think about #49249 (comment)?

Copy link
Contributor

@ciampo ciampo left a comment

Choose a reason for hiding this comment

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

Code changes LGTM, tests as per instructions — although https://github.com/Automattic/wp-calypso/pull/49249/files#r564448003? It hasn't been addressed yet.

@StefanNieuwenhuis what do you think? I understand that it's outside the scope of this PR, but at the very minimum we should discuss it and/or open a separate issue about it

@StefanNieuwenhuis
Copy link
Contributor Author

StefanNieuwenhuis commented Jan 28, 2021

Code changes LGTM, tests as per instructions — although https://github.com/Automattic/wp-calypso/pull/49249/files#r564448003? It hasn't been addressed yet.

@StefanNieuwenhuis what do you think? I understand that it's outside the scope of this PR, but at the very minimum we should discuss it and/or open a separate issue about it

Thanks for reviewing & approving!
Regarding your comment, sorry, I missed it entirely! I've abstracted the wrapper into a separate file. @ciampo, could you have another look, please?

StefanNieuwenhuis and others added 9 commits January 29, 2021 13:30
Be more explicit when it comes to `flexbox`.

Co-authored-by: Marco Ciampini <marco.ciampini@automattic.com>
The current semantics was a bit hacky and unaligned with the other domain suggestions, which are wrapped in a (surprise, surprice) wrapper component. To wrap our component, the wrapper is abstracted from the suggestion-item and moved to a seperate file.
@StefanNieuwenhuis StefanNieuwenhuis force-pushed the fix/gutenboarding/domain-i-own-mobile-layout branch from 3534764 to 717ae15 Compare January 29, 2021 12:30
Copy link
Contributor

@ciampo ciampo left a comment

Choose a reason for hiding this comment

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

LGTM!

Feel free to merge once these two comments (this and this) are addressed 🚢

Comment on lines +21 to +34
const WrappingComponent = React.forwardRef< HTMLButtonElement, WrappingComponentProps >(
( { type, disabled, ...props }, ref ) => {
if ( type === 'button' ) {
return <div { ...( props as React.HTMLAttributes< HTMLDivElement > ) } />;
}
return (
<button
ref={ ref }
disabled={ disabled }
{ ...( props as React.ButtonHTMLAttributes< HTMLButtonElement > ) }
/>
);
}
);
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm still not a fan of the markup that this component outputs. Also, it's confusing that when type === button, the HTML element returned is a div.

We should open a follow-up issue to investigate the semantics of the domain picker a bit better, given all of its variations, and come up with more accessible markup/semantics.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Created #49462

@StefanNieuwenhuis StefanNieuwenhuis merged commit 4e311f0 into trunk Jan 29, 2021
@StefanNieuwenhuis StefanNieuwenhuis deleted the fix/gutenboarding/domain-i-own-mobile-layout branch January 29, 2021 13:43
@matticbot matticbot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Jan 29, 2021
@yansern yansern mentioned this pull request Jan 29, 2021
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Goal] New Onboarding previously called Gutenboarding [Pri] High
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gutenboarding: "Choose a domain I own" layout on mobile viewport
3 participants