dthree / dthree/vorpal

List filter on fuzzy search

Open
#184 1 comment 2 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
5.6k
Forks
278
PR merge metrics
No merged PRs in 30d

Description

Crosspost from http://stackoverflow.com/questions/39925201/interactive-fuzzy-search-filter-on-list-with-vorpal. I know you like questions posted on SO for better Vorpal visibility, but I'm posting it here also in case any contributors have any ideas. If that's not appropriate, feel free to close.

First off, great framework! I really want to use it for my current project, but I'm not sure my use case is a good fit. I want to implement an interactive fuzzy search filter on a list within a vorpal shell. The flow would be something like:
- Upon startup the user would be presented with a list of options (POJOs stored locally in a .myoptions file). List would be implemented using a prompt/Inquirer list
- At the vorpal-app$ command prompt, each key the user presses would filter the list, removing the list items that don't match and highlighting the remaining items that do.
- On each key press, the list is sorted by highest match score. The top matching item is bold or colored or something to signify that's the default item and will be selected when pressing `return`
- The user can use the ↑ and ↓ arrow keys to scroll through the list. Enter selects the item.

Functionally similar to:
- zaw history matching and [GIF of shell history fuzzy search](https://github.com/sandalsoft/awssh/blob/master/fuzzy%20search%20list.gif)
- web version of same concept [GIF of fuzzy match using a web app](https://camo.githubusercontent.com/5bde373488b1d20fd0e6ecfaa79724552fe4aa61/687474703a2f2f692e696d6775722e636f6d2f6f627a435171372e676966)

I would plugin my own fuzzy search functionality or possibly use the autocomplete (I haven't looked into this part yet). Either way, the searching logic I've got covered, it's the display piece that I'm not sure about.

I've read all of the issues on github and StackOverflow vorpal.js tagged posts and couldn't find anything similar. I'd love to be able to leverage all the functionality vorpal provides and not have to re-implement it with another library.

Is this possible with the current Vorpal API?

Thanks

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.