-
Notifications
You must be signed in to change notification settings - Fork 34.8k
Labels
apiapi-finalizationfeature-requestRequest for new features or functionalityRequest for new features or functionalityinsiders-releasedPatch has been released in VS Code InsidersPatch has been released in VS Code Insiderson-testplantree-viewsExtension tree view issuesExtension 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
checkboxState
similar tocollapsibleState
which 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
}
TreeDataProvider
will have a new optional eventonDidChangeTreeCheckbox
which will fire when the checkbox of aTreeItem
is 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;
}
gjsjohnmurray, usernamehw, TylerLeonhardt, txava, Gruntfuggly and 32 more
Metadata
Metadata
Assignees
Labels
apiapi-finalizationfeature-requestRequest for new features or functionalityRequest for new features or functionalityinsiders-releasedPatch has been released in VS Code InsidersPatch has been released in VS Code Insiderson-testplantree-viewsExtension tree view issuesExtension tree view issues