Skip to content

feat(native): edit and delete comments from Pulls - #915

Merged
omartelo merged 1 commit into
mainfrom
feat/pulls-edit-delete-comments
Oct 22, 2026
Merged

omartelo merged 1 commit into
mainfrom
feat/pulls-edit-delete-comments

Conversation

@omartelo

Copy link
Copy Markdown
Collaborator

Summary

Comments in Pulls could only be replied to and resolved. Now the entries the viewer may change get a … menu:

  • Review thread comments (Conversation tab and diff): Edit and Delete.
  • Comments on the pull request: Edit and Delete.
  • A submitted review's summary: Edit only. GitHub cannot delete a submitted review or change its verdict, and the edit box says the verdict stays.

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

  • PullRequestConversation reads databaseId, viewerCanUpdate and viewerCanDelete for reviews, pull request comments and thread comments (mirrored in native/lichclient).
  • New writes: EditReviewComment, DeleteReviewComment, EditPullRequestComment, DeletePullRequestComment, EditReviewBody. Each emits PRChangedEvent once GitHub took it.
  • The REST writes that send only a body (reply, the three edits) share 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.
  • Local gate: gofmt, go vet ./..., go test ./... on the backend and in native/.

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.
@omartelo
omartelo merged commit e4d1fe0 into main Oct 22, 2026
7 checks passed
@omartelo
omartelo deleted the feat/pulls-edit-delete-comments branch October 22, 2026 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant