Skip to content
Source
Sign inSign up
TanStack/table

fix(table-core): honor explicit global filter opt-in #6439

MergedKevinVandymerged 2 commits intobeta fromrefs/pull/6439/headmerged by KevinVandy

KevinVandycommented

Summary

  • let an explicit per-column global-filter opt-in bypass the default primitive-value heuristic
  • preserve table-wide filtering controls and custom column eligibility predicates
  • cover object-valued custom global filtering at the capability and row-model levels

Rationale

By default, global filtering still only opts primitive string and number accessor values in automatically. When a column explicitly sets enableGlobalFilter to true, however, rejecting it with that same heuristic is surprising and prevents a custom globalFilterFn from handling object or array values. This change treats the explicit flag as an override of only the built-in heuristic; custom getColumnCanGlobalFilter policies remain authoritative.

Validation

  • 48 focused Vitest tests passed
  • table-core TypeScript check passed
  • ESLint passed for changed files
  • Prettier check passed for changed files
  • git diff --check passed

Closes #4673

Summary by CodeRabbit

  • Bug Fixes

    • Columns with enableGlobalFilter: true can now participate in global filtering even when their values are objects, booleans, or other non-string/non-number types.
    • Custom global-filter eligibility rules can still override individual column settings.
  • Tests

    • Added coverage for opt-in filtering of non-standard value types and custom eligibility behavior.
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      Review Change Stack

      No actionable comments were generated in the recent review. 🎉

      ℹ️ Recent review info
      ⚙️ Run configuration

      Configuration used: defaults

      Review profile: CHILL

      Plan: Pro Plus

      Run ID: ac372c7d-cd72-4388-ab06-ff178874a6c9

      📥 Commits

      Reviewing files that changed from the base of the PR and between 05edac5768d3d67bd233b31f6c569d5418dae7d2 and 6031818945820c571063f2b2f641724e57f0891f.

      📒 Files selected for processing (3)
      • packages/table-core/src/features/global-filtering/globalFilteringFeature.ts
      • packages/table-core/tests/implementation/features/column-filtering/createFilteredRowModel.test.ts
      • packages/table-core/tests/unit/features/global-filtering/globalFilteringFeature.utils.test.ts

      📝 Walkthrough

      Walkthrough

      Global filter eligibility now honors enableGlobalFilter: true before type-based detection. Tests cover opt-in for boolean and object-valued columns, plus custom predicate precedence.

      Changes

      Global filter opt-in

      Layer / File(s)Summary
      Eligibility override and filtering coverage
      packages/table-core/src/features/global-filtering/globalFilteringFeature.ts, packages/table-core/tests/unit/features/global-filtering/globalFilteringFeature.utils.test.ts, packages/table-core/tests/implementation/features/column-filtering/createFilteredRowModel.test.ts
      getColumnCanGlobalFilter accepts explicit column opt-in, with tests covering boolean columns, custom predicate rejection, and object-valued filtering.

      Estimated code review effort: 2 (Simple) | ~10 minutes

      🚥 Pre-merge checks | ✅ 5
      ✅ Passed checks (5 passed)
      Check nameStatusExplanation
      Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
      Title check✅ PassedThe title clearly describes the main change: honoring explicit global filter opt-in.
      Linked Issues check✅ PassedExplicit enableGlobalFilter:true now lets object-valued columns participate in global filtering, matching the linked bug fix.
      Out of Scope Changes check✅ PassedAll production and test changes are directly related to global filtering behavior and its coverage.
      Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
      ✨ Finishing Touches
      📝 Generate docstrings
      • Create stacked PR
      • Commit on current branch
      🧪 Generate unit tests (beta)
      • Create PR with unit tests
      • Commit unit tests in branch `agent/fix-4673-explicit-global-filter`

      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

      ❤️ Share
      Comment `@coderabbitai help` to get the list of available commands.
    2. nx-cloud[bot](GitHub profile, opens in a new tab)commented

      View your CI Pipeline Execution ↗ for commit 6031818945820c571063f2b2f641724e57f0891f

      CommandStatusDurationResult
      nx affected --targets=test:eslint,test:sherif,t...✅ Succeeded7m 41sView ↗
      nx run-many --targets=build --exclude=examples/**✅ Succeeded53sView ↗

      ☁️ Nx Cloud last updated this comment at 2026-07-30 22:22:19 UTC

    3. pkg-pr-new[bot](GitHub profile, opens in a new tab)commented
      More templates

      @tanstack/alpine-table

      npm i https://pkg.pr.new/TanStack/table/@tanstack/alpine-table@6439

      @tanstack/angular-table

      npm i https://pkg.pr.new/TanStack/table/@tanstack/angular-table@6439

      @tanstack/angular-table-devtools

      npm i https://pkg.pr.new/TanStack/table/@tanstack/angular-table-devtools@6439

      @tanstack/ember-table

      npm i https://pkg.pr.new/TanStack/table/@tanstack/ember-table@6439

      @tanstack/lit-table

      npm i https://pkg.pr.new/TanStack/table/@tanstack/lit-table@6439

      @tanstack/match-sorter-utils

      npm i https://pkg.pr.new/TanStack/table/@tanstack/match-sorter-utils@6439

      @tanstack/preact-table

      npm i https://pkg.pr.new/TanStack/table/@tanstack/preact-table@6439

      @tanstack/preact-table-devtools

      npm i https://pkg.pr.new/TanStack/table/@tanstack/preact-table-devtools@6439

      @tanstack/react-table

      npm i https://pkg.pr.new/TanStack/table/@tanstack/react-table@6439

      @tanstack/react-table-devtools

      npm i https://pkg.pr.new/TanStack/table/@tanstack/react-table-devtools@6439

      @tanstack/solid-table

      npm i https://pkg.pr.new/TanStack/table/@tanstack/solid-table@6439

      @tanstack/solid-table-devtools

      npm i https://pkg.pr.new/TanStack/table/@tanstack/solid-table-devtools@6439

      @tanstack/svelte-table

      npm i https://pkg.pr.new/TanStack/table/@tanstack/svelte-table@6439

      @tanstack/table-core

      npm i https://pkg.pr.new/TanStack/table/@tanstack/table-core@6439

      @tanstack/table-devtools

      npm i https://pkg.pr.new/TanStack/table/@tanstack/table-devtools@6439

      @tanstack/vue-table

      npm i https://pkg.pr.new/TanStack/table/@tanstack/vue-table@6439

      @tanstack/vue-table-devtools

      npm i https://pkg.pr.new/TanStack/table/@tanstack/vue-table-devtools@6439

      commit: 6031818

    4. KevinVandy merged this4cb3a7d

    5. KevinVandy closed this

Sign in to join this conversation.