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 7.7.1]: Fix editor header layout issues on mobile & tablet view. #40361

Merged
merged 1 commit into from
Mar 24, 2020

Conversation

yansern
Copy link
Contributor

@yansern yansern commented Mar 23, 2020

Changes proposed in this Pull Request

The following changes were made to fix header layout issues mobile & tablet view on Gutenberg 7.7.

Fixes #40335

Testing instructions

  • Build @automattic/full-site-editing and sync to wpcom
  • Build @automattic/wpcom-block-editor and sync to wpcom
  1. Test the editor against the following scenarios:
  1. Spot for any possible regressions by testing the above scenarios again on another site running non gutenberg-edge version. This is for backwards compatiblity with older Atomic sites.

Note:

  • You'll need to build and sync over both full-site-editing-plugin and wpcom-block-editor scopes to your sandbox.

Known Issues / Remaining Work

  • Hamburger Button is overlapping Block Inserter Button on WP-Admin version of the editor. Also take note that this issue already exist in live production so we don't necessarily have to fix it in this PR.
  • (Optional) The layout may break on fringe viewport widths. I'm limiting the scope to just some of the standard viewport widths as seen in the screenshot below.

Screenshots

WP-Calypso FSE Page Editor

image
image
image
image

WP-Calypso Non-FSE Page Editor (Has Issues)

image
image
image
image

WP-Admin FSE Page Editor (Has Issues)

image
image
image
image

WP-Admin Non-FSE Page Editor (Has Issues)

image
image
image
image

WP-Calypso Post Editor

image
image
image
image

WP-Admin Post Editor

image
image
image
image

@yansern yansern added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. [Goal] Gutenberg Working towards full integration with Gutenberg [Goal] Full Site Editing labels Mar 23, 2020
@yansern yansern self-assigned this Mar 23, 2020
@matticbot
Copy link
Contributor

@yansern yansern requested a review from a team March 23, 2020 10:49
@matticbot
Copy link
Contributor

Caution: This PR has changes that must be merged to WordPress.com
Hello yansern! These changes need to be synced to WordPress.com - If you 're an a11n, please commandeer, review, and approve D40677-code before merging this PR. Thank you!

@matticbot
Copy link
Contributor

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.

@@ -35,6 +35,45 @@
}
}

// Taken from styles/starter-page-templates-editor.scss
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. These are the list of breakpoints I was looking for:
https://github.com/WordPress/gutenberg/blob/9f0471e36aaf4a7172cc567494a8b9e4561861db/packages/base-styles/_breakpoints.scss

I didn't want to just make up my own numbers. :)

@simison simison requested a review from a team March 23, 2020 13:58
@simison simison changed the title [Gutenberg 7.7.1]: Fix editor header layout spacing issues on mobile & tablet. [Gutenberg 7.7.1]: Fix FSE editor header layout spacing issues on mobile & tablet. Mar 23, 2020
Copy link
Contributor

@Addison-Stavlo Addison-Stavlo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there are a couple issues here:

  1. First Issue I notice is that when loading the editor from wp-admin (non-iframe), there are some screen widths where the toolbar gets hidden underneath the wp-admin toolbar:
    Screen Shot 2020-03-23 at 2 39 50 PM

  2. Do all of these changes make sense to do from the dotcom FSE plugin? Hiding the dotcom FSE back button and adding padding to the inserter due to the custom button make sense, but the other pieces may need to be handled outside of the dotcom FSE plugin as I believe these issues may exist elsewhere?

  3. Changes to the custom back buttons visibility (and probably style changes it requires to happen to other things as the inserter padding) should probably be handled in dotcom-fse/plugins/close-button-override/style.scss


@media screen and ( max-width: $breakpoint-tablet ) {
// Removes whitespace above header in mobile & tablet view.
.block-editor-editor-skeleton {
Copy link
Contributor

@Addison-Stavlo Addison-Stavlo Mar 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps this is the culprit for why we get hidden under the wp-admin bar on this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Fixed in this commit: a7295c3

Reasoning for the top whitespace can be traced back to: WordPress/gutenberg#13425


.edit-post-header__toolbar {
// Back button is not displayed in mobile & tablet view.
.edit-post-fullscreen-mode-close__toolbar__override {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we go to dotcom-fse/plugins/close-button-override, there is a scss file in there where changes to this buttons visibility may make more sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Fixes in this commit. e6d5287

@noahtallen
Copy link
Member

definitely a +1 to what Addie said. i wanted to add that the code here only resolves issues if dotcom-fse is active, so it wouldn't affect most sites. I think #40335 mentions that there are similar issues with non-fse sites

@yansern yansern requested a review from a team as a code owner March 24, 2020 11:13
@yansern
Copy link
Contributor Author

yansern commented Mar 24, 2020

@Addison-Stavlo Thanks for your review & feedback. I've taken care of point 1 and 3 (with consideration of what you have said in point 2).

However, I'm changing the status of this PR from Needs Review to In Progress. This is because I reverted some of the fixes I made and reworking them. I'm going more investigative work on what's the right CSS fix and which file they should land on (based on point 2).

@yansern yansern changed the title [Gutenberg 7.7.1]: Fix FSE editor header layout spacing issues on mobile & tablet. [Gutenberg 7.7.1]: Fix editor header layout issues on mobile & tablet view. Mar 24, 2020
@yansern
Copy link
Contributor Author

yansern commented Mar 24, 2020

PR updated new descriptions, test instructions, known/remaining issues and new screenshots (which also show some of the errors remaining).

@vindl
Copy link
Member

vindl commented Mar 24, 2020

Here are a couple of notes from my testing:

Hide Back/Close Button in mobile & tablet view (as how it behaved in previous version).

It sounds like this was the case in previous versions too, but now there is no way to exit the editor on mobile and tablet views. It's probably not a blocker given the previous state of things, but could we at least file a follow up issues for this and add it to the maintenance board?

Hamburger Button is overlapping Block Inserter Button on WP-Admin version of the editor. Also take note that this issue already exist in live production so we don't necessarily have to fix it in this PR.

This could be bundled in the above issue too. It's better if we can come up with a unified strategy for closing the editor, instead of having different behavior in wp-admin and Calypso.

The layout may break on fringe viewport widths. I'm limiting the scope to just some of the standard viewport widths as seen in the screenshot below.

For the record I've noticed this on widths between 600px and 800px while testing on already published posts with English (might be different depending translation length):

Screenshot 2020-03-24 at 16 17 01

Spot for any possible regressions by testing the above scenarios again on another site running non gutenberg-edge version. This is for backwards compatiblity with older Atomic sites.

I noticed a small issue on dotcom-FSE simple sites while testing without the sticker (the Page Layout has no left margin):

Screenshot 2020-03-24 at 16 14 25

Taking into account the number of affected users and wighting this against the other fixes and benefits that the update will bring, I think we shouldn't block on any of these, but it would be good to record the items that haven't been addressed in follow-up issues.

Copy link
Member

@vindl vindl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR now needs a rebase.

Be more specific with fixes.

Ensure our custom inserter button on page editor also has a blue background just like in newer Gutenberg.

Proper overrides for close button.

Proper fix for whitespace above mobile header.

Revert old overrides which I didn't fully understand the context.

Should be top: 0.

Balance out side padding.

Hide close button label >= 960px to make room for others, hide toc button, apply padding balancing to all editor scenarios.

Fix regression on header whitespace.
@simison simison force-pushed the fix/gutenberg-7.7-mobile-header-spacing branch from 89a93a8 to 9036d3b Compare March 24, 2020 16:05
@simison
Copy link
Member

simison commented Mar 24, 2020

Rebased (and squashed to one commit to make rebasing easier)

@simison simison removed the request for review from a team March 24, 2020 16:05
Copy link
Contributor

@Addison-Stavlo Addison-Stavlo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates! This is looking better and the wp-admin top bar seems fixed.

One thing I am finding now (perhaps as a result of the recent rebase), is a large amount of extra space at the top of the bar in the iframed/calypso tablet view ( <~780px )
Screen Shot 2020-03-24 at 12 37 47 PM

@simison
Copy link
Member

simison commented Mar 24, 2020

Thanks for the updates! This is looking better and the wp-admin top bar seems fixed.

One thing I am finding now (perhaps as a result of the recent rebase), is a large amount of extra space at the top of the bar in the iframed/calypso tablet view ( <~780px )

This seemed to be due needing to build and sync @automattic/wpcom-block-editor :-)

Copy link
Member

@simison simison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested all scenarios pretty thoroughly. (FSE/non-FSE,calypso iframe/directly in wp-admin/different screen sizes/while drinking coffee/tee).

I agree with your notion to leave other issues to follow-ups. :-)

@simison simison merged commit dfe7550 into master Mar 24, 2020
@simison simison deleted the fix/gutenberg-7.7-mobile-header-spacing branch March 24, 2020 17:46
@simison simison removed [Status] In Progress [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. [Status] Needs Rebase labels Mar 24, 2020
Copy link
Contributor

@Addison-Stavlo Addison-Stavlo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seemed to be due needing to build and sync @automattic/wpcom-block-editor :-)

Ah yes! Well that makes sense. After syncing the bridge server build that goes away.
After syncing that as well I do now notice a padding issue in the iframed version that does not exist in the wp-admin version:

Screen Shot 2020-03-24 at 1 45 27 PM

But if that is truly an issue past my environment it should be added to the list of follow ups, and not hold this up any further.

@noahtallen
Copy link
Member

@Addison-Stavlo I wonder if the padding is fixed in #40329. I think there was some work towards it

@Addison-Stavlo
Copy link
Contributor

I think this was rebased with those changes. Maybe that rebase gunked it up here? (Or maybe im the only one that sees it 😆 )

@yansern
Copy link
Contributor Author

yansern commented Mar 25, 2020

@noahtallen @Addison-Stavlo
Padding issue is related to conflict of opinion on how to handle the margins for the close button.

The implementation by @razvanpapadopol here https://github.com/Automattic/wp-calypso/pull/40329/files#diff-6ef79f4807f019b9b2b7cd070541b6ddR55-R60 and this is mine https://github.com/Automattic/wp-calypso/pull/40361/files#diff-6ef79f4807f019b9b2b7cd070541b6ddL18-R23.

There's no right or wrong, just which approach to proceed with. Of course, I vote mine, lol :P

My argument is that overrides should be less disruptive, that's why if an offset of margin-left: -24px is needed on an injected custom element, its disruption should be restored with margin-right: 24px so that the adjacent elements would behave as if there were no modifications in place.

I will review what's the current state of editors now that all is merged to master... and add the additional fixes in new PRs.

@yansern
Copy link
Contributor Author

yansern commented Mar 25, 2020

This PR #40425 fixes:

After syncing that as well I do now notice a padding issue in the iframed version that does not exist in the wp-admin version:

Screen Shot 2020-03-24 at 1 45 27 PM

  • Regressions on the close button margin-left issue on non-gutenberg-edge dotcomfse page editor as reported by @vindl.

I noticed a small issue on dotcom-FSE simple sites while testing without the sticker (the Page Layout has no left margin):

Screenshot 2020-03-24 at 16 14 25

@yansern
Copy link
Contributor Author

yansern commented Mar 25, 2020

@vindl Here are the new follow-up issues created.

Hide Back/Close Button in mobile & tablet view (as how it behaved in previous version).

It sounds like this was the case in previous versions too, but now there is no way to exit the editor on mobile and tablet views. It's probably not a blocker given the previous state of things, but could we at least file a follow up issues for this and add it to the maintenance board?

Hamburger Button is overlapping Block Inserter Button on WP-Admin version of the editor. Also take note that this issue already exist in live production so we don't necessarily have to fix it in this PR.

This could be bundled in the above issue too. It's better if we can come up with a unified strategy for closing the editor, instead of having different behavior in wp-admin and Calypso.

Hamburger button overlapping + no way to exit editor in mobile & tablet view. 
#40426

The layout may break on fringe viewport widths. I'm limiting the scope to just some of the standard viewport widths as seen in the screenshot below.

For the record I've noticed this on widths between 600px and 800px while testing on already published posts with English (might be different depending translation length):

Screenshot 2020-03-24 at 16 17 01

Editor header layout break in certain viewport width. 
#40427

@ramonjd ramonjd mentioned this pull request Mar 25, 2020
23 tasks
@vindl
Copy link
Member

vindl commented Mar 25, 2020

@vindl Here are the new follow-up issues created.

Great, thanks for creating these! I added them to Create Focus maintenance board so we don't lose track of them.

@jasmussen
Copy link
Member

jasmussen commented Apr 22, 2020

Hi @yansern 👋

I'd like to know more about the change made in dfe7550#diff-9dbcb1d2dc7c57c8d265da14297e9223R57. The left padding was intentionally designed to be 24px because it's a blue button next to a dark square, whereas the button on the right, the ellipsis/more menu, is a thin vertical icon. In having different margins, the end result is optically balanced:

Screenshot 2020-04-22 at 12 08 10

I would suggest that it is more productive to disagree in the block editor repository where if we find a new consensus we can change the code at the source. By creating CSS overrides like this, you are likely to both create technical debt as the structure and markup of the core editor changes, and it also works against the concerted design effort that takes place there.

Happy to review your PRs in the public repository, you can ping me at @jasmussen and I'll help shepard them along.

@simison
Copy link
Member

simison commented Apr 22, 2020

Yep, that can be removed. @alshakero @andrewserong could you add this to the list of maintainance tasks? Thanks!

@andrewserong
Copy link
Member

Thanks for the ping, I've added it to the list!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Goal] Full Site Editing [Goal] Gutenberg Working towards full integration with Gutenberg
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gutenberg 7.7.1 update on wpcom: fix header position on mobile
8 participants