Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 323525 - clearing filter in Task List removes selection
Summary: clearing filter in Task List removes selection
Status: CLOSED MOVED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 328807
Blocks:
  Show dependency tree
 
Reported: 2010-08-24 13:18 EDT by Ian Bull CLA
Modified: 2010-10-27 06:45 EDT (History)
3 users (show)

See Also:


Attachments
change that does not collapse nodes on clear (2.04 KB, patch)
2010-10-27 06:19 EDT, Steffen Pingel CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Bull CLA 2010-08-24 13:18:08 EDT
I often use the quick filter dialog in my Task List to find specific bugs (tasks).  Once I find the bug I often want to see the sub-items, however, they are filtered (they didn't match the filter criteria).  So I clear my filter, but then my task list collapses and the item I selected is no longer selected.  

This means that the filter is useless if I want to see sub-items, but with a few hundred tasks it's difficult to find things without this control.
Comment 1 Steffen Pingel CLA 2010-08-24 14:11:09 EDT
Strange, I thought I saw that working not so long ago. We'll need to investigate if this is a regression.
Comment 2 Steffen Pingel CLA 2010-10-27 06:18:44 EDT
After investigating further I suspect that this is caused by an inconsistency in the platform: When the search field is cleared FilteredText.clearText() is invoked which sets the text of the search field to "" and invokes textChanged(). This causes a modification event which invokes textChanged() again.

The second invocation of textChanged() causes the narrowingDown flag to get set to true although this is not correct. The subsequent refresh then retains the expansion state of the tree and hence the selection. 

You can verify that by filtering in the new project wizard: search for "J" and then clear. Several nodes will stay expanded although they should have probably been collapsed which is what happens if you press backspace.

In theory this would also work for the task list tree since it extends FilteredTree. The Task List has an optimization though to only invoke textChanged() when the text actually changes and hence all nodes are correctly collapsed on clear which causes the current selection to get lost.

To fix this I see three possibilities:
* Change the refresh job in FilteredTree to not collapse nodes that have selected nodes when clearing.
* Restore the selection after clearing which might cause some flickering.
* Avoid collapsing on clear which is what platform does but I am not sure that is intentional.

Boris, do you have any thoughts on this?
Comment 3 Steffen Pingel CLA 2010-10-27 06:19:26 EDT
Created attachment 181817 [details]
change that does not collapse nodes on clear
Comment 4 Eclipse Webmaster CLA 2022-11-15 11:45:08 EST
Mylyn has been restructured, and our issue tracking has moved to GitHub [1].

We are closing ~14K Bugzilla issues to give the new team a fresh start. If you feel that this issue is still relevant, please create a new one on GitHub.

[1] https://github.com/orgs/eclipse-mylyn