-
Notifications
You must be signed in to change notification settings - Fork 4k
Fix query parameters not preserved on back navigation #13129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix query parameters not preserved on back navigation #13129
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
✅ PR preview is ready!
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a bug where query parameters are not preserved when users navigate back using the browser's back button in multi-page apps. The fix adds a preserveQueryParams parameter that is set to true during browser history navigation to prevent query params from being cleared.
Key Changes:
- Modified
onPageChangeto accept an optionalpreserveQueryParamsparameter - Updated
sendRerunBackMsgto conditionally skip clearing query params whenpreserveQueryParamsis true - Added browser back navigation handling to preserve query params from the URL
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
frontend/app/src/App.tsx |
Added preserveQueryParams parameter to onPageChange and sendRerunBackMsg methods; modified logic to skip clearing query params during history navigation |
frontend/app/src/App.test.tsx |
Added unit test to verify query params are preserved in rerun message after browser back button navigation |
e2e_playwright/multipage_apps_v2/mpa_v2_basics_test.py |
Added e2e test to verify query params are displayed correctly after browser back navigation |
sfc-gh-lwilby
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Describe your changes
Fixes an issue where query parameters don't get synced correctly on browser back navigation.
GitHub Issue Link (if applicable)
Testing Plan
Contribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.