keyboard-navigation - Mark current file as viewed with X#9087
Conversation
fregante
left a comment
There was a problem hiding this comment.
Hmm no, it's not ready for review since it contains both bugfixes and enhancements (some of which haven't been discussed yet)
I'd like to see a a PR that restores the feature first, it would likely be small. One thing to note is that this feature also covers comments in the Conversation tab, so we need to verify that any changes to the feature are compatible with it.
The ctrl shortcuts are unlikely to be accepted, especially but not only because those shortcuts are already used by some browsers.
eb756f6 to
a073eab
Compare
|
Ok, i've stripped out all of the nonessential code for the feature. |
|
note that i've left in the click/focus tracking. i can remove that as well. edit and i've split that out into a separate commit so it can easily be dropped. |
|
If you want to see #5674, please add support for It seems that @SunsetTechuila already restored the feature in #9019 so no further changes should be required at this time. |
|
Please avoid force-pushing to this PR. It makes it harder for reviewers to track what changed since the last review. Just push new commits on top of the branch instead — PRs are squashed on merge, so the commit history doesn't need to be clean. |
|
It's down to 10 lines now, which is close enough to your 5 line target. It took a bit of refactoring to the control flow, even after i pulled out the unnecessary tweaks. The 5 lines target also pushed me to improve the selector for the new PR view, as my original implementation was more complex than necessary (and github may have added some new classes to the checkbox since i originally implmentated it) Sorry about the force pushes. |
fregante
left a comment
There was a problem hiding this comment.
Thank you for the updates! It already looks reasonable for the feature
keyboard-navigation - Mark current filed as viewed with X
keyboard-navigation - Mark current filed as viewed with Xkeyboard-navigation - Mark current file as viewed with X
| } | ||
|
|
||
| function init(signal: AbortSignal): void { | ||
| document.body.addEventListener('keypress', runShortcuts, {signal}); |
There was a problem hiding this comment.
Why don't we use registerHotkey for this?
There was a problem hiding this comment.
Probably because it's not worth a refactor
|
I think that's a user option, shortcuts can be disabled in your GitHub settings |




Fixes #5674
Improves the experience of j/k such that, when navigating through a file that has been collapsed / viewed, it will not expand / uncollapse the file.removed for this prAdditionally, tracks the clicks and focus events while on a page with comments so that j/k will navigate from the last focused comment, rather than reverting to the first comment. This also affects thexkeyboard shortcut, so that a user can click a file then press "x". (This change is separated into a single commit, so we can easily drop it from this PR)Also added ctrlu/ctrld for faster navigation, which is especially useful once you have many files collapsed, as more files will fit on the screen.removedTest URLs
#4030 (comment)
https://github.com/refined-github/refined-github/pull/8517/changes
Screenshot
ScreenShot.2026-03-13.at.12.30.10.PM.mp4