zed icon indicating copy to clipboard operation
zed copied to clipboard

Add support of auto folded directories

Open ABckh opened this issue 1 year ago • 6 comments

Added support of auto collapsed directories, for example when directory has only one directory inside we should display it as dir1/dir2 (#6935 ). Please feel free to propose better solutions, as I am new in Rust

Demo: https://streamable.com/seo3n9

Release Notes:

  • Added support for auto-collapsing directories.

ABckh avatar Feb 11 '24 16:02 ABckh

A few notes related to the UX, based on a real Java project (https://github.com/vaadin/flow/)

image

Here, flow-test-generic has the action, but it does nothing — I would expect it either to be absent, or actually folding/unfolding the directories below it, even though there's no direct children that can be folded.

image

Here .github directory has nothing foldable in the entire tree, but it has the menu item for some reason.

  • when I unfold the hierarchy of files with the dir collapsed
image

it does close the new unfolded directories, and I have to make an extra click to open the back:

image

that does not seem right to me, as the original, folded view did show those directories as "open".

SomeoneToIgnore avatar Feb 12 '24 19:02 SomeoneToIgnore

How does this interact with paths that only have an empty directory at the end? Particularly if you have say, foo/bar and foo/baz and both bar and baz are empty.

jansol avatar Feb 13 '24 13:02 jansol

How does this interact with paths that only have an empty directory at the end? Particularly if you have say, foo/bar and foo/baz and both bar and baz are empty.

it would not fold them as foo has 2 children, and bar and baz has no children. Checked in vscode, the behaviour is the same: Screenshot 2024-02-13 at 7 08 07 PM

And what is the expected behaviour?

ABckh avatar Feb 13 '24 17:02 ABckh

I don't really have experience with such functionality so no good references. Not folding seems reasonable there.

And I assume foo/bar/baz/xyz/zy where zy is empty would get folded?

jansol avatar Feb 13 '24 17:02 jansol

I don't really have experience with such functionality so no good references. Not folding seems reasonable there.

And I assume foo/bar/baz/xyz/zy where zy is empty would get folded?

Yep, it does not matter if the last dir has children or not

ABckh avatar Feb 13 '24 22:02 ABckh

I don't really have experience with such functionality so no good references. Not folding seems reasonable there. And I assume foo/bar/baz/xyz/zy where zy is empty would get folded?

Yep, it does not matter if the last dir has children or not

do you consider a empty-directory icon or hide the open-directory chevron?

xerc avatar Feb 14 '24 17:02 xerc