Add delete-review-comments-faster feature - #4099
Conversation
This happens when navigating between the tabs of a PR page.
| import delegate from 'delegate-it'; | ||
| import {observe} from 'selector-observer'; | ||
| import * as pageDetect from 'github-url-detection'; | ||
|
|
There was a problem hiding this comment.
This is a review comment for testing.
quick-review-comment-deletion featuredelete-review-comments-faster feature
There was a problem hiding this comment.
In the PR comment body, you can always attach a simple screenshot/gif, it doesn't have to be final, it's just so the current style can be reviewed without having to check out the PR — unless you're still actively working on the PR right now and it's not working.
Yeah, I agree that the UX is rather perilous 😓. We could move the "Delete" button all the way to the left of the "Cancel" button, and make it smaller (maybe even reduce it to something like a trash icon) so it's harder to click by mistake. ping: @fregante thoughts? |
|
In what situations do we see a Cancel button? I think:
"Cancel" should appear in the same place everywhere, so probably: This partially undoes We also need to consider the "Close" and "Close with comment" buttons that should remain on the left. |
|
I'm -0 on moving the cancel buttons, I think it's better if they stay on the left. Maybe I'm missing something but I don't think we should change every single layout to accommodate for one specific case. Just to be clear, what I'm proposing is: This is in keeping with |
|
What about making the "Delete" button an icon-only button (with the trash icon)? Then clicking "Delete" accidentally is more difficult, and it can't be confused (via position or appearance) with the "Cancel" button. |
This comment has been minimized.
This comment has been minimized.
|
When you click "cancel", you are expecting a confirm dialog, so you'll accept it without reading. When the delete button and the cancel button are close to each other, it's easier to confuse them, which might lead to some accidentally deleted comments instead of cancelled edits. |
This comment has been minimized.
This comment has been minimized.
There is, but only after actually changing the textarea content.
Same for me 😅 |
|
You're both right and I can't think of a position that:
Maybe I have 2 more suggestions to add to the mix:
|
|
Also this doesn't necessarily need to be restricted to PR comments, however it's probably not as useful outside reviews (which is when one might decide to delete/move comments before submitting a review) |
|
Delete button on the left (but not where "Cancel" is expected to be), reduced to an icon to minimize misclicks: Delete button in the center, as suggested by @fregante: I think the first option looks better, but the second one might be the best in terms of UX. @yakov116 @FloEdelmann thoughts? |
|
Option 2 |
Co-authored-by: yakov116 <[email protected]>
|
I finally tested this. The delay introduced by the context menu’s delayed loading makes it look like it's not working for a bit: You can see that I can click multiple times before it starts loading (at my first trial I thought it wasn't loading at all because it took a second or more) I think we have 2 options:
The first one is still slow and still bound to errors (we should display an alert if we catch an error) and the second one, while easy on the surface, requires a way to correctly update the whole review UI. It's unfortunate that we need that exact "delete" form to perform the action in the DOM. I tried using a different "authenticity token" and GitHub responded with a 422. |
Since this only happens when using the |
|
Good compromise |
fregante
left a comment
There was a problem hiding this comment.
Works great! There's only one last minor change I'd like to see
Co-authored-by: Federico Brigante <[email protected]>
|
🎉 |
|
When is this feature going to be released? I often want to delete un-sent review comments but it's rather tedious 🤔 |
|
Tomorrow |




Closes #3605
Test URLs
Screenshot