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

Exploration: Supporting command types and filtered searching #53190

Open
richtabor opened this issue Jul 31, 2023 · 2 comments
Open

Exploration: Supporting command types and filtered searching #53190

richtabor opened this issue Jul 31, 2023 · 2 comments
Labels
[Package] Commands /packages/commands [Type] Comand Palette [Type] Enhancement A suggestion for improvement.

Comments

@richtabor
Copy link
Member

richtabor commented Jul 31, 2023

It may be interesting to explore a method of registering a command type, and supporting a method to filter a via that type—perhaps based on an input prefix.

In this exploration below, if you type "?" into the input, you would see all available documentation type commands. Typing a search query afterwards would the filter the results by the input value and the documentation type. This would allow for helpful documentation links within the WordPress experience, while not overwhelming the existing editor interface.

Plugins should also be able to register commands within a specific type (just like how pattern categories work). In the example I have a link that could be registered via the Gutenberg plugin (fetching the version number perhaps), which links to the latest news on Gutenberg. Third-party plugins could add help documentation; hosts even.

Visuals

help-commands searching
@richtabor richtabor added [Type] Enhancement A suggestion for improvement. [Package] Commands /packages/commands labels Jul 31, 2023
@richtabor
Copy link
Member Author

Could also be interesting to leverage the prefixes that the editor already uses, like @ to search for users—having each displayed in the palette to navigate to their WP profile. Or [[ to search for posts only.

posts-commands ( )

Perhaps : to search through the outline (headings within post title). Kind of like navigating to a specific line within VS Code.

headings-commands (_)

What other use cases would you see helpful for command types?

@priethor
Copy link
Contributor

The more I play with the Command Palette, the more I like the idea of adding command types. However, more than remembering symbol-based commands, what about supporting natural language keywords/actions like go to, edit, etc? The downside could be their internationalization, but they can coexist with the symbol-based ones.

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

No branches or pull requests

2 participants