Skip to content

Adjust clear editor confirmation dialog#102

Closed
lukaslangrock wants to merge 2 commits intoekzhang:mainfrom
lukaslangrock:main
Closed

Adjust clear editor confirmation dialog#102
lukaslangrock wants to merge 2 commits intoekzhang:mainfrom
lukaslangrock:main

Conversation

@lukaslangrock
Copy link

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.

@ekzhang ekzhang closed this May 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants