Skip to content
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

Prevent escape from closing "create pull request" modal that contains changes #5387

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

simenbrekken
Copy link

@simenbrekken simenbrekken commented Oct 31, 2024

☕️ Reasoning

After carefully crafting a pull request description for 10 minutes, the last thing you expect is for an accidental press of escape to close the dialog and destroy your stuff.

🧢 Changes

If title or body has been changed, prompt the user to confirm before closing dialog.

Copy link

vercel bot commented Oct 31, 2024

@simenbrekken is attempting to deploy a commit to the GitButler Team on Vercel.

A member of the Team first needs to authorize it.

@Byron Byron added the UX/UI Focusing on user satisfaction, usability, and overall experience label Nov 1, 2024
@Byron
Copy link
Collaborator

Byron commented Nov 1, 2024

Thank you! I would think that pressing ESC was very intentionally linked, but I'd also expect it to ask to be sure the user is fine loosing changes they made. CC @PavelLaptev as there might be other ways to prevent the user from accidentally loosing changes without completely disabling keys.

@github-actions github-actions bot added the rust Pull requests that update Rust code label Nov 1, 2024
@simenbrekken simenbrekken changed the title Prevent escape from closing "create pull request" modal Prevent escape from closing "create pull request" modal that contains changes Nov 1, 2024
@simenbrekken
Copy link
Author

I would think that pressing ESC was very intentionally linked, but I'd also expect it to ask to be sure the user is fine loosing changes they made. CC @PavelLaptev as there might be other ways to prevent the user from accidentally loosing changes without completely disabling keys.

I've added a confirm dialog now that makes more sense.

@krlvi
Copy link
Member

krlvi commented Nov 1, 2024

Maybe another way to solve this could be to save the PR description in progress in local storage, so that if one presses esc by accident, reopening the modal it will be pre-filled with the content before

@simen-ardoq
Copy link

Maybe another way to solve this could be to save the PR description in progress in local storage, so that if one presses esc by accident, reopening the modal it will be pre-filled with the content before

Even better!

@PavelLaptev
Copy link
Contributor

Maybe another way to solve this could be to save the PR description in progress in local storage, so that if one presses esc by accident, reopening the modal it will be pre-filled with the content before

Agreed. I would be nice if we can do this.
@estib-vega what do you think, will you have time to implement this?

@krlvi
Copy link
Member

krlvi commented Nov 1, 2024

We do this for commit messages already, so seems like a very easy task imo (famous last words :D )

@estib-vega
Copy link
Contributor

Sorry for the long wait! I somehow missed this completely

Maybe another way to solve this could be to save the PR description in progress in local storage, so that if one presses esc by accident, reopening the modal it will be pre-filled with the content before

Agreed. I would be nice if we can do this. @estib-vega what do you think, will you have time to implement this?

Yes! Let's do it

@estib-vega
Copy link
Contributor

This is the proposed PR for persisting the title and description: #5559

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@gitbutler/desktop rust Pull requests that update Rust code UX/UI Focusing on user satisfaction, usability, and overall experience
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants