Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 344885

Summary: "Remove Invisible" removes collapsed elements in context preview page
Product: z_Archived Reporter: Sam Davis <sam.davis>
Component: MylynAssignee: Mylyn Inbox <mylyn-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: shawn.minto, steffen.pingel
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Sam Davis CLA 2011-05-05 15:06:47 EDT
# Activate a task and open the context preview page
# Move the slider all the way to the left
# Click collapse all in the top right
# Click remove invisible
# All the collapsed elements have been removed

This is not related to the collapse all button as I've seen this before that button existed, but it doesn't seem to happen when collapsing only a few elements. However if you collapse all and then expand a couple of things, the expanded things will not be removed, but the collapsed ones will.
Comment 1 Steffen Pingel CLA 2011-05-07 20:31:49 EDT
This is the intended behavior. Literally all elements that are not nodes in the tree that are not visible (e.g. collapsed) are removed. Shawn, please reopen if this is incorrect.
Comment 2 Sam Davis CLA 2011-05-09 12:03:08 EDT
Collapsed elements are not listed in the list of invisible elements, which is what you would expect to be removed.

My use case was that I wanted to make sure that only certain projects were in my context, so I clicked collapse all so that I could easily see which projects were there and then clicked remove invisible, not expecting that it would remove all classes and methods. Also, as I mentioned above, this behaviour is not consistent - if you only collapse one project its contents are usually not removed.
Comment 3 Shawn Minto CLA 2011-05-09 13:04:58 EDT
I agree with both of you.  This is the expected behavior, but I can see how this could be unexpected for the user.  Maybe we should consider adding more text to the dialog to explain tis and maybe provide a way that it can be "fixed" (via expand before remove).  THoughts?
Comment 4 Sam Davis CLA 2011-05-09 14:15:43 EDT
Is there a reason to have this behaviour? I don't see why you would want it.
Comment 5 Sam Davis CLA 2011-05-19 13:13:38 EDT
Reopening this for 3 reasons:

# The current behaviour is inconsistent. Sometimes collapsed elements are removed and sometimes not.
# Removing collapsed elements is a bad idea anyway IMO. It's unneeded since you can already right click to remove individual elements, and it messes up the most likely workflow which is to collapse all and individually remove some projects, and then click remove invisible (everything gets removed in this case, which is not what you want after you explicitly decided which projects to not remove).
# Until the above issues are fixed, there should at least be a message in the dialog and/or tooltip indicating that collapsed elements will [may] also be removed, as this is totally unexpected.
Comment 6 Sam Davis CLA 2012-06-19 17:30:24 EDT
(In reply to comment #1)
> This is the intended behavior. Literally all elements that are not nodes in the
> tree that are not visible (e.g. collapsed) are removed. Shawn, please reopen if
> this is incorrect.

The button is called "Remove Invisible" and appears in a section called "Invisible Elements," which does not list elements that are collapsed in the tree above. I can't see how removing anything other than what is listed in the Invisible Elements section would be expected by the user.
Comment 7 Sam Davis CLA 2014-01-29 17:19:52 EST
Marking WONTFIX because this is low priority.