Repository navigation
EXC-2107 Show a code owner's files from a reviewer hover - #73
Merged
macintacos merged 26 commits intoOct 29, 2026
Merged
macintacos merged 26 commits into
macintacos merged 26 commits into
Conversation
- Drop the border beside --shadow-floating-small, whose 1px ring already draws the edge, from the diffstat tip and owners popover - Clear the owners popover's UA [popover] border with border: 0 - Record the one-edge rule in design/patterns.md
- REVIEWER_SHIELD matches the Conversation sidebar's button[id^="codeowner-"]; shieldOwner reads its owner token - Capture the sandbox PR #1 Conversation sidebar as a fixture - Record the Reviewers sidebar's facts in github-rules.md
Move place() and VIEWPORT_MARGIN from the owners popover into ui/place.ts, so the reviewer files popup can place itself the same way.
- showReviewerFiles opens a hover card below a reviewer's code-owner shield, 200 ms after the pointer rests or at once on focus, listing the changed files that reviewer owns - It takes GitHub's hovercard edge: 1px default border, no shadow - Its sheet hides the shield's own tooltip while it is open - Record the trigger and edge picks in design/
- The header visit wires showReviewerFiles, reading the code owners lazily on the first shield hover or focus, once per visit - Cover it in the wiring tests and an e2e on the Conversation fixture - Describe it in ARCHITECTURE.md, CONTEXT.md, and README.md
- Drop the popover's source, so Tab off a shield whose long list scrolls moves on instead of dropping focus to the body - Memoise the code owners read inside showReviewerFiles - Find the shield with reviewerShieldOf, the files-page finder idiom - Keep an open popup when its own shield is re-entered or focused - Return the popup's own dispose; add a --font-mono token - Cover the late-read guard, focus-out, and Tab past a long list - Use the glossary's terms and fix stale header-tab docs
Read the PR reviewers from page_data/review_requests, the source of GitHub's React reviewer list, in place of merge_box. It answers signed out, lists reviews that only commented, and names the team behind a review (onBehalfOfTeams) or an assigned request (delegatedFromTeam) where the viewer can see it, plus whether a request is a code owner's. ownerFilter now counts those teams, so the owner section lists a reviewer who owns files only through a team they reviewed for, and the owner filter narrows to the same files. The popup still matches the shield's own token until it reads the PR reviewers too.
A reviewer GitHub flags as a code owner without naming the team, such as a user requested by hand who owns files only through a team, matched no file. Give each reviewer who owns nothing yet the owning teams whose members list them, read from the JSON GitHub's team mentions use, once per team per visit. It reads members only when GitHub shows the viewer a team among the PR reviewers, so a viewer outside the organization sends no extra request.
GitHub shields only a pending code owner request, so a code owner who has reviewed loses the shield and the popup with it, and a user's GitHub shield listed nothing when only a team made them an owner. Find the rows of both Reviewers lists, the classic sidebar and the PR overview's React list, and add a shield drawn as GitHub's beside each PR reviewer who owns a changed file where GitHub draws none. The popup opens from either shield, lists the files ownerFilter gives the reviewer with the teams GitHub names for them, and names those teams, linked. When GitHub marks a code owner but hides the team, it says so in one sentence. The code owners and PR reviewers are read once per visit, when a Reviewers list first shows.
Move when the Conversation popup opens and closes into ui/hover-intent.ts, so the file sidebar's shield can open its popover the same way. It follows triggers in the document and in any shadow root handed to it, since a move between two nodes of one shadow root never reaches the document.
The file sidebar's shield opens its popover 200 ms after the pointer rests on it and at once on focus, through the Conversation popup's hover intent, which now follows each tree's shadow root. A click still opens it with focus inside and keeps it open; a click on a shield whose popover a click opened still closes it. Escape, and a scroll while focus is inside, now move focus to the row before hiding the popover. Chromium hands focus back to the shield mid-hide, and that focus would open the popover again. The hover intent keeps a card shown in the same task, so the focus move right after it can close it.
The Reviewers list's user link matched logins without `_`, so no EMU reviewer got gh-prism's shield. It now takes the same LOGIN pattern review_requests parsing accepts.
withMemberTeams gave member teams only to reviewers who owned no file yet, so a reviewer with a direct CODEOWNERS line lost their teams' files. It now adds every owning team that lists them and that GitHub doesn't already name for them. The read-once test now has one team owning several paths, so a read per owner occurrence fails it.
An owner-filtered page waited on review_requests and every team's members, none of which time out, even for a team token that needs only the code owners. A team's filter now waits on the code owners alone, a user's on both, and either read still out after 10 s counts as failed.
A scroll closed the Conversation card from inside, and the next open closed it again through hover-intent, clearing the aria-describedby the new card had just set on the same shield. The card's close is now idempotent, and hover-intent leaves alone a card that has left the document.
A detached trigger never gets a pointerout, so a Conversation card stayed open after GitHub swapped the Reviewers sidebar under the pointer. Once the open card's trigger has left the document, the next pointer move outside the card closes it on the usual 150 ms delay, clearing the old shield's aria-describedby.
The Conversation card opened at the end of the body with no source, so Tab from a shield went on through the sidebar and closed it, leaving its "Through @org/team" link mouse-only. It now opens with the shield as its source, as the sidebar popover does, and a card that holds focus as it closes hands focus back to the shield rather than the body.
Escape and a scroll moved focus to the row before hiding the popover, but hover-intent's close and the swap to another shield's popover only removed it, dropping focus held inside it to the body. Closing now hands focus the popover held to the row in every case but a click.
The popover sits in light DOM and its shield in the tree's shadow root, so the document's focusout names only the tree's host as where focus went. hover-intent took that for leaving and closed the popover, and the shield's focusin mounted a new one. Focus leaving a card for a shadow host now waits for the focusin that follows to say where it landed.
The test named for the shield sitting beside GitHub's status icon checked only its parent row, so an append or prepend still passed.
gh-prism's overview shield stayed when React later drew GitHub's own in the same row, as on a re-requested review, so the row showed two. A row that gains GitHub's shield now loses gh-prism's. The overview's GitHub shield selector skips gh-prism's own, which takes the same label, so a direct owner's shield isn't taken for GitHub's.
macintacos
deleted the
EXC-2107/show-a-code-owners-files-from-a-reviewer-hover
branch
October 29, 2026 00:09
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.
Part of: EXC-2107
Change Kind: new feature
What changed
On a pull request's Conversation tab, hovering or focusing a code-owner shield beside a PR reviewer opens a small card listing the changed files that code owner owns. The card opens from the shield rather than the name, so GitHub's own hovercard keeps the avatar and name, and the two never show at once: gh-prism waits 200 ms, longer than GitHub's card takes to close. Every gh-prism popup now draws one 1px edge instead of a border doubled by Primer's shadow ring.
A reviewer's files now include their teams' files, and a reviewer keeps their shield after they review:
page_data/review_requests, the source of GitHub's own React reviewer list, instead ofpage_data/merge_box. It names the team a review was on behalf of (onBehalfOfTeams) and the team a request was assigned from (delegatedFromTeam), wherever GitHub lets the viewer see that team. It also flags a code owner GitHub names no team for, and it lists comment-only reviews, whichmerge_boxleft out./orgs/<org>/teams/<slug>/membersas JSON, the endpoint GitHub's team mentions read, once per team per visit. gh-prism reads members only when GitHub shows the viewer a team among the reviewers, so a viewer outside the organization sends no extra request.gh-prism-ownerfilter that section sets all use the same ownership rule. Picking a reviewer keeps the files their card lists._. If GitHub later draws its own shield in a row, gh-prism's gives way. A click on either shield does nothing; that stays free for the details modal planned on top of this PR.The code owners and PR reviewers are read once per visit, when a Reviewers list first shows.
A
gh-prism-ownerpage waits only on the reads its filter needs: a team's filter on the code owners alone, a user's on the PR reviewers and their teams too. A read still out after 10 s counts as failed, so every file shows without the code owners, and only the user's own files without the reviewers.What to test
frontend's shield in the Reviewers sidebar. A card listsapi/generated/client.tsandweb/app.ts. Then hover thefrontendname: GitHub's card opens and gh-prism's doesn't.@excessive-dev/frontend, and@excessive-dev/platform.frontend. It listsapi/generated/client.tsandweb/app.ts.The sandbox has one account, which authored its pull requests, so it can't stage a team member's review or a user code owner. Check these on a pull request in your own organization, where a team owns files through CODEOWNERS:
Screenshots
Captured by the live check on sandbox PR #1 with the built extension, at 1400 × 1000.
Light. First, GitHub's tooltip, just before the card opens. Then the card is open. Last, GitHub's own hovercard, from the name, for comparison.
Dark. The same three states, in the same order.
One edge. The code owners popover on Files changed, light then dark:
The diffstat tip, light then dark:
gh-prism's shield for a reviewed code owner. These were taken on the live nodejs/node#67056 Conversation tab, with GitHub's real styles. Its
review_requestsanswer was edited in the browser to what a nodejs member would get, pimterry's approval being on behalf ofnodejs/crypto, because GitHub shows that team only to members. Each pair shows the shield beside GitHub's approval check, then its card. GitHub draws its re-request icon only for viewers who can re-request, which this account can't do there.The file sidebar's shield, opened by hover on sandbox PR #1, light then dark:
Known limits
onBehalfOfTeams, the code-owner flag, and team member lists, from a viewer outside the organization. There, a reviewer who owns files only through a team gets no shield and no filter-menu entry. On src: make crypto backend checks explicit nodejs/node#67056, signed in outside nodejs, GitHub draws no shield, and gh-prism adds none.featureStates.overviewreadUNAVAILABLEfor every account and repository available here. Its test fixture is labelled as rebuilt.delegatedFromTeam,isCodeOwnerFromDelegation, andonBehalfOfTeamsare read from GitHub's bundle, not observed live, for the same reason as the overview list.review_requestslists them.Notes for review
--shadow-floating-smallalready opens with a 1px ring, so a border beside it drew two edges, which read as about 2px in dark mode. The overlays now let the ring be their edge. The new card takes GitHub's hovercard edge instead: a 1px border and no shadow. The classic notice already drew a single edge, so it is unchanged on purpose.focusoutnames only the tree's host as where focus went. hover-intent waits for thefocusinthat follows to decide, so Shift+Tab back to the shield keeps the popover.pointerout, so once an open card's shield has left the page, the next pointer move outside the card closes it on the usual 150 ms delay.utils/github/code-owners.ts, the owner section, and the owner filter. That was asked for here.