inquirer-file-tree-selection icon indicating copy to clipboard operation
inquirer-file-tree-selection copied to clipboard

Split the question type and the application

Open curry684 opened this issue 5 years ago • 4 comments

Given that this is the only inquirer plugin afaics that provides a tree based question - how about splitting it up in 2 packages inquirer-tree-selection and on top of that a thin layer for the filesystem?

There are many more applications of trees than just filesystems.

curry684 avatar Jun 05 '20 08:06 curry684

@curry684 thx for your nice advice I guess sometimes using cascade may work better than tree selection. but it will be greatly appreciated if you can provide me some situation when you what to use a tree selection in terminal.

anc95 avatar Jun 10 '20 02:06 anc95

My use case is quite specific, I have a bunch of nested objects which can all be selected (leaves and nodes). Given a simple tree like this:

Root #1
    Child #1
        Subchild #1
    Child #2
Root #2
    Child #3
    Child #4
        Subchild #2

Selecting a target here is just more practical to present in a tree than with up to 3 consecutive questions, especially given that the user may not know beforehand where Subchild #2 resides in my case.

curry684 avatar Jun 10 '20 08:06 curry684

ok, I WILL wrok on it soon.

anc95 avatar Jun 11 '20 08:06 anc95

That would be awesome :) It was just a suggestion because it seems you've already done all the hard work on showing a tree, splitting it out to have the file tree just as a "data source" to a generic tree handler shouldn't be hard methinks 😄

curry684 avatar Jun 11 '20 10:06 curry684