Bug 7152

Summary: Layer, target and machine suggestions should be sorted in alphabetical order
Product: [Build System, Metadata & Runtime] Toaster Reporter: Belen Barros Pena <belen.barros.pena>
Component: toasterAssignee: Michael Wood <michael.g.wood>
Status: VERIFIED FIXED QA Contact: Cristina Agurida <cristina-danielax.agurida>
Severity: normal    
Priority: Medium CC: alexandru.damian, belen.barros.pena, bluelightning, bogdanx.a.voiculescu, cristiana.voicu, michael.g.wood
Version: unspecified   
Target Milestone: 1.9 M3   
Hardware: x86   
OS: Multiple   
Whiteboard: project configuration page
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)
Attachments:
Description Flags
Documentation for sorting typeaheads and table result
none
Sorting typeaheads documentation none

Description Belen Barros Pena 2015-01-16 10:42:59 UTC
Ideally, we should sort them like this:

1. First should come any entries that start with the typed string, sorted in ascending alphabetical order

2. After those, we show any entries that contain the typed string in another position, also sorted in ascending alphabetical order

If the above is too complicated, we can simply sort the entries that contain the typed the string in ascending alphabetical order.
Comment 1 Alexandru Damian 2015-03-09 17:10:41 UTC
Pushed for review on:

http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=adamian/20150309_bugz
Comment 2 Belen Barros Pena 2015-03-10 16:30:37 UTC
Had a look at this, but we need a further tweak: we need to list first the "starts with" matches (sorted in alphabetical order), followed by the "contains" matches (also in alphabetical order).
Comment 3 Alexandru Damian 2015-03-17 10:28:57 UTC
merged in master
Comment 4 Belen Barros Pena 2015-03-18 19:07:01 UTC
I don't think this is fully working. In a project with the core layers only, if I type "minimal" in one of the target fields, 'xorg-minimal-fonts" shows up before "core-image-minimal".
Comment 5 Alexandru Damian 2015-03-19 17:43:08 UTC
"xorg-minimal-fonts" come in front of "core-image-minimal" because "minimal" is closer to the start of the match word (4 chars prior compared to 11 chars prior).

So the order of the sort is:
- closer to the front, it appears first
- on same string position, order is alphabetical

Did I misunderstand what we the desired behaviour is ?
Comment 6 Belen Barros Pena 2015-03-20 14:49:04 UTC
(In reply to comment #5)
> "xorg-minimal-fonts" come in front of "core-image-minimal" because "minimal"
> is closer to the start of the match word (4 chars prior compared to 11 chars
> prior).
> 
> So the order of the sort is:
> - closer to the front, it appears first
> - on same string position, order is alphabetical

I see.

> 
> Did I misunderstand what we the desired behaviour is ?

I should have explained properly. 

Basically, the whole thing is more binary than your implementation. We make the assumption that users are most likely to type the beginning of whatever it is they are looking for. So we first show the stuff that starts with the search string, sorted in alphabetical order. 

After that, we show stuff that contains the search string, in any other position, independently of how closer to the front it is. And all those are sorted as a single block, also in alphabetical order. 

This is because although it is reasonable to assume that you will tend to type the start of what you are looking for, it is probably not so that you are more likely to want stuff that contains the typed string closer to the front when it does not start with it. 

The other issue with the sorting based on "closer to the front" is that it appears random from the outside. 

I hope this explains.
Comment 7 Stephen K Jolley 2015-04-06 17:55:23 UTC
Alex,

It appears the question has been answered.  Please set this back to NEEDINFO it that is not the case.

Thanks,

Stephen
Comment 8 Alexandru Damian 2015-05-28 15:10:14 UTC
Moved to New so anybody can take it.
Comment 9 Michael Wood 2015-06-22 11:06:56 UTC
Since the typeahead url/view has now been removed I don't think it is now possible to customise the searching algorithm for just the typeaheads behaviour.
Comment 10 Belen Barros Pena 2015-06-30 09:33:41 UTC
(In reply to comment #9)
> Since the typeahead url/view has now been removed I don't think it is now
> possible to customise the searching algorithm for just the typeaheads
> behaviour.

Can I ask why has this been removed? The last usability testing we ran showed how useful this component is, but also how important it is to fine tune its behaviour to make sure we provide the most meaningful results to users. 

Can we please bring the typeahead back, and start working on refining the suggestions it provides?
Comment 11 Michael Wood 2015-06-30 10:01:24 UTC
Question for Alex
Comment 12 Tiago Ramos 2015-07-17 14:51:54 UTC
Created attachment 2596 [details]
Documentation for sorting typeaheads and table result

This document describes the behavior when showing and sorting typeahead suggestions and the results of any Toaster table after a search.
Comment 13 Belen Barros Pena 2015-08-03 16:58:22 UTC
All the information required should be in the attached design document.
Comment 14 Tiago Ramos 2015-08-04 17:58:33 UTC
Created attachment 2625 [details]
Sorting typeaheads documentation
Comment 15 Michael Wood 2015-08-12 17:17:43 UTC
New typeahead widget now in master. This is sorted alphabetically for the match 'starting with' and the secondary results 'contains'.

poky aff29d2cd837df90a2897b9b75753e4af30f132e 
(Bitbake rev: 31a8ae7909347f7b6edde5bbdf02b86dc1b32ed0)
Comment 16 Cristina Agurida 2015-10-20 09:22:43 UTC
Verified on master: a9053ac0829eb01f6f002587854d01e47a78e6f0