Repository navigation
give the data viewer grid an overscroll tail past the last row - #18652
Merged
kevinushey merged 12 commits intoAug 27, 2026
Merged
Conversation
The custom horizontal scrollbar floats over the bottom 11px of the grid panes rather than taking layout space, and renderVisibleRows sized the bottom spacer to exactly the rows left below the window -- so the grid's scroll range ended with the last row flush against the viewport bottom, permanently half covered by the bar with nowhere left to scroll. visibleBodyHeight already discounted those 11px, which is how ensureActiveCellVisible clears the bar for every other row; the last row was the one target that could never reach the same place. Add a matching overscroll tail to the bottom spacer, mirroring the summary sidebar's tail (renderSidebarWindow) and the horizontal overscroll padding that keeps the rightmost column reachable (applyPinnedColumns). The tail is gated on overlay-scrollbar mode, since a native horizontal scrollbar takes layout space and is already excluded from clientHeight -- visibleBodyHeight now shares that gate too, instead of subtracting 11px in a mode where nothing overlays the rows. Because the tail lets scrollTop run past the last row, clamp the render window's start against its end so a very short viewport can't push it off the end of the frame, and fold the tail into the window identity so a change in horizontal overflow re-sizes the spacer on its own. Addresses #18620.
kevinushey
temporarily deployed
to
e2e-playwright
August 26, 2026 19:05 — with
GitHub Actions
Inactive
kevinushey
temporarily deployed
to
e2e-playwright
August 26, 2026 19:05 — with
GitHub Actions
Inactive
kevinushey
temporarily deployed
to
e2e-playwright
August 26, 2026 19:08 — with
GitHub Actions
Inactive
kevinushey
temporarily deployed
to
e2e-playwright
August 26, 2026 19:08 — with
GitHub Actions
Inactive
kevinushey
temporarily deployed
to
e2e-playwright
August 26, 2026 19:12 — with
GitHub Actions
Inactive
kevinushey
temporarily deployed
to
e2e-playwright
August 26, 2026 19:12 — with
GitHub Actions
Inactive
kevinushey
temporarily deployed
to
e2e-playwright
August 26, 2026 19:15 — with
GitHub Actions
Inactive
kevinushey
temporarily deployed
to
e2e-playwright
August 26, 2026 19:15 — with
GitHub Actions
Inactive
kevinushey
temporarily deployed
to
e2e-playwright
August 26, 2026 19:15 — with
GitHub Actions
Inactive
kevinushey
temporarily deployed
to
e2e-playwright
August 26, 2026 19:15 — with
GitHub Actions
Inactive
kevinushey
temporarily deployed
to
e2e-playwright
August 26, 2026 19:15 — with
GitHub Actions
Inactive
kevinushey
temporarily deployed
to
e2e-playwright
August 26, 2026 19:15 — with
GitHub Actions
Inactive
RStudio E2E - all platformsAll tests passed!
View / download the full reportView report online -- opens in the browser, no download needed. Available for 14 days. Download playwright-report.zip -- extract and open
All platforms - commit |
hScrollbarOverlayHeight assumed a native horizontal scrollbar always takes
layout space and is therefore already excluded from clientHeight. That holds
on Windows and Linux, but not on macOS, where native bars are overlays by
default ("Show scroll bars: When scrolling") and clientHeight still spans the
strip underneath. Returning 0 there re-opened the bottom-edge case #17958
fixed -- ensureActiveCellVisible would leave the last row half covered, and
updateInfoBar would count an occluded row as visible.
Measure the gutter instead: the scroll panes carry no border, so
offsetHeight - clientHeight is exactly the space the native bar claimed, and
zero means it floats like ours does. The overscroll tail now applies in that
configuration too, which is where it is equally needed.
Also drop the last hand-written 11 alongside the new constant: the vertical
overlay bar's bottom inset re-implemented the same overflow test, which is
the duplication H_SCROLLBAR_HEIGHT was introduced to remove.
The e2e geometry read ran off whichever row was last rendered; the
full-rebuild path stops at the first row missing from the block cache, so
wait for row 499 to be attached before measuring.
hScrollbarOverlayHeight now feeds both visibleBodyHeight and the bottom spacer's overscroll tail, and its answer changes when the scrollbar mode flips. applyScrollbarMode created or destroyed the overlay bars and updated them, but never re-rendered the window, so an overlay -> native switch on an open grid left an 11px dead-scroll tail past the last row until some unrelated event forced a rebuild. Every other site that can change horizontal-overflow state (onResize, toggleSidebar, column resize end, filter row toggle, tab activation) already pairs the two. Cover the native path in the e2e suite: the grid is opened in overlay mode, the preference is flipped on the open grid (the setOption path that has to re-render), and the last row's bottom edge is asserted against the viewport's measured gutter -- flush with the client box where the native bar takes layout space, a tail's height clear of it where the platform draws the bar as an overlay. That pins whichever branch the host runs. Also note the second, approximate use of H_SCROLLBAR_HEIGHT in its doc comment, and reword the newStart clamp comment: with BUFFER_ROWS = 25 and a tail only a couple of rows tall the clamp is defensive, not a live case.
…n the test The switch changes visibleBodyHeight in both directions at once -- the 11px overlay discount disappears while clientHeight shrinks by the native gutter -- and updateInfoBar derives the "Showing X to Y" range from it, so the range stayed a row off until the next scroll. onResize already pairs the two for the same class of change. The e2e test did not actually pin the re-render it was written for: every assertion came after eight wheel events, and the incremental render path repairs a stale tail on its own (the skip check compares overscroll against renderOverscroll). Read the scroll range immediately after the flip instead, before any scroll input, and assert it loses exactly the tail where the native bar takes layout space and keeps it where the platform overlays. Also gate the test on horizontal overflow rather than on the bar being in the DOM: attachCustomScrollbar leaves the element attached and only sets display:none when the axis doesn't overflow, so on a host wide enough to fit 30 columns a correct 0 tail would have failed as a tail mismatch.
…ding applyScrollbarMode also runs from initGrid, after installColumnResponse has set totalRows but before the first block has set filteredRows. updateInfoBar took its no-rows branch there while filteredRows < totalRows, so every View() briefly rendered -- and, the info bar being aria-live, announced -- "Showing 0 to 0 of 0 entries (filtered from N total entries)". Refresh the info bar only once a block has landed; the paired render was already a no-op at that point. The mode switch also changes clientWidth by the native vertical bar's width, which is what applyPinnedColumns sizes the horizontal overscroll padding from, so the rightmost column stopped landing flush at maximum horizontal scroll until an unrelated resize recomputed it. Recompute it here with the rest. On the test side, assert the info bar's range immediately after the flip, computed from the measured client box rather than hardcoded, and flip back to overlay mode at the end: the scroll range returning to its original value is what proves the pre-flip baseline the tail delta is measured against carried the tail in the first place.
…elpers filteredRows > 0 was broader than the bootstrap case it was meant to exclude: a live switch while a filter matches no rows also skipped the refresh, and the info bar's text is not row-independent there -- it still carries the visible column range, which is derived from clientWidth and does change at the switch. bootstrapping is set for exactly the initGrid call and clear for every setOption one, so guard on that instead. The two bottom-edge tests had drifted into ~40 duplicated lines: the overflow precondition, the wheel-to-bottom-and-wait sequence and the last-row geometry read are now shared helpers. Also pin the pinned-padding half of the previous commit: the padding is clientWidth minus the last unpinned column's width, so across the switch it moves by exactly the client-width delta, which is deterministic in both scrollbar modes. And derive both ends of the asserted info-bar range from the live scrollTop -- the viewer restores a saved scroll offset for a frame of the same name and row count, so a retry can reopen the grid at the bottom and "Showing 1 to N" would not hold.
…urrent The mode switch changes clientWidth, which is what computeColumnWindow derives the rendered column window from, so run syncColumnWindow ahead of the rebuild the way onResize does. BUFFER_COLS absorbs a scrollbar's width in practice, but the two "the client box changed" paths should not diverge. applyPinnedColumns stays alongside it: syncColumnWindow only reaches it when the window actually moved, which a scrollbar's width usually will not do. !bootstrapping alone dropped a refresh the previous guard was providing. In data-import preview mode initWithData publishes a range before autoSizeColumns and applyPinnedColumns settle the widths that decide whether the grid overflows horizontally, and there is no fetch response afterwards to correct it -- so the range could stay a row off. filteredRows is already set there, so keeping both conditions covers it while still suppressing the server bootstrap's "Showing 0 to 0 of 0" announcement. Also assert the overlay test's bottom edge two-sided, so a tail larger than the bar's height fails as well; the last row's position is measured against the viewport's own client box, leaving the bar's rect for the one-sided "clears the bar" check.
kevinushey
temporarily deployed
to
e2e-playwright
August 27, 2026 04:28 — with
GitHub Actions
Inactive
kevinushey
temporarily deployed
to
e2e-playwright
August 27, 2026 04:28 — with
GitHub Actions
Inactive
kevinushey
had a problem deploying
to
e2e-playwright
August 27, 2026 04:31 — with
GitHub Actions
Failure
kevinushey
temporarily deployed
to
e2e-playwright
August 27, 2026 04:31 — with
GitHub Actions
Inactive
kevinushey
temporarily deployed
to
e2e-playwright
August 27, 2026 04:36 — with
GitHub Actions
Inactive
kevinushey
temporarily deployed
to
e2e-playwright
August 27, 2026 04:36 — with
GitHub Actions
Inactive
kevinushey
temporarily deployed
to
e2e-playwright
August 27, 2026 04:36 — with
GitHub Actions
Inactive
kevinushey
temporarily deployed
to
e2e-playwright
August 27, 2026 04:36 — with
GitHub Actions
Inactive
kevinushey
temporarily deployed
to
e2e-playwright
August 27, 2026 04:36 — with
GitHub Actions
Inactive
…wer-last-row-under-scrollbar
kevinushey
temporarily deployed
to
e2e-playwright
August 27, 2026 20:05 — with
GitHub Actions
Inactive
kevinushey
temporarily deployed
to
e2e-playwright
August 27, 2026 20:05 — with
GitHub Actions
Inactive
kevinushey
temporarily deployed
to
e2e-playwright
August 27, 2026 20:05 — with
GitHub Actions
Inactive
kevinushey
temporarily deployed
to
e2e-playwright
August 27, 2026 20:05 — with
GitHub Actions
Inactive
kevinushey
temporarily deployed
to
e2e-playwright
August 27, 2026 20:08 — with
GitHub Actions
Inactive
kevinushey
temporarily deployed
to
e2e-playwright
August 27, 2026 20:08 — with
GitHub Actions
Inactive
kevinushey
temporarily deployed
to
e2e-playwright
August 27, 2026 20:09 — with
GitHub Actions
Inactive
kevinushey
temporarily deployed
to
e2e-playwright
August 27, 2026 20:09 — with
GitHub Actions
Inactive
kevinushey
temporarily deployed
to
e2e-playwright
August 27, 2026 20:09 — with
GitHub Actions
Inactive
kevinushey
temporarily deployed
to
e2e-playwright
August 27, 2026 20:09 — with
GitHub Actions
Inactive
kevinushey
temporarily deployed
to
e2e-playwright
August 27, 2026 20:09 — with
GitHub Actions
Inactive
kevinushey
temporarily deployed
to
e2e-playwright
August 27, 2026 20:09 — with
GitHub Actions
Inactive
kevinushey
deleted the
bugfix/18620-data-viewer-last-row-under-scrollbar
branch
August 27, 2026 23:10
kevinushey
temporarily deployed
to
e2e-playwright
August 27, 2026 23:31 — with
GitHub Actions
Inactive
kevinushey
temporarily deployed
to
e2e-playwright
August 27, 2026 23:31 — with
GitHub Actions
Inactive
kevinushey
temporarily deployed
to
e2e-playwright
August 27, 2026 23:31 — with
GitHub Actions
Inactive
kevinushey
temporarily deployed
to
e2e-playwright
August 27, 2026 23:31 — with
GitHub Actions
Inactive
kevinushey
temporarily deployed
to
e2e-playwright
August 27, 2026 23:34 — with
GitHub Actions
Inactive
kevinushey
temporarily deployed
to
e2e-playwright
August 27, 2026 23:34 — with
GitHub Actions
Inactive
kevinushey
temporarily deployed
to
e2e-playwright
August 27, 2026 23:36 — with
GitHub Actions
Inactive
kevinushey
temporarily deployed
to
e2e-playwright
August 27, 2026 23:36 — with
GitHub Actions
Inactive
kevinushey
temporarily deployed
to
e2e-playwright
August 27, 2026 23:36 — with
GitHub Actions
Inactive
kevinushey
temporarily deployed
to
e2e-playwright
August 27, 2026 23:36 — with
GitHub Actions
Inactive
kevinushey
temporarily deployed
to
e2e-playwright
August 27, 2026 23:36 — with
GitHub Actions
Inactive
kevinushey
temporarily deployed
to
e2e-playwright
August 27, 2026 23:36 — with
GitHub Actions
Inactive
2 of 4 tasks
This branch was previously deployed
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.
Intent
Addresses #18620.
The report has two halves -- the Data Viewer "bounces" at the bottom of a large
frame, and the last row is blocked from view. This PR fixes the second half,
which reproduces reliably on every platform.
The bug
The Data Viewer's horizontal scrollbar is a floating overlay
(
.custom-scrollbar.horizontal:bottom: 0; height: 11pxinside#gridPanes),so it covers the bottom 11px of the grid rather than taking layout space. The
virtualizer sized the bottom spacer to exactly
(activeRows - newEnd - 1) * ROW_HEIGHT, so the grid's scroll content ended at the last row: at maximumscroll that row sits flush against the viewport bottom, permanently half hidden
under the bar, with nowhere left to scroll.
visibleBodyHeight()already discounted those 11px -- that is howensureActiveCellVisibleclears the bar for every other row. The last row wasthe one target that could never reach the same place, because the scroll range
stopped 11px short of where it needed to end.
Measured in RStudio Server on macOS with `View(as.data.frame(matrix(seq_len(500
11px below the top of the scrollbar -- the bar covers just under half of it:
The fix
Add a matching overscroll tail to the bottom spacer, so the last row can be
scrolled out from under the bar. This mirrors two affordances the grid already
has for exactly this reason: the summary sidebar's tail (
renderSidebarWindow)and the horizontal overscroll padding that keeps the rightmost column reachable
(
applyPinnedColumns, #17612).The tail is gated on overlay-scrollbar mode, since a native horizontal scrollbar
takes layout space and is already excluded from
clientHeight.visibleBodyHeightnow shares that gate through the newhScrollbarOverlayHeight()helper, instead of subtracting 11px in a mode wherenothing overlays the rows.
Two consequences of letting
scrollToprun past the last row are handled:than the header plus the tail cannot push
firstVisibleoff the end of theframe and render an empty window;
renderOverscroll), so achange in horizontal overflow re-sizes the spacer even when the row window is
unchanged.
The "bounce" half
I could not reproduce a moving scroll position on macOS, in either RStudio
Server or a standalone harness driving the real grid resources. Ruled out with
measurements: the pinned-pane/viewport scroll mirror (Blink drains newly
enqueued scroll events in the same dispatch pass, so
onPinnedScrollneverobserves a stale mirror -- 356 events during a smooth scroll, 0 mismatches),
scroll anchoring (already opted out in #18222),
scrollHeightinstability,fetch-driven relayout, device pixel ratios 1-2, and page zoom 0.8-2.
Both previous bugs in this component (#18221, #18378) were Windows/RHEL-only, so
this one likely is too. The new test asserts the scroll position settles at the
bottom as well as the geometry, so the Windows CI matrix will report on that
half the way it did for #18378.
Testing
New e2e test
the last row clears the horizontal scrollbar at maximum scroll (#18620)indata_viewer.test.ts: views a 500x30 frame so both axes overflow,wheels to the bottom, and asserts the scroll settles, the last row is rendered
inside the viewport, and its bottom edge clears the top of the scrollbar.
Verified against a session serving each version of the grid resources:
Expected: <= 108.5, Received: 119, i.e. the 11px overlapThe full
tests/panes/data-viewer/suite passes (66 tests).