-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
add "prev/next issue" feature for #152 : #299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
basic implementation that go to prev/next issue based on url issue number use prev/next keyboard keys
|
Taking a quick look at the code, I don't think this is going to work the way you expect. const uri = location.href.replace(/\/issues\/(\d+)\/?$/, function(match, current) {The sequential IDs in GitHub increment based on both an issue and a PR, so there are gaps where you'll be jumping between issues and PRs. This becomes more problematic because when you hit Would you be able to test this behavior out (if you haven't already)? |
| window.enableIssuesPrevNext = (() => { | ||
| const handler = ({keyCode, target}) => { | ||
| // just go to prev/next issue based on current issue number | ||
| if ((keyCode === PREV_KEYCODE || keyCode === NEXT_KEYCODE) && target.nodeName !== 'INPUT' && target.nodeName !== 'TEXTAREA') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check may be too generic. For users that prefer to navigate with keyboard shortcuts instead of the mouse, those keys are used to scroll left/right. (this was suggested in #152 by other contributors, though, so maybe I'm in the minority).
|
Thanks for all the instructive feedback 👍 Except using github API i have no idea how to handle that PR number issue |
No problem - appreciate you contributing :)
Yeah. That PR/Issue problem makes this task super difficult. There is also the issue of not being able to persist sort/search query that was discussed here. GitHub has things setup in such a way that make accomplishing this in the best way near impossible. |
Not just that. You'll also run into the problem of deleted issues which goes to 404. Usually from spam or abusive issues. I think the new GraphQL API would make this possible. |
basic implementation that go to prev/next issue based on the current url issue number
it use prev/next arrows keys