Skip to content

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

@doekenorg

Description

@doekenorg

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Feature] DataViewsWork surrounding upgrading and evolving views in the site editor and beyond[Type] EnhancementA suggestion for improvement.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions