WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.5k stars 4.2k forks source link

Zoom out: toggle missing in toolbar when too many plugins are registered in toolbar #66884

Open annezazu opened 1 day ago

annezazu commented 1 day ago

When too many plugins are registering items in the toolbar, the zoom toggle disappears in 6.7-RC4:

https://github.com/user-attachments/assets/c54a27fc-ea1a-43f5-9813-4f5390289309

Steps to replicate:

  1. Install and activate Jetpack and Yoast.
  2. Open up Pages > Add new.
  3. Notice you don't see the zoom out toggle.
  4. Notice that if you open up the Inserter > Patterns, that it appears.

I'd expect that the zoom out toggle would still be visible and, no matter how wide I try to make the viewport, it never shows up. cc @getdave I couldn't find a comparable issue on the 6.7 board for zoom out.

Props to @laurelfulford for first finding this!

annezazu commented 1 day ago

cc @fabiankaegy as a heads up.

laurelfulford commented 22 hours ago

We ran into the above when testing different Newspack plugins with WordPress 6.7. I've run into a wall trying to figure out why it's happening, but here's a few more details:

We're seeing this with plugins like Jetpack, Newspack Blocks, Newspack Campaigns, Newspack Newsletters, Events Calendar, and some others we built. If just one of these plugins are enabled on their own (in Jetpack's case, enabled and connected), the Zoom out toggle goes away.

All of these plugins register blocks; when I removed the block registration code from a couple, the issue goes away.

We also use WooCommerce, Co-Authors Plus, and Yoast, which also register blocks but don't cause this issue.

One difference is that the latter group all register and enqueue block assets using block.json. Best I can tell the ones that cause issues with the Zoom out don't -- some of the blocks have a block.json, but don't seem to use it to register the block.

When the Zoom out isn't showing, opening the Pattern inserter will zoom the page out and make the toggle appear, but it disappears again once the Pattern inserter is closed.

Hopefully this isn't a red herring! Just let me know if you have any questions about the above.

annezazu commented 21 hours ago

Thank you so much for all of the extra details. Added props above for your hard work in trying to track this down and first reporting it :)

t-hamano commented 16 hours ago

This issue is the same as #66671.

The cause of this issue is as follows:

This issue has been fixed in Gutenberg trunk (#66789), but we need to consider how to address this issue in WP 6.7.

My suggested approach is to either:

  1. Do not enable zoom out mode in the Patterns tab
  2. Enable the zoom out toggle too, which means applying #66671 to WP 6.7 too.

The latter approach is probably the best, but this would also be considered an enhancement, so I'm not sure if it's acceptable for a point release.

cc @stokesman @draganescu

laurelfulford commented 2 hours ago

Thanks for tying that together, @t-hamano! 🙌 I focused too much on open issues when trying to search for something similar.