-
Notifications
You must be signed in to change notification settings - Fork 805
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
Masterbar: Add menu structure #17629
Conversation
This is an automated check which relies on |
c8fa79c
to
88854d6
Compare
15df81a
to
f0c1866
Compare
@obenland it seems that files and modifications are unrelated to masterbar. Do you have something in mind? |
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 @obenland for working on this! Following your great test instructions 👏 I was able to admire 🎉 the new unified menu structure which contains the WordPress.com link for eg All new posts.
Using apply_filters( 'jetpack_load_admin_menu_class', ( defined( 'IS_WPCOM' ) && IS_WPCOM ) || jetpack_is_atomic_site() )
as condition seems enough as we can add_filter
in wpcom and wpcomsh to enable / disable this feature.
I am not sure of the exact scope of this PR, so I will post below all my findings and we can decide how we can handle them:
1. We have mixed the masterbar and the menu. Has it been done intentionally? I suppose we should place the masterbar changes here only and create a separate module(?) for the menu?
2. We haven't ported the masterbar nav-unification changes which can be found by searching nav-unification
in the trunk. I suppose this has been done intentionally as we will need to consolidate the changes with modules/masterbar/masterbar.php
and modules/masterbar/overrides.css
and coordinate with the calypsoify removal modules/calypsoify/class.jetpack-calypsoify.php
so that we avoid
3. Moving to the menu structure itself:
Atomic | Simple |
---|---|
The menu items order are identical to a simple site. Adding plugins (Contact Form and Yoast) correctly shows these plugins in the menu. I suppose that ordering doesn't matter as long as it is consistent through calypso / wp-admin.
a) We need to port the new menu styles introduced here D52281-code
b) Site Switcher "Browse Sites" is missing. We need an atomic equivalent check
if ( ! is_multisite() || ( function_exists( 'get_blog_count_for_user' ) && get_blog_count_for_user() < 2 ) ) {
return;
}
c) Site card Default Icon needs to be updated
d) My Home "Home" submenu should link to WordPress.com
e) Stats are missing the graph image
f) Jetpack menu will need some auditing. Backup and Scan leads to wordpress.com though jetpack and it is shown as external link. Backup
and Scan
independent links seem not needed in this context.
g) AMP should be a single link redirecting to /wp-admin/admin.php?page=amp-options
(we omit the analytics link which leads to the same page different section)
I would be happy opening separate issues for points 2 & 3 though. Let's address point 1 here!
Thanks for the review!
Yes, this is where we arrived in pbAPfg-VL-p2#comment-1966
I'm not sure what you're referring to here, is there something you could link me to for context?
Yeah, not sure about the best way to do that one yet. Maybe wpcomsh can provide some inspiration.
Hm, I have to look into that one a bit more. Instinctively I'd probably just leave it alone since it's a separate plugin on Atomic, but I have not double-checked that yet.
These seem to be only available on Simple sites. |
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 for pushing the fixes @obenland !
We haven't ported the masterbar nav-unification changes which can be found by searching nav-unification in the trunk.
I'm not sure what you're referring to here, is there something you could link me to for context?
Search for nav-unification
in :
/admin-bar/class.wpcom-admin-bar.php
we add a .is-nav-unification
in #wpadminbar
admin-bar/wpcom-admin-bar.css
we use the class above to style the masterbar
eg
WithoutStyles | WithStyles |
---|---|
Stats are missing the graph image
These seem to be only available on Simple sites.
True!
Fix site card icon
Sadly this was not enough. It seems that the following wrongly returns true and therefore styles are not applied correctly.
if ( ( function_exists( 'blavatar_exists' ) && blavatar_exists( $domain ) ) || has_site_icon() ) {
$classes .= ' has-site-icon';
}
Wrong | Correct |
---|---|
I can confirm that the rest of the changes are LGTM!
0ed6e2f
to
c3a456a
Compare
@cpapazoglou 867a910 should fix the site icon issue on WoA sites. |
Indeed, I can confirm that is fixed! Now, we just need the masterbar missing styles. |
Actually we don't need The weird thing is that jetpack already loads wpcom styles & wpcom overrides jetpack/modules/masterbar/masterbar.php Lines 267 to 268 in 8ab0362
So, I suggest:
Last but not least, I can confirm that without using |
@anomiex Thanks for your review! I fixed up the things you pointed out, this one should be good for another round of reviews. |
Fixed the menu problem here #17905 |
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.
Still need to test this some more, but I had a few questions.
Co-authored-by: Jeremy Herve <[email protected]>
Thank you for your feedback! Happy to make any amendments as you see fit. I also expect there to be quite a few more follow up PRs to this, particularly once we opened it to a8c-internal testing this week. |
Props jeherve.
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 have some additional remarks, but I'm approving this PR anyway, for a couple of reasons:
- I believe we could really benefit from some additional testing in different scenarios, with popular plugins like WooCommerce, WooCommerce extensions, Yoast SEO, Elementor, et al., as well as popular themes that extend the Themes menu. By adding this to Jetpack now, it should make it easier for folks to test on Atomic. I suspect we'll find quite a few issues with such plugins and how they interact with the existing admin menu.
- The feature is still gated by a filter, so not breaking anything by default.
- That PR is getting big, and the more we wait, the harder it will be to review.
|
||
remove_menu_page( 'themes.php' ); | ||
remove_submenu_page( 'themes.php', 'themes.php' ); | ||
remove_submenu_page( 'themes.php', 'theme-editor.php' ); |
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.
Is it problematic that folks will lose access to this option? I know we discourage its use in general, but it remains available in wp-admin anyway, even on Atomic. I wonder if this would cause some issues for folks in support in some cases.
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.
@davemart-in Do you have thoughts on the removal/non-removal of theme & plugin editor links?
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.
Let me phone a few friends. @kristenzuck, @nerdysandy thoughts on removing links to the theme & plugin editor from a happiness perspective? These pages would still be available if you knew how to get to them, but I've proposed removing them from the default menu. I'm happy to change my position on this one. Just curious if you see these pages used by many customers.
public function add_plugins_menu( $domain ) { | ||
$calypso = $this->is_wpcom_site(); | ||
|
||
remove_submenu_page( 'plugins.php', 'plugin-editor.php' ); |
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.
Just like above, is it problematic to remove the plugin editor?
This should be functionally ready for testing.
Changes proposed in this Pull Request:
Jetpack product discussion
pbAPfg-VL-p2#comment-1904
Does this pull request change what data or activity we track or use?
No
Testing instructions:
To test locally:
add_filter( 'jetpack_load_admin_menu_class', '__return_true' );
To test with an Atomic site:
add_filter( 'jetpack_load_admin_menu_class', '__return_true' );
Proposed changelog entry for your changes: