0
Fork 0
mirror of https://github.com/TanStack/table.git synced 2026-11-18 18:55:54 +00:00
Commit graph

12 commits

Author SHA1 Message Date
Kevin Van Cott
09598d2e41
feat: support infinite pagination page sizes (#6526)
* feat: support infinite pagination page sizes

* add devtools to all with-tanstack examples

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-08-07 13:11:04 -05:00
Kevin Van Cott
a15c9e6fd6
docs: update client vs server guide and tanstack query examples 2026-08-07 10:23:29 -05:00
Kevin Van Cott
c6e8a34390
fix: correct row behavior and expand feature guides (#6509) 2026-08-03 21:15:24 -05:00
Kevin Van Cott
82c32e0bc6
docs: regen docs and fix some typos repo wide 2026-08-03 07:31:20 -05:00
Kevin Van Cott
aad2c292cb
fix(table-core): correct expanded/paginated state contents and sorting toggle defaults (#6501)
Two independent clusters of default-behavior bugs from the beta triage.

Expanded and paginated state contents:

Expand-all materialized every id in `rowsById`, including leaf rows that
can never expand, so a serialized `ExpandedState` was polluted with dead
keys and `getExpandedDepth` was skewed by them. Materialization now writes
only ids where `row.getCanExpand()` is true, chosen over `subRows.length`
so `getRowCanExpand` lazy-load overrides stay expandable.
`getExpandedDepth` filters the same way, and `getIsAllRowsExpanded` now
only considers expandable rows so the materialized map still round-trips
as "all expanded" (a map of stale ids with no expandable rows is false).

Paginated `flatRows` pushed each row and then recursed into its subRows,
but page rows already contain expanded descendants inline, so those rows
appeared twice. The rebuild now dedupes by row id. Collapsed descendants
stay included, consistent with every other row model, where `flatRows`
ignores expansion state.

`row.toggleExpanded(bool)` and `table.toggleAllRowsExpanded(bool)` fired
`onExpandedChange` even when the requested state already matched, so
controlled consumers got spurious callbacks. Both now early-return.

Neither toggle consulted `row.getCanExpand()`, unlike their row-selection
equivalents, so a non-expandable row could be written into expanded state
imperatively. The expand direction is now guarded; collapsing is always
allowed so stale expanded ids can still be cleaned up.

Sorting toggle defaults:

`column.toggleSorting()` called `column.getNextSortingOrder(column)` with
no `multi` argument, so `enableMultiRemove` was dead on every path. The
argument is now forwarded as `multi && column.getCanMultiSort()`, matching
the multi-mode condition the updater itself uses. The public
`getNextSortingOrder` type now accepts the `multi` argument it always
supported at runtime.

`column.getAutoSortDir()` sampled only `flatRows[0]`, so a leading null or
a manual-sorting data swap flipped the inferred first direction mid-cycle
and silently dropped a state from the toggle cycle. It now samples the
first 10 rows for a non-nullish value, matching `getAutoSortFn`.

Docs: `sortUndefined: false` was documented as "considered tied" in all
framework sorting guides; undefined values are actually passed straight to
the sorting function with no special handling. Corrected, and the missing
`'first'`/`'last'` bullets were added to the generated reference.

Also fixes three crashes in the MRT examples surfaced while testing the
sorting changes. The MUI and Mantine sort labels read `sorting` off
`state`, which does not carry it, and crashed on `sorting.length`; they now
read it through `table.Subscribe` on `table.atoms.sorting`, which also
makes the badge reactive. The row-action edit handler passed a shallow row
copy to `setEditingRow`, breaking the row identity the edit modal needs.
`mrtRefsFeature` seeded the keyed `editInputRefs`/`filterInputRefs` bags
with `null` instead of `{}`, crashing on first keyed write. New e2e
coverage pins all three plus the sort-direction indicator.

Closes #6115
Closes #5833
Closes #6136
Closes #4939
Closes #4946
Closes #5147
Closes #5832

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-02 22:19:11 -05:00
Kevin Van Cott
34ad4676ff
feat: add opt-in sorting auto-reset (#6489)
Co-authored-by: Jiajun Chen <tychenjiajun@live.cn>
2026-08-01 21:09:05 -05:00
Kevin Van Cott
eba5386a67
feat: new filter, sort, aggregation Fns, and recommended import patterns (#6415)
* feat: new filter, sort, aggregation Fns, and recommended import patterns

* fix some examples
2026-07-12 20:47:49 -05:00
Kevin Van Cott
0e56a4da22
docs: rewrite migrating guides (#6378) 2026-07-03 22:46:43 -05:00
Kevin Van Cott
17b84c3646 docs: update feature setup sections 2026-06-24 07:36:45 -05:00
Kevin Van Cott
a84475b17b
feat: refactor features option to include row models and fns (#6318)
* feat: refactor features option to include row models and fns

* ci: apply automated fixes

* fix column/global filtering feature relationship in types

* fix TData in custom filterFns

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-06-12 09:38:52 -05:00
Kevin Van Cott
e25a532ae8 docs: beta docs pass 2026-06-10 20:45:40 -05:00
Kevin Van Cott
29bea700a0 docs: re-organize feature guides to be framework specific 2026-06-09 10:18:53 -05:00
Renamed from docs/guide/sorting.md (Browse further)