-
Notifications
You must be signed in to change notification settings - Fork 2k
ETK Nav Sidebar: Use site icon for menu toggle when available #51477
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
Conversation
|
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. |
5d0d6ff to
a85a1cd
Compare
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 left a few inline comments, but overall this PR tests well as per instructions, including hover and focus styles
Tested on an Atomic site with Gutenberg 10.3.1 (my site's icon is an orange square):
etk-sidebar-icon.mp4
Also, it seems like the unit tests CI task is failing, which is not ideal — could you try rebasing to see it if fixes it?
...kit/editing-toolkit-plugin/wpcom-block-editor-nav-sidebar/src/components/site-icon/index.tsx
Outdated
Show resolved
Hide resolved
...kit/editing-toolkit-plugin/wpcom-block-editor-nav-sidebar/src/components/site-icon/index.tsx
Outdated
Show resolved
Hide resolved
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.
TypeScript is not happy with the third argument being undefined:
Argument of type 'undefined' is not assignable to parameter of type 'number'.
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 resolved the type error, but it's a bit ugly! I'd imagine the types will be updated in Gutenberg if and when the __unstableBase becomes "stable".
...kit/editing-toolkit-plugin/wpcom-block-editor-nav-sidebar/src/components/site-icon/index.tsx
Outdated
Show resolved
Hide resolved
...oolkit-plugin/wpcom-block-editor-nav-sidebar/src/components/toggle-sidebar-button/style.scss
Outdated
Show resolved
Hide resolved
.../editing-toolkit-plugin/wpcom-block-editor-nav-sidebar/src/components/nav-sidebar/style.scss
Outdated
Show resolved
Hide resolved
7e05b3b to
113c6fb
Compare
Done, I think that did it. @ciampo Thanks so much for the detailed feedback. This is ready for another look. |
|
Note that I've created a diff that gets this working with Simple sites, as well: D59822-code |
ciampo
left a comment
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.
Tests well as per instructions, and all feedback has been addressed (I just added a tiny change that addressed a potential flexbox bug).
I'm going to take over this PR and merge it, since it fixes #51740.
Also, noting that D59822-code needs to be merged in order for the icon to display correctly in Simple Sites
|
Thanks for getting this over the line @ciampo ! ❤️ |
Changes proposed in this Pull Request
Use the site icon for toggling the editor sidebar menu (when in full screen mode), rather then the default "W" icon.
Related to #51396
Related to #51482
Resolves #51740
Testing instructions
Testing this requires install the Editing Toolkit plugin, v10.3.0 or higher of the Gutenberg plugin, and wpcomsh (for dot org sites). I recommend a8c-wp-env (for installing all dependencies), or installing the plugin zip to an Atomic site (PCYsg-ly5-p2#etk-and-atomic-sites).
Note that the sidebar menu styles were changed in v10.3 of Gutenberg (the current release). If you wanted to be thorough, you could test with a previous version of the plugin as well (I did while I was developing and it looked okay).
Note that this requires D59822-code to work for Simple sites.