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

Selecting a directory in filepicker model #659

Open
igloo1505 opened this issue Nov 2, 2024 · 2 comments
Open

Selecting a directory in filepicker model #659

igloo1505 opened this issue Nov 2, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@igloo1505
Copy link

Describe the bug
I'm not sure if this is possible with the existing model, but there doesn't appear to be any documentation on how to pick directories on the filepicker component. The component looks phenomenonal, but even setting the DirAllowed to true and the FileAllowed to false, files are still shown and directories can't be selected, at least in any obvious way. The component looks phenomenal, but I'm unsure of how to use the component to select only directories.

Setup
Please complete the following information along with version numbers, if applicable.

  • OS MacOs Sonoma
  • Shell zsh
  • Terminal Emulator iterm
  • Terminal Multiplexer tmux

To Reproduce
Steps to reproduce the behavior:

func InitialFilePicker() *model {
	fp := filepicker.New()
	fp.DirAllowed = true
	fp.FileAllowed = false
	fp.AllowedTypes = []string{}
	fp.AutoHeight = true
	fp.CurrentDirectory, _ = os.UserHomeDir()
	m := model{
		filepicker: fp,
		err: nil,
	}
	return &m
}

Source Code
See Above

Expected behavior
To be able to select directories, and to hide files in the options list.

Additional context
I'm very new to Go, but don't feel that this is a code issue, as the app in it's current state is super simple

@meowgorithm
Copy link
Member

Listen, buddy, it's called FilePicker, not DirPicker. Kidding—this is actually really acute. We'll need to think about how this would work UX-wise but it's totally something you should be able to do with the file picker.

@meowgorithm meowgorithm added the enhancement New feature or request label Nov 4, 2024
@igloo1505
Copy link
Author

igloo1505 commented Nov 4, 2024

Listen, buddy, it's called FilePicker, not DirPicker. Kidding—this is actually really acute. We'll need to think about how this would work UX-wise but it's totally something you should be able to do with the file picker.

I know... I was without a connection all night otherwise I would've taken this down, but like an hour after I posted it I was walking around and thought "Dude... you can definitely figure this out without posting an issue". I've been working with Go for like 3 days, and pretty much all of that while working offline without the ability to look at the docs, so I'm still in that mode of getting kind of flustered with the syntax or the type system and letting that balloon out of control. Feel free to close this, and I'll post a reply with whatever solution I find when I handle that tomorrow.

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
None yet
Development

No branches or pull requests

2 participants