-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Deprecate Theme Switch modal #73726
Deprecate Theme Switch modal #73726
Conversation
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: App Entrypoints (~141 bytes removed 📉 [gzipped])
Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used. Sections (~4114 bytes removed 📉 [gzipped])
Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to. Async-loaded Components (~205 bytes removed 📉 [gzipped])
React components that are loaded lazily, when a certain part of UI is displayed for the first time. Legend What is parsed and gzip size?Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory. Generated by performance advisor bot at iscalypsofastyet.com. |
const customizeUrl = | ||
( isAtomic || isJetpack ) && hasAutoLoadingHomepage | ||
? addQueryArgs( | ||
{ 'new-homepage': true }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm removing this part because the param ?new-homepage=true
is meant to open the modal in the Post editor to choose a starter page template for a new homepage, assuming Atomic and Jetpack sites don't support auto-loading-homepage behavior. However, Atomic sites support it. See #65976.
In this PR, we always pass dont_change_homepage: true
, which skips the auto-loading-homepage behavior and that works on Atomic & Jetpack. See #65846 (comment) and fbhepr%2Skers%2Sjcpbzfu%2Ssrngher%2Qcyhtvaf%2Snhgbybnq%2Qubzrcntr%2Qercynprzrag.cuc%3Se%3Q923495oq%2320-og
I'll test these scenarios again to confirm we are safely removing that param.
@@ -29,33 +22,9 @@ export function activate( | |||
siteId, | |||
source = 'unknown', | |||
purchased = false, | |||
keepCurrentHomepage = false | |||
keepCurrentHomepage = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm setting keepCurrentHomepage: true
as default here, but it looks too fragile. We can also set dontChangeHomepage: true
as default in the action activateTheme
:
dontChangeHomepage = false |
What do you think?
5f357a0
to
9aa33fd
Compare
This PR modifies the release build for editing-toolkit To test your changes on WordPress.com, run To deploy your changes after merging, see the documentation: PCYsg-mMA-p2 |
@@ -29,33 +22,9 @@ export function activate( | |||
siteId, | |||
source = 'unknown', | |||
purchased = false, | |||
keepCurrentHomepage = false | |||
keepCurrentHomepage = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pointing that out.
I missed that persist_homepage_template
is always false
because the themes/theme-switch-persist-template
feature flag is false
in all environments.
That means the logic related to preserving the home template is not being used.
See pbxlJb-2X4-p2#comment-2162 and the changes in that API fbhepr%2Suvfgbel%2Sjcpbz%2Schoyvp.ncv%2Serfg%2Sjcpbz%2Qwfba%2Qraqcbvagf%2Spynff.jcpbz%2Qwfba%2Qncv%2Qnpgvir%2Qgurzr%2Qraqcbvag.cuc-og
Some interesting conversations on the theme switch and the template persistence
Here some of the comments: User flows First we should outline user flows that we anticipate or want to make possible. For example:
What is clear is that we can no longer assume for users what they may want to do but we should choose a good default. It'd be reasonable to make the first option the default since it's what most are accustomed to, but we can discuss it. Semantic template parts are also a tool we have for managing some expectations since they can overlap between themes. Theme switching should have the option of being a more granular operation in the site editor, walking users through some steps where they could choose to retain or discard specific templates (like a header) or global styles. Right now there's a lack of clarity upon switching themes about whether a specific part of the site will be replaced or not. User flow: I create a blank.html template that only renders the post content block (just like BlockBase). I've assigned it to display on a particular page, as I want no headers or footers — just my block content for this landing page. I change my theme to get a new look cause I feel like it, but now my landing page has a header, footer and an empty sidebar next to it. To resolve this today, I need to create a blank custom template and assign it to the page once again. If I ever change my theme, I end up with the same issue, needed to create the blank template again (while deleting the old one). User next steps: While we can't assume that every time I change a theme, all my custom templates should stay, I do lean in the direction that that behavior should be the default experience. Maybe we have a mechanism that let's me opt to resetting all templates as the theme's default templates, instead of what happens today where everything resets when a theme is changed. In addition, I should also be able to use any template I've created on any theme. I'm not sure what the purpose behind locking templates to themes is, but its seems counter-intuitive. Block templates are theme specific but that is not obvious. I agree this deserve to be made clearer, maybe in the welcome guide? (Open to ideas here). I wanted to detail the reasoning more here. The block templates are not necessarily theme specific, they can easily translate to other themes but theme CSS design can have impact and alter the result. In the future, we do want to allow them to be theme-agnostic but for the initial release we wanted to keep them theme specific because otherwise, there’s a lot of UX/UI work that need to happen on theme switching and elsewhere to take into account these new possibilities. It’s also a decision based on the initial version of FSE themes we want to ship. FSE themes rely on these templates as well (wp_template) and we don’t want to solve the cross-themes templates in the first release but we want to start exploring this at their own pace. Keeping the template editor theme specific allow us to simplify the mental model of these templates: These are just editable “Page Templates” (the custom page templates themes provide) |
@okmttdhr for the Live Preview spike, you might find relevant the details about the Theme switch that is on the description and comments in this PR. Feel free to reach out to me to discuss anything related to it. Here some interesting threads: The work on this PR has been stopped because removing the modal won't fix anything and the feedback from HEs was that the modal must explain exactly what will happen after the theme switch. The answer to that question is complex because there are several factors that can break the preview and the theme switch. So, in order to tell users what will happen we first must understand what is failing and that implies IMO understanding and fixing the preview and the theme switch. |
Thank you for your sharing, @miksansegundo! |
Related to #69687
Site Onboarding Flows Homepage Setup > Switching to another theme PCYsg-Ln8-p2
Theme Switch User Research pekYwv-uV-p2
Theme Experience Walkthrough > Issues for preserving templates pekYwv-BQ-p2
Persist template content on theme switch pbxlJb-2X4-p2
Proposed Changes
dont_change_homepage: true
in the requestPOST /themes/mine
Description
In this PR, we always pass
dont_change_homepage: true
in the request for a theme switch, which is the same as choosing the "Switch theme, preserving my homepage content" option in the modal.We are forcing users to preserve their homepage content on theme switches, but we might have exceptions when testing.
Where is the logic for
POST /themes/mine
?TODO
Known issues
Testing Instructions
The expected result after a theme switch is that the content on the homepage (front of the site), excluding template parts (e.g. header/footer), must be preserved.
Currently when you activate a new theme, any of the old theme templates that you have customised are retained. For this reason, even though template parts of the homepage template are not preserved after switching to another theme, they will be back if we switch back to the old theme.
The homepage outcome after a theme switch depends on the following:
Test flows
Flow 1 "Skip"
Appearances -> Themes
multiple timesFlow 2 "Pick a design"
Appearances -> Themes
multiple timesFlow 3 "Assembler"
Appearances -> Themes
multiple timesTest buttons
From the theme detail, click "Activate this design"
From the theme showcase, open the three dots menu and click "Activate"
Test themes switch by theme type
Test themes switch by homepage type
Classic themes
Classic themes with posts as homepage
Classic themes that uses a page as homepage
Block themes
Block themes with posts as homepage
Block themes that uses a page as homepage
Test sites
From
wordpress.com/themes/{ site slug }
Pre-merge Checklist