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

Guided Tours: Add Jetpack Plugin Autoupdate Tour #25474

Merged
merged 18 commits into from
Jul 20, 2018

Conversation

ockham
Copy link
Contributor

@ockham ockham commented Jun 13, 2018

Adds the tour.

Waits for plugins to be loaded with some magic. See notes. Existing tools don't seem to be applicable because plugin store is not redux and the wait may be too long.

Try rolling back f7170ea01ee3b09c0f8392ad6aab6074e3bb4102 while testing.
Ensure you test with clean application state and with already loaded plugin data in state. Should display the tour under all conditions.

Testing

Visit the checklist for a new Jetpack site and click the plugin auto-update step.

Closes #25458

@ockham ockham added Jetpack [Status] In Progress [Feature] Plugins Features related to plugins on WordPress.com, including search, management, and installation. Checklist labels Jun 13, 2018
@ockham ockham self-assigned this Jun 13, 2018
@matticbot
Copy link
Contributor

matticbot commented Jun 13, 2018

@ockham ockham force-pushed the add/jetpack-plugin-update-tour branch from 0cc4a97 to 7e28953 Compare June 18, 2018 14:12
@ockham ockham force-pushed the add/jetpack-plugin-update-tour branch from 8fa54a2 to 3ade47e Compare July 3, 2018 17:11
@sirreal sirreal assigned sirreal and unassigned ockham Jul 13, 2018
@sirreal sirreal force-pushed the add/jetpack-plugin-update-tour branch 2 times, most recently from 339baa0 to d2fc725 Compare July 13, 2018 10:20
@sirreal sirreal requested a review from a team July 13, 2018 12:48
@sirreal sirreal added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. and removed [Status] In Progress labels Jul 13, 2018
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.

Left some implementation notes.

@@ -377,10 +381,10 @@ export default class Step extends Component {

const style = { ...this.props.style, ...stepCoords };

return (
return ContentComponent ? (
Copy link
Member

Choose a reason for hiding this comment

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

Don't render and empty tour if no children are provided.

'Step#componentWillMount: stepSection: %s, name: %s',
this.stepSection,
this.props.name
);
Copy link
Member

Choose a reason for hiding this comment

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

Probably should rollback, I don't think Steps remount.

target=".plugin-item.is-placeholder"
onTargetDisappear={ ( { next } ) => next() }
next="onLoaded"
/>
Copy link
Member

Choose a reason for hiding this comment

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

Magic, exhibit 1 (wait for placeholders to disappear)…

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👏 Well played, Jon.

name="onLoaded"
wait={ () => !! query( '.plugin-item-jetpack .form-toggle:enabled' ).length }
target=".plugin-item-jetpack .form-toggle__switch"
onTargetDisappear={ /** Errors if missing */ () => {} }
Copy link
Member

Choose a reason for hiding this comment

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

Magic, exhibit 2.

I think GT are buggy, while waiting it seems that the target appears and disappears. Ideally none of the logic would occur until wait passes.

Without onTargetDisappear, this errors as the component appears.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Might want to add a code comment above this whole step, too.

/cc @lsinger for GT bugginess

! isAutomatedTransfer && <ChecklistShow /> }
! isAutomatedTransfer && (
<Fragment>
<QueryJetpackPlugins siteIds={ [ selectedSiteId ] } />
Copy link
Member

Choose a reason for hiding this comment

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

Query 'em early. As long as this query finishes, the guided tour should display immediately.

@sirreal sirreal requested review from joanrho and a team July 13, 2018 12:54
) }
</p>
<ButtonRow>
<SiteLink isButton href={ '/plans/my-plan/:site' }>
Copy link
Member

Choose a reason for hiding this comment

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

no {

@sirreal sirreal requested a review from a team July 13, 2018 12:55
<Step
name="onLoaded"
wait={ () => !! query( '.plugin-item-jetpack .form-toggle:enabled' ).length }
target=".plugin-item-jetpack .form-toggle__switch"
Copy link
Contributor Author

@ockham ockham Jul 13, 2018

Choose a reason for hiding this comment

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

I added the 'plugin-item-' + plugin.slug class to plugin-item.jsx (see below) so the GT could easily query the JP plugin toggle. However, there's already an id we might be able to use

image

Specifically, we might use label[for=autoupdates-jetpack-:site] .form-toggle__switch as selector (which means adding some more silly :site replacements to GT -- there's precedent).

Not sure it's worth it 🤷‍♂️

@@ -343,7 +343,9 @@ class PluginItem extends Component {
pluginActions = this.renderActions();
}

const pluginItemClasses = classNames( 'plugin-item', { disabled } );
const pluginItemClasses = classNames( 'plugin-item', 'plugin-item-' + plugin.slug, {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ockham
Copy link
Contributor Author

ockham commented Jul 13, 2018

😖 Seeing some bugginess if landing directly at calypso.localhost:3000/plans/my-plan/<jpSite>:

  • Click plugin auto-update step's 'Do it'
  • Behold the plugins page. No GT 🙁
  • Click the browser's 'Back' button, taking you back to the checklist. GT bubble appears... somewhere?!

autoupdate

@sirreal
Copy link
Member

sirreal commented Jul 16, 2018

Thanks @ockham, I'll dig into this more. @lsinger if you have any thoughts, would be great to hear them.

The difficulty here is waiting for a non-Redux data store to finish loading (and the relevant toggles to render) before starting the tour.

@sirreal sirreal force-pushed the add/jetpack-plugin-update-tour branch from 5291247 to 6a7a07a Compare July 19, 2018 07:45
@sirreal
Copy link
Member

sirreal commented Jul 19, 2018

Thanks @joanrho, I can confirm a positioning issue. I'll try to determine whether that's introduced by this PR or an existing bug.

popover

If you expand your viewport a bit, it should be on the right toggle. A workaround would be to change the popover so the box is positioned on the other side and the sidebar provides some room.

@sirreal
Copy link
Member

sirreal commented Jul 19, 2018

Workaround fail 😂

right

@sirreal
Copy link
Member

sirreal commented Jul 19, 2018

@joanrho These seem to be positioning bugs present in the guided tours.

@ockham @joanrho Shall we merge this and worry about the positioning before this can be put into production, possibly as part of #25933 or #25932

@joanrho
Copy link
Contributor

joanrho commented Jul 19, 2018

@sirreal Yes, let's merge and move forward for now, since the Issue has already been captured. Thanks!

@sirreal sirreal added [Status] Ready to Merge and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Jul 19, 2018
@sirreal sirreal merged commit a3cac49 into master Jul 20, 2018
@sirreal sirreal deleted the add/jetpack-plugin-update-tour branch July 20, 2018 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Checklist [Feature] Plugins Features related to plugins on WordPress.com, including search, management, and installation. Guided Tours Jetpack
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants