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

Live Preview: Introduce the upgrade modal in Premium and WooCommerce themes #85013

Merged
merged 21 commits into from
Dec 15, 2023

Conversation

okmttdhr
Copy link
Member

@okmttdhr okmttdhr commented Dec 8, 2023

Related to #79223, #83630, #84676
#84483

Proposed Changes

This PR introduces the upgrade modal that activates when a user, while live-previewing a theme, clicks on the Upgrade button.

UI

the modal (for Premium themes)
Screenshot 2023-12-14 at 15 28 03

the modal (for WooCommerce themes)
Screenshot 2023-12-14 at 15 27 23

'edit' mode
Screenshot 2023-12-11 at 16 01 41 copy

'view' mode
Screenshot 2023-12-11 at 15 14 05

Flow

Screen.Recording.2023-12-11.at.15.26.31.2.mov

Testing Instructions

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • https://wpcalypso.wordpress.com/devdocs/docs/testing/index.md for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-ajp-p2)?

@matticbot
Copy link
Contributor

matticbot commented Dec 8, 2023

@matticbot
Copy link
Contributor

matticbot commented Dec 8, 2023

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • editing-toolkit
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug add/live-preview-upgrade-modal on your sandbox.

@okmttdhr okmttdhr force-pushed the add/live-preview-upgrade-modal branch 2 times, most recently from 48f0b87 to 4e64079 Compare December 11, 2023 04:32
@okmttdhr okmttdhr marked this pull request as ready for review December 11, 2023 07:12
@okmttdhr okmttdhr requested a review from a team December 11, 2023 07:16
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Dec 11, 2023
@okmttdhr okmttdhr self-assigned this Dec 11, 2023
@okmttdhr okmttdhr changed the title Live Preview: Add the upgrade modal Live Preview: Introduce the upgrade modal in Premium and WooCommerce themes Dec 11, 2023
@autumnfjeld

This comment was marked as resolved.

@okmttdhr okmttdhr force-pushed the add/live-preview-upgrade-modal branch 2 times, most recently from 4ee9590 to c2af835 Compare December 12, 2023 06:03
@okmttdhr

This comment was marked as resolved.

@okmttdhr okmttdhr force-pushed the add/live-preview-upgrade-modal branch from c2af835 to fe737d0 Compare December 12, 2023 06:05
@okmttdhr okmttdhr requested review from renatho and a team December 12, 2023 06:37
@arthur791004

This comment was marked as resolved.

@taipeicoder

This comment was marked as resolved.

@taipeicoder

This comment was marked as resolved.

@okmttdhr okmttdhr force-pushed the add/live-preview-upgrade-modal branch from fe737d0 to 8f09760 Compare December 13, 2023 02:23
@fushar
Copy link
Contributor

fushar commented Dec 13, 2023

Wait a minute... So if I made some changes, then click Upgrade now, I will be redirected to the checkout, then got redirected back to the Site Editor, but my changes are lost... is this the expected flow? 🥲

I think so because we currently don't have the mechanism to save without activating (CMIIW).

But this seems weird...

@okmttdhr
Copy link
Member Author

okmttdhr commented Dec 13, 2023

Wait a minute... So if I made some changes, then click Upgrade now, I will be redirected to the checkout, then got redirected back to the Site Editor, but my changes are lost... is this the expected flow? 🥲

I think so because we currently don't have the mechanism to save without activating (CMIIW).

But this seems weird...

Yes, that is expected, and we have no way to save before activation (yet) ... (´・ω・`).;:…(´・ω...:.;::..(´・;::: .:.;:

@fushar

This comment was marked as resolved.

@taipeicoder
Copy link
Contributor

Wait a minute... So if I made some changes, then click Upgrade now, I will be redirected to the checkout, then got redirected back to the Site Editor, but my changes are lost... is this the expected flow? 🥲
I think so because we currently don't have the mechanism to save without activating (CMIIW).
But this seems weird...

Yes, that is expected, and we have no way to save before activation (yet) ... (´・ω・`).;:…(´・ω...:.;::..(´・;::: .:.;:

This seems to be a pretty significant caveat. cc: @autumnfjeld
Ideally the changes are saved before leaving the Site Editor to the checkout, can we create a spike for this?

@fushar

This comment was marked as resolved.

@okmttdhr okmttdhr force-pushed the add/live-preview-upgrade-modal branch from 978bb27 to 1b374b4 Compare December 15, 2023 00:42
@okmttdhr

This comment was marked as resolved.

Copy link
Contributor

@fushar fushar left a comment

Choose a reason for hiding this comment

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

Working well.

Thanks for the hard work!

@okmttdhr okmttdhr merged commit 41bf95c into trunk Dec 15, 2023
12 of 13 checks passed
@okmttdhr okmttdhr deleted the add/live-preview-upgrade-modal branch December 15, 2023 01:53
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Dec 15, 2023
@okmttdhr
Copy link
Member Author

#85013 (comment)

Wait a minute... So if I made some changes, then click Upgrade now, I will be redirected to the checkout, then got redirected back to the Site Editor, but my changes are lost... is this the expected flow? 🥲
I think so because we currently don't have the mechanism to save without activating (CMIIW).
But this seems weird...

Yes, that is expected, and we have no way to save before activation (yet) ... (´・ω・`).;:…(´・ω...:.;::..(´・;::: .:.;:

This seems to be a pretty significant caveat. cc: @autumnfjeld Ideally the changes are saved before leaving the Site Editor to the checkout, can we create a spike for this?

In reference to the previous discussions about saving functionality in #81119, I believe the following same principles apply here:

The current behavior is already clear, if we think the BTP as a truly "Preview" experience (quoting @autumnfjeld's words). We also have communicated this behavior clearly in two places:
#81119 (comment)

Given that we can still perceive it as "a true Preview experience", and we have the notices indicating that users cannot save changes before upgrading (You can try out your own style customizations, which will only be saved if you upgrade and activate this theme.),
We might want to retain user editings during the same flow (= 'Live Preview in Premium and WooCommerce themes') at least. But, if we decide to do a spike, we may want to aim to think about these complexities #81119 (comment). This may include considering the saving feature in Live Preview comprehensively to ensure a consistent and non-contradictory user experience.

@taipeicoder
Copy link
Contributor

We might want to retain user editings during the same flow (= 'Live Preview in Premium and WooCommerce themes') at least.

Yes. I think this user scenario is more nuanced than #81119, in terms of (1) we are not providing a Save button to the user, and (2) I don't think it's a good UX for users to change the theme → upgrade → redo the changes → activate the theme.

The wording "You can try out your own style customizations, which will only be saved if you upgrade and activate this theme." implies the order of trying out changes → upgrade → activate, which is not technically correct since the changes will be gone after upgrading.

That said, we don't necessarily need to save when users go to checkout. Just need to improve the UX so that the second point mentioned above can be further avoided 🙂

@okmttdhr
Copy link
Member Author

okmttdhr commented Dec 15, 2023

It would be worthwhile to see how many users make what changes before upgrading their plan in this flow before jumping in.

renatho added a commit that referenced this pull request Dec 21, 2023
* Refactor check for plugins to be generic

* Update bundle settings hook to allow getting settings by theme software

* Move array of plugins to check to the bundle settings

* Update feature flag to a generic name

* Rename woo confirm to bundle confirm

* Add new hook to get site bundle settings

* Add TODO comment to review later

* Rename woo transfer to bundle transfer

* Make bundle transfer step generic

* Rename woo install plugins to bundle install plugins

* Make install plugins generic

* Translate message that was not translated

* Get software name dynamically from bundle settings

* Remove a not necessary hook

* Refactor hooks to be named exports, following the standards of the existing ones

* Use hook to get plugin slug

* Remove Woo Verify Email not used feature

* Reorganize bundle steps array

* Add comments to make the steps more clear

* Move custom back to settings

* Move flow settings to bundleStepsSettings

* Move steps to settings

So only one object from this file needs to be customized for bundles.

* Make end of flow generic

* Make custom functions optional

* Add comments to the custom functions

* Rename the variable to follow the same standard of the other file

* Force type to be a string

* Add steps as argument to the useStepNavigation

* Make the navigation to the next step generic for the submit

* Refactor submit

* Update log and event name

* Update import to the new function

* Remove unused code

This logic is part of plugin-bundle-flow.

* Move the styles to the file

Following the approach applied in other files

* Remove comment

Keeping it as a customization inside the step, as exception.

* Update logic to upgrade site when installing free theme with bundle

* Make `ThemeUpgradeModal` Calypso-State-free

Update to match changes from conflicting PR. See #85013 and #84886 (comment).

Co-authored-by: okmttdhr <okmttdhr@users.noreply.github.com>

* Add event for all the cases, and keep the current one for backward compatibility

* Fix case when endFlow is not set

* Fix logic to display activate or upgrade button

---------

Co-authored-by: okmttdhr <okmttdhr@users.noreply.github.com>
renatho added a commit that referenced this pull request Dec 21, 2023
* Refactor check for plugins to be generic

* Update bundle settings hook to allow getting settings by theme software

* Move array of plugins to check to the bundle settings

* Update feature flag to a generic name

* Rename woo confirm to bundle confirm

* Add new hook to get site bundle settings

* Add TODO comment to review later

* Rename woo transfer to bundle transfer

* Make bundle transfer step generic

* Rename woo install plugins to bundle install plugins

* Make install plugins generic

* Translate message that was not translated

* Get software name dynamically from bundle settings

* Remove a not necessary hook

* Refactor hooks to be named exports, following the standards of the existing ones

* Use hook to get plugin slug

* Remove Woo Verify Email not used feature

* Reorganize bundle steps array

* Add comments to make the steps more clear

* Move custom back to settings

* Move flow settings to bundleStepsSettings

* Move steps to settings

So only one object from this file needs to be customized for bundles.

* Make end of flow generic

* Make custom functions optional

* Add comments to the custom functions

* Rename the variable to follow the same standard of the other file

* Force type to be a string

* Add steps as argument to the useStepNavigation

* Make the navigation to the next step generic for the submit

* Refactor submit

* Update log and event name

* Update import to the new function

* Remove unused code

This logic is part of plugin-bundle-flow.

* Move the styles to the file

Following the approach applied in other files

* Remove comment

Keeping it as a customization inside the step, as exception.

* Update logic to upgrade site when installing free theme with bundle

* Make `ThemeUpgradeModal` Calypso-State-free

Update to match changes from conflicting PR. See #85013 and #84886 (comment).

Co-authored-by: okmttdhr <okmttdhr@users.noreply.github.com>

* Add event for all the cases, and keep the current one for backward compatibility

* Fix case when endFlow is not set

* Add Sensei bundle settings

* Update string to match new updates from rebase

* Redirect to Sensei Setup Wizard after the WPCOM flow

* Remove step from URL

It automattically redirects to the first step of the wizard.

* Update string for bundled plugin messages

* Fix logic to display activate or upgrade button

---------

Co-authored-by: okmttdhr <okmttdhr@users.noreply.github.com>
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.

7 participants