Command Palette: Block actions in command center #51559
Labels
Needs Design Feedback
Needs general design feedback.
[Package] Commands
/packages/commands
[Type] Comand Palette
[Type] Enhancement
A suggestion for improvement.
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.
The text was updated successfully, but these errors were encountered: