-
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
A4A: Add "Next Steps" Onboarding Tours #89081
Conversation
Jetpack Cloud live (direct link)
Automattic for Agencies live (direct link)
|
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: Sections (~5555 bytes added 📈 [gzipped])
Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to. 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. Generated by performance advisor bot at iscalypsofastyet.com. |
01e04e7
to
8bf0547
Compare
40f880f
to
80b1747
Compare
55bedb3
to
9b41d64
Compare
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 job on this, @nateweller!
It mostly looks good. I have left a few comments. Let me know what you think.
Few things to note:
- Could you please rebase this PR with the latest trunk?
- I also see the PR has 1300+ lines added. We suggest keeping it to maximum of 500 lines, limiting the scope of changes as tightly as makes sense, and breaking it into multiple PRs, as it becomes very hard to review everything. But it is okay for now as I have reviewed most of the things.
.dataviews-wrapper { | ||
.dataviews-no-results, | ||
.dataviews-loading { | ||
padding-top: 1rem; |
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.
[Non-blocker] It is better to use logical properties everywhere on this file since we can support RTL locales in Calypso.
6171336
to
a553674
Compare
Thanks for the review @yashwin! I've rebased trunk and addressed the color variables. I've left the sites dataviews alone for now. Let me know what you think 👍 |
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.
Haven't tested it manually but the code looks good and it already had previous approvals! 👍
It was a comment for another PR.
@@ -1,5 +1,7 @@ | |||
import classNames from 'classnames'; | |||
import React, { ReactNode } from 'react'; | |||
import GuidedTour from 'calypso/a8c-for-agencies/components/guided-tour'; |
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 this variable is unused.
type Props = { | ||
id: string; | ||
tourId: TourId; | ||
context?: LegacyRef< HTMLElement | null >; |
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.
There's a typescript error caused by this. I think we can use just HTMLElement | null
here.
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.
Thank you for working on this. Overall, it looks like a solid solution.
There's a number of small issues with typescript build we need to address prior to be able to fully test it though. Please let me know if these looks reasonable. Thanks!
</div> | ||
<GuidedTourStep | ||
id="sites-walkthrough-site-preview-tabs" | ||
tourId="sitesWalkthrough" |
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 see typescript shows an error here. Should it be sites-walkthrough
?
); | ||
|
||
// Legacy refs for guided tour popovers | ||
const [ introRef, setIntroRef ] = useState< React.LegacyRef< HTMLElement | null > >(); |
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 we should be able to use simply as well
const [ introRef, setIntroRef ] = useState< HTMLElement | null >();
</SiteSort> | ||
<GuidedTourStep | ||
id="sites-walkthrough-intro" | ||
tourId="sitesWalkthrough" |
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.
Typescript is complaining here. Should it be tourId="sites-walkthrough"
?
} | ||
/> | ||
</div> | ||
<GuidedTourStep id="add-new-site" tourId="addSiteStep1" context={ tourStepRef } /> |
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 tourId
here be 'add-new-site'
?
</div> | ||
<div className="guided-tour__popover-footer-right-content"> | ||
<> | ||
{ ( ( ! currentStep.nextStepOnTargetClick && |
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.
It's a bit hard to follow here. Maybe we could move it to a constant defined above?
dispatch( | ||
savePreference( A4A_ONBOARDING_TOURS_PREFERENCE_NAME[ 'sitesWalkthrough' ], true ) | ||
); | ||
resetTour( [ 'sitesWalkthrough' ] ); |
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 it be sites-walkthrough
?
This PR modifies the release build for the following Calypso Apps: For info about this notification, see here: PCYsg-OT6-p2
To test WordPress.com changes, run |
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.
Great work 👍 Thank you for addressing the comments. Looks great now. Let's merge it and iterate if needed.
Some small comments, that we don't need type assertions but they are not blocking.
@@ -71,13 +71,13 @@ export function GuidedTourStep( { id, tourId, context, hideSteps, className }: P | |||
// Add a click event listener to the context element if the step requires it | |||
useEffect( () => { | |||
if ( currentStep && currentStep.nextStepOnTargetClick && context ) { | |||
context.addEventListener( 'click', nextStep ); | |||
( context as HTMLElement ).addEventListener( 'click', nextStep ); |
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 don't think it's necessary here. Should be ok just to use context.addEventListener
?
@@ -111,14 +111,14 @@ const SitesDataViews = ( { | |||
<SiteSort isSortable={ true } columnKey="site"> | |||
<span | |||
className="sites-dataview__site-header sites-dataview__site-header--sort" | |||
ref={ ( ref ) => setIntroRef( ref as React.LegacyRef< HTMLElement | null > ) } | |||
ref={ ( ref ) => setIntroRef( ref as HTMLElement | null ) } |
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.
Similarly, no need for type assertion here.
Resolves https://github.com/Automattic/jetpack-genesis/issues/292
Proposed Changes
tour=sites-walkthrough
ortour=add-new-site
. These are linked in the Overview page's "Next Steps" card.GuidedTourStep
components.GuidedTourStep
components to ensure each step is only rendered when it's anchor is available.Testing Instructions
tour
parameter in the query string.Pre-merge Checklist
Screenshots