Skip to content

[Feature] Add active filter count badge to filter icon #1728

Description

@Uday9909

Current Behavior

The filter icon in table toolbars (UniversalFilter component) shows no indication of how many filters are currently active. Users have to open the filter dropdown to see if any filters are applied.

Desired Behavior

Show a badge on the filter icon displaying the number of active (non-default) filters so users can see at a glance whether filters are applied without opening the dropdown.

Implementation

Wrap the filter icon (FilterIcon / TooltipIcon) with a MUI Badge component that displays the count of active filter values (where the value is not "All"). This was previously implemented in the feat/datatable-toolbar branch and then removed. The active count can be derived from selectedFilters as:

const activeFilterCount = Object.values(selectedFilters).filter(
  (value) => value !== 'All'
).length;

Acceptance Tests

  • Badge shows number of active filters on the filter icon
  • Badge is invisible/hidden when no filters are active
  • Badge count updates when filters are applied or cleared
  • Works across all table pages that use UniversalFilter

Mockups


Contributor Guide

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions