refined-github / refined-github

:octocat: Browser extension that simplifies the GitHub interface and adds useful features
MIT License
24.97k stars 1.49k forks source link

Add a keyboard shortcut to mark current PR file as viewed #5674

Open forivall opened 2 years ago

forivall commented 2 years ago

Description

Before stumbling on refined github, I wrote this bookmarklet. I included v as the shortcut to mark a file as viewed, but that conflicts with your v shortcut, so I suggest m.

Also, a recent github change re-opens any collapsed sections when using j/k (refined github or my bookmarlket), so I have a kludgy fix for that in my bookmarklet too.

Screenshot

For now, just turn off refined github keyboard shortcuts and demo my bookmarklet https://gist.github.com/forivall/49bb31234168481e68843cb5800fab0c#file-github-review-keyboard-shortcuts-bookmarklet-min-js

Example URL

https://github.com/mongodb-js/vscode/pull/417/files

fregante commented 2 years ago

I think our v shortcut only applies to the conversation tab while this one only applies to the files tab, right? It should be fine

cheap-glitch commented 2 years ago

I think our v shortcut only applies to the conversation tab

No, it also works on the "Files" tab (as it should, imo).

fregante commented 2 years ago

Since w're using j/k to navigate the files, we should use x to toggle them

Screen Shot

That's what GitHub uses to navigate PRs and toggle the selections as well:

https://user-images.githubusercontent.com/1402241/171984875-07031703-554b-48dc-a361-bed9e2c872bd.mov

It should be part of keyboard-navigation I think. If there's another shortcut for toggling the files (not space, it's used for scrolling) we can include this as well: