browsr icon indicating copy to clipboard operation
browsr copied to clipboard

[Feature Request] Toggle all below

Open dhirschfeld opened this issue 1 year ago • 3 comments

In the filebrowser, clicking on a directory will expand/collapse the immediate children of that directory.

It would be great to have some way to apply that recursively for all folders below the one selected so that, with a single click/key-combo, you could expand (or collapse) everything beneath the selected folder.

dhirschfeld avatar Feb 12 '24 13:02 dhirschfeld

This is a neat idea, it might be a difficult one to implement though for a couple reasons:

  • The TUI framework browsr uses, textual, doesn't current give a way to recursively open directory nodes.
  • Each time a directory is expanded a worker process is launched to list its contents. This probably isn't a problem when you're working on a local filesystem - but could become problematic when dealing with filesystems like AWS S3 / SFTP / GitHub. I wouldn't be surprised to see this crash for the remote filesystems.

Recursive closing is actually coming soon with a new Refresh shortcut that refreshes the current directory tree to sync new/deleted files. Recursive closing is a side effect of this feature.

I will think on this one and follow up.

juftin avatar Feb 12 '24 15:02 juftin

The TUI framework browsr uses, textual, doesn't current give a way to recursively open directory nodes.

It sounds like this might be a feature request for upstream 🤔

dhirschfeld avatar Feb 12 '24 21:02 dhirschfeld

I might be wrong on that one - it looks the the parent of the DirectoryTree, Tree, might actually have some of this functionality. I'll keep digging

juftin avatar Feb 12 '24 21:02 juftin