pragmatic-streamlit / streamlit-file-browser

Streamlit file browser
102 stars 17 forks source link

Navigate to parent directory and select directories instead of files #34

Closed PeterLappo closed 5 months ago

PeterLappo commented 5 months ago

Hi, I want to navigate and select a directory. I also want to navigate up to the parent directory. Ideally i don't want to show the files. Is this possible? If not can you give me some pointers to the code so that i can change it? Thanks Peter

y805939188 commented 5 months ago

Hi, I want to navigate and select a directory. I also want to navigate up to the parent directory. Ideally i don't want to show the files. Is this possible? If not can you give me some pointers to the code so that i can change it? Thanks Peter

Hi, I have added this feature in version 3.2.21-alpha.1. You can try it in this way:

    event = st_file_browser(
        {your_path},
        file_ignores={ "retain_parent": True, "rules": ("a.py", re.compile(".*.txt")) },
        # file_ignores=("a.py", "a.txt", re.compile(".*.pdb")),
        key="A",
        show_choose_file=True,
        show_choose_folder=True,
    )
PeterLappo commented 5 months ago

Hi, Thanks for that. It doesn't display the parent directory. Possibly a MacOs thing. When I select the folder i don't get an event, only get events on files. Will try alternative solutions.

y805939188 commented 5 months ago

Hi, Thanks for that. It doesn't display the parent directory. Possibly a MacOs thing. When I select the folder i don't get an event, only get events on files. Will try alternative solutions.

@PeterLappo Sorry, I forgot to compile the front-end code last time 😂 . The current version of "3.2.22" should be good.

PeterLappo commented 5 months ago

I got something working with dynamic drop down menus. Not great but it works and occupies less screen space. Ideally I need a popup to choose a directory but I appreciate your efforts. Thanks Sent from my iPhoneOn 23 Apr 2024, at 15:48, Shinn @.***> wrote:

Hi, Thanks for that. It doesn't display the parent directory. Possibly a MacOs thing. When I select the folder i don't get an event, only get events on files. Will try alternative solutions.

@PeterLappo Sorry, I forgot to compile the front-end code last time 😂 . The current version of "3.2.22" should be good.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>