Skip to content

Adjust clear editor confirmation dialog #102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

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