You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Expose the collapsible state of the tree item #30535
That would allow the TreeDataProvider to preserve the collapsibleState on updates.
Reacted by Sandeep Somavarapu, Ricky Hartmann, Andre Weinand, Maik Riechert, Patryk Zawadzki, Alex Wendland, Javier Pena, Holger Benl, Eric Amodio, Osman Yavuz and 1 more
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.
Reacted by Chris Dias, Alex Wendland and Javier Pena
+1
Right now it is impossible to preserve the visible state on updates (which can be very annoying for the user). Even when I'm reusing the old TreeItems, their state is replaced with the initialcollapsibleState.
Andre Weinand (@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: tree._onDidChangeTreeData.fire(<T>); to trigger a refresh of single node?
/** * 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>;
Reacted by Eric Amodio, Osman Yavuz and Beau Allison
All, please note that there is a slight change done to the events
exportinterfaceTreeViewExpansionEvent<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>>;
Activity
weinand commentedon Jul 20, 2017
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.
chrisdias commentedon Sep 24, 2017
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.
eamodio commentedon Sep 24, 2017
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.
hbenl commentedon Oct 31, 2017
+1
Right now it is impossible to preserve the visible state on updates (which can be very annoying for the user). Even when I'm reusing the old
TreeItems, their state is replaced with the initialcollapsibleState.weinand commentedon Nov 29, 2017
I'm bumping the severity of this since it makes the tree very difficult to use for users.
In addition this is a bug not a feature request.
GordonSmith commentedon Nov 30, 2017
Andre Weinand (@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:
tree._onDidChangeTreeData.fire(<T>);to trigger a refresh of single node?12 remaining items
sandy081 commentedon Feb 19, 2018
Eric Amodio (@eamodio) Christof Marti (@chrmarti) Your use cases makes sense to me.
#30535 expand and collapse events
sandy081 commentedon May 17, 2018
Added following events in the
Treeviewsandy081 commentedon May 30, 2018
All, please note that there is a slight change done to the events