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

Block Theme Previews: show education modal when previewing theme #34935

Merged
merged 4 commits into from
Jan 16, 2024

Conversation

fushar
Copy link
Contributor

@fushar fushar commented Jan 10, 2024

64QjSf.mp4

Related to:

Proposed changes:

This PR shows an education modal when a user previews a block theme, for the first theme.

The modal can be dismissed and it won't be shown again, by storing a flag in a persisted redux store.

Infra changes

I added the following in jetpack-mu-wpcom package:

  • Support for transpiling SCSS file.
  • Support for bundling CSS file into [name]/[name].css, similar to JS.
  • New jetpack-mu-wpcom text domain for i18n.

Other information:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?
  • Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?

Jetpack product discussion

Does this pull request change what data or activity we track or use?

Testing instructions:

  1. Patch this change by following the instructions from the bot below.
  2. Go to /themes.
  3. Click a block theme.
  4. In the theme details page, click Preview & Customize.
  5. Verify that you can see the modal as shown in the above video.
  6. Verify you can dismiss the modal by clicking the primary button or the close icon.
  7. Verify that the modal won't be shown anymore when previewing another theme.
  8. (To re-enable the modal, you need to clear the local storage as below:)
image
  1. Verify that you can still see the modal when the ETK plugin is disabled.

Copy link
Contributor

github-actions bot commented Jan 10, 2024

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Team Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available.


Once your PR is ready for review, check one last time that all required checks appearing at the bottom of this PR are passing or skipped.
Then, add the "[Status] Needs Team Review" label and ask someone from your team review the code. Once reviewed, it can then be merged.
If you need an extra review from someone familiar with the codebase, you can update the labels from "[Status] Needs Team Review" to "[Status] Needs Review", and in that case Jetpack Approvers will do a final review of your PR.


Mu Wpcom plugin:

  • Next scheduled release: February 6, 2024.
  • Scheduled code freeze: January 29, 2024.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

Copy link
Contributor

github-actions bot commented Jan 10, 2024

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WordPress.com Simple site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin, and enable the live-preview-modal branch.

    • For jetpack-mu-wpcom changes, also add define( 'JETPACK_MU_WPCOM_LOAD_VIA_BETA_PLUGIN', true ); to your wp-config.php file.
  • To test on Simple, run the following command on your sandbox:

    bin/jetpack-downloader test jetpack live-preview-modal
    
    bin/jetpack-downloader test jetpack-mu-wpcom-plugin live-preview-modal
    

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@fushar fushar changed the title Block Theme Previews: show modal when previewing theme Block Theme Previews: show education modal when previewing theme Jan 11, 2024
@fushar fushar force-pushed the live-preview-modal branch 2 times, most recently from a1eb506 to 91aa2d7 Compare January 11, 2024 14:05
@github-actions github-actions bot added the [Plugin] mu wpcom jetpack-mu-wpcom plugin label Jan 11, 2024
@fushar fushar force-pushed the live-preview-modal branch 3 times, most recently from 17428af to 4df6dec Compare January 11, 2024 15:21
@fushar fushar marked this pull request as ready for review January 11, 2024 15:45
@fushar fushar self-assigned this Jan 11, 2024
@fushar
Copy link
Contributor Author

fushar commented Jan 11, 2024

@matt-west, I've sent you an invite to a test site testfushar61.wpcomstaging.com where you can see the modal in action.

@fushar
Copy link
Contributor Author

fushar commented Jan 11, 2024

Tagging @autumnfjeld to check the copy.

@fushar fushar force-pushed the live-preview-modal branch 2 times, most recently from 0cef6c3 to 2824d13 Compare January 12, 2024 03:09
Copy link
Member

@okmttdhr okmttdhr left a comment

Choose a reason for hiding this comment

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

Tested and looked good to me 👍

I think we need to hide the existing modal when we have this new modal!
Screenshot 2024-01-12 at 15 18 23

@fushar
Copy link
Contributor Author

fushar commented Jan 12, 2024

@okmttdhr Thanks for testing!

I think we need to hide the existing modal when we have this new modal!

I have this already:

https://github.com/Automattic/jetpack/pull/34935/files#diff-39db167254b449962c8c2fa34249704084a73e5f4d2a44c3c361d976440bea38R28

I somewhat remember that it worked but I'm not very sure now 🥲 Maybe it's not possible and the only way is to remove the old ETK modal when we are about to release this.

Copy link

@matt-west matt-west left a comment

Choose a reason for hiding this comment

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

Thanks @fushar!

I ran into the same issue with both modals being displayed at once. (Safari)
Screenshot 2024-01-12 at 09 34 09

Super nit-pick. There’s a 1px line underneath the animation in the modal (Safari). Is there anything we can do about that?

Screenshot 2024-01-12 at 09 38 41

The modal was correctly hidden on subsequent visits. 👍

okmttdhr
okmttdhr previously approved these changes Jan 15, 2024
Copy link
Member

@okmttdhr okmttdhr left a comment

Choose a reason for hiding this comment

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

🚀

@fushar
Copy link
Contributor Author

fushar commented Jan 15, 2024

Thanks for testing, @matt-west!

I ran into the same issue with both modals being displayed at once.

Yes, looks like my "fix" does not work, so I'll just completely the old modal (via Automattic/wp-calypso#86385).

Super nit-pick. There’s a 1px line underneath the animation in the modal (Safari). Is there anything we can do about that?

Nice catch! It was due to the computed height being a non-integer. I've fixed that, could you test again?


Also, design-wise, is this good to go?

matt-west
matt-west previously approved these changes Jan 15, 2024
Copy link

@matt-west matt-west 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. Thanks @fushar!

@fushar fushar dismissed stale reviews from matt-west and okmttdhr via 6363f81 January 16, 2024 02:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants