Open bruno-f-cruz opened 2 months ago
@bruno-f-cruz This makes sense. Just trying to decide whether to toggle expansion on single-click or double-click. VS seems to do it on double-click, while VS Code does it on single-click, so both might appeal to a broader base of people.
My preference is towards a single click as it feels like there might be other stuff we might want to use the double for (e.g. opening workflow, separate window, etc...) and I can't think of a good example for the single click that is inconsistent with the expansion of the level(maybe you can?).
Relatedly, when navigating with arrows keys i am also not able to select a current level using the keyboard.
My preference is towards a single click as it feels like there might be other stuff we might want to use the double for (e.g. opening workflow, separate window, etc...)
You are right that we are already using the node double-click for a very important function, which is navigating to the selected level. This actually raises the slightly awkward point that if we use single-click to toggle expansion you will always toggle expansion just before you navigate to a level (on the first click of the double-click), which is not very pleasant.
One alternative is to always select the level on single-click, and toggle on double-click, but also not entirely satisfying. It seems better to figure out a separate alternative for these actions. With the keyboard we can make it unambiguous, since left-right arrows already expand and collapse, and we can use the return key for navigation.
Other options include using a modifier, such as Ctrl+Click to navigate, but then it feels like we might as well just press Enter.
This is not an issue in VS code only because the "folders" are not navigated into, just "files", so it's fine to have a single click to expand.
The best metaphor for us might really be the file explorer, where folders are expanded by +/- and left/right keys and navigated into by a single click and return key respectively (or a double-click like it is now).
if we use single-click to toggle expansion you will always toggle expansion just before you navigate to a level (on the first click of the double-click)
For some reason I thought there was a way to opt-in to single clicks being delayed until it's definitely not a double-click, but I must be misremembering (or maybe that's a web thing.) However I did find this which seems like a good philosophy on handling the difference:
Until you get the double-click message, there is no way to tell that the first mouse click is the start of a double click. Therefore, a double-click action should continue an action that begins with the first mouse click. For example, in the Windows Shell, a single click selects a folder, while a double click opens the folder.
It's worth noting the toolbox also has this issue and hasn't been a source of complaints AFAIK. The active area of expansion buttons is actually quite a bit bigger than they are visually, so this might be a case of overthinking a new feature.
An alternative might be to adopt the more modern chevron-style tree views. Visually-speaking, the chevrons are bigger than the old-school +/- buttons. They also lack any border making misleading implications of their exact size.
Winforms doesn't have them built in, but they're pretty easy to activate manually.
The tree can be expanded by clicking the '+'. This is ok but it tends to be a bit hard given the small size of the button. It would be interesting to prototype an interaction where the menu would expand after the group is selected instead of having to click on the plus sign