-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
Expose the collapsible state of the tree item #30535
Comments
For me it would even be sufficient to preserve the expand/collapse state that the user has changed. So the TreeItem.collapsibleState would be only used for the initial state. |
This would let me run an expensive refresh operation in the docker extension only when the parent node is expanded. right now it runs even if the parent node is collapsed because I can't see the state of the node. |
Same for me with GitLens. Though ideally I'd want an state change event so that I could hook/unhook other handlers (file system watchers) only if needed. |
+1 |
I'm bumping the severity of this since it makes the tree very difficult to use for users. |
@weinand If you also made label + collapsibleState refresh their UI when they are written to, then it would allow a simple way to refresh a single node. Or support: |
Looks like this issue contains multiple requests
Instead of hijacking this for multiple issues, I have created issues for each. Coming back to this issue, IMO, this is a feature request to expose the view state of the Tree. Issue #39505 is a bug and tagged important. Please let me know if this feature is still needed after fixing issues #39505 and #34789. If so, please provide the use cases. Otherwise, I would prefer to close it. @weinand FYI |
As I do not see any scenarios to support this request after other fixes/enhancements done to custom view, I am inclined to close this. If there is still need of it, please reopen it with the supporting use cases. Thanks. |
I would vote to re-open this. GitLens has certain nodes that when expanded, start file watchers and other event hooks, but currently I have no way to undo them if the node is collapsed. These leads to wasted performance, battery, etc |
The Docker extension has |
Added following events in the /**
* Event that is fired when an element is expanded
*/
readonly onDidExpandElement: Event<T>;
/**
* Event that is fired when an element is collapsed
*/
readonly onDidCollapseElement: Event<T>; |
All, please note that there is a slight change done to the events export interface TreeViewExpansionEvent<T> {
/**
* Element that is expanded or collapsed.
*/
element: T;
}
/**
* Event that is fired when an element is expanded
*/
readonly onDidExpandElement: Event<TreeViewExpansionEvent<T>>;
/**
* Event that is fired when an element is collapsed
*/
readonly onDidCollapseElement: Event<TreeViewExpansionEvent<T>>; |
That would allow the TreeDataProvider to preserve the collapsibleState on updates.
The text was updated successfully, but these errors were encountered: