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

Add "Expand All" Button to Tree (make "Collapse All" toggleable) #88682

Closed
niderhoff opened this issue Jan 15, 2020 · 23 comments · Fixed by #153614
Closed

Add "Expand All" Button to Tree (make "Collapse All" toggleable) #88682

niderhoff opened this issue Jan 15, 2020 · 23 comments · Fixed by #153614
Assignees
Labels
feature-request Request for new features or functionality file-explorer Explorer widget issues help wanted Issues identified as good community contribution opportunities *out-of-scope Posted issue is not in scope of VS Code
Milestone

Comments

@niderhoff
Copy link

niderhoff commented Jan 15, 2020

Hello,

as of now it is possible to conveniently collapse all tree nodes using the "collapse all" button in the action toolbar of the tree view. However, there is no button for the opposite action ("expand all").

One solution would be to make this button into a toggle. And I suppose that I am not the only one who tried to click the collapse all button again to expand the whole tree again, so it would be quite a natural user experience I suppose.

Is there already an Issue regarding this? I couldn't find one for the life of me.
Basically we need #85428 for the explorer.

@vscodebot
Copy link

vscodebot bot commented Jan 15, 2020

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

@gjsjohnmurray
Copy link
Contributor

Discussed in #66811

@isidorn
Copy link
Contributor

isidorn commented Jan 16, 2020

This is a fair feature request which I like, however we do not have it on our immediate plan. Thus assigning to backlog candidates and we might add this in the future. Thanks

@isidorn isidorn added this to the Backlog Candidates milestone Jan 16, 2020
@vscodebot
Copy link

vscodebot bot commented Jan 16, 2020

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@fbehrens
Copy link

Not so sure, but this may be useful, even for only see that there is a useful feature waiting to be implemented.

I see another possibility which may be very useful (at least to me) while avoiding unintended performance problems, when there are so many files:

When i type in the Explorer then I can quickly jump to matching files. When I then click on Enable filter on type this unfortunately shows only files in already opened folders. To me this is unexpected, as I want to filter from all my files.

Maybe when using this toggle the explorer can be populated fully for this search, while keeping the toggle state in the explorer. Thanks

@lnogueir
Copy link

lnogueir commented Oct 14, 2020

I think this is also applicable to the Variable section when debugging.
If the variable I'm analyzing is an array or object, I have to manually open every single entry. It would be much more convenient if there was an 'Expand All' button that opens each entry of the object/array.

The image below describes what I mean:
image

It would be very nice if there was an 'Expand All' button on every expandable (root) variable. In fact, this feature is present in other IDEs.

@patrickhlauke
Copy link

for what it's worth, i'd love to see this as well - the lack of an "expand all" control is real pain when flitting between large projects that all have their odd deeply-nested structures

@MightyPen
Copy link

Without this enhancement, the feature does not scale well.

Would also be nice if we could Copy the list, then Paste it into Excel (tab-delimited, not comma-delimited).
Presently we cannot Copy the list at all. :-(

GeneMi (= MightyPen)

@obar1
Copy link

obar1 commented Jul 19, 2021

+1 to this in general
and if possible add option called focus mode or something like that:

  • 2-click on a file it opens it editor panel and collapse any other folder open in the folder explorer
    image
  • 2-click on any file in the editor does the same (only the folder to which the files belongs is expanded all the rest are collapsed)

@JacksonKearl
Copy link
Contributor

Alt-Click on the Collapse-All button could toggle it to expand either one or all layers.

@JacksonKearl JacksonKearl added the help wanted Issues identified as good community contribution opportunities label Aug 13, 2021
@lramos15 lramos15 self-assigned this May 25, 2022
@vscodenpa vscodenpa added unreleased Patch has not yet been released in VS Code Insiders insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Jul 11, 2022
@rzhao271 rzhao271 modified the milestones: Backlog, July 2022 Jul 25, 2022
@lramos15 lramos15 modified the milestones: July 2022, August 2022 Jul 25, 2022
@lramos15 lramos15 reopened this Jul 25, 2022
@vscodenpa vscodenpa removed the insiders-released Patch has been released in VS Code Insiders label Jul 25, 2022
@lramos15
Copy link
Member

Reopening this as there are some UX questions for expand all left. The toggle button seems great but file systems are async. Whether it be going to a remote resource, or cyclical symlinks expansion of all nodes can be very expensive. From my understand the largest use case here is filtering?

@sguilliaci
Copy link

Tree views currently support the showCollapseAll option (Whether to show collapse all action or not).

It would be nice if there was an analogous showExpandAll option like in this issue?

@lramos15
Copy link
Member

@sguilliaci Mind sharing the use case you have in mind for expand all? I'm trying to better understand so I can implement the feature well. Wouldn't a fully expanded tree be super noisy?

@sguilliaci
Copy link

@lramos15 We'd like to expand all top-level elements one level deep. Allowing extensions to specify depth level might avoid having noisy trees. Our use case is to display the details of user's latest pipelines in their CI. Tree is paginated anyway to it limits noisiness.

Today, extensions that are willing to have expandAll must also implement collapseAll, because the showCollapseAll setting cannot be changed after the tree view creation: extensions cannot use showCollapseAll only when at least one item is collapsible.

Because the opposite of reveal() does not exist (no .collapse() API yet), and because vscode only takes TreeItemCollapsibleState into account for new items only, implementing collapseAll and expandAll is a tough task.

Note that extensions might need to know whether everything is collapsed or expanded in order to consistently populate the TreeItemCollapsibleState of new items.

@lramos15
Copy link
Member

@joaomoreno Maybe I misinterpreted this original issue. It sounds like the request is for a generalized expansion functionality that can be optionally added to any tree

@joaomoreno
Copy link
Member

joaomoreno commented Oct 18, 2022

Wouldn't a fully expanded tree be super noisy?

Not only super noisy, but costly for some and event impossible for some others. Expanding everything in the Explorer from a large workspace will be very expensive. And async data trees can be infinitely recursive, like a variable inspector showing an object with a circular dependency.

@jerviscui
Copy link

Is there an extension available for this feature now?

@sguilliaci
Copy link

@joaomoreno I understand we can't have ExpandAll on the explorer, but the request is slightly different:

  • We're requesting a button to expand 1, 2 or 3 levels deep, just like the reveal method
  • Infinite expansion is not requested
  • ExpandAll on the explorer is not requested, the request is only for extension-contributed tree views

@lramos15
Copy link
Member

lramos15 commented Dec 9, 2022

Closing this as out of scope as it seems like the root solution to this is actually #66971 since the expansion is only necessary to get search to work.

If there is an ask for extension contributed views to support expand all please file that separately as this issue seems to be a mix of explorer and all trees making it hard to tackle as they're different items.

@lramos15 lramos15 added the *out-of-scope Posted issue is not in scope of VS Code label Dec 9, 2022
@vscodenpa
Copy link

We closed this issue because we don't plan to address it in the foreseeable future. If you disagree and feel that this issue is crucial: we are happy to listen and to reconsider.

If you wonder what we are up to, please see our roadmap and issue reporting guidelines.

Thanks for your understanding, and happy coding!

@ffMathy
Copy link

ffMathy commented Feb 18, 2024

@lramos15 I think this should be reconsidered. I disagree with the premise for closing it.

For instance, in the test runner I have, there's a tag called "open", which allows me to filter tests that are currently open in the editor. I can combine that with the "failed" tag also to narrow it even further down.

Let's say that brings me to 5 different test files that I am currently working on. Because these are nested a lot, I need to manually expand all the tests to see their status at a glance while I am in "Continuous Run Mode", instead of just being able to expand their status directly.

With this in mind, I hope you can see that most people here (including those voting 👎 on the triage bot comment) have other use-cases in mind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality file-explorer Explorer widget issues help wanted Issues identified as good community contribution opportunities *out-of-scope Posted issue is not in scope of VS Code
Projects
None yet
Development

Successfully merging a pull request may close this issue.