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

Bug 216150

Summary: 2nd level sorting in Search view
Product: z_Archived Reporter: Eugene Kuleshov <ekuleshov>
Component: MylynAssignee: Frank Becker <eclipse>
Status: VERIFIED FIXED QA Contact:
Severity: enhancement    
Priority: P2 CC: eclipse, mik.kersten, robert.elves, steffen.pingel
Version: unspecifiedKeywords: noteworthy, plan
Target Milestone: 3.2   
Hardware: PC   
OS: All   
Whiteboard:
Bug Depends on: 231336    
Bug Blocks:    
Attachments:
Description Flags
patch for Descending
none
mylyn/context/zip
none
Patch with 2nd level sorting
none
mylyn/context/zip
none
new Patch
none
mylyn/context/zip
none
Patch with JUnit Test
none
mylyn/context/zip
none
updated patch
none
mylyn/context/zip
none
poc with patch for 231336
none
mylyn/context/zip
none
patch for 3.2
none
mylyn/context/zip
none
updated patch none

Description Eugene Kuleshov CLA 2008-01-22 10:58:27 EST
When sorting by priority, order or tasks with the same priority is random and they should be sorted by task id/description as a 2nd level of sorting
Comment 1 Frank Becker CLA 2008-02-09 17:20:05 EST
Created attachment 89347 [details]
patch for Descending

When I look at this I found a problem.

If you use descending this was not supported for sortorder "Date Created" and "Priority".

If sorted by "Priority" the 2nd level of sorting is by "summary".

Should I start with the implementation of 2nd level of sorting.
Comment 2 Frank Becker CLA 2008-02-09 17:20:16 EST
Created attachment 89348 [details]
mylyn/context/zip
Comment 3 Frank Becker CLA 2008-02-10 16:40:07 EST
Created attachment 89358 [details]
Patch with 2nd level sorting

Please review!
Comment 4 Frank Becker CLA 2008-02-10 16:40:11 EST
Created attachment 89359 [details]
mylyn/context/zip
Comment 5 Mik Kersten CLA 2008-02-19 00:46:18 EST
Frank: this bug is about sorting in the Search view, not Task List.  However, it would be great if you could make a new bug for your additional Task List sorting, because there have been some requests for that as well.  Regarding this approach, I have a bit of a usability concern with your approach though, because some might have trouble understanding the word "Level", and because doubly-nested menus are hard to use.  What if the menu was?
* First Sort by -> full list of sorters
* Then Sort by -> full list of sorters

Btw, if you're interested in providing a patch for this bug that would be great too.  What we're after is that no matter what primary sort order is chosen in the Search view, there should be a second sort order that's by ID and description (with the same semantics as in the Task List).
Comment 6 Frank Becker CLA 2008-02-19 02:16:07 EST
 (In reply to comment #5)
Sorry my mistake :-(

I try to do both (create new bug and solve this on) but maybe this will be to late for 2.3.
Comment 7 Mik Kersten CLA 2008-02-21 21:47:05 EST
Sounds good Frank.
Comment 8 Frank Becker CLA 2008-02-23 16:41:51 EST
Created attachment 90557 [details]
new Patch

Here the Patch for Search View
Comment 9 Frank Becker CLA 2008-02-23 16:41:54 EST
Created attachment 90558 [details]
mylyn/context/zip
Comment 10 Eugene Kuleshov CLA 2008-02-24 01:07:47 EST
Frank, you may want to add tests for TaskSearchResultSorter and TaskComparator classes to make sure that backend is working properly.
Comment 11 Frank Becker CLA 2008-02-24 14:27:55 EST
Created attachment 90583 [details]
Patch with JUnit Test

Here the Version with a test.
Comment 12 Frank Becker CLA 2008-02-24 14:28:01 EST
Created attachment 90584 [details]
mylyn/context/zip
Comment 13 Robert Elves CLA 2008-04-08 19:05:24 EDT
Frank I was seeing some failing tests the other day when reviewing (sorry for not posting soon), and this patch is now a little stale. Any chance you could look into the failures and recut this patch.  Otherwise I think it's all good here aside from the need to set the title on the search dialog itself.
Comment 14 Frank Becker CLA 2008-04-09 15:48:51 EDT
Created attachment 95415 [details]
updated patch

 (In reply to comment #13)
>Otherwise I think it's all good here aside from the need to set the title on the search dialog itself.

What do you think that should be done here?
Comment 15 Frank Becker CLA 2008-04-09 15:48:54 EDT
Created attachment 95416 [details]
mylyn/context/zip
Comment 16 Mik Kersten CLA 2008-06-12 19:08:33 EDT
Need to defer.
Comment 17 Steffen Pingel CLA 2008-09-20 01:34:14 EDT
The task list already has a configuration dialog and two-level sorting. Is there any chance that some of the code could be shared between the task list and search results view? 
Comment 18 Mik Kersten CLA 2008-10-07 00:30:47 EDT
That would be great.  Also, as part of that we should make sure that the sorting and grouping setting in the Search view sticks.
Comment 19 Frank Becker CLA 2008-10-24 15:42:43 EDT
Created attachment 116103 [details]
poc with patch for 231336

this is only to save the current state until bug#231336 is resolved
Comment 20 Frank Becker CLA 2008-10-24 15:42:47 EDT
Created attachment 116104 [details]
mylyn/context/zip
Comment 21 Steffen Pingel CLA 2009-01-27 03:02:28 EST
I'll move this for 3.2 for now. There are some fixes and refactorings I want to take a look at before we make further changes to the sorting implementation (bug 261998).
Comment 22 Frank Becker CLA 2009-03-30 15:52:09 EDT
Created attachment 130300 [details]
patch for 3.2
Comment 23 Frank Becker CLA 2009-03-30 15:52:15 EDT
Created attachment 130301 [details]
mylyn/context/zip
Comment 24 Mik Kersten CLA 2009-04-13 18:04:36 EDT
Adding to plan since this is a relevant feature for 3.2.
Comment 25 Steffen Pingel CLA 2009-05-08 02:12:22 EDT
Created attachment 134922 [details]
updated patch
Comment 26 Steffen Pingel CLA 2009-05-08 02:14:07 EDT
Thanks Frank! Based on your patch I have generalized the persistence of the sorting settings to a memento to get rid of some of the code duplication. I have committed the updated patch. Please take a look at my changes and let me know if that makes sense.
Comment 27 Frank Becker CLA 2009-05-08 15:55:38 EDT
(In reply to comment #26)
> Thanks Frank! Based on your patch I have generalized the persistence of the
> sorting settings to a memento to get rid of some of the code duplication. I
> have committed the updated patch. Please take a look at my changes and let me
> know if that makes sense.
> 

Looks good!