Skip to content

Decouple filter factory display concerns from column dependency #977

@craigmarker

Description

@craigmarker

Problem

useCategoricalFilterFactory and useDatetimeFilterFactory both accept a column argument, but the column is only used in two places:

  • getFilterSummary — reads column.label for display
  • buildTableFilterFn — reads column shape for cell value lookup

isFilterInactive and getActiveFilter (when filter is inactive) ignore
the column entirely. Tests for these methods currently pass {} with
@ts-expect-error because the TypeScript signature requires a full
ColumnConfig even when it's structurally unused.

Proposed change

Make the column argument optional or accept a partial, OR split the returned FilterHook so that display methods (getFilterSummary) and filter methods (buildTableFilterFn) can declare their column dependency explicitly.

Metadata

Metadata

Assignees

Labels

refactoringCode refactoring needed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions