Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
c38d215
style(content): give floating surfaces one edge
macintacos Oct 28, 2026
bd7eba0
feat(github): find a reviewer's code-owner shield
macintacos Oct 28, 2026
ca976d2
refactor(content): share the popover placer
macintacos Oct 28, 2026
4ba1b61
feat(content): list a code owner reviewer's files from their shield
macintacos Oct 28, 2026
41fa7e0
feat(content): open a reviewer's files on the Conversation tab
macintacos Oct 28, 2026
b07d875
fix(content): apply review fixes to the code owner's files popup
macintacos Oct 28, 2026
e9376dd
docs(content): re-wrap the files-page module docblock
macintacos Oct 28, 2026
4815567
refactor(content): name the popup's locals for what they hold
macintacos Oct 28, 2026
5a94ef6
feat(github): read PR reviewers and the teams they review for
macintacos Oct 28, 2026
00ab30f
feat(github): count the owning teams a reviewer belongs to
macintacos Oct 28, 2026
dd899d0
test(github): share the node reads in the code owners tests
macintacos Oct 28, 2026
c348ef7
feat(content): shield every code owner reviewer on Conversation
macintacos Oct 28, 2026
2713be9
refactor(content): share the popup's hover intent
macintacos Oct 28, 2026
d2f2c0a
feat(sidebar): open a file's code owners on hover
macintacos Oct 28, 2026
4eb8206
docs: tighten the code owner reviewer docs after review
macintacos Oct 28, 2026
bf7786f
fix(content): find an Enterprise Managed User's reviewer row
macintacos Oct 28, 2026
e4c8396
fix(github): credit a reviewer with every owning team they belong to
macintacos Oct 28, 2026
d713bf4
fix(content): wait only on the reads an owner filter needs
macintacos Oct 28, 2026
30a2bd8
fix(content): keep a reopened reviewer card's shield described
macintacos Oct 28, 2026
3628ad0
fix(content): close a card whose trigger GitHub replaced
macintacos Oct 28, 2026
a4af6d6
fix(content): let Tab reach a reviewer card's team link
macintacos Oct 28, 2026
3711a93
fix(sidebar): hand a closing owners popover's focus to its row
macintacos Oct 28, 2026
e03369e
fix(content): keep a sidebar popover open on Shift+Tab to its shield
macintacos Oct 28, 2026
a7054ce
test(content): check where gh-prism's classic shield sits
macintacos Oct 28, 2026
7daf250
fix(content): give way to GitHub's shield once it draws one
macintacos Oct 28, 2026
b7cd32c
docs(testing): hover a tree row before tabbing to its shield
macintacos Oct 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions CONTEXT.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ and its head. A revisit with the same pin lands its intent without reading the d
commit's page. _Avoid_: files page, diff page

**Header tab**: A pull request's Conversation, Commits, or Checks tab. It shares the Files
changed tab's header, so gh-prism shows only the diffstat there. _Avoid_: other tab
changed tab's header, so gh-prism shows the diffstat there. _Avoid_: other tab

**Page kind**: Which Files view shows the diff: a pull request's Files changed tab or a
commit's page. _Avoid_: page type, view type
Expand Down Expand Up @@ -108,9 +108,11 @@ mode
changed file, kept as its token (`@user`, `@org/team`). _Avoid_: owner, when the viewer's
own ownership is meant

**PR reviewer**: An account requested to review a pull request, or whose review GitHub's
merge box lists. A reviewer who only commented isn't one. _Avoid_: reviewer alone, which
names the person reading the diff
**PR reviewer**: An account requested to review a pull request, or that submitted a review
of it, commenting included. Someone who only commented outside a review isn't one. A PR
reviewer owns the changed files whose code owners name them, a team GitHub says they
review for, or a team whose members GitHub lists them among. _Avoid_: reviewer alone,
which names the person reading the diff

**Owner filter**: gh-prism's narrowing of a pull request's files, in the sidebar and the
diff list, to the files one code owner owns, set by the `gh-prism-owner` query parameter,
Expand Down
25 changes: 16 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,24 @@ how to get the new tab. Once you close the dialog, it stays closed, and
- It marks a file Viewed on GitHub when you tick the checkbox on its row, or when you
Alt-click the row (Option-click on macOS). Doing either again marks it not viewed.
- On a pull request, hovering or focusing a file's row shows a shield when the file has
code owners. Clicking the shield lists them, each team or user linked to their GitHub
page.
code owners. Hovering, focusing, or clicking the shield lists them, each team or user
linked to their GitHub page.
- On a pull request's Conversation tab, hovering or focusing the code-owner shield beside
a team or person in the Reviewers list lists the changed files that code owner owns.
When a team makes them a code owner, the list names that team. gh-prism adds the shield
where GitHub draws none, such as beside a code owner who has reviewed.
- After an update, the sidebar opens with a collapsed **What's new in vX.Y.Z** block of
that version's release notes. It goes away when you dismiss it, or 3 days after you
first see it.
- Adding `gh-prism-owner=<owner>` to a pull request's Files changed URL, where the owner
is a team such as `org/team` or a user's login, narrows the sidebar and the diffs to the
files whose CODEOWNERS rule names that owner. A user's filter doesn't include files they
own only through a team. It combines with GitHub's own filters, and removing it from the
URL shows every file again. You can also pick the owner from the
**Only files owned by…** section of the file tree's filter menu, which lists **Me** and
each reviewer who owns a changed file; picking a reviewer reloads the page narrowed to
their files.
files whose CODEOWNERS rule names that owner, or a team GitHub shows you the owner
reviewed for, was assigned from, or belongs to. GitHub shows you teams only in your own
organizations, so a user's filter leaves out files they own through a team you can't
see. It combines with GitHub's own filters, and removing it from the URL shows every
file again. You can also pick the owner from the **Only files owned by…** section of the
file tree's filter menu, which lists **Me** and each reviewer who owns a changed file;
picking a reviewer reloads the page narrowed to their files.
- A **Report a miscategorized file** button beside the file tree's filter opens a new
issue on gh-prism's repository with your gh-prism version filled in, and, on a public
repository only, the diff's URL.
Expand Down Expand Up @@ -113,7 +118,9 @@ gh-prism needs access to three hosts and to Chrome's extension storage, and noth
runs inside matching pages, also runs here, so gh-prism catches GitHub's in-page
navigation into a pull request or commit. It acts only on Files changed and commit
pages, and on a pull request's Conversation, Commits, and Checks tabs, where it reads
the diff to split the header's lines-changed counter by section.
the diff to split the header's lines-changed counter by section, and, on Conversation,
the code owners and reviewers to list a code owner's files. It reads an owning team's
members only when GitHub shows you a team among the pull request's reviewers.
- `https://patch-diff.githubusercontent.com/*` is where GitHub redirects diff downloads.
- `https://raw.githubusercontent.com/*` is where GitHub redirects raw-file downloads.
- Extension storage holds the side you put the sidebar on, whether the header's
Expand Down
51 changes: 51 additions & 0 deletions design/decisions.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,57 @@ maintain its design direction.*
Each entry records one design pick: what was compared, what won, and why. Add new entries
at the top, dated.

## 2026-10-28: A file's code owners on hover

- **Compared:** for the file sidebar's shield, opening its popover on a click only, and
opening it on hover and focus with the Conversation popup's timing. For a click on a
shield whose popover hover already opened: closing it, as a second click closes a
click-opened popover, and keeping it open with focus inside.
- **Won:** hover and focus open it, and that click keeps it open, taking focus.
- **Why:** one timing for both code-owner popups, so a reviewer who learns one knows the
other. A click right after the popover appears is a reach for its links, so closing it
then would undo what the reviewer asked for.

## 2026-10-28: A shield for every code owner reviewer

- **Compared:** for a PR reviewer who owns files where GitHub draws no shield, as after a
code owner reviews: a shield drawn as GitHub's own, a mark of gh-prism's own beside the
name, and the popup opening from the name. For the teams that make a reviewer an owner:
one line under the count, a team label on each file row, and nothing. For a code owner
whose team GitHub hides: a sentence in the popup, and no popup.
- **Won:** a shield drawn as GitHub's, in the same spot; one "Through @org/team" line,
each team linked; and one sentence saying GitHub hides the team.
- **Why:** one trigger for every code owner keeps one gesture to learn, and a shield
matching GitHub's reads as the same fact GitHub states, that the reviewer is a code
owner. A mark of gh-prism's own would be a second symbol for it, and the name keeps
GitHub's hovercard. A single line names the team without repeating it on every row,
which is noise when one team owns them all. A shield that opens nothing reads as broken,
so the hidden team gets a plain sentence, as [`brief.md`](brief.md) asks of a degraded
state.

## 2026-10-28: A code owner's files, from their Reviewers sidebar shield

- **Compared:** four triggers for the popup listing a code owner's files:
- the code-owner shield, the shield icon GitHub shows beside a team or person in the
Reviewers sidebar who owns code in the pull request;
- the name or avatar, replacing GitHub's card with gh-prism's on shielded rows;
- the name, appending the list into GitHub's card, which grows the card away from the
arrow GitHub placed it by;
- the name, opening beside GitHub's card, which stacks two cards at once.

Also compared: GitHub's three measured edges for a floating surface. Primer's ActionMenu
draws no border and lets `--shadow-floating-small`'s 1px ring be its edge. A legacy
`details-menu` dropdown draws a 1px `--borderColor-default` border and that full shadow,
so its edge doubles. The hovercard draws the 1px border and no shadow.
- **Won:** the shield as the trigger. One edge won for every floating surface: overlays
take the ActionMenu's ring, and the code owner's files popup takes the hovercard's
border.
- **Why:** the shield has only a tooltip, so gh-prism's card never shares a trigger with
GitHub's. A PR reviewer without a shield gets no popup. Each surface gets one edge
because two read as about 2px in dark mode. The popup opens one row away from where
GitHub's hovercard opens, so it takes that card's 1px `--borderColor-default` border
rather than a shadow.

## 2026-10-28: Only files owned by… in GitHub's filter menu

- **Compared:** building the section from gh-prism's own classes against copying GitHub's
Expand Down
62 changes: 55 additions & 7 deletions design/patterns.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@ mid-word. The row's title and accessible name still carry every part.

An owned file's icon gives way to a shield while its row is hovered or focused, as a
folder's icon gives way to its chevron. The shield is Octicons `shield-lock`, muted at
rest and `--fgColor-default` on hover. Clicking it, or Enter or Space on it, opens a
popover listing the file's code owners. `sidebar/section-tree.css` swaps the icon for the
shield; `sidebar/owners-popover.ts` builds the popover.
rest and `--fgColor-default` on hover. Resting the pointer on it opens a popover listing
the file's code owners, with the code owner's files popup's timing below, and so does
focusing it. Clicking it, or Enter or Space on it, opens the popover and moves focus into
it, where it stays until Escape or a click outside. `sidebar/section-tree.css` swaps the
icon for the shield; `sidebar/owners-popover.ts` builds the popover.

A folder chain short of room keeps its first folder and as many trailing folders as fit
around one `…`. With room for less, it shows `…` and the deepest folder alone. Only the
Expand Down Expand Up @@ -110,10 +112,56 @@ hover, so they never show the keycap.

## Floating surfaces

A surface that floats over the page sits on `--overlay-bgColor`, falling back to
`--bgColor-default`, inside the default border, with the medium radius and
`--shadow-floating-small`. The header counter's tip in `header/diffstat-view.ts` and the
code owners popover in `sidebar/owners-popover.ts` share it, class for class.
An overlay that floats over the page sits on `--overlay-bgColor`, falling back to
`--bgColor-default`, with the medium radius and `--shadow-floating-small`. The header
counter's tip in `header/diffstat-view.ts` and the code owners popover in
`sidebar/owners-popover.ts` share it, class for class.

A floating surface draws one 1px edge, never two. An overlay draws no border of its own,
because `--shadow-floating-small` opens with a 1px ring that draws its edge, as in
Primer's ActionMenu. Browsers give `[popover]` and `<dialog>` a default border, which
would add a second edge, so such an overlay clears it with `tw:[border:0]`. The code
owners popover does, and so does the classic notice in `classic/notice.ts`, which keeps
its own radius.

A hover card whose trigger sits next to one of GitHub's hovercard triggers takes GitHub's
hovercard form instead: the 1px `--borderColor-default` border, the medium radius, and no
shadow. The rule above holds, because that border is its one edge. The code owner's files
popup below is the one such card.

## Code owner's files

On a pull request's Conversation tab, a code-owner shield beside a team or person in a
Reviewers list opens a popup listing the changed files that code owner owns. The avatar
and name keep GitHub's own hovercard, so the two cards never share a trigger.

- **The shield:** GitHub's own, or gh-prism's beside a PR reviewer who owns a changed file
where GitHub draws none, as after a code owner reviews. gh-prism's is drawn as GitHub's
is in that list: Octicons `shield-lock` at 16px, muted, just before the status icon. In
the classic sidebar it takes GitHub's own `btn-link muted-icon` classes; in the overview
list, the look of Primer's small invisible `IconButton`. A 24px target surrounds the
16px glyph without moving it. Its accessible name says, in GitHub's words, "… is a code
owner", adding "through" and the team when only a team makes them one.
- **Timing:** it opens 200 ms after the pointer rests on the shield, longer than GitHub's
card takes to close, and at once when the shield takes keyboard focus. It closes 150 ms
after the pointer leaves both shield and popup, so the pointer can cross into it. Tab
from the shield moves into it, so its team links work from the keyboard. Escape, focus
leaving both, and a scroll outside the popup close it at once, handing focus it held
back to the shield. One is open at a time.
- **Content:** the count line "Code owner of N files in this pull request", in GitHub's
own words from its user hovercard. When teams make them an owner, a small muted line
under it says "Through" and names each team, linked to its team page, or "Directly and
through" when CODEOWNERS names them too. Then one row per file, its path in monospace
with the directory muted. A long list scrolls inside the popup.
- **When GitHub hides the team:** a code owner GitHub marks without letting you see which
team makes them one gets one plain muted sentence instead of the list.
- **The tooltip:** the classic shield's own GitHub tooltip ("… is a code owner") says
less, so the popup's stylesheet hides it while the popup is open. It stays the shield's
accessible name.

It takes the hovercard form above on `--overlay-bgColor`, and matches GitHub's hovercard
in size: 14px body text, 16px padding, and at most 360px wide.
`conversation/reviewer-files.ts` and `conversation/reviewer-files.css` hold it.

## Loading

Expand Down
3 changes: 2 additions & 1 deletion design/tokens.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ Counts, markers, and status letters in a row use `--fontStack-sansSerif`, with t
figures so columns of counts line up.

Sizes, line heights, and weights are the `--text-body-*`, `--leading-body-*`, and
`--font-weight-*` tokens in `ui/tailwind.css`.
`--font-weight-*` tokens in `ui/tailwind.css`, and the monospace face is its `--font-mono`
(`tw:font-mono`).

## Radius

Expand Down
Loading
Loading