Skip to content
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

[Request] Path input #96

Open
hasantezcan opened this issue Mar 5, 2023 · 9 comments · May be fixed by #148
Open

[Request] Path input #96

hasantezcan opened this issue Mar 5, 2023 · 9 comments · May be fixed by #148
Labels
enhancement New feature or request

Comments

@hasantezcan
Copy link

hasantezcan commented Mar 5, 2023

Is your feature request related to a problem? Please describe.
I would like to enter a folder directory input and I want it clack auto complete these folders like zsh

Describe the solution you'd like
Create a input type name with path input and handle it like zsh shell

image

I found a source related this

@hasantezcan hasantezcan added the enhancement New feature or request label Mar 5, 2023
@hasantezcan hasantezcan changed the title [Request] File input [Request] Path input Mar 5, 2023
@ulken
Copy link
Collaborator

ulken commented Mar 5, 2023

Sounds neat 👍

Wonder if this should be part of, separate or replace the suggested file select in #32?

@hasantezcan
Copy link
Author

I guess this two issue were pointed the same issue

@bjesuiter
Copy link

I would also like to have a path select component with autocomplete.
Especially, since most clis do need to work with lots of paths!

@orochaa orochaa linked a pull request Aug 24, 2023 that will close this issue
4 tasks
@orochaa
Copy link
Contributor

orochaa commented Aug 25, 2023

@bjesuiter @hasantezcan does select component from PR #148 satisfies this issue, or do you really need a input with autocomplete sugestions?

@bjesuiter
Copy link

@Mist3rBru This path input select component would be sufficient.
However, I think that this could be annoying for power users, since they have to navigate with the arrow keys.
I'd also like the option of having a path input which allows tabbing a path, like in a shell.
Since this is relatively widespread behavior, it would be nice to have such a widget.

Alternatively: Is there a possibility to extend the framework myself to do that?
For example: Does the input widget has some kind of "onInput" hook, where i could add such behavior?

@orochaa
Copy link
Contributor

orochaa commented Aug 29, 2023

@cpreston321 What do you think about I create a param type on path prompt that receives text or select, so user can choose between them, and we cover both cases?

@cpreston321
Copy link
Collaborator

@Mist3rBru I think you are on the right path. I am thinking of something that can try to fill most gaps with current p.text() input. Have you used https://fig.io/ ? They handle this with creating a neat handler postProcess: https://fig.io/docs/getting-started/generating-argument-suggestions.

Furthermore, I think we could create a plug and play for neat custom generators that are built in and what people can come up. So I think this would be a neat DX vs creating multiple different primitives.

@orochaa
Copy link
Contributor

orochaa commented Aug 29, 2023

@cpreston321 That's a great idea!

I will stick with these two primitives, and let path prompt as a "specialized" one, then for text prompt we open this possibility.

@hasantezcan
Copy link
Author

Thanks for your great work Mist3rBru. But I agree to bjesuiter this cool feature makes happy to the general user but it could annoy the power user, I expect behavior like how cd command work in zsh more likely

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Needs triage
Development

Successfully merging a pull request may close this issue.

5 participants