Skip to content
This repository was archived by the owner on Jul 12, 2024. It is now read-only.

Conversation

@samueljseay
Copy link
Contributor

@samueljseay samueljseay commented Jul 30, 2020

Fixes #4590

This implements a paged modal via the Gutenberg Guide component. Some styling adjustment was needed to match the designs exactly.

This also introduces 3 SVG based illustrations for display in the modal. According to this comment there is a need to color them based on the theme at some point, but based on a current lack of requirements for that, I felt that could be done at a separate time (that was suggested in the comment as well).

Accessibility

Screenshots

welcome-modal

Detailed test instructions:

  • Go to the homescreen on a site that has never dismissed the modal before
  • You should see the new welcome modal
  • click through the pages of the modal to see all the content and illustrations. Confirm styling is according to the designs.

@samueljseay samueljseay added focus: home screen Issues around the new home screen feature focus: components Issues for woocommerce components needs: design The issue requires design input/work from a designer. and removed tool: monorepo infrastructure focus: components Issues for woocommerce components labels Jul 30, 2020
.components-guide__finish-button,
.components-guide__forward-button,
.components-guide__back-button {
position: initial;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There isn't a lot of control you can have over the rendering of the buttons in the Guide, so I had to mimic styles from other button types like secondary in the styles to match the designs.

@samueljseay samueljseay requested a review from a team July 30, 2020 02:51
@samueljseay samueljseay removed the request for review from a team July 30, 2020 04:38
@timmyc
Copy link
Contributor

timmyc commented Jul 30, 2020

The conditions for showing the modal currently are the same as those of the old modal, which are tied to the task list being available. I wasn't 100% sure if this was correct. If someone could confirm or deny on that, that would be helpful

I think we should be able to retain some of the existing logic to satisfy when to display this guide. From the issue:

Display the intro guide when a new user visits the home screen for the first time, after completing or skipping the store profiler

So the existing modal with the 🚀 is shown after completing the profiler, not sure about if its shown after skipping the profiler. The other use case of someone visiting the home screen for the first time might require some additional logic - that flow would be a user whom already has a store setup, and then opts-in to the homescreen, or after we make it the default on all stores, sees it for the first time.

Thinking we might need to track that view in an option somewhere.

Perhaps we could land this with the coverage for the profiler completion scenario, then do a follow-up for the other scenario. Up to you Sam.

@samueljseay
Copy link
Contributor Author

samueljseay commented Aug 3, 2020

@timmyc yeah I backed out of my original implementation and put this "in progress" to move the modal out of task-list (where the old one was). I'm adjusting the logic to cover all the scenarios now, which I think makes more sense.

The other use case of someone visiting the home screen for the first time might require some additional logic

Yes this requirement especially is what required a significant refactor. The task list may not be in place when we need to show the modal so the modal needs to be higher up the component tree.

Adjust the rendering of the welcome modal for all scenarios
covered in the requirements.
@samueljseay
Copy link
Contributor Author

samueljseay commented Aug 4, 2020

@timmyc I've refactored the modal now, moving it outside the task list, but using the original option.

Note these acceptance criteria from the issue:

  • Display the intro guide when a new user visits the home screen for the first time, after completing or skipping the store profiler
  • Display the intro guide when existing users visit the home screen for the first time

The way I see these 2 requirements, it basically boils down to: if its your first time on the homescreen (or you've never dismissed the modal before), show the modal. What do you think?

@samueljseay samueljseay requested a review from a team August 4, 2020 01:19
Copy link
Contributor

@joshuatf joshuatf left a comment

Choose a reason for hiding this comment

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

Great refactor, Sam! This is testing well for me, just left a couple quick fixes in the code, but pre-approving.

The way I see these 2 requirements, it basically boils down to: if its your first time on the homescreen (or you've never dismissed the modal before), show the modal. What do you think?

I think the logic for showing this makes sense. Tested coming from onboarding profiler flows and with onboarding disabled and both cases worked as expected.


jest.mock( 'lib/tracks', () => ( { recordEvent: jest.fn() } ) );

describe( 'WelcomeModal', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

💯

@joshuatf joshuatf added needs: author feedback The issue/PR needs a response from any of the parties involved in the issue. and removed [Status] Needs Review labels Aug 4, 2020
@samueljseay
Copy link
Contributor Author

@joshuatf I've addressed your points, thanks so much for that!

@samueljseay samueljseay added [Status] Ready to Merge and removed needs: author feedback The issue/PR needs a response from any of the parties involved in the issue. labels Aug 5, 2020
@samueljseay samueljseay merged commit c7efb12 into main Aug 5, 2020
@samueljseay samueljseay deleted the add/4590 branch August 5, 2020 00:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

focus: home screen Issues around the new home screen feature needs: design The issue requires design input/work from a designer. tool: monorepo infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Display modal with more info about the new home screen

4 participants