-
Notifications
You must be signed in to change notification settings - Fork 815
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
Refreshing the DirectoryTree without resetting the selected node. #3574
Comments
Polling the filesystem can be quite inefficient. A better approach might be to use watchdog which uses an OS level API to get notifications when the filesystem changed. Either way though, I think an incremental |
Wouldn't https://textual.textualize.io/widgets/directory_tree/#textual.widgets._directory_tree.DirectoryTree.reload_node be most of an incremental reload? |
How do you actually use Do we need a mechanism for "given a path contained within the tree, return the corresponding TreeNode"? I can see that on |
Thanks a lot, I did not know about watchdog that is very useful. For our case, partial refreshing of the DirectoryTree is nice. However the primary change that would be useful for us is to maintain the currently selected node after refreshing the entire directory tree. At present, if I understand correctly on a reload the gui is set back to the root node being selected - so the user must manually click to return to the node they had selected. If it is possible, it would be nice to add an option such that the DirectoryTree is reloaded such that the currently selected node is not set back to root. |
Replaced with #4056 |
Don't forget to star the repository! Follow @textualizeio for Textual updates. |
We are really enjoying using the textual for our project and are impressed with its ease of use and powerful features.
Currently we have a DirectoryTree widget that is integral to the project. If a file or folder is deleted through the filesystem (i.e. not through our application), we would like to ensure the DirectoryTree in the app is refreshed to reflect this.
Currently the
reload
function serves this purpose, and it is sufficient for us to call every now and then (e.g. when a file or folder is clicked on the DirectoryTree). However, the only problem is that thereload
function moves the currently selected folder back to the root folder. Is there a way to callreload()
without changing the currently selected folder, and avoid having the dropdown structure of entire tree reset?The text was updated successfully, but these errors were encountered: