Open
Conversation
|
xIrusux
approved these changes
Apr 20, 2026
Contributor
There was a problem hiding this comment.
The page reset on sort change makes sense and should fix the “sorting only works on the first page” behavior. I’d just suggest deriving nextSortFilter / nextPage first and using those for the request, then updating state afterward. That makes the flow easier to read and avoids mixing request and state updates.
I.e.
const nextSortFilter = overrides?.sortFilter ?? sortFilter
const isSortChange = overrides?.sortFilter !== undefined && overrides?.page === undefined
const nextPage = isSortChange ? 1 : (overrides?.page ?? page)
const nextProvider = overrides?.provider ?? provider
const nextColumnFilters = overrides?.columnFilters ?? columnFilters
const nextPageSize = overrides?.pageSize ?? pageSize
if (overrides?.sortFilter !== undefined) {
setSortFilter(overrides.sortFilter)
}
if (isSortChange) {
setPage(1)
}
if (nextProvider === '' || isEmpty(nextColumnFilters)) return
void trigger({
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.



Changes in this pull request
Resolves #2885
Additional info
This pull request refines the sorting and pagination logic in the
GDPRDataExtractorContainercomponent to improve user experience and state management. The main focus is on ensuring that changing the sort order resets the page to 1 and that the sort state is properly tracked and updated.Improvements to sorting and pagination logic:
sortFilterstate usinguseStateto track the current sort order.executeSearchfunction to:sortFilterstate when a new sort is applied.