-
Notifications
You must be signed in to change notification settings - Fork 394
feat: fuzzy search for graph:handler #4276
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
Conversation
📊 Benchmark resultsComparing with b74c0ee Package size: 442 MB(no change)
Legend
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @sgrove, added a comment
src/commands/graph/graph-handler.js
Outdated
@@ -1,20 +1,32 @@ | |||
// @ts-check | |||
const inquirer = require('inquirer') | |||
const inquirerFuzzySearchPrompt = require('inquirer-search-list') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use a different approach in other places in the CLI:
cli/src/utils/detect-server-settings.js
Line 207 in 3ef3d3c
if (!input || input === '') { |
if (!input || input === '') { |
I don't know if there's much difference in what the user experiences, but we should probably use the same method everywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll give this a try and see if the experience is similar!
@erezrokah Updated with your suggestion - works just as well (actually better in the scenario where there are no matches!) |
Summary
When running
graph:handler
previously, the user had to provide a<name>
argument. Usually this would mean getting an error, runninggraph:operations
to get a list of operation names, and then runninggraph:handler <name>
.Since the list is known and enumerable, this PR changes the
graph:handler
behavior to list all of the options in a selectable list that's also fuzzy-searchable (important due to how many operations there can be in a typical usage).The behavior of
graph:handler <name>
remains the same