Refined-github: Add shortcuts to navigate to PR tabs

Created on 4 Jul 2017  路  15Comments  路  Source: sindresorhus/refined-github

I think it would be useful to have keyboard shortcuts to navigate to Conversation, Commits and Files changed tabs in a pull request.

I think the keyboard shortcuts should start with g so they don't collide with other things or be unintuitive.

Do you support that so we could disucss specific shortcuts?

Please! 鈾ワ笌 enhancement good first issue help wanted

Most helpful comment

I'll propose the following variants for shortcuts:

Variant 1 馃帀

Start with g like other navigational shortcuts:

  • g + g Conversation (Discussion g + d is Dashboard, Conversation g + c is Code, Just c is create issue/PR. gg is like go to beginning in vi)
  • g + l Commits (like go to log, as g + c is taken for going to the Code repo tab)
  • g + f - Files changed

Variant 2 鉂わ笍

Start with another prefix for navigating in a PR: p:

  • p + c Conversation
  • p + l Commits (like PR log)
  • p + f - Files changed

All 15 comments

I like it. I change between those so often that keyboard shortcuts would be useful.

I'll propose the following variants for shortcuts:

Variant 1 馃帀

Start with g like other navigational shortcuts:

  • g + g Conversation (Discussion g + d is Dashboard, Conversation g + c is Code, Just c is create issue/PR. gg is like go to beginning in vi)
  • g + l Commits (like go to log, as g + c is taken for going to the Code repo tab)
  • g + f - Files changed

Variant 2 鉂わ笍

Start with another prefix for navigating in a PR: p:

  • p + c Conversation
  • p + l Commits (like PR log)
  • p + f - Files changed

Would you do another emoji vote, please? /cc @sindresorhus @bfred-it @jgierer12

Variant 3, just use numbers. p+1, p+2, p+3, like with browser tabs in Chrome (Cmd+1,2,3...).

I like numbers the most. Easier to remember and can be used anywhere they have tabs too.

Hmm, you'd need two hands for this or move your hand across the keyboard. It's also a bit ambiguous which tabs you navigating to.

you'd need two hands for this or move your hand across the keyboard

Only if we make it p. Could use q or w instead.

It's also a bit ambiguous which tabs you navigating to.

Not really more ambiguous than arbitrary characters as shortcuts (like p+l).

Ambiguous as in it's not really clear which tabs you're navigating - the repository tabs, the PR tabs or something else? The p prefix could hint that you're navigating the PR tabs, but on another page with nested tabs, it won't make sense for navigating the tabs.

If we go with numbers I'd suggest t + 1, t + 2 for the main tabs on the page - usually the repo tabs and some other generic letter for the nested tabs.

How about t <number> and t <arrow-left/right> for the main repo tabs and p instead of t for the pull request tabs?

To give this another bump. I'm in favor of p+numbers. I'd be interested in implementing this. Are there any hints for some files where I can look aroud how I'd implement this?

@vanniktech 馃憤

On the actual implementation, I think the last suggestion from Sindre is the most sensible as it would make sense in more scenarios if we decide to expand it.

How about t <number> and t <arrow-left/right> for the main repo tabs and p instead of t for the pull request tabs?

t searches for files on the main page. Are we sure we want to use t then?

This is easy. Someone who interested please send a PR to add 3 attributes so we can close this :)

Hi, I started to work on this issue but the t hotkey open the Jump to... menu in the Files tab.

github-pr-tabs

And like @vanniktech said, t is used to search files on the main page. I don't think t is the best choice.

Any suggestion?

Why not just implement what Sindre suggested earlier, but just on for the PR tabs.

https://github.com/sindresorhus/refined-github/issues/568#issuecomment-337464005

So

  • p 1 Conversation
  • p 2 Commits
  • p 3 Files changed
  • p _Previous tab_
  • p _Next tab_
Was this page helpful?
0 / 5 - 0 ratings