Repository navigation
Labels
apiapi-finalizationfeature-requestRequest for new features or functionalityinsiders-releasedPatch has been released in VS Code Insiderson-testplantree-viewsExtension tree view issues
Milestone
Description
I'm all for trying to avoid webviews as much as possible, especially when tree views are hard to make work in a webview. This proposal allows for treeviews to have checkboxes:

(but better styling of course 😄)
Scenarios
- To-do list extensions
- Applying filters where an 'Edit' button drops you into the experience above where checkboxes show up
- Crafting
.gitignore's or other 'ignores' where you go down the filesystem and uncheck the files you want to ignore
Proposal
- TreeItem has new optional property called
checkboxStatesimilar tocollapsibleStatewhich takes in aTreeItemCheckBoxState:
export class TreeItem {
// ...
/**
* [TreeItemCheckboxState](#TreeItemCheckboxState) of the tree item.
*/
checkboxState?: TreeItemCheckboxState;
// ...
}
/**
* Checkbox state of the tree item
*/
export enum TreeItemCheckboxState{
/**
* Determines an item can be neither checked nor unchecked. Implies it has no checkbox.
*/
None = 0,
/**
* Determines an item is checked
*/
Checked = 1,
/**
* Determines an item is unchecked
*/
Unchecked = 2
}TreeDataProviderwill have a new optional eventonDidChangeTreeCheckboxwhich will fire when the checkbox of aTreeItemis checked or unchecked:
/**
* A data provider that provides tree data
*/
export interface TreeDataProvider<T> {
// ...
/**
* An optional event to signal that an element or root has either been checked or unchecked.
*/
onDidChangeTreeCheckbox?: Event<ChangeTreeCheckboxEvent<T>>;
// ...
}
export interface ChangeTreeCheckboxEvent {
/**
* The item that was checked or unchecked.
*/
readonly item: <T>;
/**
* Removed workspace folders.
*/
readonly newState: TreeItemCheckboxState;
}Reacted by John Murray, Alexander, TylerLeonhardt, Salvador Cabrera Lozano, Nigel Scott, Busticated, Taras Novak, Dan Čermák, D4N, Sebastian Pfitzner and 27 more
Metadata
Metadata
Assignees
Labels
apiapi-finalizationfeature-requestRequest for new features or functionalityinsiders-releasedPatch has been released in VS Code Insiderson-testplantree-viewsExtension tree view issues
Activity
TylerLeonhardt commentedon Feb 8, 2021
btw, this is essentially an alternative to #115365
vscode-triage-bot commentedon Feb 8, 2021
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!
vscode-triage-bot commentedon Feb 9, 2021
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!
vscode-triage-bot commentedon Apr 1, 2021
This feature request has not yet received the 20 community upvotes it takes to make to our backlog. 10 days to go. To learn more about how we handle feature requests, please see our documentation.
Happy Coding!
37 remaining items
alexr00 commentedon May 25, 2023
Thanks for the example Yan Zhang (@Eskibear)! I was using the
readonly state: TreeItemCheckboxState; readonly tooltip?: string;}type forcheckboxState, which is why I failed to repro.Finalize tree checkbox API
Finalize tree checkbox API (#185846)