Make PR filenames headings and label the file contents#29
Merged
jcsteh merged 3 commits intojcsteh:masterfrom Aug 9, 2025
Merged
Make PR filenames headings and label the file contents#29jcsteh merged 3 commits intojcsteh:masterfrom
jcsteh merged 3 commits intojcsteh:masterfrom
Conversation
Contributor
SaschaCowley
commented
Aug 22, 2024
- Makes the filenames in diff viewers level 2 headings.
- Moves the filename first, rather than after a bunch of controls for that file.
- Makes the file contents a region labelled by the filename. Useful when navigating by table rather than by heading.
SaschaCowley
commented
Aug 22, 2024
GitHubA11yFixes.user.js
Outdated
| let headerRow = el.parentElement | ||
| let children = Array.from(headerRow.children) | ||
| // Filename is the last child of .file-info, make it the first | ||
| children.unshift(children.pop()) |
Contributor
Author
There was a problem hiding this comment.
I tried using Array.prototype.indexOf to find the index of the filename in the parent, then removing it by splicing and unshifting it to the start, but it seriously slowed things down for me. This assumes the filename is the last child of .file-info, which it always seems to be for me.
jcsteh
approved these changes
Aug 9, 2025
Owner
jcsteh
left a comment
There was a problem hiding this comment.
Thanks. I'm really sorry. Looking at this, I don't honestly know why I never got around to merging it.
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.