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

[Goals Capture] Display Continue button in goals capture screen #64656

Merged
merged 1 commit into from
Jun 16, 2022

Conversation

mashikag
Copy link
Contributor

@mashikag mashikag commented Jun 15, 2022

Proposed Changes

  • Implement Continue button to goals capture screen
Before (Desktop and Mobile)

No Continue button at Goals capture step screen.
Screenshot 2022-06-15 at 16 55 08
Screenshot 2022-06-15 at 16 55 21

After (Desktop and Mobile)

Continue button is present.
Screenshot 2022-06-15 at 16 49 20
Screenshot 2022-06-15 at 16 49 41

Testing Instructions

  1. Checkout this branch locally.
  2. In config/development.json set signup/goals-step property to true
  3. Build and run wp-calypso locally.
  4. Navigate to http://calypso.localhost:3000/setup/goals?siteSlug=<YOUR SITE'S ADDRESS HERE>, e.g.: http://calypso.localhost:3000/setup/goals?siteSlug=blajh198278453.wordpress.com
  5. Test for Continue button being displayed.

Related to #63921

@matticbot
Copy link
Contributor

matticbot commented Jun 15, 2022

@matticbot
Copy link
Contributor

matticbot commented Jun 15, 2022

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

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

name                 parsed_size           gzip_size
entry-stepper             +292 B  (+0.0%)      +63 B  (+0.0%)
entry-gutenboarding        +22 B  (+0.0%)      +12 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.

@mashikag mashikag force-pushed the add/onboarding-goals-navigation-on-submit branch from 241e3b1 to a23c654 Compare June 15, 2022 13:19
@yansern yansern added [Feature] Site Goals & Onboarding Paths The onboarding flows for all new sites. [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Jun 15, 2022
@yansern yansern requested a review from a team June 15, 2022 15:15
Copy link
Contributor

@phcp phcp left a comment

Choose a reason for hiding this comment

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

Looks good! From the code perspective I like that you changed the SelectCard component to use generics, that way we earn more flexibility and avoid casting the value.

The navigation flow is working as expected and the Continue button is disabled until the user select a goal.

Screen Shot 2022-06-15 at 17 51 55

Screen Shot 2022-06-15 at 17 52 09

Copy link
Contributor

@yansern yansern left a comment

Choose a reason for hiding this comment

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

The 3 issues that need to be addressed are:

  • Flow routing needs changes. See further comment here.
  • The "Continue" button behavior when no goals are selected.
  • Untranslated strings.

For future work, I would recommend, where possible, breaking compound work down into separate PRs to make things easier to review.

</div>

<div className="select-goals__actions-container">
<Button primary disabled={ ! hasSelectedGoals } onClick={ onSubmit }>
Copy link
Contributor

@yansern yansern Jun 15, 2022

Choose a reason for hiding this comment

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

Actually, user should be allowed to click Continue button when no goals are selected. When no goals are selected, it should route to the build flow, meaning the intent is build.

Be aware of the subtle difference:

  • Continue button's intent is build when no goals are selected.
  • Skip button's intent is wpadmin.

Have a feeling something needs to change in the goalsToIntent mapping function. Let me know what you find out! :)

Context: p1653902033117909-slack-C02TCEHP3HA

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmmm... Ok. I will make the button always enabled then. However the fix to have the build intent selected by default, if no goals are selected, will need to be addressed in another PR. It will add a little bit more complexity because we will need to ensure that this default value is only set (locally and remotely) when goals capture screen is used.

Write = 'write',
Sell = 'sell',
Build = 'build',
DIFM = 'difm', // "Do It For Me"
WpAdmin = 'wpadmin',
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Not sure if this should be WPAdmin, wpAdmin or WpAdmin. All 3 use cases seem to exist across different codebases.

Copy link
Contributor

@yansern yansern left a comment

Choose a reason for hiding this comment

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

Relooking this PR with fresher eyes and more focus on the routing part, there are some routing issues that need to align more to the flow on whimsical.

Comment on lines 328 to 331
case 'intent':
return navigate( isEnabled( 'signup/site-vertical-step' ) ? 'vertical' : 'intent' );
return navigate(
isEnabled( 'signup/site-vertical-step' ) ? 'vertical' : intentCaptureStep
);
Copy link
Contributor

Choose a reason for hiding this comment

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

Given that this context is under goBack(), something feels off here.

  1. When the current step is intent, we know that this is a version of the onboarding flow that doesn't have Goals Capture, and therefore replacing intent with intentCaptureStep is likely incorrect, as intentCaptureStep could be either intent or goals.
  2. Goals Capture will be the first step, Verticals is the second step, so a case for handling go-back flow when vertical is the second step is likely needed.
case 'intent':
	return navigate( isEnabled( 'signup/site-vertical-step' ) ? 'vertical' : 'intent' );
case 'vertical':
    // the latter part of is something I'm unsure of
    return navigate( isEnabled( 'signup/goals-step') ? 'goals' :  'vertical' ); 

Comment on lines 202 to 206
case SiteIntent.Write:
case SiteIntent.Sell:
return navigate( 'options' );
case SiteIntent.Build:
return navigate( 'designSetup' );
Copy link
Contributor

@yansern yansern Jun 16, 2022

Choose a reason for hiding this comment

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

If V13N is enabled, this should first route to the Verticals step. And after the Verticals step is completed, it should continue with the logic above. See more about post-verticals routing comment below.

If V13N is not enabled, where import flow should go is still a question that needs addressing.

Comment on lines 300 to 282
case 'vertical': {
return navigate( 'intent' );
return navigate( intentCaptureStep );
}
Copy link
Contributor

@yansern yansern Jun 16, 2022

Choose a reason for hiding this comment

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

Under the scenario where both GC + V13N are enabled, it should:

  1. Check if the goal import is selected, and route to Import flow import.
  2. Check if the intent is write or sell, then route to Write/Sell flow options.
  3. Else if the intent is build, then route to Build flow designSetup.

Can't wrap my headspace around this at the moment, but double-check for possible scenarios like:

  • No V13N
  • V13N only
  • GC with V13N
  • GC only (without V13N)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What about the difm goal/intent was selected? Do we still go through vertical step? And then, only after, exit out to /start/website-design-services/?siteSlug=${ siteSlug }? Or we skip the vertical step then and exit out directly from goals capture screen?

Copy link
Contributor

@yansern yansern left a comment

Choose a reason for hiding this comment

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

After reviewing the flow routing issues, I think those mentioned issues need to be addressed before the PR can be merged.

Or split the site-setup-flow.ts changes to another PR, and address other issues in the comments above in other smaller PRs.

@mashikag mashikag force-pushed the add/onboarding-goals-navigation-on-submit branch from c1f6ee4 to 0778c09 Compare June 16, 2022 15:33
@mashikag mashikag requested a review from yansern June 16, 2022 15:48
@mashikag mashikag changed the title [Goals Capture] Implement Continue button to goals capture screen and its navigation flow [Goals Capture] Display Continue button in goals capture screen Jun 16, 2022
Copy link
Contributor

@yansern yansern left a comment

Choose a reason for hiding this comment

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

Thanks a lot! Let's roll it in.

@mashikag mashikag linked an issue Jun 16, 2022 that may be closed by this pull request
@mashikag mashikag removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Jun 16, 2022
@mashikag mashikag merged commit 4808bef into trunk Jun 16, 2022
@mashikag mashikag deleted the add/onboarding-goals-navigation-on-submit branch June 16, 2022 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Site Goals & Onboarding Paths The onboarding flows for all new sites.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[UI] Implement the step submit action
4 participants