pwntester / octo.nvim

Edit and review GitHub issues and pull requests from the comfort of your favorite editor
MIT License
2.24k stars 124 forks source link

Add keymaps for start, resume, submit and discard Reviews #498

Closed carlos-algms closed 4 months ago

carlos-algms commented 4 months ago

Describe what this PR does / why we need it

The process of opening a pull-request and starting a review was a little disconnected, as we had keymaps to almost everything we can do with a pull-request, except for starting a review.

https://github.com/pwntester/octo.nvim/assets/4634613/68458e0b-d791-4ab4-b568-3ef8532142ac

Describe how you did it

I followed the project standard and created named mappings that mirror the configuration keys and added them to:

The new commands are:

Command Binding
review_start <leader>vs
review_resume <leader>vr
submit_review <leader>vs
discard_review <leader>vd

Describe how to verify it

Start and resume a PR:

  1. Open a Pull-Request
  2. press <leader>vs to start a review
  3. press Ctrl+c to close the review
  4. press <leader>vr to resume the review

Submit or discard a PR

  1. Open a Pull-request
    1. press <leader>vs to start a review
  2. from the diff-view or the files pane, press <leader>vs to open the submit modal
  3. Run the command :q to close it
  4. press <leader>vd to discard the review, you should see a prompt asking to confirm.

Special notes for reviews

Aside from the keybindings, this PR also fixed the Ctrl+C to close the review, that wasn't working, as it wasn't passing the current tab as an argument to the close() function, so the key press was just ignored.

pwntester commented 4 months ago

LGTM, Thanks for the contribution!