Repository navigation
keep data viewer pinned columns pinned across column pagination - #17838
Merged
Merged
Conversation
Pinned columns, the sort column, and per-column filters are now tracked by absolute column index in the full frame rather than by their position within the currently fetched window, and the column request asks for any pinned columns alongside the visible window so an off-window pinned column keeps its data. Previously a pinned column was tracked by window position, so paging to a different set of columns left the pin on whatever column now occupied that slot. The server-side column request is now an explicit ordered list of absolute column indices (pinned first, then the window), which also removes the column-offset realignment of sort and filter indices on the backend. Addresses #17835.
The post-load column auto-size rebuilds the header row, which would tear down an open per-column filter editor (a popup, or the inline text-filter input) while the user was still typing into it. Defer that rebuild while a header editor is open and flush it once the editor closes, so keystrokes typed into a filter immediately after opening a wide frame are not lost.
The per-column filter test opened its retry loop with inputValue() on the text-filter input before the editor existed, blocking ~10s on the action timeout each load. Probe with count() (instant) and wait for the initial row batch before opening the filter; the test body drops from ~12s to ~2s. Also document how to profile a slow Playwright test (force a trace, then pair the before/after events in test.trace by callId) in the e2e README and the run-playwright-tests skill.
The global td background rule painted an opaque --grid-bg over the sidebar stats table, so the .sidebar-col hover highlight stopped at the expanded summary widget. Keep the stats cells transparent so the parent background shows through.
The plain Reset View MenuItem rendered its label flush left while the CheckableMenuItem reserves a 25px icon column, leaving Reset View looking offset. Render its label through formatMenuLabel so it carries the same icon column. Add a single-arg AppCommand.formatMenuLabel(String) overload for this label-only case.
getActiveCellTd located the cell by the rsGridCell_<row>_<col> id, but buildRow assigns that id only to the cell that is already active. So when setActiveCell updated activeRow/activeCol and looked up the newly targeted cell to mark it, the lookup returned null and .activeCell was never applied; the highlight only reappeared once a later render pass (e.g. a scroll) rebuilt the row and re-derived the class from activeRow/activeCol. Headers were unaffected because getActiveHeaderTh resolves by column index. Look the cell up by data-col-pos, which buildRow sets on every rendered cell, so the highlight lands immediately. Regression from #17812.
Guards the regression fixed in the previous commit: clicking or arrow-keying a cell must apply .activeCell to the live cell immediately, not only after a later scroll re-renders the row. Asserts on the class rather than the painted outline so it does not depend on focus/compositing state.
3 of 4 tasks
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 #17835.
A column pinned in the data viewer stopped tracking its original column once you
paged to a different set of columns in a very wide data frame (ncol > the
200-column page size). The pin stayed on whatever column now occupied that slot
instead of the column the user pinned.
Cause
Pinned columns -- and, as it turns out, the sort column and per-column filters --
were tracked by their position within the currently fetched column window,
not by a stable column identity. The backend also only sent the contiguous
window of columns, so once a pinned column scrolled out of the window its data
wasn't even on the client anymore.
Change
Track pinned columns, the sort column, and per-column filters by absolute
column index in the full frame. The column request is now an explicit ordered
list of absolute indices (pinned columns first, then the visible window), so a
pinned column outside the window is fetched alongside it and keeps both its
identity and its data across pagination. Each column the server returns carries
its absolute
col_index. This also lets the backend drop the column-offsetrealignment it used to apply to sort/filter indices.
Saved per-object UI state now persists these as absolute identities (state
version bumped so stale positional payloads are dropped).
Also included
auto-size rebuilds the header row, which previously tore down an open
per-column filter editor mid-type. It's now deferred while an editor is open
and flushed when it closes -- so keystrokes typed into a filter immediately
after opening a wide frame aren't lost.
retry loop with
inputValue()on an input that didn't exist yet, blocking~10s per load; it now probes with
count()and waits for the initial rowbatch first (test body ~12s -> ~2s). Added a "Profiling a slow test" recipe
(force a trace, pair
before/afterevents intest.trace) to the e2eREADME and the run-playwright-tests skill.
Testing
./rstudio-tests --scope r --filter dataviewer-- 91 pass (rewrote thedescribeColSlicetests for the newdescribeColsByIndex; addedcol_indexand column-ordering coverage).
tests/panes/data-viewer/-- 16 pass, including a new regressiontest that pins column 1 in a 300-column frame, pages to columns 101-300, and
asserts the pinned slot still reports absolute column 1 and that its data
followed the pin.