Skip to content

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

Merged
merged 7 commits into from
Feb 14, 2022
Merged

Conversation

sgrove
Copy link
Contributor

@sgrove sgrove commented Feb 13, 2022

Summary

When running graph:handler previously, the user had to provide a <name> argument. Usually this would mean getting an error, running graph:operations to get a list of operation names, and then running graph: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


Screen Shot 2022-02-13 at 13 14 46

Screen Shot 2022-02-13 at 13 14 37

Screen Shot 2022-02-13 at 13 14 31


  • Make sure the status checks below are successful ✅

Sorry, something went wrong.

@sgrove sgrove added the type: feature code contributing to the implementation of a feature and/or user facing functionality label Feb 13, 2022
@github-actions
Copy link

github-actions bot commented Feb 13, 2022

📊 Benchmark results

Comparing with b74c0ee

Package size: 442 MB

(no change)

^  439 MB  439 MB  439 MB  439 MB  438 MB  438 MB  438 MB  438 MB  438 MB  438 MB  438 MB  438 MB  442 MB 
│   ┌──┐    ┌──┐    ┌──┐    ┌──┐    ┌──┐    ┌──┐    ┌──┐    ┌──┐    ┌──┐    ┌──┐    ┌──┐    ┌──┐    ┌──┐  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
└───┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴──>
    T-12    T-11    T-10    T-9     T-8     T-7     T-6     T-5     T-4     T-3     T-2     T-1      T    
Legend

@sgrove sgrove requested a review from erezrokah February 14, 2022 06:43
Copy link
Contributor

@erezrokah erezrokah left a 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

@@ -1,20 +1,32 @@
// @ts-check
const inquirer = require('inquirer')
const inquirerFuzzySearchPrompt = require('inquirer-search-list')
Copy link
Contributor

@erezrokah erezrokah Feb 14, 2022

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:

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.

Copy link
Contributor Author

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!

@sgrove sgrove requested a review from erezrokah February 14, 2022 17:34
@sgrove
Copy link
Contributor Author

sgrove commented Feb 14, 2022

@erezrokah Updated with your suggestion - works just as well (actually better in the scenario where there are no matches!)

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@sgrove sgrove added the automerge Add to Kodiak auto merge queue label Feb 14, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@kodiakhq kodiakhq bot merged commit 050bf90 into main Feb 14, 2022
@kodiakhq kodiakhq bot deleted the graph-handler-fuzzy-search branch February 14, 2022 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Add to Kodiak auto merge queue type: feature code contributing to the implementation of a feature and/or user facing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants