Add count to Work items sidebar nav item

What does this MR do and why?

This MR adds count back to Work items nav. It mimics the issue count except

  • Epics are now consider in groups work items list
  • Requirements are not considered for group or project
  • If records are above 10000, it will just show 10k

Limitations

  • The count does not automatically changes after work items is created/moved/deleted.

References

Screenshots or screen recordings

Project Group
No records Screenshot 2026-04-02 at 11.56.23 PM.png Screenshot 2026-04-02 at 11.56.43 PM.png
Records below 1000 Screenshot 2026-04-02 at 11.57.15 PM.png Screenshot 2026-04-02 at 11.59.27 PM.png
Records above 1000 Screenshot 2026-04-03 at 12.00.58 AM.png
Records above 10000 Screenshot 2026-04-07 at 11.34.58 PM.png

How to set up and validate locally

Prerequisites

  1. Enable the feature flag to show the count show_work_items_sidebar_count

Steps to reproduce

  1. Create an empty group and project
  2. Create 10000 work items
  3. Verify the count

Steps to test 10K+ records (no data generation needed)

  1. In app/graphql/types/namespaces/sidebar_type.rb, temporarily hardcode open_work_items_count to return 10010:

    def open_work_items_count
      return unless Feature.enabled?(:show_work_items_sidebar_count, context[:current_user])
    
      # TEMPORARY: hardcoded for reviewer testing — always returns 10010
      # (above the 10,000 limit, so the sidebar should display "10k+")
      10010
    end
  2. Enable the feature flag show_work_items_sidebar_count

  3. Navigate to any group or project sidebar

  4. Verify the Work Items nav item displays "10k+"

  5. Revert the hardcoded change after testing

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #593599

Edited by Rajan Mistry

Merge request reports

Loading