-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Conversation
Caution: This PR has changes that must be merged to WordPress.com |
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could also say taken from https://github.com/WordPress/gutenberg/blob/9f0471e36aaf4a7172cc567494a8b9e4561861db/packages/base-styles/_breakpoints.scss ;-)
We can also use https://github.com/WordPress/gutenberg/blob/9f0471e36aaf4a7172cc567494a8b9e4561861db/packages/base-styles/_mixins.scss
But for now for this fix this is fine. 👍
There was a problem hiding this comment.
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. :)
There was a problem hiding this 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:
-
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:
-
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?
-
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 { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
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 |
@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). |
apps/wpcom-block-editor/src/calypso/features/iframe-bridge-server.scss
Outdated
Show resolved
Hide resolved
PR updated new descriptions, test instructions, known/remaining issues and new screenshots (which also show some of the errors remaining). |
Here are a couple of notes from my testing:
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?
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.
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):
I noticed a small issue on dotcom-FSE simple sites while testing without the sticker (the Page Layout has no left margin): 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. |
There was a problem hiding this 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.
89a93a8
to
9036d3b
Compare
Rebased (and squashed to one commit to make rebasing easier) |
There was a problem hiding this 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 |
There was a problem hiding this 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. :-)
There was a problem hiding this 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:
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.
@Addison-Stavlo I wonder if the padding is fixed in #40329. I think there was some work towards it |
I think this was rebased with those changes. Maybe that rebase gunked it up here? (Or maybe im the only one that sees it 😆 ) |
@noahtallen @Addison-Stavlo 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 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. |
This PR #40425 fixes:
|
@vindl Here are the new follow-up issues created.
Hamburger button overlapping + no way to exit editor in mobile & tablet view.
Editor header layout break in certain viewport width. |
Great, thanks for creating these! I added them to Create Focus maintenance board so we don't lose track of them. |
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: 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. |
Yep, that can be removed. @alshakero @andrewserong could you add this to the list of maintainance tasks? Thanks! |
Thanks for the ping, I've added it to the list! |
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
@automattic/full-site-editing
and sync to wpcom@automattic/wpcom-block-editor
and sync to wpcomhttps://wordpress.com/block-editor/page/YOUR_FSE_SITE_HERE.wordpress.com
https://wordpress.com/block-editor/page/YOUR_NON_FSE_SITE_HERE.wordpress.com
https://YOUR_FSE_SITE_HERE.wordpress.com/wp-admin/post-new.php?post_type=page
https://YOUR_NON_FSE_SITE_HERE.wordpress.com/wp-admin/post-new.php?post_type=page
https://wordpress.com/block-editor/post/YOUR_SITE_HERE.wordpress.com
https://YOUR_SITE_HERE.wordpress.com/wp-admin/post-new.php
gutenberg-edge
version. This is for backwards compatiblity with older Atomic sites.Note:
full-site-editing-plugin
andwpcom-block-editor
scopes to your sandbox.Known Issues / Remaining Work
Screenshots
WP-Calypso FSE Page Editor
WP-Calypso Non-FSE Page Editor (Has Issues)
WP-Admin FSE Page Editor (Has Issues)
WP-Admin Non-FSE Page Editor (Has Issues)
WP-Calypso Post Editor
WP-Admin Post Editor