build-trust / ockam

Orchestrate end-to-end encryption, cryptographic identities, mutual authentication, and authorization policies between distributed applications โ€“ at massive scale.
https://ockam.io
Apache License 2.0
4.47k stars 562 forks source link

Make `ockam tcp-inlet show` (no args) interactive by asking the user to choose from a list of tcp-inlets to show (tuify) #6478

Open nazmulidris opened 1 year ago

nazmulidris commented 1 year ago

Current behavior

When a user runs ockam tcp-inlet show without any arguments, currently they are shown an error message & help text. Here's a screenshot of this.

Image

Desired behavior

Change the behavior of this command so that it becomes interactive with the user when no arguments are passed. Note that this can only be allowed to happen if:

This what the user flow should look like in interactive mode.

1) Use the tuify crate's select_from_list() function to ask the user to select from a list of tcp-inlet aliases, at the default node. They should be able to make multiple selections. If there are none, then simply display a message saying that none exist (not an error) and exit.

2) Once the user has made their selection(s), then run show for each selected tcp-inlets, and display the results of the show command for each tcp-inlets that they've selected.

The following is a video showing a generic user flow that shows the user experience when a user is asked to choose a from a list of "things". Then an action is performed on each "thing". Finally status information is reported for each action that is performed on each "thing". Please note that this flow is not specific to this issue. Image https://asciinema.org/a/612547

Implementation details


We love helping new contributors! โค๏ธ If you have questions or need help as you explore, please join us on Discord. If you're looking for other issues to contribute to, please checkout our good first issues.

makeittotop commented 1 year ago

@nazmulidris The description looks very thorough, thanks. Can I take it up?

nazmulidris commented 1 year ago

@makeittotop That's awesome, this is all yours. Please let us know if you have any questions as you explore. You can also ask questions on the contributors discord https://discord.gg/RAbjRr3kds

makeittotop commented 1 year ago

Thanks @nazmulidris . I'll start working on it very soon as I'm very busy at work for the next few days. Thanks for the patience.

nazmulidris commented 1 year ago

@makeittotop No worries. If you don't have time, feel free to unassign yourself from this issue. You can always come back later and request this issue to work on or some other one ๐Ÿ‘๐Ÿฝ

makeittotop commented 1 year ago

No, I've time @nazmulidris . I'll submit the PR very soon

nazmulidris commented 1 year ago

@makeittotop Excellent ๐Ÿ‘๐Ÿฝ Looking forward to it

makeittotop commented 1 year ago

@nazmulidris reg: the --no-output or --quiet flags have not been passed, and,... I couldn't find --no-output flag in the ockam command global options list. Did you mean --no-input instead?

nazmulidris commented 1 year ago

@makeittotop You are right it is --no-input (https://github.com/build-trust/ockam/blob/develop/implementations/rust/ockam/ockam_command/src/terminal/mod.rs#L265). Sorry about that, I will update the other issues to reflex this fix. ๐Ÿ‘๐Ÿฝ

nazmulidris commented 1 year ago

@makeittotop You can also take a look at this PR as an example https://github.com/build-trust/ockam/pull/6480

nazmulidris commented 1 year ago

@makeittotop We made a minor UX (user experience) update to the issue today. Instead of asking a user for confirmation once they've made their selection, we can just skip that and allow them to perform the action. Since the action is not destructive, it results in a better UX for the user.

makeittotop commented 1 year ago

Thanks for the info. I'll make the necessary adjustment, and do the PR by the end of the day

On Mon, Oct 23, 2023 at 2:27 PM Nazmul Idris @.***> wrote:

@makeittotop https://github.com/makeittotop We made a minor UX (user experience) update to the issue today. Instead of asking a user for confirmation once they've made their selection, we can just skip that and allow them to perform the action. Since the action is not destructive, it results in a better UX for the user.

โ€” Reply to this email directly, view it on GitHub https://github.com/build-trust/ockam/issues/6478#issuecomment-1776049714, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABFYC7PNNY62MR27HBYZZKLYA3ONHAVCNFSM6AAAAAA56JVFHKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZWGA2DSNZRGQ . You are receiving this because you were mentioned.Message ID: @.***>