Treeview: Expand single-child folders in the new tree view#47117
Treeview: Expand single-child folders in the new tree view#47117philipp-spiess merged 1 commit intomainfrom
Conversation
|
I tested it with VoiceOver as well and when expanding a directory, the name is repeated so this works great on screen readers :) |
Bundle size report 📦
Look at the Statoscope report for a full comparison between the commits 622192e and f180943 or learn more. Open explanation
|
|
Is it possible to link the individual parts of a combined path? Like <a href="/foo">foo</a> / <a href="/foo/bar">bar</a> / <a href="/foo/bar/baz">baz</a> |
It is but this would break the keyboard handling since selection is handled with the tree component and for the tree, this is only a single item (it handles space and enter unrelated to what items are rendered inside). I felt like this implementation was much easier to understand. I also don't really get why you would want to go to a directory individually since it will only show one folder anyways 😅 If you refer to this form a UI perspective, sure we can change this to whatever, but I would still recommend that we only have one logical interaction for the whole entry |
|
Yeah I guess you're right, I just thought it would be nice because VS Code does it too. But thinking about it, VS Code actually has use cases for it, like right click > new file/folder on the sub-items, which we don't have. |
taras-yemets
left a comment
There was a problem hiding this comment.
Love the new file tree!
It would be helpful to cover the main tree data manipulations with tests, WDYT?
Part of #46602
This adds single-child folder expansion to the new tree view based on how VS Code does it 🎉
Since the implementation of the tree is append-only, only a bit of bookkeeping is needed to detect single-child expansion scenarios and change the tree entries accordingly. I've left various comments in the code which should explain the implementation for the curious.
VS Code Reference
reference.mov
Test plan
Screen.Recording.2023-01-30.at.17.44.03.mov
App preview:
Check out the client app preview documentation to learn more.