fix: blog pagination reset - implement URL parameter persistence#2291
Open
waygeance wants to merge 3 commits intojson-schema-org:mainfrom
Open
fix: blog pagination reset - implement URL parameter persistence#2291waygeance wants to merge 3 commits intojson-schema-org:mainfrom
waygeance wants to merge 3 commits intojson-schema-org:mainfrom
Conversation
Utkarsh-123github
requested changes
Mar 1, 2026
Member
Utkarsh-123github
left a comment
There was a problem hiding this comment.
Hi @waygeance
Your PR is failing checks and requires fix.
Thanks!
built with Refined Cloudflare Pages Action⚡ Cloudflare Pages Deployment
|
Contributor
Author
|
Hi @Utkarsh-123github Boss, I have resolved the error please review when you get time |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2291 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 30 30
Lines 672 672
Branches 211 211
=========================================
Hits 672 672 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
Author
|
Any Updates on this @Utkarsh-123github Boss |
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.
What kind of change does this PR introduce?
Bugfix (pagination state persistence) with minor refactoring.
Issue Number:
Screenshots/videos:
Before:
After:
?page=N.?type=Category.Screencast.from.2026-02-25.16-50-33.webm
If relevant, did you update the documentation?
Not required. This change affects internal state handling and does not modify public documentation or APIs.
Summary
This PR fixes the bug where the blog pagination resets to page 1 after a browser reload.
Previously, pagination state was stored only in component state and was not synchronized with the URL. As a result, refreshing the browser caused the blog to reload on page 1, losing the current pagination context.
Changes made:
currentPagefrom URL query parameters inpages/blog/index.page.tsx.updateUrlhelper function to synchronize pagination and filter state with the browser URL.toggleCategoryto reset pagination to page 1 when filters change.This ensures pagination and filter state persist across reloads and eliminates hydration warnings.
Does this PR introduce a breaking change?
No. This change is backward compatible and does not affect any public APIs or external behavior.
Checklist
Please ensure the following tasks are completed before submitting this pull request.