chore: correct tfeatures usage in examples#6304
Conversation
📝 WalkthroughWalkthroughThe PR systematically refactors TanStack Table's filter typing contracts and public APIs across table-core and forty example applications. Filter function registries transition from row-data-generic ( ChangesCore and Example Typing Alignment
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
|
View your CI Pipeline Execution ↗ for commit ea8fa7a
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/table-core/src/features/column-filtering/columnFilteringFeature.utils.ts (1)
62-68:⚠️ Potential issue | 🟠 Major | ⚡ Quick winArray auto-filter detection is shadowed by the object branch.
At Line 62, arrays are matched as objects first, so Line 66 (
arrIncludes) is never reached. Array-valued columns will incorrectly useequalsinstead ofarrIncludes.Suggested fix
- if (value !== null && typeof value === 'object') { - return filterFns?.equals - } - if (Array.isArray(value)) { return filterFns?.arrIncludes } + + if (value !== null && typeof value === 'object') { + return filterFns?.equals + }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/table-core/src/features/column-filtering/columnFilteringFeature.utils.ts` around lines 62 - 68, The object branch (if (value !== null && typeof value === 'object')) currently catches arrays before the Array.isArray check, causing arrays to use filterFns?.equals instead of filterFns?.arrIncludes; fix by checking Array.isArray(value) first (or refine the object condition to exclude arrays) so that Array.isArray(value) returns filterFns?.arrIncludes and non-array objects return filterFns?.equals; update the logic around the branches that return filterFns?.equals and filterFns?.arrIncludes accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In
`@packages/table-core/src/features/column-filtering/columnFilteringFeature.utils.ts`:
- Around line 62-68: The object branch (if (value !== null && typeof value ===
'object')) currently catches arrays before the Array.isArray check, causing
arrays to use filterFns?.equals instead of filterFns?.arrIncludes; fix by
checking Array.isArray(value) first (or refine the object condition to exclude
arrays) so that Array.isArray(value) returns filterFns?.arrIncludes and
non-array objects return filterFns?.equals; update the logic around the branches
that return filterFns?.equals and filterFns?.arrIncludes accordingly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: eda689d1-abd9-43ef-bd59-43a6ed718ca3
📒 Files selected for processing (56)
examples/angular/column-pinning-sticky/src/app/app.tsexamples/angular/filters-fuzzy/src/app/app.tsexamples/angular/kitchen-sink/src/app/app.tsexamples/angular/row-selection-signal/src/app/app.component.tsexamples/angular/row-selection-signal/src/app/filter.tsexamples/angular/row-selection-signal/src/app/selection-column.component.tsexamples/angular/row-selection/src/app/table-filter/table-filter.tsexamples/angular/row-selection/src/app/table.tsexamples/angular/sub-components/src/app/app.tsexamples/angular/sub-components/src/app/sub-component/sub-component.tsexamples/lit/composable-tables/src/components/cell-components.tsexamples/lit/composable-tables/src/components/header-components.tsexamples/lit/composable-tables/src/hooks/table.tsexamples/lit/filters-fuzzy/src/main.tsexamples/lit/kitchen-sink/src/main.tsexamples/lit/sorting/src/main.tsexamples/preact/filters-fuzzy/src/main.tsxexamples/preact/kitchen-sink/src/main.tsxexamples/preact/sorting/src/main.tsxexamples/react/filters-fuzzy/src/main.tsxexamples/react/kitchen-sink-hero-ui/src/lib/data-table.tsexamples/react/kitchen-sink-hero-ui/src/main.tsxexamples/react/kitchen-sink-mantine/src/lib/data-table.tsexamples/react/kitchen-sink-mantine/src/main.tsxexamples/react/kitchen-sink-material-ui/src/lib/data-table.tsexamples/react/kitchen-sink-material-ui/src/main.tsxexamples/react/kitchen-sink-react-aria/src/lib/data-table.tsexamples/react/kitchen-sink-react-aria/src/main.tsxexamples/react/kitchen-sink-shadcn-base/src/lib/data-table.tsexamples/react/kitchen-sink-shadcn-base/src/main.tsxexamples/react/kitchen-sink-shadcn-radix/src/lib/data-table.tsexamples/react/kitchen-sink-shadcn-radix/src/main.tsxexamples/react/kitchen-sink/src/main.tsxexamples/react/sorting/src/main.tsxexamples/react/virtualized-columns/src/main.tsxexamples/react/with-tanstack-router/src/utils/userColumns.tsxexamples/solid/filters-fuzzy/src/App.tsxexamples/solid/kitchen-sink/src/App.tsxexamples/solid/with-tanstack-router/src/utils/userColumns.tsxexamples/svelte/filtering/src/App.svelteexamples/svelte/filtering/src/ColumnFilter.svelteexamples/svelte/filtering/src/features.tsexamples/svelte/filters-faceted/src/App.svelteexamples/svelte/filters-faceted/src/ColumnFilter.svelteexamples/svelte/filters-faceted/src/features.tsexamples/svelte/filters-fuzzy/src/App.svelteexamples/svelte/filters-fuzzy/src/features.tsexamples/svelte/filters-fuzzy/src/main.tsexamples/svelte/kitchen-sink/src/App.svelteexamples/svelte/kitchen-sink/src/table-augmentations.tsexamples/vanilla/sorting/src/main.tsexamples/vue/kitchen-sink/src/App.vuepackages/table-core/src/features/column-filtering/columnFilteringFeature.types.tspackages/table-core/src/features/column-filtering/columnFilteringFeature.utils.tspackages/table-core/src/features/column-filtering/createFilteredRowModel.tspackages/table-core/src/features/global-filtering/globalFilteringFeature.utils.ts
🎯 Changes
✅ Checklist
pnpm test:pr.Summary by CodeRabbit