imperative icon indicating copy to clipboard operation
imperative copied to clipboard

Interactive Selection Implementation

Open zFernand0 opened this issue 3 years ago • 5 comments

Added support for interactive menu selection

zFernand0 avatar Mar 01 '21 17:03 zFernand0

I tried this out and it seemed pretty straight forward to use:

interactive test

A couple ideas:

  • can you help with formatting? in the gif, i was struggling to get things to align, and i think other api users would as well
  • it might be cool if the api could accept an array of objects where the key became the headers

dkelosky avatar Mar 11 '21 15:03 dkelosky

Thanks for trying it Dan!

can you help with formatting? To help with the alignment, I believe I've exposes some of the console.format private functions (like formatOutput and such) Feel free to check out the `interactive-entries-2 branches 😋

it might be cool if the api could accept an array of objects where the key became the headers Cool idea. One question for you is how to handle missing keys, like: [ { header1: 123, header2: 456 }, { header1: 234, header3: 789} ]

zFernand0 avatar Mar 11 '21 15:03 zFernand0

To help with the alignment, I believe I've exposes some of the console.format private functions (like formatOutput and such) Feel free to check out the `interactive-entries-2 branches 😋

😢 ok I'll go searching for it

Cool idea. One question for you is how to handle missing keys, like: [ { header1: 123, header2: 456 }, { header1: 234, header3: 789} ]

ImperativeError!

dkelosky avatar Mar 11 '21 17:03 dkelosky

To help with the alignment, I believe I've exposes some of the console.format private functions (like formatOutput and such) Feel free to check out the `interactive-entries-2 branches 😋

😢 ok I'll go searching for it

Cool idea. One question for you is how to handle missing keys, like: [ { header1: 123, header2: 456 }, { header1: 234, header3: 789} ]

ImperativeError!

Hey @dkelosky, I removed the interactive-entries-2 branches. however object[] is now supported 😋 Here is an example of how to use the API both ways 😋 https://github.com/zowe/zowe-cli/blob/interactive-entries/packages/cli/src/zosjobs/view/interactive-jobs/InteractiveJobs.handler.ts#L36-L57

zFernand0 avatar Nov 18 '21 13:11 zFernand0

Very cool feature! Thanks for sharing an example - it looks clean.

Also, I never knew the ?? existed before!

dkelosky avatar Nov 18 '21 13:11 dkelosky

I believe that there are too many changes required for this PR to become ready for review. It might be best to close this and create a new one when/if there's any interest. Also, this could be moved to a plug-in that introduces interaction and animations to the terminal

zFernand0 avatar Feb 14 '23 10:02 zFernand0