Support preview mode from mobile devices #27837
Labels
General Interface
Parts of the UI which don't fall neatly under other labels.
Mobile Web
Viewport sizes for mobile and tablet devices
[Type] Enhancement
A suggestion for improvement.
Background:
Gutenberg's preview mode is working well for previewing blogs on mobile/tablet from within a desktop sized editor.
But preview mode hasn't been optimized to work when the editor is opened on a mobile device.
In gutenberg core, we simply don't allow device preview from a Mobile sized editor, we keep the preview mode set to "Desktop" and have the preview button open a new preview tab instead
The Layout Grid block allows users to select different column widths and offsets for different device widths.
So for example you can have a three column layout on desktop, and then have two half width and one full width column on mobile.
The block has a portion of its settings which utilizes gutenberg's preview mode in order to preview and set column width/offset on different devices
This allows users to create flexible responsive designs and is very useful for e.g. theme homepages.
The problem:
With the Layout Grid block, we need to use the three different preview modes so that we can set column widths/offsets for different breakpoints
Currently when opening the editor on a mobile device, preview mode defaults to "desktop" and results in a confusing experience.
When the layout grid block is used in the wild and on wpcom, the results can be more dramatic:
Automattic/wp-calypso#42148
Automattic/block-experiments#152
I originally tried to fix this issue in the Layout Grid block, but was unable to achieve a satisfactory outcome for mobile and desktop Automattic/block-experiments#161
Another minor issue is that when using mobile preview on mobile devices, only 320px of the screen are used e.g.
Looking beyond the layout grid block, better supporting preview from a mobile device is a useful feature, especially as more responsive aware content is developed and mobile device usage continues to increase.
Ideal Solution:
My proposed solution:
Outcome:
This will allow the experience on a mobile device to be intuitive, the preview mode will be mobile by default and use the screen efficiently.
when editing column widths in the grid layout, mobile mode will be selected by default as expected.
A desktop preview will be available from mobile, horizontal scrolling will be used.
Desktop will actually continue to work exactly as it does now.
Tablet mode will render in an efficient tablet preview by default, mobile and desktop can be previewed as expected.
Conclusion:
Phew I've gone down a few different paths thinking about mobile preview, but I think that this solution
will work really nicely for mobile without affecting desktop and it should actually be pretty simple to implement in gutenberg. I hope this communicates the issues and proposal well, and also, enjoy your holidays!
The text was updated successfully, but these errors were encountered: