-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Re-label restore-file
and use new API
#6596
Conversation
Maybe I'm confused, but "Restore file" should not depend on the current URL. The intent of the button is to completely remove the file from the PR, does this happen with this code? Examples to test:
Live example: |
I did not read your entire post, this feature restores the as it was prior to the PR was submitted. |
@yakov116 Then I think we need to hide restore button on showing commit's different page since the UX is different. |
I'm not arguing for it, just for a slightly better UX. If that was the original intent, I'm willing to fix it, and it's very easy. :) |
Maybe we can make this more clear by changing the label to “Drop from PR” or “Discard changes” like GitHub Desktop calls it |
Decided on the wording, I'll rework it to drop. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look good on paper. Just make sure it works and update the PR title to reflect the changes (it's no longer a bugfix I think)
@@ -127,7 +123,7 @@ function handleMenuOpening({delegateTarget: dropdown}: DelegateEvent): void { | |||
role="menuitem" | |||
type="button" | |||
> | |||
Restore file | |||
Drop from PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure i like this wording, we "restoring the file" to how it was prior to the pr.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not clear whether it's "Based on commit" or "Based on PR".
As I said before, the UI may only show a portion of the commit, not the entire PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I suggested a change because "Restore" isn't really clear what we're restoring to. My suggestions were either
- Drop from PR
- Discard changes
But the first one is the clearest.
@fregante While working with |
Yes we used to call it "Revert file" but that was just as ambiguous. That label is also too long. |
restore-file
: restores based on user's current diffrestore-file
to drop-file-from-pr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@134130 no need to rename features, renaming is a last resort that breaks our search. Just change the label here
<p><a title="restore-file"></a> Adds a button to revert all the changes to a file in a PR | ||
<p><img src="https://user-images.githubusercontent.com/1402241/130660479-083e91e6-0778-446a-9aaf-b9b3e7214281.gif"> | ||
<p><a title="drop-file-from-pr"></a> Adds a button to revert all the changes to a file in a PR | ||
<p><img src="https://user-images.githubusercontent.com/50487467/236245182-afc97200-2634-4f82-9e9c-1f605fb04565.gif"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the gif update!
restore-file
to drop-file-from-pr
restore-file
drops file from PR correctlly
restore-file
drops file from PR correctllyrestore-file
and use new API
Note again: this does not fix #4679 |
throw new Error('Nothing to restore. Delete file instead'); | ||
throw new Error('Nothing to drop. Delete file instead'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That error message seems wrong now: There is something to drop (the whole new file), but nothing to restore. When does this error occur?
Suggestions for better wording:
- File was created in this PR. Delete it instead.
- Can't drop created file. Delete it instead.
I does not. The underlying API is unchanged from what I see. It used |
Description
restore-file
occasionally restores the wrong commit #4679restore-file
restores file to the base of the Pull Request.git restore
for restoring a file to not "untouched status", but "previous status".Test URLs
Maybe the above url's cannot work. Check
Range commit diff
andSingle commit diff
with this screenshotScreenshot
Same as before.