-
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
Editor: Hide plugin buttons in header on mobile layouts #49329
Conversation
Caution: This PR affects files in the Editing Toolkit Plugin on WordPress.com D56047-code has been created so you can easily test it on your sandbox. See this FieldGuide page about developing the Editing Toolkit Plugin for more info: PCYsg-ly5-p2 |
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. |
This works well except for an edge case where pinned plugins might appear before the settings icon. As far as I can see, the repro steps are a bit weird:
The weird part is that this instead works appropriately:
In the scenario where the settings icon is hidden, AFAIK the only way of opening the post/block sidebar (aside from resizing the window or hit ⇧⌘,, which might not be possible on mobile) would be to select a block and click on "Show More Settings" (first item of the block toolbar's "more options" menu). As I said at the beginning, I'm inclined to consider this an unlikely edge case, which has a clear (although not straightforward) workaround. Also, as mentioned internally, Gutenberg itself should have hidden the icons on small screens in the first place, and this is apparently a regression. |
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 LGTM, and making it filterable is an excellent idea! ✨
I'm "pre-approving" this as I deem the edge case is unlikely enough.
Although, before merging, I'd recommend to observe p7DVsv-amS-p2, because @jasmussen is working on a fix on Gutenberg, which might render this PR obsolete very quickly.
I have a fix for this in core, here: WordPress/gutenberg#28521 This seems like a lot of code for the fix, but I'll defer to you on the details. But it would also be good to remove this again once the core fix lands. |
The Core fix is scheduled for 9.9, which should land next week. |
@Copons I see that @simison has listed it as a blocker for the next onboarding test (pbAok1-1PR-p2) so I'm going to deploy this fix (it's not the only blocker of course, but I wouldn't want to be in the situation where we're waiting for a GB release before we start testing)
It is! Some of the code is unfortunately needed to satisfy the webpack build. The other code is so we can quickly disable it without an ETK release. Could be useful if when we ship GB 9.9 but aren't immediately in a position to ship a version of ETK.
I see the core fix has also WordPress/gutenberg#28526 dealt with this by just hiding everything after the |
Yup! |
Thanks for the work. I'm happy to be pinged directly for any followup questions or PRs that need to be done here. |
Changes proposed in this Pull Request
This is a stripped down version of the original PR that also collapsed the publish/save/update buttons #49079
Testing instructions
yarn dev --sync
Fixes #48337