Skip to content
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

API to programatically expand/collapse tree view #88219

Open
JarrettSpiker opened this issue Jan 7, 2020 · 7 comments
Open

API to programatically expand/collapse tree view #88219

JarrettSpiker opened this issue Jan 7, 2020 · 7 comments
Assignees
Labels
api feature-request Request for new features or functionality tree-views Extension tree view issues
Milestone

Comments

@JarrettSpiker
Copy link

Request

An API on TreeView which allows extensions to expand or collapse their contributed views within the view container. That is, expand/collapse the view itself, not the items in the view.

Example Use Case

If I have a view container with multiple contributed views, not all views may be relevant all the time. It would be nice to be able to close the irrelevant views, to give more screen real estate to the relevant ones.

For example, maybe one view shows the definition of the currently selected word in the editor: if nothing in the editor is selected, then ideally this view could just be collapsed since it is providing no value to the user. When something is selected, it should be possible for the extension to re-expand the view.

@vscodebot
Copy link

vscodebot bot commented Jan 7, 2020

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@jrieken jrieken assigned alexr00 and unassigned jrieken Jan 7, 2020
@alexr00 alexr00 added api tree-views Extension tree view issues labels Jan 8, 2020
@alexr00 alexr00 added this to the On Deck milestone Jan 8, 2020
@ravipal
Copy link

ravipal commented Apr 30, 2020

In Docker extension we have several views and some of them are used by only the advanced users. So we would like to collapse those views to make room for other commonly used views. We need this feature too.

@asifkareem03
Copy link

Hai,

Any one got a solution for this??

@ArturoDent
Copy link

Is there no way to programmatically focus the view header? By that I mean the line with the header title and typically a refresh button, etc.

@alexr00
Copy link
Member

alexr00 commented May 10, 2022

You can focus the tree, not the view title with the command ${viewId}.focus.

@ArturoDent
Copy link

If you could focus the view title, then list.collapse closes that view. You can focus the view title with Shift+Tabs but I don't see how that can be performed in an extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api feature-request Request for new features or functionality tree-views Extension tree view issues
Projects
None yet
Development

No branches or pull requests

6 participants