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

Reset "Your homepage displays" setting to Default upon activating a non-"auto-loading-homepage" theme #79167

Closed
2 tasks done
okmttdhr opened this issue Jul 10, 2023 · 1 comment
Assignees

Comments

@okmttdhr
Copy link
Member

okmttdhr commented Jul 10, 2023

(edited by @fushar on 20 Jul 2023)

Description

As proposed in this post: "Revisiting auto-loading-homepage and blog-homepage Tags for the Theme Switch Logic" pekYwv-2bc-p2, we want to change the theme switch logic as follows:

  • Always reset the "Your homepage displays" setting to "Default" (formerly called "latest posts"),
    • unless the new theme has the auto-loading-homepage tag (which is rare exception).

However, currently the auto-loading-homepage tag has been misused; it is assigned to the wrong themes. Therefore:

  • For simple and Atomic sites, we rely on whether or not the theme has the show_on_front: page option in its Headstart annotation.
    • If it does, we will set the "Your homepage displays" to the (generated) static page instead. This is existing behavior which we will not change.
  • For Jetpack-connected sites, we cannot get the Headstart annotation to begin with.
    • For such sites, activating an "auto-loading-homepage" theme won't actually generate the correct homepage even before this issue. This is existing behavior which we will not change.

For the purpose of testing the acceptance criteria:

  • an example of "auto-loading-homepage" theme is Meraki.
  • an example of "standard" theme is Exmoor.

Acceptance Criteria

Existing Behaviors

  1. Given that we are in any theme where the "Your homepage displays" setting is "Default",
    • when we switch to an auto-loading-homepage theme,
      • then the "Your homepage displays" setting is now set to a newly generated static page.
      • then the newly generated static page's content is from the Headstart annotation.
      • then the "Default posts page" setting is set to a newly generated posts page.
  2. Given that we are in any theme where the "Your homepage displays" setting is set to a static page,
    • when we switch to an auto-loading-homepage theme,
      • then the "Your homepage displays" setting is now set to a newly generated static page.
      • then the newly generated static page's content is from the Headstart annotation.
      • then the old static home page should be in draft state.
  3. Given that we are in an auto-loading-homepage theme,
    • when we switch to any theme,
      • and we switch back to the old auto-loading-homepage theme,
        • then the "Your homepage displays" setting is set back to the old generated static page from the old theme.
  4. Given that we are in any theme where the "Your homepage displays" setting is set to a static page,
    • when we switch to an auto-loading-homepage theme,
      • then the "Default posts page" setting is set to a newly generated posts page.
        • then when we switch to a standard theme,
          • then the old posts page should be in draft state.
  5. Given that we are in any theme where the "Your homepage displays" setting is "Default",
    • when we switch to a standard theme,
      • then the "Your homepage displays" setting is still "Default".

NEW Behaviors

  1. Given that we are in any theme where the "Your homepage displays" setting is set to a static page,
    • when we switch to a standard theme,
      • then the "Your homepage displays" setting is now set to "Default".
      • then the old static home page should be in draft state.

Related

Dev Tasks

@fushar fushar self-assigned this Jul 11, 2023
@fushar fushar changed the title Implement the new theme switch logic Reset "Your homepage displays" setting to Default upon activating a non-"auto-loading-homepage" theme Jul 20, 2023
@fushar
Copy link
Contributor

fushar commented Aug 2, 2023

This has been shipped to Simple and Atomic sites.

Finally, we fixed theme switch, once and for all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants