Steps to reproduce: * Create a project with release 'Yocto Project master' * Import a few layers (3 or 4) * Go to the all layers page * Click on the filter button in the 'Layer source' column. In the filter, the information shown refers to the whole information set in the database * Select the 'Imported layers' source and click apply * Click again on the filter button in the 'Layer source' column Result: the information shown in the filter applies only to the subset currently shown on the table Expected result: filters should always show the information of the whole data set. The only exception to this rule happens when filters are applied to a set of search results. To see the proper behaviour of filters in action, run a build and visit the tasks table.
This seems to happen across Toaster. The attached screenshot (messed-filters.png) is from the project builds page. The 'All builds' counter should show 3 builds, but it shows only 1 (which is the number of builds shown by the filtered table).
Created attachment 2383 [details] messed-filters.png
The problem is that we're taking the total as the final number of objects returned after filtering them down. e.g Currently: compatible (hundreds results) -> filtered / ordered -> (tens results) -> equivalents (fewer results) -> get TOTAL Possible fix: compatible (hundreds results) -> equivalents (hundreds results) -> get TOTAL -> filtered / ordered (tens results) This is what I've done in the all machines page but it's really slow. The issue is that the equivalents is a really expensive operation which we only want to perform on the smallest dataset possible (which is usually after filters have been applied) A quick test on the layers page: Current: 176 queries run Possible fix: 482 queries run I'm wondering if we can just not have a number in the "All" part? I know that's not great but is probably a better user experience than the slow down.
Can we cheat? And by this I mean, run the queries to get the counters for the non-all options, then add the results, and display that as the counter for the 'all' option.
After some discussion, we have removed the filters from the all layers page due to performance issues.
poky baa38a14c7d3a71b650b6362641bddbe7aaa3315 (Bitbake rev: ca5124d48d306921ac0f0499762ea5867644b0ef)