Limit counts in the super sidebar
What does this MR do and why?
Caps the counts to 99 in the super sidebar's top bar. When the 99 limit is exceeded, we fall back to displaying "99+".
Screenshots or screen recordings
How to set up and validate locally
-
Enable the new nav:
-
If you don't want to mess with actual data in the GDK to hit the 99 limit properly, apply the following patch to force all counts to be a
100
:diff --git a/app/helpers/sidebars_helper.rb b/app/helpers/sidebars_helper.rb index 7e0693a0e7b4..07e42eb66f2d 100644 --- a/app/helpers/sidebars_helper.rb +++ b/app/helpers/sidebars_helper.rb @@ -299,6 +299,7 @@ def context_switcher_links # We want to avoid printing huge numbers there, so when the count exceeds TOP_BAR_COUNT_LIMIT, # we cap it to TOP_BAR_COUNT_LIMIT and append a "+" to it. def format_top_bar_count(count) + count = 100 if count > TOP_BAR_COUNT_LIMIT "#{TOP_BAR_COUNT_LIMIT}+" else
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #399114 (closed)