Repository navigation
FIX: disarm the finding dialog leave guard for an untouched edit - #4006
Open
Manohar Paturi (ManoharPaturi) wants to merge 3 commits into
Open
Manohar Paturi (ManoharPaturi) wants to merge 3 commits into
Manohar Paturi (ManoharPaturi) wants to merge 3 commits into
Conversation
The clean check required every watched field to be empty, which a prefilled edit dialog never satisfies, so opening Edit and refreshing always warned about unsaved changes. Each watched field now compares against the draft the dialog started with. Signed-off-by: Manohar Paturi <186662190+ManoharPaturi@users.noreply.github.com>
Roman Lutz (romanlutz)
approved these changes
Nov 8, 2026
Roman Lutz (romanlutz)
left a comment
Contributor
There was a problem hiding this comment.
Making an addition, but otherwise this looks great!
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This branch has not been deployed
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 #4005
The unsaved changes guard treated the draft as clean only when every watched field was empty. An edit dialog opens prefilled with the finding's stored values, and a finding always carries a title, so the clean check could never pass: opening Edit and immediately refreshing or closing the tab produced the browser's leave site confirmation for a draft with no changes. Only severity was compared against its initial value; the other watched fields were checked for emptiness alone.
Each watched field now compares against the draft the dialog started with, so a create dialog with untouched fields stays disarmed exactly as before, and an untouched edit dialog is clean because it still equals the stored finding.
Tests and Documentation
Added a regression that opens an edit dialog with prefilled values, changes nothing, and asserts the beforeunload guard stays disarmed; it fails on main, where the guard arms from the first render. The severity only create case keeps its armed assertions. The dialog suite passes at 12 tests and tsc is clean.
No documentation change needed, so I did not run JupyText.