Repository navigation
Conversation
… and keep a consistent left margin. Do not limit the width since the contents are being scaled and it becomed detatched from the preview thumbnail sidebar.
|
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. |
There was a problem hiding this comment.
This definitely works as intended, so if you'd like to have it in for tomorrow, go for it! note that this requires a plugin sync
I do have a couple thoughts about it:
- Many templates feel very large, almost as if we are zooming in on them. I know we aren't, but I imagine it's something to do with the way block preview works:
- What if instead of scrolling the whole page and keeping the preview fixed, we kept the whole page fixed as well and just scrolled the list? I.e. the scrollbar wouldn't be on the far right, but beside the list of layouts.
Copons
left a comment
There was a problem hiding this comment.
Removing the wp-admin sidebar calculations won't work on wp-admin though!
(And, admittedly, those calculations don't consider the fact that on Calypso there is no sidebar...)
See how the preview overflows to the right, covering the browser scrollbar:

Unfortunately this is not a super trivial fix, also because as @noahtallen mentioned, the BlockPreview scales the preview content based on an hardcoded 960px of viewport.
Meaning that if the preview container is 960px wide, the preview looks exactly like it will be rendered; if the container is narrower than 960px, the preview will look incrementally smaller; and if the container is wider, it will look larger.
This happens in order to get a "large screen preview" even if the actual user screen is small, instead of being responsive.
I think this is why @Automattic/ajax settled to a container max width === BlockPreview viewport width, which would only scale the preview down, and not up.
A solution might be to provide a variable viewport width to the BlockPreview, giving it a lower limit of 960px (so that the preview will scale down instead of being responsive), and no upper limit (so that the preview will always at its 1:1 scale on large screens).
I don't know the kind of performance impact this might have though.
|
Good catch on the WP-Admin view, I have everything set to full screen. :D I think we can fix this by sticking to percentages and avoiding pixel values all together. I'll have a look at the viewport issue. I honestly don't mind the zoomed view, because it avoids users seeing the tablet view even when their browser is wide enough for a full width view. Will dig some more on this one. |
… mode, as well as Calypso and wp-admin
|
Unfortunately this has broken preview rendering. The actual preview container is now sizing perfectly in all circumstances. Getting the scaling of the preview to work correctly and actually render the template is eluding me.
This seems like the right way to go. If the scale is set to 1 all the time, on larger screens this works well and shows space either side of the template preview, rather than it just scaling everything up. I don't think I'm going to get this going however, so unless someone else wants to try, I'll likely close this PR out. |


Changes proposed in this Pull Request
Before:
After:
Testing instructions