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

Keep the collapse state of a tree-view #9636

Merged

Conversation

alvsan09
Copy link
Contributor

The 'collapse' state of a tree view is preserved, however setting the
hidden state to false was incorrectly cascading to collapse
false.

NOTE: The issue can be reproduced using a tree-view provided by a plugin
which uses a when clause to open it.

Fixes: #9578
Signed-off-by: Alvaro Sanchez-Leon [email protected]

What it does

Removes a condition which incorrectly caused this types of views to expand when the hidden state was set to false

How to test

  1. Use the following tree view extension example or the 'npm' scripts view.
    The extension provides a tree-view called JSON OUTLINE which is activated when the open file in editor is a json file i.e. It uses a when clause.
  2. Open a 'json' file in editor to make sure the 'JSON OUTLINE' opens.
  3. Follow the sequence as shown in the following .gif files to reproduce and then verify the fix.
    Keep-collapsed-fails

keep_collapses_works

Review checklist

Reminder for reviewers

The 'collapse' state of a tree view is preserved, however setting the
`hidden` state to `false` was incorrectly cascading to `collapse`
`false`.

Signed-off-by: Alvaro Sanchez-Leon <[email protected]>
@vince-fugnitto vince-fugnitto added tree issues related to the tree (ex: tree widget) vscode issues related to VSCode compatibility labels Jun 28, 2021
Copy link
Member

@msujew msujew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alvsan09 Thank you for your contribution.

I can confirm that the issue is present on master and is fixed by your changes:

Closing the npm container and reloading the application will re-open the container on master. Repeating the same with your changes keeps the npm container closed after reloading.

I wasn't able to find any regressions with this approach.

Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I confirmed that the tree-view part collapsed state is preserved on reloads under different conditions:

  • confirmed that collapsing all parts are preserved on reload.
  • confirmed under different conditions that parts are preserved on reload (collpased + uncollapsed).
  • confirmed that the reset workbench layout properly resets the layout, and parts explicitly collapsed by users are reset.

@vince-fugnitto vince-fugnitto merged commit 86cde4a into eclipse-theia:master Jul 7, 2021
@vince-fugnitto vince-fugnitto deleted the asl/keep-collapse-state branch July 7, 2021 15:01
@vince-fugnitto vince-fugnitto added this to the 1.16.0 milestone Jul 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tree issues related to the tree (ex: tree widget) vscode issues related to VSCode compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Preserve the collapse state of a tree-view
3 participants