gradio-app / gradio

Build and share delightful machine learning apps, all in Python. 🌟 Star to support our work!
http://www.gradio.app
Apache License 2.0
34.03k stars 2.58k forks source link

Refresh method for FileExplorer component #9350

Open DRomatzki opened 2 months ago

DRomatzki commented 2 months ago

Describe the solution you'd like
A file explorer component shows the local file structure, but sometimes the underlying file structure changes due to file addition, renaming and deletion. So there must be a way to toggle a refresh.

Additional context
Currently I am overcoming the refresh by toggling the "glob" or "ignore_glob" parameters in the traditional way with success, but it would be nice to have a refresh parameter/method. Looking at the source code of the FIleExplorer is could be done by adding a refresh flag to the [Key] trigger list. The problem is I can not figure out the part thereafter and how the [key] are used to update the interface.

freddyaboulton commented 2 months ago

This is related to https://github.com/gradio-app/gradio/issues/7788 imo. We can either refactor the component to refresh automatically or add a method to trigger the refresh.