feat(FilterSummaryBar): active-filter summary bar for data grids - #400
feat(FilterSummaryBar): active-filter summary bar for data grids#400ebellamy-bh wants to merge 2 commits into
Conversation
Ported from waggleline's grid pages: 'X of Y records — N filters active · Clear all', hidden while idle unless showWhenIdle, tinted with the primary accent when narrowing. Teal hardcodes become primary tokens, FontAwesome becomes lucide, and every visible string is overridable for i18n.
There was a problem hiding this comment.
Pull request overview
Adds a new FilterSummaryBar component to the design system to display an always-on “filtered results” summary for grids/lists (filtered/total counts, active filter count, and search state), with an optional idle display mode.
Changes:
- Introduces
FilterSummaryBarReact component with styling, accessibility semantics (role="status"), and configurable labels. - Adds unit tests and Storybook stories (including an interactive demo) for the new component.
- Exposes the component via package exports (
src/index.ts) and build entrypoints (tsup.config.ts).
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tsup.config.ts | Adds build entrypoint for FilterSummaryBar. |
| src/index.ts | Re-exports FilterSummaryBar from the public package API. |
| src/components/FilterSummaryBar/index.ts | Barrel export for component + props. |
| src/components/FilterSummaryBar/FilterSummaryBar.tsx | New summary bar component implementation and public props. |
| src/components/FilterSummaryBar/FilterSummaryBar.test.tsx | Unit tests covering idle/active states, pluralization, clear action, and label overrides. |
| src/components/FilterSummaryBar/FilterSummaryBar.stories.tsx | Storybook stories including interactive “add a filter” example. |
Suppressed comments (1)
src/components/FilterSummaryBar/FilterSummaryBar.tsx:125
- The combined state renders a hardcoded "+ search" suffix, which is user-visible and not overridable for i18n (and it also differs from the
searchActiveLabeltext used in the search-only state).
{hasSearchText && activeFilterCount === 0 && (
<> — {searchActiveLabel}</>
)}
{hasSearchText && activeFilterCount > 0 && <> + search</>}
{!isFiltering && showWhenIdle && <> — {allVisibleLabel}</>}
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Deploying ui with
|
| Latest commit: |
6b05cd1
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://0300958e.ui-6d0.pages.dev |
| Branch Preview URL: | https://feat-filter-summary-bar.ui-6d0.pages.dev |
…rops for full i18n coverage
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.
Suppressed comments (3)
Previously missed (3) — in code that hasn't changed since the last review.
src/components/FilterSummaryBar/FilterSummaryBar.tsx:84
- The live region is missing explicit
aria-liveconfiguration. Elsewhere in the codebase, status regions typically specifyaria-live(and oftenaria-atomic) to ensure consistent announcements (e.g.DropzoneOverlay.tsx:97-99,ConnectionStatus.tsx:386-389). Adding these here makes the announcement behavior more predictable across screen readers.
<div
ref={ref}
role="status"
className={cn(
src/components/FilterSummaryBar/FilterSummaryBar.tsx:148
- Add a
displayNamefor the forwarded-ref component. Many components in this repo set it for better DevTools output (e.g.Avatar.tsx:122,Alert.tsx:106).
});
src/components/FilterSummaryBar/FilterSummaryBar.tsx:140
- The "Clear all" button doesn’t include the project’s standard
focus-visiblering styles, which can make keyboard focus hard to see. Other inline icon buttons include these classes (e.g.Alert.tsx:91-95,CountBadge.tsx:43-44).
className={cn(
'ms-auto flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium transition-colors',
'text-primary-700 hover:bg-primary-500/15 dark:text-primary-300'
)}
Ports the bar that anchors every filtered waggleline grid into the design system: "1,204 of 8,911 records — 3 filters active · Clear all".
What it does
filteredCount/totalCount/activeFilterCountwith correct pluralization, plus search-only and filters-plus-search statesshowWhenIdle(then reads "all records visible" with no clear action)role="status"announces changes to assistive techrecordsLabel,filterLabel/filtersLabel,clearLabel, …)Screenshots
Provenance
Port of
waggleline/app/imports/ui/components/filters/FilterSummaryBar.tsx(used across its AG Grid pages); teal hardcodes → primary tokens, FontAwesome → lucideFilter/X,ml-auto→ logicalms-auto.Testing
typecheck/lint/format/rtl:scanclean; combined batch suite 651/651