Skip to content
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

Command Palette: Block actions in command center #51559

Open
draganescu opened this issue Jun 16, 2023 · 2 comments
Open

Command Palette: Block actions in command center #51559

draganescu opened this issue Jun 16, 2023 · 2 comments
Labels
Needs Design Feedback Needs general design feedback. [Package] Commands /packages/commands [Type] Enhancement A suggestion for improvement.

Comments

@draganescu
Copy link
Contributor

Command center is a great solution for keyboard based interaction with the block editor in all its shapes and forms.

One of the most common actions in the block editor is interacting with blocks via the controls in the toolbar and the inspector.

Consider adding commands to the command center from blocks, mirror actions of things that exist in the block toolbar and the block inspector.

For example the image block could register direct shortcuts such as "Replace from media library" or "Crop image". The navigation block could register "change to Footer Nav 2" or "delete navigation".

Some commands such as select parent or move up/down/left/right could work out of the box.

Since blocks can have many possible actions available, which could lead to crowding of the command center search results, I suggest creating a sort of global shortcut command using ":" to trigger the block commands of the currently selected block.

(We could also use other similar shortcuts like "@" for a list view in the way finder.)

The main hurdle is how to register commands from blocks. My initial thought was to use the block toolbar to auto add all registered buttons plus the default ones. But the way we extend that makes this idea inappropriate - each block would have to provide name and callback for the command too big of a rewrite.

Another way is to selectively register block by block the commands that make most sense from block definition or simply from its edit component.

I suppose a big part of this is already possible?

All the commands will work on the currently selected block(s) - so commands such as group, insert before and insert after would also make sense but these are handled separately.

These commands would work great with distraction free mode. Since the introduction of this mode we had a problem with making often used UI actions available quickly and easily without turning off the mode. Command center - given its extensible enough could solve this quite easily.

@draganescu draganescu added [Type] Enhancement A suggestion for improvement. Needs Design Feedback Needs general design feedback. [Package] Commands /packages/commands labels Jun 16, 2023
@richtabor
Copy link
Member

Since blocks can have many possible actions available, which could lead to crowding of the command center search results, I suggest creating a sort of global shortcut command using ":" to trigger the block commands of the currently selected block.

I'm not so worried about crowding the commands. I suspect there will be hundreds of commands one day — and that's not a bad thing. We do have context — which surfaces the right commands in the right context; perhaps this could work as an extension of that, to suggest block commands if a block is selected when pulling up Wayfinder.

@richtabor richtabor changed the title Block actions in command center / way finder Wayfinder: Block actions in command center Jun 16, 2023
@priethor priethor changed the title Wayfinder: Block actions in command center Command Palette: Block actions in command center Jun 30, 2023
@priethor
Copy link
Contributor

I'm not so worried about crowding the commands.

I agree with this. As long as the search functionality and discoverability are good, it shouldn't be a problem. It's like an action inserter 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Design Feedback Needs general design feedback. [Package] Commands /packages/commands [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

3 participants