Repository navigation
feat: Add visual feedback on Remove and Discard changes dialogs - #7029
Conversation
|
@HashimotoYT Thanks for the PR! Is this ready for review? |
|
@HashimotoYT Also, quick question on the discard changes: does this also trigger the spinner when you're just discarding a selection of changes. In other words, if I have 10 changes and I've selected 5 of them to discard, does the spinner show up? |
|
@billygriffin Spinner shows anyways, discarding selected files shows same Dialog component, and yes this is ready for review 🍿. |
|
@HashimotoYT another example to test out as part of this would be discarding thousands of files (renaming |
|
Tested and LGTM 👍 |
|
@HashimotoYT Thanks for surfacing this. The |
@tierninho Hm... 🤔 Disabling |
iAmWillShepherd
left a comment
There was a problem hiding this comment.
Just a few tweaks needed.
There was a problem hiding this comment.
I think we need to add the following attribute to the Cancel button: disabled={this.state.isDiscardingChanges}.
|
So this is where it gets a bit complicated. Cancelling the dialog doesn't actually cancel the action (yet?), but as a user I would expect it to. |
|
@iAmWillShepherd changes made |
|
You are right, cancelling the dialog won't cancel the action. Cancelling an in-progress discard is a non-trivial thing to do with how the discard logic works in the application right now and we’d prefer to focus on getting this change in which will at least provide some feedback while the discard is running and since we’re not going to be able to cancel the operation, we feel like it would be confusing if the cancel button remains enabled after discarding has begun. That's why our opinion is that we should disable the Cancel button to ensure it's clear what's happening. If we did cancel an operation while it's running, doing so would put your repository in an unclear state depending on what percentage of the operation was completed. In this case, especially since you're already in a confirm dialog, our assumption is that once a user has clicked confirm to begin the operation, that's it. The Cancel button here is really about whether you want to start the operation in the first place. Note that the Cancel button is enabled and displayed before confirming, but sticks around after confirmation is made. I can see how that button remaining visible after confirming changes the semantics behind it. The dialog component actually has a prop to make it not-dismissible: desktop/app/src/ui/dialog/dialog.tsx Line 49 in 253a27b And a prop to disable all buttons within it: desktop/app/src/ui/dialog/dialog.tsx Line 103 in 253a27b Using ☝️ means we don't have to modify that ourselves, instead relying on the component to do it. |
iAmWillShepherd
left a comment
There was a problem hiding this comment.
Use the built-in functionality of the Dialog component.

Overview
Closes #7015
Description
Discarding:

Removing:

Release notes
Notes:
[Improved?] "Remove" and "Discard changes" dialogs show visual effects on action