Add selectionGroup
to TreeItem to allow for multiselect restrictions
#157408
Labels
Milestone
selectionGroup
to TreeItem to allow for multiselect restrictions
#157408
Currently allowing multiselect on a TreeView is an all or nothing affair, and if the view contains items of different types that leads to a less than desirable user experience.
I'm starting to enable multiselect in GitLens and here is one example where I've enabled multiselect on the Stashes view
The selection now contains files & stashes, which grouped together as shown don't really make sense. And currently extensions can't limit selection in any way.
I'm proposing the addition of a new optional string
selectionGroup
(or evenselectionContext
property onTreeItem
s to allow extensions to group/bound the items that can be selected.So in the example above, I could have the "file" items have a
selectionGroup
of"files"
and the "stashes" aselectionGroup
of"stashes"
. And then based on the first selected item, you would only be able to select other items in that same group. So if I started on a "file" I could only select other files, etc.We may also want to allow the
selectionGroup
to be set to*
if there were items you wanted to allow in any group.This could be taken further, to have 2 props, one for the
selectionGroup
of the item itself, but anotherallowedSelectionGroups
which could be a string array of all the selection groups that an item could belong to.I think starting with
selectionGroup
alone gets us pretty far and imo would start there.//cc @alexr00
The text was updated successfully, but these errors were encountered: