Bug 5821

Summary: Add counters to filters
Product: [Build System, Metadata & Runtime] Toaster Reporter: Belen Barros Pena <belen.barros.pena>
Component: toasterAssignee: Ravi Chintakunta <ravi.chintakunta>
Status: VERIFIED FIXED QA Contact:
Severity: enhancement    
Priority: Medium CC: alexandru.damian, belen.barros.pena, cristiana.voicu, jessica.zhang
Version: unspecified   
Target Milestone: 1.6 M4   
Hardware: All   
OS: Multiple   
Whiteboard: GUI design available
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)
Attachments:
Description Flags
Design - Filter counters
none
Filter heading with search example none

Description Belen Barros Pena 2014-02-13 19:29:21 UTC
Created attachment 1771 [details]
Design - Filter counters

Alex Damien has suggested to add a counter for each filter, so that you know at a glance the general distribution between the different categories and the number of items that will be returned by the filter.

A nice side effect of the counter is that we can use it to disable the filter when the counter is 0, i.e. when it will return no results.

Design spec attached
Comment 1 Ravi Chintakunta 2014-03-10 02:58:04 UTC
Since the filter is applied on the search results (if there is a search string), I believe that the count that is displayed for the various filters should be after the search is applied. 

Can you please confirm? 

And if so, should the filter dialog show that it is being applied on top of the search string.
Comment 2 Belen Barros Pena 2014-03-10 11:22:02 UTC
(In reply to comment #1)
> Since the filter is applied on the search results (if there is a search
> string), I believe that the count that is displayed for the various filters
> should be after the search is applied. 
> 
> Can you please confirm? 

Yes, you are completely right. The counter should reflect the number of results that the filter will return at any given time. So if a filter is applied of top of a search string, the counter should update accordingly to show the numbers contained within the search results. 

> 
> And if so, should the filter dialog show that it is being applied on top of
> the search string.

This is a really good point. Maybe we could use the modal dialog heading. It could be like this:

Filter <number_of_search_results> {{objectname|title}} matching '<search_string>' by '{{tc.name}}

So, for example, if I searched my builds for the string '-minimal' and got 25 results, the filter heading for the Errors filter would say:

Filter 25 Builds matching '_minimal' by 'Errors'

I have attached an example.
Comment 3 Belen Barros Pena 2014-03-10 11:22:32 UTC
Created attachment 1801 [details]
Filter heading with search example
Comment 6 Belen Barros Pena 2014-03-19 15:59:34 UTC
verified in master:ac4ff568f5b2ad4f50a1b7b60797e7b797c314bb