amp-wp icon indicating copy to clipboard operation
amp-wp copied to clipboard

Add AMP under "Preview" dropdown in WordPress

Open simison opened this issue 1 year ago • 2 comments

Hi! I wanted to let you know that it's now possible to add items under "Preview" menu in Gutenberg since:

  • https://github.com/WordPress/gutenberg/pull/64644

More here: https://make.wordpress.org/core/2024/10/18/extending-the-preview-dropdown-menu-in-wordpress-6-7/

I recommend moving the AMP preview there from the plugin toolbar conditionally when PreviewDropdownMenuItem is available:

Screenshot 2024-10-17 at 20 22 59

The original issue at Gutenberg repo used AMP as an example of why the Preview dropdown had to be extendable:

  • https://github.com/WordPress/gutenberg/issues/25309

I wrote more ideas here on how to improve preview extensibility. Feel free to share AMP perspective!

  • https://github.com/WordPress/gutenberg/issues/65005

simison avatar Oct 17 '24 17:10 simison

Perhaps for another issue, but I noticed the 'Preview in new tab' line has more left/right padding than the rest of the items.

kellychoffman avatar Oct 17 '24 19:10 kellychoffman

This is great as I understand it will eliminate some brittle code we've had to implement to work around this limitation:

https://github.com/ampproject/amp-wp/blob/60a655cdad9e3431b47b2dcc3b2e5ddb86ac5c5e/assets/src/block-editor/plugins/wrapped-amp-preview-button.js

westonruter avatar Oct 18 '24 00:10 westonruter