fix(table-core): correct expanded/paginated state contents and sorting toggle defaults #6501
beta fromrefs/pull/6501/head·merged by KevinVandy Clears clusters 3 and 4 from the beta triage: expanded/paginated state contents, and sorting toggle defaults. Both are default-behavior changes, which is why they belong in the beta window rather than a later 9.x.
Expanded and paginated state contents#
#6115 — expand-all materializes non-expandable ids. Toggling a row while expanded === true materialized every id in rowsById, including leaf rows that can never expand. That polluted serialized ExpandedState and skewed getExpandedDepth. Materialization now writes only ids where row.getCanExpand() is true. getCanExpand was chosen over subRows.length so that getRowCanExpand lazy-load overrides stay expandable.
Companion change: table.getIsAllRowsExpanded() now only considers expandable rows, so the materialized map still round-trips as "all expanded". A side effect worth calling out in review: a state of stale ids with no expandable rows in the current model now returns false rather than true.
#5833 — paginated flatRows duplicates expanded sub-rows. The rebuild pushed each page row and then recursed into its subRows, but page rows already contain expanded descendants inline, so those rows landed in flatRows twice. Now deduped by row id. Semantic decision: collapsed descendants stay included, consistent with every other row model, where flatRows ignores expansion state. Only the duplication is removed.
#6136 — spurious onExpandedChange. row.toggleExpanded(bool) and table.toggleAllRowsExpanded(bool) fired the change handler even when the requested state already matched. Both now early-return.
#4939 — imperative toggles ignore getCanExpand. Neither toggle consulted row.getCanExpand(), unlike their row-selection equivalents. The expand direction is now guarded. Collapsing is always allowed so stale expanded ids can still be cleaned up.
This last one has fallout for consumers who drove expansion on flat rows without setting getRowCanExpand: those calls become no-ops. The angular and ember flex-render tests did exactly that and are updated with getRowCanExpand: () => true.
Sorting toggle defaults#
#4946 — enableMultiRemove was dead on every path. column.toggleSorting() called column.getNextSortingOrder(column) without the multi argument, so the option could never take effect. Now forwarded as multi && column.getCanMultiSort(), which matches the multi-mode condition the updater itself computes, so a multi toggle on a column that cannot multi-sort correctly falls back to single-sort removal semantics. The public getNextSortingOrder type now accepts the multi argument it always supported at runtime.
#5147 / #5832 — auto sort direction flips the toggle cycle. column.getAutoSortDir() sampled only flatRows[0], so a leading null or a manual-sorting data swap changed the inferred first direction mid-cycle, and the cycle went asc → removed without ever reaching desc. It now samples the first 10 filtered rows for the first non-nullish value, matching getAutoSortFn's existing N=10 convention. #5832 is the same root cause and closes as a duplicate.
#5653 (docs half only). sortUndefined: false was documented as "undefined values will be considered tied" in all ten framework sorting guides and the reference. That is wrong: undefined values are passed straight to the sorting function with no special handling, and the built-in text fns coerce them to ''. Corrected, and the missing 'first'/'last' bullets were added to the generated reference page.
The semantic half of #5653 — whether the default sortUndefined: 1 should short-circuit before a user's custom sortFn — is deliberately not addressed here. Current behavior is defensible and now accurately documented; users who want their fn to see undefined can set sortUndefined: false.
MRT example crashes#
Surfaced while exercising the sorting changes against the MUI and Mantine example ports, not caused by them.
- Both sort labels read
sortingoffstate, which does not carry it, and crashed onsorting.length. They now read it throughtable.Subscribeontable.atoms.sorting, which also makes the multi-sort badge reactive. - The row-action edit handler passed a shallow row copy (
setEditingRow({ ...row })) instead of the row, breaking the row identity the edit modal depends on. mrtRefsFeatureseeded the keyededitInputRefs/filterInputRefsbags withnullinstead of{}, crashing on the first keyed write when filters or edit inputs mounted.- One duplicate React
keyin the MUI example's row-action menu.
New e2e coverage pins all of these plus the sort-direction indicator, per the existing per-example self-contained spec convention.
Verification#
- table-core: 1255 tests pass,
tscand declaration-emit clean. - angular-table (41) and ember-table (34) pass with the updated expansion tests.
- eslint and prettier clean on all changed files. The 24 pre-existing eslint errors elsewhere in
packages/table-core/testsare untouched by this PR. - New regression tests were each verified to fail against the pre-fix code.
Closes #6115, closes #5833, closes #6136, closes #4939, closes #4946, closes #5147, closes #5832.
🤖 Generated with Claude Code
Summary by CodeRabbit#
Bug Fixes
- Improved row expansion to ignore non-expandable rows, avoid redundant updates, and prevent duplicate child rows in paginated results.
- Corrected automatic sorting direction when leading values are empty or null.
- Improved multi-column sorting and removal behavior.
Documentation
- Clarified handling of undefined values and sorting options across framework guides and reference documentation.
Tests
- Added coverage for expansion, pagination, sorting indicators, filtering, and row-edit workflows.
- 1
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:
c0a097c2-9cb4-4cb4-80c5-ac9fc876f6c0📥 Commits
Reviewing files that changed from the base of the PR and between 9b40f2243bc4dc8653c5d02cb3928c651eb91800 and c35d70da7f23a8558b19426968795f3f887a39e3.
📒 Files selected for processing (32)
beta-window-triage.mddocs/framework/alpine/guide/sorting.mddocs/framework/angular/guide/sorting.mddocs/framework/ember/guide/sorting.mddocs/framework/lit/guide/sorting.mddocs/framework/octane/guide/sorting.mddocs/framework/preact/guide/sorting.mddocs/framework/react/guide/sorting.mddocs/framework/solid/guide/sorting.mddocs/framework/svelte/guide/sorting.mddocs/framework/vue/guide/sorting.mddocs/reference/index/interfaces/ColumnDef_RowSorting.mddocs/reference/index/interfaces/Column_RowSorting.mddocs/reference/static-functions/functions/column_getAutoSortDir.mddocs/reference/static-functions/functions/column_toggleSorting.mdexamples/react/mantine-react-table/src/mantine-react-table/components/buttons/MRT_ToggleRowActionMenuButton.tsxexamples/react/mantine-react-table/src/mantine-react-table/components/head/MRT_TableHeadCellSortLabel.tsxexamples/react/mantine-react-table/tests/e2e/smoke.spec.tsexamples/react/material-react-table/src/main.tsxexamples/react/material-react-table/src/material-react-table/components/buttons/MRT_ToggleRowActionMenuButton.tsxexamples/react/material-react-table/src/material-react-table/components/head/MRT_TableHeadCellSortLabel.tsxexamples/react/material-react-table/src/material-react-table/features/mrtRefsFeature.tsexamples/react/material-react-table/tests/e2e/smoke.spec.tspackages/angular-table/tests/flex-render/flex-render-table.test.tspackages/ember-table/tests/integration/flex-render.test.gtspackages/table-core/src/features/row-expanding/rowExpandingFeature.utils.tspackages/table-core/src/features/row-pagination/createPaginatedRowModel.tspackages/table-core/src/features/row-sorting/rowSortingFeature.types.tspackages/table-core/src/features/row-sorting/rowSortingFeature.utils.tspackages/table-core/tests/implementation/features/row-pagination/createPaginatedRowModel.test.tspackages/table-core/tests/unit/features/row-expanding/rowExpandingFeature.utils.test.tspackages/table-core/tests/unit/features/row-sorting/rowSortingFeature.utils.test.ts
🚧 Files skipped from review as they are similar to previous changes (32)
- examples/react/material-react-table/src/main.tsx
- docs/framework/octane/guide/sorting.md
- docs/framework/react/guide/sorting.md
- docs/framework/alpine/guide/sorting.md
- docs/framework/lit/guide/sorting.md
- packages/table-core/tests/implementation/features/row-pagination/createPaginatedRowModel.test.ts
- examples/react/material-react-table/src/material-react-table/features/mrtRefsFeature.ts
- docs/framework/preact/guide/sorting.md
- docs/framework/vue/guide/sorting.md
- examples/react/material-react-table/src/material-react-table/components/buttons/MRT_ToggleRowActionMenuButton.tsx
- docs/framework/solid/guide/sorting.md
- docs/reference/index/interfaces/Column_RowSorting.md
- docs/reference/static-functions/functions/column_getAutoSortDir.md
- docs/reference/static-functions/functions/column_toggleSorting.md
- examples/react/material-react-table/tests/e2e/smoke.spec.ts
- packages/table-core/src/features/row-pagination/createPaginatedRowModel.ts
- docs/framework/angular/guide/sorting.md
- packages/ember-table/tests/integration/flex-render.test.gts
- docs/reference/index/interfaces/ColumnDef_RowSorting.md
- packages/table-core/src/features/row-sorting/rowSortingFeature.types.ts
- docs/framework/svelte/guide/sorting.md
- packages/table-core/src/features/row-sorting/rowSortingFeature.utils.ts
- examples/react/mantine-react-table/src/mantine-react-table/components/buttons/MRT_ToggleRowActionMenuButton.tsx
- packages/table-core/src/features/row-expanding/rowExpandingFeature.utils.ts
- packages/table-core/tests/unit/features/row-expanding/rowExpandingFeature.utils.test.ts
- docs/framework/ember/guide/sorting.md
- examples/react/material-react-table/src/material-react-table/components/head/MRT_TableHeadCellSortLabel.tsx
- packages/angular-table/tests/flex-render/flex-render-table.test.ts
- examples/react/mantine-react-table/tests/e2e/smoke.spec.ts
- beta-window-triage.md
- examples/react/mantine-react-table/src/mantine-react-table/components/head/MRT_TableHeadCellSortLabel.tsx
- packages/table-core/tests/unit/features/row-sorting/rowSortingFeature.utils.test.ts
📝 Walkthrough
Walkthrough#
The PR updates row expansion and pagination behavior, sorting contracts and direction inference, sorting documentation across frameworks, and Mantine and Material React example behavior and smoke tests.
Changes#
Expansion and pagination semantics
Layer / File(s) Summary Guarded expansion state
packages/table-core/src/features/row-expanding/...,packages/table-core/tests/unit/features/row-expanding/...,packages/angular-table/tests/...,packages/ember-table/tests/...,beta-window-triage.mdExpansion operations now respect getRowCanExpand, skip redundant updates, exclude non-expandable rows from expanded-all state, and allow stale expansion entries to be collapsed.Deduplicated paginated rows
packages/table-core/src/features/row-pagination/createPaginatedRowModel.ts,packages/table-core/tests/implementation/features/row-pagination/...Paginated flatRowsnow includes each row ID once in both pagination modes.Sorting semantics
Layer / File(s) Summary Sorting contracts and behavior
packages/table-core/src/features/row-sorting/...,packages/table-core/tests/unit/features/row-sorting/...,docs/framework/*/guide/sorting.md,docs/reference/index/interfaces/*RowSorting.md,docs/reference/static-functions/functions/column_*.mdsortUndefined: falsedelegates handling to the sorting function. Automatic sort direction skips nullish samples.getNextSortingOrderreceives multi-sort state and respectsenableMultiRemove.React example integration
Layer / File(s) Summary Mantine sorting and editing example
examples/react/mantine-react-table/src/...,examples/react/mantine-react-table/tests/e2e/smoke.spec.tsThe sort label subscribes to sorting atoms, editing preserves the original row reference, and smoke tests cover sorting and row editing. Material sorting and editing example
examples/react/material-react-table/src/...,examples/react/material-react-table/tests/e2e/smoke.spec.tsThe sort label subscribes to sorting atoms, editing preserves the original row reference, ref maps initialize as objects, and smoke tests cover sorting, filters, and row editing. Estimated code review effort: 4 (Complex) | ~45 minutes
Possibly related PRs
- TanStack/table#6458: The React sorting-label changes use reactive atom subscription behavior related to this PR.
🚥 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 summarizes the main fixes for expanded, paginated, and sorting state behavior. Linked Issues check ✅ Passed The changes address expandable-row state, unique paginated flatRows, no-op expansion toggles, multi-sort removal, and stable auto-sort direction [ #6115,#5833,#6136,#4939,#4946,#5147,#5832].Out of Scope Changes check ✅ Passed The documentation, regression tests, and MRT example fixes directly support the linked expansion and sorting objectives. Docstring Coverage ✅ Passed Docstring coverage is 80.00% which is sufficient. The required threshold is 80.00%. ✨ 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 `fix/expanding-sorting-state-contents`
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 `@coderabbitai help` to get the list of available commands.More templates
- tanstack-alpine-table-example-aggregation
- tanstack-alpine-table-example-basic-app-table
- tanstack-alpine-table-example-basic-create-table
- tanstack-alpine-table-example-basic-dynamic-columns
- tanstack-alpine-table-example-basic-external-atoms
- tanstack-alpine-table-example-basic-external-state
- tanstack-alpine-table-example-cell-selection
- tanstack-alpine-table-example-cell-spanning
- tanstack-alpine-table-example-column-ordering
- tanstack-alpine-table-example-column-pinning
- tanstack-alpine-table-example-column-pinning-split
- tanstack-alpine-table-example-column-pinning-sticky
- tanstack-alpine-table-example-column-resizing
- tanstack-alpine-table-example-column-resizing-performant
- tanstack-alpine-table-example-column-sizing
- tanstack-alpine-table-example-column-visibility
- tanstack-alpine-table-example-custom-plugin
- tanstack-alpine-table-example-expanding
- tanstack-alpine-table-example-filters
- tanstack-alpine-table-example-filters-faceted
- tanstack-alpine-table-example-filters-faceted-bucketed
- tanstack-alpine-table-example-grouped-aggregation
- tanstack-alpine-table-example-grouping
- tanstack-alpine-table-example-header-groups
- tanstack-alpine-table-example-pagination
- tanstack-alpine-table-example-row-pinning
- tanstack-alpine-table-example-row-selection
- tanstack-alpine-table-example-sorting
- tanstack-alpine-table-example-sorting-dynamic-data
- tanstack-alpine-table-example-sub-components
- tanstack-ember-table-example-aggregation
- tanstack-ember-table-example-basic-app-table
- tanstack-ember-table-example-basic-external-atoms
- tanstack-ember-table-example-basic-external-state
- tanstack-ember-table-example-basic-table
- tanstack-ember-table-example-cell-selection
- tanstack-ember-table-example-cell-spanning
- tanstack-ember-table-example-column-ordering
- tanstack-ember-table-example-column-pinning
- tanstack-ember-table-example-column-pinning-split
- tanstack-ember-table-example-column-pinning-sticky
- tanstack-ember-table-example-column-resizing
- tanstack-ember-table-example-column-resizing-performant
- tanstack-ember-table-example-column-sizing
- tanstack-ember-table-example-column-visibility
- tanstack-ember-table-example-custom-plugin
- tanstack-ember-table-example-editable
- tanstack-ember-table-example-expanding
- tanstack-ember-table-example-filters
- tanstack-ember-table-example-filters-faceted
- tanstack-ember-table-example-filters-faceted-bucketed
- tanstack-ember-table-example-filters-fuzzy
- tanstack-ember-table-example-grouped-aggregation
- tanstack-ember-table-example-grouping
- tanstack-ember-table-example-header-groups
- tanstack-ember-table-example-kitchen-sink
- tanstack-ember-table-example-pagination
- tanstack-ember-table-example-remote-data
- tanstack-ember-table-example-row-dnd
- tanstack-ember-table-example-row-pinning
- tanstack-ember-table-example-row-selection
- tanstack-ember-table-example-sorting
- tanstack-ember-table-example-sub-components
- tanstack-angular-table-example-aggregation
- tanstack-angular-table-example-basic-app-table
- tanstack-angular-table-example-basic-dynamic-columns
- tanstack-angular-table-example-basic-external-atoms
- tanstack-angular-table-example-basic-external-state
- tanstack-angular-table-example-basic-inject-table
- tanstack-angular-table-example-cell-selection
- tanstack-angular-table-example-cell-spanning
- tanstack-angular-table-example-column-ordering
- tanstack-angular-table-example-column-pinning
- tanstack-angular-table-example-column-pinning-split
- tanstack-angular-table-example-column-pinning-sticky
- tanstack-angular-table-example-column-resizing
- tanstack-angular-table-example-column-resizing-performant
- tanstack-angular-table-example-column-sizing
- tanstack-angular-table-example-column-visibility
- tanstack-angular-table-example-composable-tables
- tanstack-angular-table-example-custom-plugin
- tanstack-angular-table-example-editable
- tanstack-angular-table-example-expanding
- tanstack-angular-table-example-filters
- tanstack-angular-table-example-filters-faceted
- tanstack-angular-table-example-filters-faceted-bucketed
- tanstack-angular-table-example-filters-fuzzy
- tanstack-angular-table-example-grouped-aggregation
- tanstack-angular-table-example-grouping
- tanstack-angular-table-example-header-groups
- tanstack-angular-table-example-kitchen-sink
- tanstack-angular-table-example-pagination
- tanstack-angular-table-example-remote-data
- tanstack-angular-table-example-row-dnd
- tanstack-angular-table-example-row-pinning
- tanstack-angular-table-example-row-selection
- tanstack-angular-table-example-row-selection-signal
- tanstack-angular-table-example-signal-input
- tanstack-angular-table-example-sorting
- tanstack-angular-table-example-sub-components
- tanstack-angular-table-example-virtualized-columns
- tanstack-angular-table-example-virtualized-infinite-scrolling
- tanstack-angular-table-example-virtualized-rows
- tanstack-angular-table-example-with-tanstack-form
- tanstack-angular-table-example-with-tanstack-query
- tanstack-lit-table-example-aggregation
- tanstack-lit-table-example-basic-app-table
- tanstack-lit-table-example-basic-dynamic-columns
- tanstack-lit-table-example-basic-external-atoms
- tanstack-lit-table-example-basic-external-state
- tanstack-lit-table-example-basic-subscribe
- tanstack-lit-table-example-basic-table-controller
- tanstack-lit-table-example-cell-selection
- tanstack-lit-table-example-cell-spanning
- tanstack-lit-table-example-column-ordering
- tanstack-lit-table-example-column-pinning
- tanstack-lit-table-example-column-pinning-split
- tanstack-lit-table-example-column-pinning-sticky
- tanstack-lit-table-example-column-resizing
- tanstack-lit-table-example-column-resizing-performant
- tanstack-lit-table-example-column-sizing
- tanstack-lit-table-example-column-visibility
- tanstack-lit-table-example-composable-tables
- tanstack-lit-table-example-expanding
- tanstack-lit-table-example-filters
- tanstack-lit-table-example-filters-faceted
- tanstack-lit-table-example-filters-faceted-bucketed
- tanstack-lit-table-example-filters-fuzzy
- tanstack-lit-table-example-grouped-aggregation
- tanstack-lit-table-example-grouping
- tanstack-lit-table-example-header-groups
- tanstack-lit-table-example-kitchen-sink
- tanstack-lit-table-example-pagination
- tanstack-lit-table-example-row-pinning
- tanstack-lit-table-example-row-selection
- tanstack-lit-table-example-sorting
- tanstack-lit-table-example-sorting-dynamic-data
- tanstack-lit-table-example-sub-components
- tanstack-lit-table-example-virtualized-columns
- tanstack-lit-table-example-virtualized-infinite-scrolling
- tanstack-lit-table-example-virtualized-rows
- @tanstack/octane-table-example-aggregation
- tanstack-octane-table-example-basic-dynamic-columns
- tanstack-octane-table-example-basic-external-atoms
- tanstack-octane-table-example-basic-external-state
- tanstack-octane-table-example-basic-subscribe
- tanstack-octane-table-example-basic-use-app-table
- tanstack-octane-table-example-basic-use-table
- @tanstack/octane-table-example-cell-spanning
- @tanstack/octane-table-example-column-ordering
- @tanstack/octane-table-example-column-pinning
- @tanstack/octane-table-example-column-pinning-split
- @tanstack/octane-table-example-column-pinning-sticky
- @tanstack/octane-table-example-column-resizing
- @tanstack/octane-table-example-column-resizing-performant
- @tanstack/octane-table-example-column-sizing
- @tanstack/octane-table-example-column-visibility
- @tanstack/octane-table-example-composable-tables
- @tanstack/octane-table-example-custom-plugin
- @tanstack/octane-table-example-expanding
- @tanstack/octane-table-example-filters
- @tanstack/octane-table-example-filters-faceted
- @tanstack/octane-table-example-filters-faceted-bucketed
- @tanstack/octane-table-example-filters-fuzzy
- @tanstack/octane-table-example-grouped-aggregation
- @tanstack/octane-table-example-grouping
- @tanstack/octane-table-example-header-groups
- @tanstack/octane-table-example-kitchen-sink
- @tanstack/octane-table-example-pagination
- @tanstack/octane-table-example-row-pinning
- @tanstack/octane-table-example-row-selection
- @tanstack/octane-table-example-sorting
- @tanstack/octane-table-example-sub-components
- tanstack-preact-table-example-aggregation
- tanstack-preact-table-example-basic-dynamic-columns
- tanstack-preact-table-example-basic-external-atoms
- tanstack-preact-table-example-basic-external-state
- tanstack-preact-table-example-basic-subscribe
- tanstack-preact-table-example-basic-use-app-table
- tanstack-preact-table-example-basic-use-table
- tanstack-preact-table-example-cell-selection
- tanstack-preact-table-example-cell-spanning
- tanstack-preact-table-example-column-ordering
- tanstack-preact-table-example-column-pinning
- tanstack-preact-table-example-column-pinning-split
- tanstack-preact-table-example-column-pinning-sticky
- tanstack-preact-table-example-column-resizing
- tanstack-preact-table-example-column-resizing-performant
- tanstack-preact-table-example-column-sizing
- tanstack-preact-table-example-column-visibility
- tanstack-preact-table-example-composable-tables
- tanstack-preact-table-example-custom-plugin
- tanstack-preact-table-example-expanding
- tanstack-preact-table-example-filters
- tanstack-preact-table-example-filters-faceted
- tanstack-preact-table-example-filters-faceted-bucketed
- tanstack-preact-table-example-filters-fuzzy
- tanstack-preact-table-example-grouped-aggregation
- tanstack-preact-table-example-grouping
- tanstack-preact-table-example-header-groups
- tanstack-preact-table-example-kitchen-sink
- tanstack-preact-table-example-pagination
- tanstack-preact-table-example-row-pinning
- tanstack-preact-table-example-row-selection
- tanstack-preact-table-example-sorting
- tanstack-preact-table-example-sub-components
- tanstack-preact-table-example-with-tanstack-form
- tanstack-preact-table-example-with-tanstack-query
- tanstack-solid-table-example-aggregation
- tanstack-solid-table-example-basic-app-table
- tanstack-solid-table-example-basic-dynamic-columns
- tanstack-solid-table-example-basic-external-atoms
- tanstack-solid-table-example-basic-external-state
- tanstack-solid-table-example-basic-use-table
- tanstack-solid-table-example-cell-selection
- tanstack-solid-table-example-cell-spanning
- tanstack-solid-table-example-column-ordering
- tanstack-solid-table-example-column-pinning
- tanstack-solid-table-example-column-pinning-split
- tanstack-solid-table-example-column-pinning-sticky
- tanstack-solid-table-example-column-resizing
- tanstack-solid-table-example-column-resizing-performant
- tanstack-solid-table-example-column-sizing
- tanstack-solid-table-example-column-visibility
- tanstack-solid-table-example-composable-tables
- tanstack-solid-table-example-expanding
- tanstack-solid-table-example-filters
- tanstack-solid-table-example-filters-faceted
- tanstack-solid-table-example-filters-faceted-bucketed
- tanstack-solid-table-example-filters-fuzzy
- tanstack-solid-table-example-grouped-aggregation
- tanstack-solid-table-example-grouping
- tanstack-solid-table-example-header-groups
- tanstack-solid-table-example-kitchen-sink
- tanstack-solid-table-example-pagination
- tanstack-solid-table-example-row-pinning
- tanstack-solid-table-example-row-selection
- tanstack-solid-table-example-sorting
- tanstack-solid-table-example-spreadsheet
- tanstack-solid-table-example-sub-components
- tanstack-solid-table-example-virtualized-columns
- tanstack-solid-table-example-virtualized-infinite-scrolling
- tanstack-solid-table-example-virtualized-rows
- tanstack-solid-table-example-with-tanstack-form
- tanstack-solid-table-example-with-tanstack-query
- tanstack-solid-table-example-with-tanstack-router
- tanstack-react-table-example-aggregation
- tanstack-react-table-example-basic-dynamic-columns
- tanstack-react-table-example-basic-external-atoms
- tanstack-react-table-example-basic-external-state
- tanstack-react-table-example-basic-subscribe
- tanstack-react-table-example-basic-use-app-table
- tanstack-react-table-example-basic-use-legacy-table
- tanstack-react-table-example-basic-use-table
- tanstack-react-table-example-cell-selection
- tanstack-react-table-example-cell-spanning
- tanstack-react-table-example-column-dnd
- tanstack-react-table-example-column-ordering
- tanstack-react-table-example-column-pinning
- tanstack-react-table-example-column-pinning-split
- tanstack-react-table-example-column-pinning-sticky
- tanstack-react-table-example-column-resizing
- tanstack-react-table-example-column-resizing-performant
- tanstack-react-table-example-column-sizing
- tanstack-react-table-example-column-visibility
- tanstack-react-table-example-composable-tables
- tanstack-react-table-example-custom-plugin
- tanstack-react-table-example-expanding
- tanstack-react-table-example-filters
- tanstack-react-table-example-filters-faceted
- tanstack-react-table-example-filters-faceted-bucketed
- tanstack-react-table-example-filters-fuzzy
- tanstack-react-table-example-grouped-aggregation
- tanstack-react-table-example-grouping
- tanstack-react-table-example-header-groups
- tanstack-react-table-example-kitchen-sink
- tanstack-react-table-example-kitchen-sink-chakra-ui
- tanstack-react-table-example-kitchen-sink-hero-ui
- tanstack-react-table-example-kitchen-sink-mantine
- tanstack-react-table-example-kitchen-sink-material-ui
- tanstack-react-table-example-kitchen-sink-react-aria
- tanstack-react-table-example-kitchen-sink-shadcn-base
- tanstack-react-table-example-kitchen-sink-shadcn-radix
- tanstack-react-table-example-lib-chakra-ui
- tanstack-react-table-example-lib-hero-ui
- tanstack-react-table-example-lib-mantine
- tanstack-react-table-example-lib-material-ui
- tanstack-react-table-example-lib-react-aria
- tanstack-react-table-example-lib-shadcn-base
- tanstack-react-table-example-lib-shadcn-radix
- tanstack-react-table-example-mantine-react-table
- tanstack-react-table-example-material-react-table
- tanstack-react-table-example-pagination
- tanstack-react-table-example-row-dnd
- tanstack-react-table-example-row-pinning
- tanstack-react-table-example-row-selection
- tanstack-react-table-example-sorting
- tanstack-react-table-example-spreadsheet
- tanstack-react-table-example-sub-components
- tanstack-react-table-example-virtualized-columns
- tanstack-react-table-example-virtualized-columns-experimental
- tanstack-react-table-example-virtualized-infinite-scrolling
- tanstack-react-table-example-virtualized-rows
- tanstack-react-table-example-virtualized-rows-experimental
- tanstack-react-table-example-web-worker-row-models
- tanstack-react-table-example-with-tanstack-form
- tanstack-react-table-example-with-tanstack-query
- tanstack-react-table-example-with-tanstack-router
- tanstack-vanilla-table-example-aggregation
- tanstack-vanilla-table-example-basic
- tanstack-vanilla-table-example-pagination
- tanstack-vanilla-table-example-sorting
- tanstack-svelte-table-example-aggregation
- tanstack-svelte-table-example-basic-app-table
- tanstack-svelte-table-example-basic-create-table
- tanstack-svelte-table-example-basic-dynamic-columns
- tanstack-svelte-table-example-basic-external-atoms
- tanstack-svelte-table-example-basic-external-state
- tanstack-svelte-table-example-basic-snippets
- tanstack-svelte-table-example-cell-selection
- tanstack-svelte-table-example-cell-spanning
- tanstack-svelte-table-example-column-ordering
- tanstack-svelte-table-example-column-pinning
- tanstack-svelte-table-example-column-pinning-split
- tanstack-svelte-table-example-column-pinning-sticky
- tanstack-svelte-table-example-column-resizing
- tanstack-svelte-table-example-column-resizing-performant
- tanstack-svelte-table-example-column-sizing
- tanstack-svelte-table-example-column-visibility
- tanstack-svelte-table-example-composable-tables
- tanstack-svelte-table-example-expanding
- tanstack-svelte-table-example-filtering
- tanstack-svelte-table-example-filters-faceted
- tanstack-svelte-table-example-filters-faceted-bucketed
- tanstack-svelte-table-example-filters-fuzzy
- tanstack-svelte-table-example-grouped-aggregation
- tanstack-svelte-table-example-grouping
- tanstack-svelte-table-example-header-groups
- tanstack-svelte-table-example-kitchen-sink
- tanstack-svelte-table-example-pagination
- tanstack-svelte-table-example-row-pinning
- tanstack-svelte-table-example-row-selection
- tanstack-svelte-table-example-sorting
- tanstack-svelte-table-example-spreadsheet
- tanstack-svelte-table-example-sub-components
- tanstack-svelte-table-example-virtualized-columns
- tanstack-svelte-table-example-virtualized-infinite-scrolling
- tanstack-svelte-table-example-virtualized-rows
- tanstack-svelte-table-example-with-tanstack-form
- tanstack-svelte-table-example-with-tanstack-query
- tanstack-vue-table-example-aggregation
- tanstack-vue-table-example-basic-dynamic-columns
- tanstack-vue-table-example-basic-external-atoms
- tanstack-vue-table-example-basic-external-state
- tanstack-vue-table-example-basic-use-app-table
- tanstack-vue-table-example-basic-use-table
- tanstack-vue-table-example-cell-selection
- tanstack-vue-table-example-cell-spanning
- tanstack-vue-table-example-column-ordering
- tanstack-vue-table-example-column-pinning
- tanstack-vue-table-example-column-pinning-split
- tanstack-vue-table-example-column-pinning-sticky
- tanstack-vue-table-example-column-resizing
- tanstack-vue-table-example-column-resizing-performant
- tanstack-vue-table-example-column-sizing
- tanstack-vue-table-example-column-visibility
- tanstack-vue-table-example-composable-tables
- tanstack-vue-table-example-expanding
- tanstack-vue-table-example-filters
- tanstack-vue-table-example-filters-faceted
- tanstack-vue-table-example-filters-faceted-bucketed
- tanstack-vue-table-example-filters-fuzzy
- tanstack-vue-table-example-grouped-aggregation
- tanstack-vue-table-example-grouping
- tanstack-vue-table-example-header-groups
- tanstack-vue-table-example-kitchen-sink
- tanstack-vue-table-example-pagination
- tanstack-vue-table-example-row-pinning
- tanstack-vue-table-example-row-selection
- tanstack-vue-table-example-sorting
- tanstack-vue-table-example-sub-components
- tanstack-vue-table-example-virtualized-columns
- tanstack-vue-table-example-virtualized-infinite-scrolling
- tanstack-vue-table-example-virtualized-rows
- tanstack-vue-table-example-with-tanstack-form
- tanstack-vue-table-example-with-tanstack-query
@tanstack/alpine-table
npm i https://pkg.pr.new/TanStack/table/@tanstack/alpine-table@6501@tanstack/angular-table
npm i https://pkg.pr.new/TanStack/table/@tanstack/angular-table@6501@tanstack/angular-table-devtools
npm i https://pkg.pr.new/TanStack/table/@tanstack/angular-table-devtools@6501@tanstack/ember-table
npm i https://pkg.pr.new/TanStack/table/@tanstack/ember-table@6501@tanstack/lit-table
npm i https://pkg.pr.new/TanStack/table/@tanstack/lit-table@6501@tanstack/match-sorter-utils
npm i https://pkg.pr.new/TanStack/table/@tanstack/match-sorter-utils@6501@tanstack/octane-table
npm i https://pkg.pr.new/TanStack/table/@tanstack/octane-table@6501@tanstack/preact-table
npm i https://pkg.pr.new/TanStack/table/@tanstack/preact-table@6501@tanstack/preact-table-devtools
npm i https://pkg.pr.new/TanStack/table/@tanstack/preact-table-devtools@6501@tanstack/react-table
npm i https://pkg.pr.new/TanStack/table/@tanstack/react-table@6501@tanstack/react-table-devtools
npm i https://pkg.pr.new/TanStack/table/@tanstack/react-table-devtools@6501@tanstack/solid-table
npm i https://pkg.pr.new/TanStack/table/@tanstack/solid-table@6501@tanstack/solid-table-devtools
npm i https://pkg.pr.new/TanStack/table/@tanstack/solid-table-devtools@6501@tanstack/svelte-table
npm i https://pkg.pr.new/TanStack/table/@tanstack/svelte-table@6501@tanstack/table-core
npm i https://pkg.pr.new/TanStack/table/@tanstack/table-core@6501@tanstack/table-devtools
npm i https://pkg.pr.new/TanStack/table/@tanstack/table-devtools@6501@tanstack/vue-table
npm i https://pkg.pr.new/TanStack/table/@tanstack/vue-table@6501@tanstack/vue-table-devtools
npm i https://pkg.pr.new/TanStack/table/@tanstack/vue-table-devtools@6501commit:
c35d70dActionable comments posted: 4
🧹 Nitpick comments (1)
examples/react/mantine-react-table/src/mantine-react-table/components/head/MRT_TableHeadCellSortLabel.tsx (1)
4-4: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winPrefer
table.Subscribeover the standaloneSubscribeimport.This component imports the standalone
Subscribecomponent. The TanStack Table v9 migration guide states that "For table.Subscribe from useTable, prefer that API — it uses overloads so JSX contextual typing works. This standalone component uses a union props type." The Material counterpart of this component usestable.Subscribedirectly. Usetable.Subscribehere too for better type inference and consistency across the Mantine and Material examples.♻️ Proposed refactor
-import { Subscribe } from '`@tanstack/react-table`' +return ( - <Subscribe source={table.atoms.sorting}> + <table.Subscribe source={table.atoms.sorting}> {(sorting) => {}} - </Subscribe> + </table.Subscribe> )Also applies to: 31-32, 96-96
🤖 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 `@examples/react/mantine-react-table/src/mantine-react-table/components/head/MRT_TableHeadCellSortLabel.tsx` at line 4, Remove the standalone Subscribe import and update the component’s Subscribe usages to call table.Subscribe instead, matching the Material counterpart and preserving the existing subscription behavior and JSX content.🤖 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. Inline comments: In `@docs/framework/alpine/guide/expanding.md`: - Around line 279-280: Correct the getCanExpand() wording to state that rows are expanded only when row.getCanExpand() returns true, not when it “accepts” rows. Apply this wording change in docs/framework/alpine/guide/expanding.md lines 279-280, docs/framework/angular/guide/expanding.md lines 254-255, docs/framework/ember/guide/expanding.md lines 270-271, docs/framework/lit/guide/expanding.md lines 273-274, docs/framework/octane/guide/expanding.md lines 258-259, and docs/framework/preact/guide/expanding.md lines 258-259. In `@docs/reference/index/interfaces/Column_RowSorting.md`: - Around line 142-144: Update the documentation for column_getNextSortingOrder to state that enableSortingRemoval is the global gate for removing sorting, while enableMultiRemove applies the additional restriction for multi-sort toggles. In `@packages/table-core/src/features/row-expanding/rowExpandingFeature.utils.ts`: - Around line 80-81: The TSDoc for table_toggleAllRowsExpanded must clarify that having no expandable rows is a no-op only for expansion requests; collapsing must still clear stale expanded IDs. Update the no-op description near table_toggleAllRowsExpanded without changing the implementation. - Around line 94-97: Update the guard in the all-rows expansion logic to treat any state where table_getIsAllRowsExpanded(table) is true as already expanded, not only currentExpanded === true. Preserve the existing partial-expansion and non-expandable checks, and add a regression test covering table_toggleAllRowsExpanded(table, true) with an explicit map containing every expandable row ID to verify onExpandedChange is not called. --- Nitpick comments: In `@examples/react/mantine-react-table/src/mantine-react-table/components/head/MRT_TableHeadCellSortLabel.tsx`: - Line 4: Remove the standalone Subscribe import and update the component’s Subscribe usages to call table.Subscribe instead, matching the Material counterpart and preserving the existing subscription behavior and JSX content.🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID:
bbbc38de-d807-4682-874f-986352f71ef5📥 Commits
Reviewing files that changed from the base of the PR and between 015b3d2cb49842fcc32d568eac42973d7984f14c and 9b40f2243bc4dc8653c5d02cb3928c651eb91800.
📒 Files selected for processing (42)
beta-window-triage.mddocs/framework/alpine/guide/expanding.mddocs/framework/alpine/guide/sorting.mddocs/framework/angular/guide/expanding.mddocs/framework/angular/guide/sorting.mddocs/framework/ember/guide/expanding.mddocs/framework/ember/guide/sorting.mddocs/framework/lit/guide/expanding.mddocs/framework/lit/guide/sorting.mddocs/framework/octane/guide/expanding.mddocs/framework/octane/guide/sorting.mddocs/framework/preact/guide/expanding.mddocs/framework/preact/guide/sorting.mddocs/framework/react/guide/expanding.mddocs/framework/react/guide/sorting.mddocs/framework/solid/guide/expanding.mddocs/framework/solid/guide/sorting.mddocs/framework/svelte/guide/expanding.mddocs/framework/svelte/guide/sorting.mddocs/framework/vue/guide/expanding.mddocs/framework/vue/guide/sorting.mddocs/reference/index/interfaces/ColumnDef_RowSorting.mddocs/reference/index/interfaces/Column_RowSorting.mddocs/reference/static-functions/functions/column_getAutoSortDir.mddocs/reference/static-functions/functions/column_toggleSorting.mdexamples/react/mantine-react-table/src/mantine-react-table/components/buttons/MRT_ToggleRowActionMenuButton.tsxexamples/react/mantine-react-table/src/mantine-react-table/components/head/MRT_TableHeadCellSortLabel.tsxexamples/react/mantine-react-table/tests/e2e/smoke.spec.tsexamples/react/material-react-table/src/main.tsxexamples/react/material-react-table/src/material-react-table/components/buttons/MRT_ToggleRowActionMenuButton.tsxexamples/react/material-react-table/src/material-react-table/components/head/MRT_TableHeadCellSortLabel.tsxexamples/react/material-react-table/src/material-react-table/features/mrtRefsFeature.tsexamples/react/material-react-table/tests/e2e/smoke.spec.tspackages/angular-table/tests/flex-render/flex-render-table.test.tspackages/ember-table/tests/integration/flex-render.test.gtspackages/table-core/src/features/row-expanding/rowExpandingFeature.utils.tspackages/table-core/src/features/row-pagination/createPaginatedRowModel.tspackages/table-core/src/features/row-sorting/rowSortingFeature.types.tspackages/table-core/src/features/row-sorting/rowSortingFeature.utils.tspackages/table-core/tests/implementation/features/row-pagination/createPaginatedRowModel.test.tspackages/table-core/tests/unit/features/row-expanding/rowExpandingFeature.utils.test.tspackages/table-core/tests/unit/features/row-sorting/rowSortingFeature.utils.test.ts
docs/framework/alpine/guide/expanding.md lines 279 to 280Outdated@@ -276,3 +276,5 @@276276 table.resetExpanded()277277 ```278278279+Toggling is guarded and de-duplicated. `row.toggleExpanded()` and `table.toggleAllRowsExpanded()` only expand rows that `row.getCanExpand()` accepts, and they skip `onExpandedChange` entirely when the requested state already matches the current state. Collapsing is always allowed, so stale ids left in a controlled `expanded` map can still be cleared.280+📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Correct the
getCanExpand()wording.getCanExpand()returns a boolean. It does not accept rows. Replace “rows thatrow.getCanExpand()accepts” with “rows for whichrow.getCanExpand()returnstrue”.docs/framework/alpine/guide/expanding.md#L279-L280: Correct the predicate wording.docs/framework/angular/guide/expanding.md#L254-L255: Apply the same wording correction.docs/framework/ember/guide/expanding.md#L270-L271: Apply the same wording correction.docs/framework/lit/guide/expanding.md#L273-L274: Apply the same wording correction.docs/framework/octane/guide/expanding.md#L258-L259: Apply the same wording correction.docs/framework/preact/guide/expanding.md#L258-L259: Apply the same wording correction.
📍 Affects 6 files
docs/framework/alpine/guide/expanding.md#L279-L280(this comment)docs/framework/angular/guide/expanding.md#L254-L255docs/framework/ember/guide/expanding.md#L270-L271docs/framework/lit/guide/expanding.md#L273-L274docs/framework/octane/guide/expanding.md#L258-L259docs/framework/preact/guide/expanding.md#L258-L259
🤖 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 `@docs/framework/alpine/guide/expanding.md` around lines 279 - 280, Correct the getCanExpand() wording to state that rows are expanded only when row.getCanExpand() returns true, not when it “accepts” rows. Apply this wording change in docs/framework/alpine/guide/expanding.md lines 279-280, docs/framework/angular/guide/expanding.md lines 254-255, docs/framework/ember/guide/expanding.md lines 270-271, docs/framework/lit/guide/expanding.md lines 273-274, docs/framework/octane/guide/expanding.md lines 258-259, and docs/framework/preact/guide/expanding.md lines 258-259.docs/reference/index/interfaces/Column_RowSorting.md lines 142 to 144@@ -134,9 +134,11 @@134134 ### getNextSortingOrder()135135136136 ```ts137-getNextSortingOrder: () => false | SortDirection;137+getNextSortingOrder: (multi?) => false | SortDirection;138138 ```139139140-Defined in: [features/row-sorting/rowSortingFeature.types.ts:191](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-sorting/rowSortingFeature.types.ts#L191)140+Defined in: [features/row-sorting/rowSortingFeature.types.ts:193](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-sorting/rowSortingFeature.types.ts#L193)141141142-Returns the next sorting order.142+Returns the next sorting order. Pass `multi` to resolve the order for a143+multi-sort toggle, where `enableMultiRemove` governs whether the cycle can144+remove the sort.🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Document the global removal setting as well.
enableSortingRemovalremains the global removal gate incolumn_getNextSortingOrder;enableMultiRemoveadds a multi-sort-specific restriction. Update this text so readers do not assumeenableMultiRemovealone controls removal.🤖 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 `@docs/reference/index/interfaces/Column_RowSorting.md` around lines 142 - 144, Update the documentation for column_getNextSortingOrder to state that enableSortingRemoval is the global gate for removing sorting, while enableMultiRemove applies the additional restriction for multi-sort toggles.@@ -77,3 +77,5 @@7777 * an empty map. Omitting the value toggles based on whether all rows are7878 * currently expanded.7979 *80+ * The call is a no-op (no `onExpandedChange`) when no row can expand or when81+ * the requested state matches the current state exactly.📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Correct the no-op condition in the TSDoc.
A collapse is not a no-op when no row can expand if the state contains stale expanded IDs.
table_toggleAllRowsExpanded(table, false)must clear those IDs.State that the no-expandable-row condition applies only to expansion requests.
🤖 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/row-expanding/rowExpandingFeature.utils.ts` around lines 80 - 81, The TSDoc for table_toggleAllRowsExpanded must clarify that having no expandable rows is a no-op only for expansion requests; collapsing must still clear stale expanded IDs. Update the no-op description near table_toggleAllRowsExpanded without changing the implementation.✅ Addressed in commit c35d70d
@@ -86,5 +89,9 @@8689 TFeatures extends TableFeatures,8790 TData extends RowData,8891 >(table: Table_Internal<TFeatures, TData>, expanded?: boolean) {92+ const currentExpanded = table.atoms.expanded?.get() ?? {}93+8994 if (expanded ?? !table_getIsAllRowsExpanded(table)) {95+ if (currentExpanded === true) return96+ if (!table_getCanSomeRowsExpand(table)) return9097 table_setExpanded(table, true)🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Treat a materialized all-expanded map as already expanded.
currentExpanded === trueonly detects the sentinel representation. A map containing every expandable row ID already satisfiestable_getIsAllRowsExpanded(table).table_toggleAllRowsExpanded(table, true)currently callsonExpandedChangeand converts that map totrue. This violates the no-op contract. Usetable_getIsAllRowsExpanded(table)for this guard. Add a regression test with an explicit map of all expandable row IDs.Proposed fix
if (expanded ?? !table_getIsAllRowsExpanded(table)) { - if (currentExpanded === true) return + if (table_getIsAllRowsExpanded(table)) return if (!table_getCanSomeRowsExpand(table)) return table_setExpanded(table, true)📝 Committable suggestion
‼️ IMPORTANT Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
if (expanded ?? !table_getIsAllRowsExpanded(table)) { if (table_getIsAllRowsExpanded(table)) return if (!table_getCanSomeRowsExpand(table)) return table_setExpanded(table, true)🤖 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/row-expanding/rowExpandingFeature.utils.ts` around lines 94 - 97, Update the guard in the all-rows expansion logic to treat any state where table_getIsAllRowsExpanded(table) is true as already expanded, not only currentExpanded === true. Preserve the existing partial-expansion and non-expandable checks, and add a regression test covering table_toggleAllRowsExpanded(table, true) with an explicit map containing every expandable row ID to verify onExpandedChange is not called.✅ Addressed in commit c35d70d
KevinVandy merged thisaad2c29
KevinVandy closed this
Sign in to join this conversation.
View your CI Pipeline Execution ↗ for commit 9b40f2243bc4dc8653c5d02cb3928c651eb91800
nx affected --targets=test:eslint,test:sherif,t...nx run-many --targets=build --exclude=examples/**☁️ Nx Cloud last updated this comment at
2026-08-03 03:18:38UTC