Address review: tidy pagination handling and comments

Let useTableQueryState accept a full TablePaginationConfig (only defaultPageSize
is read) so UsersTable passes its pagination prop straight through instead of
extracting and casting it. Drop the redundant pagination: false from the tables
that just want it disabled (that is already the default). Clarify the comment on
the Last Seen online-only default to mention the onlyOnline prop, and explain why
onChange only uses the first sorter.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
bbassieandClaude Opus 4.8 committed 2026-06-29 22:26:39 +00:00
1 parent 8cacdc5112
commit 1e7b8f08cf
9 files changed
+19 -17

No files matched your search

@@ -15,8 +15,8 @@ export interface TableQueryStateOptions {
defaultSortKey?: string;
/** Direction of the default sort. Default "ascend". */
defaultSortOrder?: SortOrder;
/** Pass an object to persist pagination; omit/false for `pagination={false}` tables. */
pagination?: false | { defaultPageSize?: number };
/** Pagination config to persist pagination; only `defaultPageSize` is read (omit for `pagination={false}`). */
pagination?: false | TablePaginationConfig;
/** Per-column-key codecs to persist a bundled filter value as separate readable params. */
filterCodecs?: Record<string, FilterCodec>;
}
@@ -59,6 +59,8 @@ export default function useTableQueryState<T>(options: TableQueryStateOptions):
return {
onChange(pagination, tableFilters, sorter) {
// Only single-column sort is persisted; antd passes an array when several
// columns are sorted, so take the first (primary) sorter.
const single = Array.isArray(sorter) ? sorter[0] : sorter;
const order = single && single.order ? single.order : undefined;
const columnKey = order ? String(single.columnKey ?? single.field ?? "") : undefined;