dlvhdr / gh-dash

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

Open the "files" tab view of a PR ? #298

Open drupol opened 12 months ago

drupol commented 12 months ago

Hi!

I'm doing a lot of code review within the NixOS project and I was wondering if it would be possible to have a shortcut that open a PR but in the "files" tab view (url ending with /files).

Currently, I use the o shortcut to open the PR but then it requires an extra click on the files tab so I can make the review.

Since it is not possible to make inline reviews inside gh-dash, this would definitely be useful for me and most probably some others too.

Thanks!

dlvhdr commented 12 months ago

Hi, yes this is possible. See the section about custom key binds. You can override the o keybind to run gh pr open with maybe the json arg and then pipe it to jq or something like that.

drupol commented 12 months ago

Hi, yes this is possible. See the section about custom key binds. You can override the o keybind to run gh pr open with maybe the json arg and then pipe it to jq or something like that.

I tried:

key: o
command: |
  open $(gh pr view {{.PrNumber}} --json url -q ".url + \"/files\"")

But this doesn't seems to work. Do you another clue?

dlvhdr commented 10 months ago

This works for me:

    - key: o
      command: open $(gh pr view 244 --json url | jq -r '.url')/files

There's probably something going on when trying to subtitue the 244 with the {{.PrNumber}} variable

drupol commented 10 months ago

We should add this option in gh-dash perhaps then?