Skip to content

Diffs: the library's own scrollbar at the bottom; remove the top bar - #2763

Merged
backnotprop merged 4 commits into
mainfrom
fix/diff-scrollbar-bottom
Nov 6, 2026
Merged

backnotprop merged 4 commits into
mainfrom
fix/diff-scrollbar-bottom

Conversation

@backnotprop

@backnotprop backnotprop commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner

What changed

  • The custom top bar is gone. DiffHScrollbar, the bar under each file's name, is removed from the browser review app (DiffViewer, AllFilesCodeView) and from the Inbox review. Its Inbox rules for hover and touch go too (Inbox review: the bar under a file's name shows on hover, or under a finger while it moves #2698: [data-diff-hscrollbar] in inbox.css and the data-review-file-moving effect in ReviewPane), with its e2e tests and its doc paragraph.
  • The diff library's own horizontal scrollbar is back at the bottom of each file's code, in split and unified views. A wrapped diff has no bar.
    • usePierreTheme no longer hides it.
    • theme.css resets scrollbar-color on diffs-container. The app-wide * { scrollbar-color } rule leaked into Pierre's shadow root. Chrome ignores ::-webkit-scrollbar styles while that property is set, so Pierre's 6 px bar became a 15 px classic bar that Pierre's layout had no room for, and the file's box cut it off. With the reset, Pierre keeps its own bar and the space it reserves for it.
    • The thumb now has a quiet colour (a mix of the text colour, a little stronger on hover) that you can see in light and dark. Pierre's thumb is transparent until hover, and it was nearly invisible on our background. Firefox gets the same colour through scrollbar-color.
    • In the Inbox, a file is laid out as tall as its content. It now counts Pierre's 8 px under the last row, so the bar sits inside the file's box.
  • Also pinned to the bottom of the screen, like GitHub (DiffBottomBar). Pierre's bar stays at the end of each file. While a file is in view and its own bar is below the screen, a second bar sits at the bottom edge of the scroll pane. It is a plain native scrollbar with Pierre's look, one per column in split view.
    • It follows the code's sideways scroll, and dragging it scrolls the code.
    • It goes away once the file's last row is on screen, so the two bars never show together and it never covers that row.
    • It sits inside the pane, so the comments panel, menus and the Approve control stay on top of it.
    • Nothing is added at the top.

Why

The owner asked for a normal scrollbar at the bottom of each diff, using the library's built-in one, and for the top bar to be removed (the owner's approval "diff-scrollbar-bottom", 2026-11-06). Afterwards the owner chose to also pin a bar to the bottom of the screen while a wide file is in view, as GitHub does. This applies to both the review app and the Inbox.

This removes the approach from #1586, which Karrq built for #1048: a bar pinned under the file header so it stays in reach on long diffs. It is removed at the owner's request.

Checked

  • In the Inbox review and the review app at 1440 px, split and unified, light and dark, and on a 390 px phone:
    • The pinned bar is at the pane's bottom while the file's end is below the screen.
    • Once the file's last row is on screen, only Pierre's bar shows.
    • A wrapped diff shows no bar.
  • With the comments panel open, the panel covers the pinned bar, not the other way round.
  • Sideways scrolling with the wheel or trackpad, a drag on either bar, and a sideways finger drag on a phone all scroll the code. The page does not move.
  • On macOS with overlay scrollbars, Chrome still draws Pierre's styled bar. Unstyled overlay scrollbars show only while you scroll, which is normal.
  • tests/e2e/inbox-code-review.spec.ts and inbox-guides.spec.ts pass against a scratch build. New tests in inbox-code-review.spec.ts:
    • Wheel scrolling.
    • Pierre's bar sits fully inside the file's box, and dragging it scrolls the code.
    • The pinned bar shows, scrolls the code, and goes away at the file's end.
    • A phone drag scrolls the code.
  • The related DOM tests pass. There are no new tsc errors in review-editor or inbox.

The owner's decision: a normal scrollbar at the bottom of each diff, the diff
library's own, and the custom bar under the file name taken out.

- Remove DiffHScrollbar (#1586) from the review app and the Inbox, with the
  Inbox's hover and finger rules for it (#2698) and its e2e tests.
- Stop hiding Pierre's horizontal scrollbar. theme.css's scrollbar-color
  reached into Pierre's shadow root by inheritance, and Chrome then drops
  Pierre's ::-webkit-scrollbar sizing: a 15px classic bar its layout did not
  count, cut off at the file's edge. diffs-container resets it, so Pierre
  keeps its 6px bar and the room it counts for it.
- Give the thumb a quiet visible colour in light and dark (Pierre leaves it
  transparent until hover).
- The Inbox (a file as tall as its layout) counts Pierre's 8px under the last
  row, so the bar sits inside the file's box.
…le's own bar is below the screen

Pierre's bar stays at the bottom of each file's code. While the file is in view and that bar is below the
pane, a native scrollbar (Pierre's 6px look) pinned to the pane's bottom edge mirrors the code's sideways
scroll, one per column in split view; it goes once the file's own bar is on screen. Nothing at the top.
…s; it goes once the file's last row is on screen

A sticky dock at the end of the pane's content holds it, so the comments panel and menus stay over it
(it was fixed in the page above the Inbox's review). It leaves once Pierre's room under the last row
reaches the screen, so it never covers that row.
@backnotprop
backnotprop merged commit 64951ee into main Nov 6, 2026
45 checks passed
backnotprop added a commit that referenced this pull request Nov 6, 2026
Main removed the custom top scrollbar (#2763): the PR page's hover rules for it go, and its tests check the 33 px file head alone. Flush files keep the 8 px foot main now counts for files that scroll with the page.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant