fix(pull-request-hotkeys): support renamed aria-label and fix arrow-key navigation - #10008
Closed
mu88 wants to merge 1 commit into
Closed
fix(pull-request-hotkeys): support renamed aria-label and fix arrow-key navigation#10008mu88 wants to merge 1 commit into
pull-request-hotkeys): support renamed aria-label and fix arrow-key navigation#10008mu88 wants to merge 1 commit into
Conversation
…ey navigation GitHub renamed the PR tab-nav's aria-label again (now "Pull request navigation" on the Conversation/Commits sub-pages, while /files still uses the old "Pull request tabs"), which broke tab detection. The arrow-key hotkeys (g Left/g Right) also navigated to the wrong tab, because they were combined with the tab's own `g <number>` hotkey on the same element via a comma-separated data-hotkey value. GitHub's native hotkey handler doesn't reliably resolve multiple g-prefixed sequences sharing one element, so the previous/next hotkeys are now registered on dedicated hidden elements instead. Fixes refined-github#10006 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
This looks like an AI-generated PR, so we're preemptively closing it. If you're human and tested it, include a screenshot/video/gif of the working PR and we can reopen the PR. Don't open more PRs until this one is resolved. |
pull-request-hotkeys): support renamed aria-label and fix arrow-key navigation
Author
|
@fregante: I tested it manually and added a screen recording |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
GitHub renamed the PR tab-nav's
aria-labelagain (now"Pull request navigation"on the Conversation/Commits sub-pages, while/filesstill uses the old"Pull request tabs"), which broke tab detection and threwElementNotFoundErrorin the console.While fixing that, I also found that
g Left/g Rightnavigated to the wrong tab. The previous code combinedg <number>andg Arrow*on the same tab link via a comma-separateddata-hotkeyvalue (e.g."g 1,g ArrowLeft"). This is the only place in the codebase using that pattern, and GitHub's native hotkey handler doesn't reliably resolve multipleg-prefixed sequences sharing one element. Registering the previous/next hotkeys on dedicated hidden elements (via the existingregisterHotkeyhelper) fixes it.How to replicate the issue + URL
#9916
ElementNotFoundErrorand thatg <number>hotkeys silently stop working.g Left/g Right- it lands on the wrong tab instead of the adjacent one.Testing
Manually tested on both the linked public PR and an internal company repository:
g 1-g 4jump to the correct tab.g Left/g Rightcycle correctly through all tabs in both directions, including wraparound (last <-> first).Recording attached below (keystrokes shown for each navigation step):

Fixes #10006