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

Add the sticky notice when previewing a theme #82629

Merged
merged 3 commits into from
Oct 6, 2023

Conversation

okmttdhr
Copy link
Member

@okmttdhr okmttdhr commented Oct 5, 2023

Proposed Changes

Related

Testing Instructions

  • Patch this PR to your sandbox with cd apps/wpcom-block-editor/ && yarn dev --sync
  • Sandbox widgets.wp.com and your site
  • Open https://horizon.wordpress.com
  • Go to Appearance -> Editor. Verify that the modal is NOT shown because we're not live-previewing anything.
  • Go to the Theme Detail page of a free theme
  • Click the Preview & Customize
  • See the sticky notice
image

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)?

@github-actions
Copy link

github-actions bot commented Oct 5, 2023

@matticbot
Copy link
Contributor

This PR modifies the release build for wpcom-block-editor

To test your changes on WordPress.com, run install-plugin.sh wpcom-block-editor add/live-preview-stickey-notice on your sandbox.

To deploy your changes after merging, see the documentation: PCYsg-l4k-p2

@okmttdhr okmttdhr self-assigned this Oct 5, 2023
@okmttdhr okmttdhr marked this pull request as ready for review October 5, 2023 05:47
@okmttdhr okmttdhr requested a review from a team October 5, 2023 05:48
@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 Oct 5, 2023
@matticbot
Copy link
Contributor

This PR does not affect the size of JS and CSS bundles shipped to the user's browser.

Generated by performance advisor bot at iscalypsofastyet.com.

Copy link
Contributor

@miksansegundo miksansegundo left a comment

Choose a reason for hiding this comment

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

👍 LGTM and works as expected.

Screenshot 2566-10-05 at 13 43 04

We should use Back to themes rather than Back to Themes to be consistent with other screens.

Screenshot 2566-10-05 at 13 51 48

About the copy of the notice

I wonder if we can still make the copy of the notice more helpful for users. Some suggestions:

  • Use "previewing" rather than "live-previewing" because the button doesn't mention "Live" and users might not get the meaning of "live" in this context.
  • I think users will appreciate to read that changes done while previewing won't affect their site.
  • Maybe we can use the word "customize" in some way?

How can we make this copy more helpful? cc: @Automattic/lego

Current: "You are currently live-previewing the Smithland theme."
Suggestion: "You are currently previewing the Smithland theme on your site. You can customize it without affecting your site."

Here is a demo:

Screenshot 2566-10-05 at 14 08 41

@fushar
Copy link
Contributor

fushar commented Oct 5, 2023

Current: "You are currently live-previewing the Smithland theme."
Suggestion: "You are currently previewing the Smithland theme on your site. You can customize it without affecting your site."

This is a bit tricky, because we can add new pages which does affect the site :')

Maybe:

"You are currently previewing the Smithland theme on your site. You can try customizing the styles without affecting your site."

@okmttdhr
Copy link
Member Author

okmttdhr commented Oct 5, 2023

Current: "You are currently live-previewing the Smithland theme."
Suggestion: "You are currently previewing the Smithland theme on your site. You can customize it without affecting your site."

This is a bit tricky, because we can add new pages which does affect the site :')

Just to add some context, it is related to WordPress/gutenberg#53935. 📝

"You are currently previewing the Smithland theme on your site. You can try customizing the styles without affecting your site."

@fushar @miksansegundo CC: @Automattic/lego
This looks good to me!
I feel a little guilty about saying "without affecting your site" currently, but it should be fine (with adding "try") in most cases because users can't Save without Activate anyway (#81119).

// eslint-disable-next-line @typescript-eslint/no-explicit-any
const theme = ( select( 'core' ) as any ).getTheme( currentlyPreviewingTheme() );
return {
previewingTheme: theme?.name?.rendered || 'new',
Copy link
Contributor

Choose a reason for hiding this comment

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

Should || 'new' be || currentlyPreviewingTheme() ?

@fushar
Copy link
Contributor

fushar commented Oct 5, 2023

@okmttdhr Just confirming, have we tested this on Atomic sites 😄

@autumnfjeld

This comment was marked as resolved.

@autumnfjeld
Copy link
Contributor

autumnfjeld commented Oct 5, 2023

Nice work thinking through copy ideas everyone!!! I did a little adaptation of the suggestions:

You are previewing the {theme_name} theme. You can try out your own style customizations, which will only be saved if you activate this theme.

@okmttdhr
Copy link
Member Author

okmttdhr commented Oct 6, 2023

@okmttdhr Just confirming, have we tested this on Atomic sites 😄

Yes! Sandboxing widgets.wp.com worked on Atomic sites, too.

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 very well 😄 🚢

image

@okmttdhr okmttdhr merged commit a6d1837 into trunk Oct 6, 2023
3 checks passed
@okmttdhr okmttdhr deleted the add/live-preview-stickey-notice branch October 6, 2023 02:09
@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 Oct 6, 2023
@a8ci18n
Copy link

a8ci18n commented Oct 6, 2023

This Pull Request is now available for translation here: https://translate.wordpress.com/deliverables/9245807

Thank you @okmttdhr for including a screenshot in the description! This is really helpful for our translators.

@a8ci18n
Copy link

a8ci18n commented Oct 17, 2023

Translation for this Pull Request has now been finished.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Reverted This was removed after being merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants