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

Customizer > Change > Preview takes you away from Calypso #1227

Closed
johngodley opened this issue Dec 3, 2015 · 2 comments
Closed

Customizer > Change > Preview takes you away from Calypso #1227

johngodley opened this issue Dec 3, 2015 · 2 comments
Labels
[Feature] Customizer The site customizer for traditional, non-block themes. [Type] Enhancement

Comments

@johngodley
Copy link
Member

If you press on the customizer, then change the theme, you are shown a set of other themes (unsure why?). If you press preview on one of these themes you are then taken away from Calypso to the site in question.

This doesn't seem an optimal experience, although I'm sure there are technical reasons.

Unfortunately in the desktop app this has the effect of opening the customizer in a browser window, and leaving Calypso in a loading state.

wp-desktop-theme-preview

Although this is only a problem in the desktop app I am recording it here as its something that can only be fixed in Calypso.

Do we need to show a list of themes once you've just picked one?

Is it possible to keep the second theme selection inside Calypso?

@johngodley johngodley added [Type] Enhancement [Feature] Customizer The site customizer for traditional, non-block themes. labels Dec 3, 2015
@mattwiebe
Copy link
Contributor

Just to reduce the steps to reproduce:

  1. Desktop app
  2. Load the Customizer
  3. Try to preview a theme in Customizer
  4. Customizer with theme preview pops open into the system browser

So, what's happening here is that the Customizer is served in an iframe, and when we preview a theme, the Customizer has to refresh itself entirely because its state is dependent on being loaded in a theme's context (boo).

The problem is that the core code which does this calls window.parent.location = previewUrl, which bubbles up into Calypso, and the Electron wrapper spots this as an external URL and opens it in the system browser.

I'm guessing core called the parent window for some good reason, but that's the cause of breaking.

Since previewing a theme breaks out of Calypso in either case, my own recommendation would be for us to disable theme previewing/browsing in the Customizer, since it duplicates (poorly) functionality already in Calypso.

@mattwiebe
Copy link
Contributor

Theme browsing in the Customizer inside Calypso is disabled with r127751-wpcom

This will not only fix the bug, but should see a 2-3x DOMContentLoaded speedup. 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Customizer The site customizer for traditional, non-block themes. [Type] Enhancement
Projects
None yet
Development

No branches or pull requests

2 participants