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

Don't show Gutenberg welcome tour for course on wpcom #7399

Merged
merged 4 commits into from
Dec 22, 2023

Conversation

Imran92
Copy link
Contributor

@Imran92 Imran92 commented Dec 20, 2023

Resolves #7398

Proposed Changes

  • When a new Course is created, on wpcom, if the user hasn't taken the Gutenberg tour yet, they see two modals on the screen. So it looks messy. Now, when creating a new Course, we don't show the user the Gutenberg tour modal.

Testing Instructions

  1. Create a new course locally with the console open
  2. Make sure you see no error in the console
  3. Make sure the editor works as expected
  4. Now create a new WPCOM site with Sensei
  5. Create a new Course
  6. Make sure you see only the Course modal
  7. Now open any post in the GB editor
  8. Make sure you see the Gutenberg tour modal now

New Course Editor

image

Other Post Editor

image

Pre-Merge Checklist

  • PR title and description contain sufficient detail and accurately describe the changes
  • Acceptance criteria is met
  • Decisions are publicly documented
  • Adheres to coding standards (PHP, JavaScript, CSS, HTML)
  • All strings are translatable (without concatenation, handles plurals)
  • Follows our naming conventions (P6rkRX-4oA-p2)
  • Hooks (p6rkRX-1uS-p2) and functions are documented
  • New UIs are responsive and use a mobile-first approach
  • New UIs match the designs
  • Different user privileges (admin, teacher, subscriber) are tested as appropriate
  • Code is tested on the minimum supported PHP and WordPress versions
  • User interface changes have been tested on the latest versions of Chrome, Firefox and Safari
  • "Needs Documentation" label is added if this change requires updates to documentation
  • Known issues are created as new GitHub issues

@Imran92 Imran92 added this to the 4.20.1 milestone Dec 20, 2023
@Imran92 Imran92 requested a review from a team December 20, 2023 03:36
@Imran92 Imran92 self-assigned this Dec 20, 2023
Copy link

github-actions bot commented Dec 20, 2023

WordPress Dependencies Report

The github-action-wordpress-dependencies-report action has detected some script changes between the commit e1c2293 and trunk. Please review and confirm the following are correct before merging.

Script Handle Added Dependencies Removed Dependencies Total Size Size Diff
admin/editor-wizard/index.js 12.4 kB +132 B ( +1.08% 🔼 )

This comment was automatically generated by the github-action-wordpress-dependencies-report action.

Copy link

codecov bot commented Dec 20, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (efc60d1) 50.94% compared to head (4283401) 50.94%.
Report is 1 commits behind head on trunk.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##              trunk    #7399   +/-   ##
=========================================
  Coverage     50.94%   50.94%           
  Complexity    11150    11150           
=========================================
  Files           613      613           
  Lines         47063    47063           
  Branches        404      404           
=========================================
  Hits          23976    23976           
  Misses        22760    22760           
  Partials        327      327           

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update eaccd83...4283401. Read the comment docs.

@renatho
Copy link
Contributor

renatho commented Dec 20, 2023

Hi @Imran92! It didn't work for me on WPCOM.

But it works if I run wp.data.dispatch( 'automattic/wpcom-welcome-guide' ).setShowWelcomeGuide( true, { onlyLocal: true } ) through the terminal.

Maybe there's a race condition issue there? I noticed that the tour is displayed a little later than the wizard.

Also, I needed to create a new user for every test. Clearing local data and creating a new site wasn't enough for me. Is it the same for you? Or did you find a way to test with the same user?

@Imran92
Copy link
Contributor Author

Imran92 commented Dec 21, 2023

Hi @Imran92! It didn't work for me on WPCOM.

But it works if I run wp.data.dispatch( 'automattic/wpcom-welcome-guide' ).setShowWelcomeGuide( true, { onlyLocal: true } ) through the terminal.

Heyyy @renatho 👋 👋 I tried to reproduce the scenario to make it not work in a good number of ways, but each time it was working for me. By any chance, can it be not working for you due to the same reason as you mentioned here? #7397 (review) . Maybe the remote version didn't get updated as expected. Can you add maybe a console log in this portion of code and create a build and upload that build in your wpcom site to check in the console if the intended part of code is present in that build?

Also, I needed to create a new user for every test. Clearing local data and creating a new site wasn't enough for me. Is it the same for you? Or did you find a way to test with the same user?

Actually whatever we do with that Tour modal once gets persisted in the database in the backend, unless onlyLocal is explicitly set to be true. You can see the code here https://github.com/Automattic/wp-calypso/blob/52bfa215f402201e73653185cccee35cca7e8abd/apps/editing-toolkit/editing-toolkit-plugin/wpcom-block-editor-nux/src/store.js#L115-L121 .

A trick around this is to just hit wp.data.dispatch( 'automattic/wpcom-welcome-guide' ).setShowWelcomeGuide( true ) in your console. This will set the flag to show the welcome guide to you again and then you can check the behavior in Course editor and other post type editors and compare them.

@renatho
Copy link
Contributor

renatho commented Dec 21, 2023

@Imran92! Good point! It's probably the case of the plugin not updated! I'll try again making sure the plugin is properly updated as soon as I connect. 😉

@renatho
Copy link
Contributor

renatho commented Dec 21, 2023

By any chance, can it be not working for you due to the same reason as you mentioned here? #7397 (review) . Maybe the remote version didn't get updated as expected.

Hi @Imran92! I re-tested it, and unfortunately it wasn't the case.
I updated the code to have a "!!!" in the end of the Sensei LMS menu, just to make sure it was the correct package, and it didn't work for me.

I recorded a video of my test, just in case we're thinking something in a different way:

Screen.Recording.2023-12-21.at.16.22.22.mov

My steps before that were:

  • Open a new incognito window.
  • Create a new site with a new user.
  • Install the Sensei LMS.
  • Deactivate and delete the plugin.
  • And install again to get the correct package.

I'm using Chrome.

If you can't reproduce following the same steps, feel free to let me know so that we could try to pair to debug together. 😉

@Imran92
Copy link
Contributor Author

Imran92 commented Dec 22, 2023

Thanks for checking it @renatho ! I've made some changes e1c2293 that should take care of it, can you kindly take another look? Thanks!

Copy link
Contributor

@renatho renatho 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 and works well!

@Imran92 Imran92 merged commit d53e6a4 into trunk Dec 22, 2023
24 checks passed
@Imran92 Imran92 deleted the add/dont-show-gutenberg-tour-for-course-wpcom branch December 22, 2023 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hide WordPress welcome modal when creating first course
2 participants