Skip to content

Reveal hidden files from direct links #9

Closed

Description

@ribeirogab

Parent

#1

What to build

A direct link to a hidden file, a line in it, or a review comment in it reveals that file temporarily and explains why. Other matching files stay hidden, and no rule changes.

Acceptance criteria

  • A link to #diff-<sha256 of path> of a hidden file reveals the file and scrolls to it. Links with an L<n> or R<n> line suffix do the same. A link to a review comment (#r<id>) in a hidden file reveals the file and highlights the comment.
  • A notice above the revealed file says that it is temporarily visible because of a direct link and names the matching rule. The file header shows Temporarily visible.
  • Hide again hides the file, removes the link from the URL, announces the change, and returns focus to the control.
  • Other matching files stay hidden, rules do not change, and the hidden count does not include revealed files.
  • A reveal lasts until Hide again, turning filtering off, or leaving the pull request. A reload with the same link reveals the file again.
  • When GitHub's own navigation changes the URL to target a hidden file, the file is revealed like a direct link.

Blocked by

Activity

  1. self-assigned this
    on Oct 2, 2026
  2. ribeirogab commented on Oct 2, 2026

    @ribeirogab
    OwnerAuthor

    Finding from the fixtures (tests/fixtures/github/README.md, commit 49e302d):

    • File anchors behave as the spec says: each file block is div#diff-<sha256 of path>. A renamed file uses its new path, a deleted file its old path, and a path with spaces is hashed as is.
    • A review comment has no element id in the diff of the new Files changed page. To resolve #r<id>, read the page's embedded JSON. There the comment's databaseId sits next to its file and line; pr1-changes contains one comment, 4168120910, on src/components/Button.spec.tsx.
  3. ribeirogab commented on Oct 2, 2026

    @ribeirogab
    OwnerAuthor

    The fixture request is withdrawn because the implementation was reverted at the maintainer's request. The earlier fixture findings remain valid, but no extension implementation from this attempt remains in the current main branch.

  4. ribeirogab commented on Oct 2, 2026

    @ribeirogab
    OwnerAuthor

    The partial implementation was reverted in a619cac. All acceptance criteria are unchecked. This issue remains open; #10 and #11 remain unimplemented.

  5. ribeirogab commented on Oct 3, 2026

    @ribeirogab
    OwnerAuthor

    Built direct-link reveals. #diff-<sha256 of path> (with an optional L<n>/R<n> suffix) and #r<id> (resolved through the embedded pullRequestsChangesRoute JSON: the comment's databaseId maps to its file and line marker) reveal a hidden file without changing any rule. The notice sits right above the file entry and names the matching rule, the file header gets the Temporarily visible label and an accent outline, and the target line (or the comment's line) is highlighted and scrolled into view. Hide again hides the file, removes the hash, announces <path> is hidden again., and returns focus to the control. Reveals survive Show all files and last until Hide again, turning filtering off, or leaving the pull request; a reload with the same link reveals the file again. URL changes from GitHub's own navigation (history API, observed through the Navigation API) are handled like direct links.

    The fixture has no expanded comment thread, so the highlight for #r<id> is applied to the commented line; on github.com GitHub opens the thread itself once the file is visible.

    Tests:

    • End to end: 7 new tests (file link with notice, label, count and announcement; line link; comment link; Hide again; reveal lifetime across reload, Show all files, and turning off; navigation via history.replaceState; links to visible files).
    • Visual: notice (file and comment links, Hide again hover and focus), Temporarily visible and Always shown labels (rest, hover tooltip, keyboard focus), and the control after a reveal, in light and dark; 134 comparisons in total, all at zero different pixels.

    Commit: 0e29b92.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions