Skip to content

Use contextual snackbar text when activating a theme from preview#68779

Closed
dhananjaykuber wants to merge 4 commits intoWordPress:trunkfrom
dhananjaykuber:fix/snackbar-text-when-theme-activation
Closed

Use contextual snackbar text when activating a theme from preview#68779
dhananjaykuber wants to merge 4 commits intoWordPress:trunkfrom
dhananjaykuber:fix/snackbar-text-when-theme-activation

Conversation

@dhananjaykuber
Copy link
Contributor

Fixes #56876

What?

This PR updates the success notification message displayed when activating a theme via the Site Editor. Previously, the message showed "Site updated.", which has now been corrected to "Theme activated." for better clarity.

Why?

The current message, "Site updated.", can be misleading as it does not accurately convey the action taken when activating a theme. This change improves the user experience by providing a clearer and more appropriate notification.

Testing Instructions

  1. Go to Appearance --> Themes
  2. Click on Live Preview of any theme
  3. In left bottom corner of Site Editor click on Activate {Theme_Name} button
  4. Check the snackbar with updated message "Theme activated"
Before After
Screenshot 2025-01-20 at 2 37 24 PM Screenshot 2025-01-20 at 2 29 22 PM

@github-actions
Copy link

github-actions bot commented Jan 20, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: dhananjaykuber <[email protected]>
Co-authored-by: carolinan <[email protected]>
Co-authored-by: richtabor <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@carolinan carolinan added [Type] Enhancement A suggestion for improvement. [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. labels Jan 20, 2025
Copy link
Contributor

@carolinan carolinan left a comment

Choose a reason for hiding this comment

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

This change updates the text in the notice everywhere, even if it is not a theme that is activated.
For example when changing the content of the Site Title in the Site Editor.

The new message needs to be limited to the theme activation.

@carolinan
Copy link
Contributor

Also there is a test that would need to be updated: \test\e2e\specs\site-editor\activate-theme.spec.js

@carolinan
Copy link
Contributor

Hi
I have tested this again and I am not able to make it work.
If I log onSave?.toString() it does not include the matching word.

In the tests, I don't think the theme name "Emptytheme" should be included. The theme name is not in the snackbar.

@carolinan
Copy link
Contributor

carolinan commented Feb 27, 2025

There are two utilities in the Edit Site package called isPreviewingTheme and currentlyPreviewingTheme you could perhaps look into copying them.

@juanfra
Copy link
Member

juanfra commented Feb 13, 2026

Thanks for the PR! Closing as fixed via #75385

@juanfra juanfra closed this Feb 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use contextual snackbar text when activating a theme from preview

3 participants