WordPress / gutenberg

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

DataViews: Remove primary actions from secondary actions drop down #66811

Open doekenorg opened 2 weeks ago

doekenorg commented 2 weeks ago

What problem does this address?

In some cases you might have 1 or 2 primary actions, and that's it. The additional actions drop down with the exact same buttons might be overkill (when the screen accommodates all primary buttons). I'd like to be able to hide this menu.

What is your proposed solution?

I propose an explicit isSecondary attribute (with a default of true for backwards compatibility). When set to false this action will not be populated in the action drop down.

Image Image (Note the delete action missing from the drop down, or the action menu completely missing)

I can imagine actions also being hidden when the screen is smaller, where only the dropdown is visible; and these primary actions are visible too. But that might be a different issue / feature.

I recognise this is mostly useful for table and list views. For Grid I would propose to keep it as is, unless there is only one primary action. Then I would replace the menu button with that primary action.

Image

CC @wordpress/gutenberg-components

oandregal commented 2 weeks ago

For reference, this is very related to https://github.com/WordPress/gutenberg/issues/65165