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:
Khalim Conn-Kowlessar 2026-07-14 12:12:05 +00:00
parent 99025ce4b3
commit a7781eca81

View file

@ -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 }) => (