Skip to content

Selecting a folder in FileExplorer #11390

@GrunyD

Description

@GrunyD
  • I have searched to see if a similar issue already exists.

Our specific problem is that we need to select zarr and ome-zarr structures which are basically folders with a nested structure of folders and files. Our specific need is to select a single folder.

Current gradio solution is to open the folder and click "." folder:

Image

I had to got through the issue #9835 to figure out how it works. This solution is very unsatisfying, bordering with blocking the usage of gradio. The fact that a user and a developer of gradio (I am assuming its a developer) both missed the fact that you have to click the inner "." folder proves my point about how intuitive it is. I apologize if I am wrong and just didn't find the proper way to do it.

Also another problem arises as mentioned at the end of the #9835. If you let people to only see folders, it is not possible to select them.

Image

I suggest switching the behavior.
For file_count="single" you have a checkbox next to a folder, if you select that, it will only select the folder.
For file_count="multiple" the behavior of the checkbox doesn't change, but you gain the option inside the folder to select everything (instead of the "." folder/file/option).

This leads to

  1. more predictable behavior as the checkbox behaves the same for both files and folders
  2. preventing undesirable behavior like the post at the end of #9835 where you can not select a single folder if you display only folders.
  3. Better user experience as choosing one folder is definitely more usual case than choosing all contents of a folder

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions