fix: persist filter and tab state on back-navigation (#871)#944
Open
aliangm wants to merge 1 commit intoentrius:testfrom
Open
fix: persist filter and tab state on back-navigation (#871)#944aliangm wants to merge 1 commit intoentrius:testfrom
aliangm wants to merge 1 commit intoentrius:testfrom
Conversation
10 tasks
Contributor
|
Could you please resolve the merge conflicts so we can proceed with the review? |
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 #871. Filter and inner-tab selections across several pages were stored in local
useState, so navigating to a detail page and pressing browser Back silently reset them to the default. This swaps those call sites onto a sharedsessionStorage-backed hook so selections survive the unmount/remount cycle but still reset when the tab is closed.src/hooks/useSessionStoredState.ts—useState-shaped API backed bysessionStorage, with a type-guard parameter so stale values from older builds fall back to the default safely.useStatewithuseSessionStoredStateat every call site listed in the issue, using the existingfeature:fieldstorage-key convention.Call sites converted
watchlist:repos:statusFilterwatchlist:prs:statusFilterminer:openIssues:mineFilterminer:openIssues:otherFilterrepository:contributors:programTabrepository:issues:filterpr:detailsTabissue:detailsTabMinerIssuesTable.tsxwas intentionally left alone — it already persists via URL search params.Test plan
For each row above: set a non-default filter/tab → click an item → press browser Back → confirm the selection is retained.
npm run buildandnpm run lintpass