mirror of
https://github.com/Hestia-Homes/assessment-model.git
synced 2026-07-27 22:45:03 +00:00
fix(tags): header checkbox selects all loaded rows, not just the page
With a 7-row page size, the header "select all" (toggleAllPageRowsSelected) only selected the visible 7 — so it never reached "all loaded", the condition that reveals the "Select all N matching" escalation. It now selects every loaded row (toggleAllRowsSelected): - when everything matching is already loaded, that IS the whole set (tag via ids); - when more match than are loaded (e.g. 250 loaded of 10,000), the escalation appears and routes through mode:"filter" — the server resolves and tags the entire matching set (getFilteredPropertyIds, chunked), so memory is never the ceiling and no huge id list is sent from the client. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
99025ce4b3
commit
a7781eca81
1 changed files with 7 additions and 4 deletions
|
|
@ -215,17 +215,20 @@ const coreColumns: ColumnDef<PropertyWithRelations>[] = [
|
|||
id: "select",
|
||||
enableSorting: false,
|
||||
enableHiding: false,
|
||||
// Selects ALL loaded rows (not just the paginated page), so on a small page
|
||||
// size it still covers everything in view. When more properties match than
|
||||
// are loaded, the TagActionBar offers "Select all N matching" on top of this.
|
||||
header: ({ table }) => (
|
||||
<Checkbox
|
||||
aria-label="Select all on this page"
|
||||
aria-label="Select all loaded rows"
|
||||
checked={
|
||||
table.getIsAllPageRowsSelected()
|
||||
table.getIsAllRowsSelected()
|
||||
? true
|
||||
: table.getIsSomePageRowsSelected()
|
||||
: table.getIsSomeRowsSelected()
|
||||
? "indeterminate"
|
||||
: false
|
||||
}
|
||||
onCheckedChange={(v) => table.toggleAllPageRowsSelected(!!v)}
|
||||
onCheckedChange={(v) => table.toggleAllRowsSelected(!!v)}
|
||||
/>
|
||||
),
|
||||
cell: ({ row }) => (
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue