Use filterSortAndPaginate for client-side filtering, sorting, and pagination#39
Merged
Conversation
…ination Move filtering, sorting, and pagination to the client via the filterSortAndPaginate utility from @wordpress/dataviews. This gives us full operator coverage (contains, before/after, lessThan, etc.) without waiting for server-side support in the REST endpoint. - Pass dataFiltered and clientPaginationInfo to DataViews instead of raw server data - Fetch all rows from the server (per_page: -1), removing sort/filter query params from the REST request - Fix checkbox field type mapping (text → boolean) - Add explicit filterBy operators for multiselect fields - Update Tab navigation to use filtered/sorted row order Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Gate filter params through SERVER_OPERATORS so that client-only operators (contains, lessThan, etc.) don't change the query key and trigger unnecessary re-fetches. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
priethor
reviewed
Apr 30, 2026
| collection: collectionId, | ||
| per_page: view?.perPage ?? 25, | ||
| page: view?.page ?? 1, | ||
| per_page: -1, |
Collaborator
There was a problem hiding this comment.
This is related to the new task you opened, right?
Member
Author
There was a problem hiding this comment.
Yes. Do you think we should revert this piece?
Collaborator
There was a problem hiding this comment.
Nope! Just trying to connect the dots :)
filterSortAndPaginate filters rows against fields with enableGlobalSearch, which none of our fields set. Strip search from the view before passing to filterSortAndPaginate so server-matched rows aren't incorrectly dropped. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #126
filterSortAndPaginatefrom@wordpress/dataviews, giving full operator coverage (contains, before/after, lessThan, between, etc.) regardless of server-side filtering supporttext→boolean) and adds explicitfilterByoperators for multiselect fieldsOpen question
per_page: -1), removing sort/filter query params from the REST request. But the server should still do what it can to trim the results, but the challenge here is to not break client-side pagination.Test plan
🤖 Generated with Claude Code