Skip to content

Conversation

frano-m
Copy link
Contributor

@frano-m frano-m commented Aug 14, 2025

Closes #634.

This pull request refactors and extends the filtering adapter logic for TanStack tables, introducing support for range filters and category groups. The changes improve how category filters are constructed, making the codebase more modular and flexible for different filter types.

Filter adapter enhancements

  • Added support for range filters by introducing the isRangeCategoryConfig type guard and handling VIEW_KIND.RANGE in the filter application logic, enabling direct value assignment for numeric ranges. [1] [2] [3]
  • Refactored the filter-building utilities to support category groups and both select and range category views, allowing for more complex and grouped filter UIs. [1] [2] [3] [4]

Type and interface updates

  • Introduced ColumnFiltersTableMeta interface to extend TanStack's table meta with optional categoryGroups, and updated relevant imports and usages.

These changes make the filter system more robust and ready for advanced use cases involving both grouped and range-based filters.

image

@frano-m frano-m requested review from NoopDog and Copilot August 14, 2025 10:48
@frano-m frano-m changed the title Fran/634 column range filtering feat: update columnfiltersadapter to handle grouping of column filters (#632) Aug 14, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request refactors the TanStack table filtering adapter to support range filters and category groups, enabling more flexible filter configurations. The changes introduce support for both select and range category views while maintaining backward compatibility.

  • Added range filter support with direct value assignment for numeric ranges
  • Introduced category groups functionality to organize filters into logical sections
  • Refactored filter building utilities to handle both grouped and ungrouped filter configurations

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
utils.ts Refactored filter building logic to support category groups and range filters, with new mapping functions for different view types
types.ts Added ColumnFiltersTableMeta interface to extend TanStack table meta with optional categoryGroups property
columnFiltersAdapter.tsx Updated filter adapter to handle range filters with direct value assignment and added VIEW_KIND parameter
typeGuards.ts Created new type guard function to identify range category configurations

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@frano-m frano-m changed the title feat: update columnfiltersadapter to handle grouping of column filters (#632) feat: update columnfiltersadapter to handle range category filtering (#634) Aug 19, 2025
@frano-m frano-m force-pushed the fran/634-column-range-filtering branch from 49d4f96 to 80a093f Compare August 19, 2025 00:26
@frano-m frano-m marked this pull request as ready for review August 19, 2025 01:04
Copy link
Collaborator

@NoopDog NoopDog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@NoopDog NoopDog merged commit 5b5a5b8 into main Aug 19, 2025
2 checks passed
@frano-m frano-m deleted the fran/634-column-range-filtering branch August 19, 2025 01:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update ColumnFiltersAdapter to handle range category filtering
2 participants