Implement pagination state management in URL for resource lists - #1206
Merged
Conversation
✅ Deploy Preview for commercelayer-app-elements ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
commit: |
pfferrari
approved these changes
Aug 24, 2026
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.
Related to commercelayer/issues-app#682
What I did
Paginated lists now keep the current page in the query string, so coming back from
a details page reopens the page the user was on instead of page 1. Filters were
already restored; the page was the missing piece.
usePageInUrlreads and writes?page=N(pushed, so the back button walks thepages; no parameter on page 1).
useResourceListturns the requested page into one that canactually be served. The Core API can address any page; the Metrics API can only
open a page whose cursor it holds, so it declines and falls back to page 1
rather than serving page 1's rows under another page's label.
useMetricsCursorTrailpersists the Metrics cursor trail insessionStorage,so a metrics-backed list can reopen on the page it was left on.
Also included, independent of pagination and worth its own look:
useResourceFiltersnow replaces
sdkFiltersonly when the filters actually change.FilteredTableismemoized on that object, so today any query-string change remounts the whole list.
How to test
Checklist