Skip to content

fix numeric zero global filters#6432

Merged
KevinVandy merged 1 commit into
betafrom
agent/fix-4488-zero-global-filter
Jul 17, 2026
Merged

fix numeric zero global filters#6432
KevinVandy merged 1 commit into
betafrom
agent/fix-4488-zero-global-filter

Conversation

@KevinVandy

@KevinVandy KevinVandy commented Jul 17, 2026

Copy link
Copy Markdown
Member

What changed

  • treat numeric 0 as an active global filter value
  • apply the same active-value check in filtered and faceted row models
  • retain the existing inactive behavior for undefined, null, and the empty string
  • add a regression test using a numeric-zero global filter

Why

The row-model pipeline used truthiness to decide whether global filtering was active. That skipped 0, even though numeric status values are valid filter inputs.

The filtered model and faceted model now agree on explicit empty values instead of relying on truthiness.

Validation

  • packages/table-core/tests/implementation/features/column-filtering/createFilteredRowModel.test.ts — 27 tests passed
  • Prettier and git diff --check

Closes #4488

Summary by CodeRabbit

  • Bug Fixes

    • Improved global filtering behavior for empty, null, and undefined values.
    • Numeric global filter values such as 0 now work correctly.
    • Ensured filtering and faceting consistently apply active global filters.
  • Tests

    • Added coverage for filtering with a numeric value of 0.

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

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

Run ID: 1c8ab836-811e-4b61-8aea-6917ef80ffc7

📥 Commits

Reviewing files that changed from the base of the PR and between a4040a2 and 9a8fa98.

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

📝 Walkthrough

Walkthrough

Global filtering and faceting now distinguish inactive values from falsy values, allowing globalFilter: 0 to filter rows. A regression test verifies that only the matching row remains.

Changes

Global filter activation

Layer / File(s) Summary
Normalize global filter handling
packages/table-core/src/features/column-filtering/createFilteredRowModel.ts, packages/table-core/src/features/column-faceting/createFacetedRowModel.ts, packages/table-core/tests/implementation/features/column-filtering/createFilteredRowModel.test.ts
Both row-model paths treat zero as an active global filter while excluding undefined, null, and empty-string values. A test verifies filtering with globalFilter: 0.

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

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: fixing numeric zero global filters.
Linked Issues check ✅ Passed The filtered and faceted row models now treat 0 as an active global filter, and the regression test covers the reported bug.
Out of Scope Changes check ✅ Passed The edits are limited to the bug fix and its test, with no unrelated changes apparent.
Docstring Coverage ✅ Passed No 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-4488-zero-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.

@nx-cloud

nx-cloud Bot commented Jul 17, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 9a8fa98

Command Status Duration Result
nx affected --targets=test:eslint,test:sherif,t... ✅ Succeeded 8m 38s View ↗
nx run-many --targets=build --exclude=examples/** ✅ Succeeded 51s View ↗

☁️ Nx Cloud last updated this comment at 2026-07-17 20:28:33 UTC

@pkg-pr-new

pkg-pr-new Bot commented Jul 17, 2026

Copy link
Copy Markdown
More templates

@tanstack/alpine-table

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

@tanstack/angular-table

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

@tanstack/angular-table-devtools

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

@tanstack/ember-table

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

@tanstack/lit-table

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

@tanstack/match-sorter-utils

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

@tanstack/preact-table

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

@tanstack/preact-table-devtools

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

@tanstack/react-table

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

@tanstack/react-table-devtools

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

@tanstack/solid-table

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

@tanstack/solid-table-devtools

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

@tanstack/svelte-table

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

@tanstack/table-core

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

@tanstack/table-devtools

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

@tanstack/vue-table

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

@tanstack/vue-table-devtools

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

commit: 9a8fa98

@KevinVandy
KevinVandy marked this pull request as ready for review July 17, 2026 21:54
@KevinVandy
KevinVandy merged commit 6dba057 into beta Jul 17, 2026
9 checks passed
@KevinVandy
KevinVandy deleted the agent/fix-4488-zero-global-filter branch July 17, 2026 22:00
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.

[v8] globalFilter: when state.globalFilterValue is set to 0, rows are not filtered.

1 participant