-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Order tree by size #89
Comments
@wagoodman I am picking up this, do let me know if you already started working on this :) |
@darxtrix haven't started yet, have at it! |
Cool, thanks will send in a PR when done. |
@wagoodman currently the file search is implemented at complete FileTree level and not at a particular FIleNode level, so are we going to implement the sorting operation on the FileTree level or FileNode level ? A FileTree level sort will be more resourcing consuming and I guess at a particular point users are mostly interested in sorting at a FileNode (directory). |
I took this issue to be sort the current directory in the tree by size, but what you're really saying is globally sort the tree contents by size, regardless of which directory it is in? If that's true, then this is a heavier lift since it implies replacing the filetree UI (right pane) entirely. Since each directory is showing the aggregated content size, would sorting the dir contents be good enough? Later tonight I can jump back on and go into a bit more detail. |
Sorry for late reply. Timezone issues. @wagoodman I was trying communicate the same as you mentioned. We should sort at the directory level instead of full tree level. We might need to put some parameter representing the total size of the directory at the FileNode level otherwise we have to traverse down recursively each time. What are your thoughts on this ? Should we have to support both ASC or DESC sort, or the DESC is sufficient ? |
Hi @wagoodman, just following up. Any thoughts on this ? |
Sorry for the delay, you're right about needing to add a total size parameter on the The next problem to solve is ensuring that there is parity with rendering the tree string. Currently it presumes that each dir contents is sorted alphabetically (https://github.com/wagoodman/dive/blob/master/filetree/tree.go#L73), so now there will need to be a way to indicate the current sort preference and reference that here. As for ASC/DESC, I'd start with DESC for now, we can always expand it to ASC later (this becomes more of a screen realestate problem than a technical problem... the bottom hint bar that shows keybinding hints is getting full). |
Cool, I will go ahead and implement this. Thanks ! |
I see this issue was removed from "UI Enhancements". What is the status of this? Is it just low priority? Thanks. |
@wagoodman Is this abandoned? |
It seems like this specific issue is probably up for grabs, yup. |
Would (still) be greatly appreciated in 2021 :) Love the tool 👍 |
+1 |
+1, this would be super beneificial. |
I'll join the choir and say that this would be a terrific feature. Also, I would like to add that dive is a fantastic tool and I truly appreciate all the work you put in. |
Still would be a great feature in 2022 :) |
In 2023 we would also really appreciate if this is implemented |
looks like this was added in v0.11.0. If you're focused on the current layer contents pane and hit CTRL + o, it'll sort by size. |
Awesome, we did it guys. (by bumping a feature request for half a decade and absolutely no one making a single PR). Another win for open source 😎 |
FYI: This issue has been resolved by #424 |
This is a great tool.
Can you add an option to order the folder structure by size?
The text was updated successfully, but these errors were encountered: