Repository navigation
feat(native): edit and delete comments from Pulls - #915
Merged
Merged
Conversation
Review thread comments, comments on the pull request and a submitted review's summary get a ... menu in Pulls offering what GitHub lets the viewer do: Edit rewrites the text in place, Delete asks first. The conversation read carries each entry's database id and GitHub's viewerCanUpdate/viewerCanDelete, and the REST writes that take a body share writeBody.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Comments in Pulls could only be replied to and resolved. Now the entries the viewer may change get a
…menu:Edit turns the text into a textarea in place (Save, Cancel, Ctrl+Enter). While a thread comment is being edited, the thread's Reply and Resolve step aside, the same way the reply box takes their place. Delete asks in a dialog, which warns when the comment is the thread's last and the thread goes with it.
The menu follows GitHub: the conversation read now carries each entry's database id with
viewerCanUpdate/viewerCanDelete, so it only offers what the account gh runs as is allowed to do.Backend
PullRequestConversationreadsdatabaseId,viewerCanUpdateandviewerCanDeletefor reviews, pull request comments and thread comments (mirrored innative/lichclient).EditReviewComment,DeleteReviewComment,EditPullRequestComment,DeletePullRequestComment,EditReviewBody. Each emitsPRChangedEventonce GitHub took it.writeBody.Test plan
internal/project: the gh call each write makes, empty bodies never reaching gh, every write announcing the change and staying quiet when gh refuses, the new fields parsed from the conversation payload.native/cmd/lich-native: the menu offers what GitHub allows; editing hides Reply until Cancel, in the frame that took the click; the delete dialog warns about the thread's last comment and Cancel closes it; the Conversation tab lays out every kind of entry while editing.gofmt,go vet ./...,go test ./...on the backend and innative/.