dlvhdr / gh-dash

A beautiful CLI dashboard for GitHub 🚀
https://dlvhdr.github.io/gh-dash
MIT License
7.06k stars 208 forks source link

Enable approving a PR without entering a comment #420

Closed rmacklin closed 1 month ago

rmacklin commented 1 month ago

Summary

This is a follow-up to https://github.com/dlvhdr/gh-dash/pull/399 to address https://github.com/dlvhdr/gh-dash/pull/399#pullrequestreview-2239389841

That PR added support for approving PRs. However, the code was requiring that a comment be entered, or else the approval wouldn't occur. This seemed unintended because the implementation of the approve method had some code to explicitly handle the case where the comment was empty: https://github.com/dlvhdr/gh-dash/blob/d9033f7855730e536f5a3ecfbd8cb8e9f4c9268b/ui/components/prsidebar/approve.go#L33-L35

It was likely just a copy-paste mistake - the code for leaving a regular comment was aborting if the comment was empty (or only whitespace), which makes sense (but doesn't apply for approvals).

How did you test this change?

I built this branch locally and ran it and used it to approve a PR without a comment:

image