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: Add domain categories. #41358

Merged
merged 10 commits into from
Apr 28, 2020
Merged

Conversation

yansern
Copy link
Contributor

@yansern yansern commented Apr 22, 2020

Changes proposed in this Pull Request

  • Introduce domain categories filter.
  • Styling update to match closer to how domain picker looks in modal view.

Testing instructions

Note: This is hiding under a feature flag so it is only testable locally.

  1. Go to /new.
  2. Click on the Domain Picker Button > More Options to show the domain picker modal.
  3. Click on the various categories and see the list of domains change.

Known issues / Things To Consider

  1. A proper way to load the list of domain categories?
    The domains.ts is just a temporary workaround. https://github.com/Automattic/wp-calypso/blob/5ab9ed3cd0df76e879bf863543cdd5aee54f1f64/client/landing/gutenboarding/domains.ts

  2. Avoid tlds prop?
    There might not be a need to use the tlds prop in the future if domains API accept domain category param.

  3. How to translate domain category string?
    If we find out how the list of domain categories are loaded (item no. 1), we'll find an answer to this one to.

  4. (Semi-related) Quantity for modal should be 10, quantity for popover should be 5.
    I was considering introducing the quantity prop to the DomainPicker component when I noticed queryParameters prop is not used. Should queryParameters prop be passed over to useDomainSuggestions()?

  5. Should domain category in popover view reset back to Popular after user changed it in the modal view?

  6. The "Popular" domain category?
    What tlds should the "Popular" domain category include? Currently I just simply added .com, .net and .org. Or if "Popular" is chosen, no TLDs should be passed to the API and the API will return popular TLDs?

  7. Mobile view of categories not implemented.

  8. Focus outline seems to be clipped.
    Need design input on how category button should look like when hovered & clicked.

Screenshot

image

Fixes #41081

@yansern yansern added [Feature Group] Emails & Domains Features related to email integrations and domain management. [Goal] New Onboarding previously called Gutenboarding labels Apr 22, 2020
@yansern yansern requested a review from a team as a code owner April 22, 2020 10:58
@yansern yansern self-assigned this Apr 22, 2020
@matticbot
Copy link
Contributor

@matticbot
Copy link
Contributor

matticbot commented Apr 22, 2020

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

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

name                 parsed_size           gzip_size
entry-gutenboarding      +5063 B  (+0.3%)    +1968 B  (+0.4%)

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.

{ paidSuggestions &&
( paidSuggestions?.length ? (
paidSuggestions.map( ( suggestion, i ) => (
<div className="domain-picker__body">
Copy link
Contributor Author

@yansern yansern Apr 22, 2020

Choose a reason for hiding this comment

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

Don't be alarmed by lots of diffs, all the changes in this file is just to nest the divs in an outer div .domain-picker__body, code remains the same.

@daledupreez
Copy link
Contributor

As a quick note on fetching the categories, I have a prototype diff for this in D42138-code. You should be aware that from a data structure perspective that we will need both the localized display name and a key/slug to include in the API calls to the domain suggestions end point. (The additional parameter to the end point doesn't exist yet, but I wanted to get feedback on this approach first.)

More discussion in #41081.

@sirreal sirreal assigned sirreal and unassigned yansern Apr 23, 2020
@sirreal sirreal force-pushed the add/gutenboarding-domain-categories branch from 5ab9ed3 to 3b3d39f Compare April 24, 2020 16:34
@sirreal sirreal requested a review from a team April 27, 2020 16:59
@sirreal sirreal force-pushed the add/gutenboarding-domain-categories branch from 4351a5c to 2fa50a8 Compare April 28, 2020 09:35
@sirreal
Copy link
Member

sirreal commented Apr 28, 2020

rebased

@sirreal sirreal added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Apr 28, 2020
@sirreal
Copy link
Member

sirreal commented Apr 28, 2020

Known issues / Things To Consider

  1. A proper way to load the list of domain categories?
    The domains.ts is just a temporary workaround. https://github.com/Automattic/wp-calypso/blob/5ab9ed3cd0df76e879bf863543cdd5aee54f1f64/client/landing/gutenboarding/domains.ts

Will be handled in #41450 / D42138-code (not yet ready)

  1. Avoid tlds prop?
    There might not be a need to use the tlds prop in the future if domains API accept domain category param.

We can iterate on this when and if it becomes a feature of the domains API. It does seem redundant to pass the TLD list back and forth with the client. (cc: @daledupreez)

  1. How to translate domain category string?
    If we find out how the list of domain categories are loaded (item no. 1), we'll find an answer to this one to.

Will be handled in #41450 / D42138-code (not yet ready)

  1. (Semi-related) Quantity for modal should be 10, quantity for popover should be 5.
    I was considering introducing the quantity prop to the DomainPicker component when I noticed queryParameters prop is not used. Should queryParameters prop be passed over to useDomainSuggestions()?

It seems problematic that we're putting all of the domain search state into the onboarding store (search query/categories). Onboarding store state has also permeated the domain picker, initially we were treating it like a library that should not depend on store state but that has been lost.

I'd like to work to recover the domain-picker as a library, but in the short term we can continue as we are now.

  1. Should domain category in popover view reset back to Popular after user changed it in the modal view?

Popover doesn't have the concept of categories, I don't believe they should be reflected there. The apparent, visible query should be shown.

  1. The "Popular" domain category?
    What tlds should the "Popular" domain category include? Currently I just simply added .com, .net and .org. Or if "Popular" is chosen, no TLDs should be passed to the API and the API will return popular TLDs?

Looking at an API query to a /tlds endpoint in /start onboarding, I see a response like this:

["com", "net", "org", "blog", "club", "co", "life", "me", "site", "academy", "accountants", /* … */ ]

That appears to be some preferred domains, followed by an alphabetical list? Maybe ["com", "net", "org", "blog", "club", "co", "life", "me", "site" ] should be the popular TLDs?

I expect #41450 / D42138-code will solve this.

  1. Mobile view of categories not implemented.
  2. Focus outline seems to be clipped.

✅ I think we're good here with recent changes.

Need design input on how category button should look like when hovered & clicked.

I've followed the pattern used elsewhere - hover is like selected state. Focus has extra visual queues with keyboard navigation.

Copy link
Member

@sirreal sirreal left a comment

Choose a reason for hiding this comment

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

This is a big changeset. It's not perfect, but I'd like to get it landed so we can improve it in smaller PRs.

Nice work on the bulk of this @yansern 👍

Copy link
Contributor

@daledupreez daledupreez left a comment

Choose a reason for hiding this comment

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

RE the open issues/questions:

1, 2, 3, and 6 should all be addressed by a combination of:

We should be able to avoid dealing with the complete list of TLDs.

*/
import type { ValuesType } from 'utility-types';

export const domainTldsByCategory = {
Copy link
Contributor

Choose a reason for hiding this comment

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

It will be very nice to drop this once we land the category API support!

@yansern yansern merged commit 5efe03d into master Apr 28, 2020
@yansern yansern deleted the add/gutenboarding-domain-categories branch April 28, 2020 13:20
@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 Apr 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature Group] Emails & Domains Features related to email integrations and domain management. [Goal] New Onboarding previously called Gutenboarding
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gutenboarding: "more domains" modal
4 participants