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

Gutenberg mobile editor: Misaligned Header items #50758

Open
StefanNieuwenhuis opened this issue Mar 4, 2021 · 8 comments
Open

Gutenberg mobile editor: Misaligned Header items #50758

StefanNieuwenhuis opened this issue Mar 4, 2021 · 8 comments
Labels
[Feature] Post/Page Editor The editor for editing posts and pages. Mobile Web [Pri] Normal Triaged To be used when issues have been triaged. [Type] Bug

Comments

@StefanNieuwenhuis
Copy link
Contributor

StefanNieuwenhuis commented Mar 4, 2021

The Header in the Gutenberg Editor on Mobile Web doesn't contain sufficient screen estate to align the items nicely.

Screenshot 2021-03-04 at 14 17 34

Steps to reproduce

  1. Switch to a mobile viewport (I used Moto G4). Here's a guide on how to do it w/ Chrome Dev Tools.
  2. Go to https://wordpress.com/home/<somesiteid>.wordpress.com
  3. From the main menu, select Appearance > Themes
  4. Activate a different theme and proceed to edit the homepage
  5. The items in the header aren't aligned.

Here's a video where the behavior is being reproduced https://www.loom.com/share/6f6eecb26818454891daaaf3753ca3b6.

You can also go straight to https://wordpress.com/page/<somesiteid>.wordpress.com/home to reproduce the behavior.

Notes

Related to #48337 and #47386. See #47386 (comment)

Hint: to prevent the DOM manipulation that adds the Launch button and modifies the Save button, we can do an early return, on smaller screens: https://github.com/Automattic/wp-calypso/blob/trunk/apps/editing-toolkit/editing-toolkit-plugin/editor-site-launch/src/launch-button/index.ts#L24

@jeyip jeyip added [Pri] High Triaged To be used when issues have been triaged. labels Mar 8, 2021
@deBhal deBhal self-assigned this Mar 11, 2021
@deBhal
Copy link
Contributor

deBhal commented Mar 11, 2021

This looks to be about having the cutoffs wrong/too small for the adaptive elements in our UI, leading to the elements wrapping around at screen sizes close to the transition points.

Edit_Post_‹Test—_WordPress_com

Edit_Post_‹Test—_WordPress_com

The problem is exacerbated by more/longer elements in the bar, for example while auto-saving for a jetpack site, the bar will wrap even at 820 pixel screen-width:

Edit_Post_‹Test—_WordPress_com

So there are a couple of different fixes to consider:

  • decrease the threshold for reducing elements. This is the most obvious fix for the 782px and 600px thresholds, but won't actually address the Moto G4, as that is already using the smallest set of elements.
  • add new even smaller UI option, reducing the footprint of one or more of elements in the smallest @media case or reducing the minimum whitespace between elements or switching to a more vertical style.
  • stop the bar from wrapping (i.e. change the failure state).

I'm leaning towards making the edit-post-header more responsive, preventing wrapping and allowing more whitespace to be removed as it shrinks.

@simison
Copy link
Member

simison commented Mar 11, 2021

I think for now we should just hide the button on mobile. It's still available in the customer home page.

@razvanpapadopol @ollierozdarz thoughts? What would be a good alternative placement for this in mobile screens, if any?

@deBhal
Copy link
Contributor

deBhal commented Mar 12, 2021

@simison : Which button do you mean? The autosaving? That does seem a good target to improve things, but we'll need a lot more.

It's even worse in other languages - check out german, which still doesn't have enough space at 1010px width:
Seite_bearbeiten_‹Test—_WordPress_com

Contrast that with Chinese, which could show every element at half that size:
編輯頁面_‹Test—_WordPress_com

@ollierozdarz
Copy link

I think for now we should just hide the button on mobile. It's still available in the customer home page.

@simison are you talking about the Launch button on mobile? That seems like only element there that could possibly be removed/hidden without affecting the core functionality of the toolbar (saving/previewing/publishing) - although I'd hate to see launch rates decline because of it.

The difficult thing is that I believe we stack plugins in the toolbar (i.e. Jetpack), so this will become an issue as more plugins are installed regardless?

Have we ever tested using icons for things like 'preview' on mobile? We could always introduce another 'bar', but that would be three bars stacked and take up a lot of the real estate.

@simison
Copy link
Member

simison commented Mar 22, 2021

@ollierozdarz yeah, I meant Launch button on mobile can be hidden because it's still better than the broken header. If there's an alternative that we can implement after hiding, great! :-)

The difficult thing is that I believe we stack plugins in the toolbar (i.e. Jetpack), so this will become an issue as more plugins are installed regardless?

There was a core issue previously (that got since fixed) where plugins would get stacked even when there wasn't space, but they're since getting hidden in the three dots menu.

@alshakero @roo2 let's hide the launch button for now as a fix.

@creativecoder
Copy link
Contributor

Note that this is a problem at various screen sizes, not just mobile:

< 382px

gutenberg-header-lt-382

600-728px

gutenberg-header-600-728

782-824px

gutenberg-header-782-824

And as pointed out above, it varies by language and can happen an larger screen sizes with added buttons (autosave) and/or plugin menus.


Here's a draft PR that hides the Launch button for small screens, but it doesn't help with screen widths above 480px.

Selectively hiding/showing the button based on screen width across a large range of sizes seems error prone and not maintainable... I think we're going to need some other (smarter) collapsing behavior, but I'm not sure what, yet.

@kwight
Copy link
Contributor

kwight commented Apr 9, 2021

This is a visual problem that, while pretty ugly, doesn't affect a user's ability to use anything here. Dropping this to normal priority.

@razvanpapadopol
Copy link

razvanpapadopol commented May 24, 2021

Once the Launch button is removed from the editor header, can we retest this issue in all the cases (page, post, draft, etc)?

Check out a couple examples of a published page:

  • Mobile landscape (640px)

Screenshot 2021-05-24 at 17 39 13

  • Some viewport 601px wide

Screenshot 2021-05-24 at 17 40 45

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Post/Page Editor The editor for editing posts and pages. Mobile Web [Pri] Normal Triaged To be used when issues have been triaged. [Type] Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants