Skip to content
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

Add selectionGroup to TreeItem to allow for multiselect restrictions #157408

Open
eamodio opened this issue Aug 6, 2022 · 2 comments
Open

Add selectionGroup to TreeItem to allow for multiselect restrictions #157408

eamodio opened this issue Aug 6, 2022 · 2 comments
Assignees
Labels
feature-request Request for new features or functionality tree-views Extension tree view issues
Milestone

Comments

@eamodio
Copy link
Contributor

eamodio commented Aug 6, 2022

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

image

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 even selectionContext property on TreeItems 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" a selectionGroup 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 another allowedSelectionGroups 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

@alexr00 alexr00 assigned alexr00 and unassigned lramos15 Aug 8, 2022
@alexr00 alexr00 added feature-request Request for new features or functionality tree-views Extension tree view issues and removed triage-needed labels Aug 8, 2022
@alexr00 alexr00 added this to the Backlog Candidates milestone Aug 8, 2022
@VSCodeTriageBot
Copy link
Collaborator

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@VSCodeTriageBot
Copy link
Collaborator

🙂 This feature request received a sufficient number of community upvotes and we moved it to our backlog. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality tree-views Extension tree view issues
Projects
None yet
Development

No branches or pull requests

4 participants