Remove the counts from the search results tabs
On the search results page, each tab displays how many results have been found for the current query.
I think we could re-evaluate the result counts that appears on the tabs for a couple reasons:
-
Only the first page of result is important to fetch quickly, so if the count is greater than the PAGE_SIZE it doesn't really matter. My result has to be on the first page.
-
Is it useful? Either I get the result I want in the result list — or I don't. There is no consolation prize here. Knowing that the search found 234 results other than what I wanted isn't helpful.
-
They are costly calls — each of these calls basically have to do the full search again. The search is already call heavy (8 calls for the results, 8 calls for the counts). We are talking about a 50% reduction in overhead.
-
It causes layout flickering and I find it distracting. Whenever a count gets populated the whole tab bar has to readjust and it seems clunky.
Proposal
It would be best to remove the counts at this time until we can get to a place where there is very minimal impact on performance. Since the performance gain of removing these counts may not impact some self-managed users as much, we should consider putting this under a feature flag or admin setting.
References
Follow-up of #213595 (comment 345986927)
Solution to https://gitlab.com/gitlab-org/gitlab/-/issues/37959
/cc @JohnMcGuire