Repository navigation
FIX: stop pushing a duplicate history entry on first page finding saves - #3667
Merged
hannahwestra25 merged 5 commits intoNov 6, 2026
Merged
hannahwestra25 merged 5 commits into
hannahwestra25 merged 5 commits into
Conversation
Saving or deleting a finding on the first findings page rewrote an identical URL, and the router pushed a new history entry for it, so Back needed one extra press per save. The offset navigation is skipped when the requested offset is already in the URL. Signed-off-by: Manohar Paturi <186662190+ManoharPaturi@users.noreply.github.com>
The location key assertion pinned the implementation and would fail a replace based fix that works; the router driven cases now start from the operations list, save or delete a finding, press Back, and assert the list is restored, covering both paths through navigatePage(0). Signed-off-by: Manohar Paturi <186662190+ManoharPaturi@users.noreply.github.com>
Contributor
Author
|
You were right that the test pinned the implementation: it is replaced in 4b0e5a9 with the behavior block you suggested, which drives a real memory router from the operations list, saves or deletes a finding on the first page, goes Back, and asserts the list is restored. It covers both paths through navigatePage(0), which the old test never did for delete. Verified in both directions before pushing: with the offset bail disabled the two Back cases fail, and with the component swapped to main they fail as you found, while a replace based fix would pass. The suite passes at 31 tests with tsc clean. |
Build the next search params once and skip navigation only when the serialized query is unchanged, so the guard and the write cannot drift. Remove stray blank lines left by the test rewrite. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
hannahwestra25
approved these changes
Nov 5, 2026
hannahwestra25
left a comment
Contributor
There was a problem hiding this comment.
thanks for contributing! added a few small changes jfyi
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Nov 5, 2026
hannahwestra25
enabled auto-merge
November 6, 2026 20:09
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Nov 6, 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.
Description
Fixes #3666
Saving or deleting a finding always rewrote the findings page offset in the URL. On the first page there is no offset to change, so the router received the identical URL and still pushed a new history entry for it. Each save or delete on the first page added one dead Back press, and leaving the page afterwards took as many presses as there had been saves.
The offset navigation is now skipped when the URL already carries the requested offset. The refresh after a save or delete keeps working through the existing revision bump, and navigating back from a later page to the first still updates the URL exactly as before.
Tests and Documentation
Added a regression that records every router location during a save on the first page and asserts the history holds a single entry. It fails on main with a second entry for the identical URL and passes with the change. The full operation detail suite passes (30 tests) and tsc is clean.
No documentation change needed, so I did not run JupyText.