Skip to content

Expose the collapsible state of the tree item #30535

Closed

Description

That would allow the TreeDataProvider to preserve the collapsibleState on updates.

Activity

  1. added
    feature-request
    on Jul 13, 2017
  2. weinand commented on Jul 20, 2017

    @weinand
    Contributor

    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.

  3. chrisdias commented on Sep 24, 2017

    @chrisdias
    Contributor

    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.

  4. eamodio commented on Sep 24, 2017

    @eamodio
    Contributor

    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.

  5. hbenl commented on Oct 31, 2017

    @hbenl

    +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 initial collapsibleState.

  6. weinand commented on Nov 29, 2017

    @weinand
    Contributor

    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.

  7. added
    bug
    important
    and removed
    feature-request
    on Nov 29, 2017
  8. GordonSmith commented on Nov 30, 2017

    @GordonSmith

    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?

  9. 12 remaining items

  10. sandy081 commented on Feb 19, 2018

    @sandy081
    Member

    Eric Amodio (@eamodio) Christof Marti (@chrmarti) Your use cases makes sense to me.

  11. added a commit that references this issue on May 15, 2018
  12. sandy081 commented on May 17, 2018

    @sandy081
    Member

    Added following events in the Treeview

    /**
     * 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>;
  13. sandy081 commented on May 30, 2018

    @sandy081
    Member

    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>>;
  14. locked and limited conversation to collaborators on Jul 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

feature-requeston-testplantree-views

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions