Adjust clear editor confirmation dialog #102
Closed
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.
Clicking on "read the code" will replace the entire editor and can be a very destructive action, especially for users unaware of
Ctrl + Z
. The current confirmation dialog has a threshold of 10 lines of code, meaning smaller documents can still be replaced accidentally.This PR reduces the threshold to two lines (as one line will always exist in the editor, even when it's empty).
I also rephrased the dialog to use the word replace instead of clear to make the resulting action clearer. This should improve user experience and prevent accidental loss of data for smaller documents.
It's essentially a follow-up to my comment here. Let me know what you think.