Skip to content

data viewer: restore column count in status bar - #17617

Merged
kevinushey merged 5 commits into
rel-golden-wattlefrom
bugfix/17613-data-viewer-column-count
May 14, 2026
Merged

kevinushey merged 5 commits into
rel-golden-wattlefrom
bugfix/17613-data-viewer-column-count

Conversation

@kevinushey

Copy link
Copy Markdown
Collaborator

Intent

Addresses #17613.

The vanilla-JS data viewer rewrite (#17382) dropped the column count from the info bar. The old viewer (DataTables-based) appended , N total columns to the Showing X to Y of N entries text.

This restores the column count, and at the same time switches "entries" to "rows" so the wording pairs naturally with "columns".

Before:

Showing 1 to 18 of 100,000 entries

After (unfiltered):

Showing rows 1 to 18 of 100,000 total rows, 500 total columns

After (filtered):

Showing rows 1 to 18 of 250 rows (filtered from 100,000 total), 500 total columns

totalCols is already tracked by the viewer; the change is purely in updateInfoBar in DataViewer.js.

No NEWS.md entry: the data viewer rewrite is part of the current (unreleased) Golden Wattle development cycle, so this regression hasn't reached any official-release user.

Test plan

  • df <- data.frame(matrix(1:1000000, nrow = 100000, ncol = 500)); View(df) -- status bar shows row + column counts
  • Apply a global filter that reduces the row count -- status bar shows (filtered from N total) and still reports column count
  • 1-column data frame -- status bar reads "1 total column" (singular)
  • Empty data frame (0 rows) -- info bar remains empty (unchanged from prior behavior)

@kevinushey kevinushey added this to the Golden Wattle milestone May 12, 2026
@posit-snyk-bot

posit-snyk-bot commented May 12, 2026 •

Copy link
Copy Markdown
Contributor

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@gtritchie

Copy link
Copy Markdown
Member

PR Review

Reviewed the diff against src/cpp/session/resources/grid/DataViewer.js. The change is small, surgical, and correctly addresses #17613.

Looks good

  • The empty data frame case is safe: updateInfoBar already returns early with empty text when totalRows === 0 (line 1673), so the totalCols > 0 guard never has to handle the truly-empty deck.
  • The totalCols > 0 check also covers zero-data-column frames where totalCols falls back to cols.length - 1 == 0.
  • Wording / structure matches the rest of the function (toLocaleString, plain string concatenation, no i18n machinery — consistent with the surrounding file).
  • Test plan covers the four cases I'd want exercised (unfiltered, filtered, 1-column singular, 0-row).

Minor: pluralization inconsistency

The PR introduces singular handling for columns:

totalCols === 1 ? " total column" : " total columns"

but leaves the neighboring row strings always plural. So a 1-row frame will read:

  • Unfiltered: Showing rows 1 to 1 of 1 total rows, 5 total columns
  • Filtered to 1: Showing rows 1 to 1 of 1 rows (filtered from 100 total), 5 total columns

The plural-only behavior for rows is pre-existing (the old text said "1 entries"), so this isn't a regression — but since the PR is establishing the new convention by adding singular for columns, it'd be consistent to do the same for the two row strings (" total row" / " total rows", " row " / " rows " in the filtered branch). Cheap to fix while you're here; fine to defer.

Nit (optional)

When activeRows === 0 (filter matches nothing, totalRows > 0), the text reads Showing rows 0 to 0 of 0 rows (filtered from N total), M total columns. The Showing rows 0 to 0 phrasing is pre-existing and unchanged in spirit, so no action needed — just noting it in case you want to tighten the empty-filter wording in a follow-up.

Verdict

LGTM modulo the optional pluralization touch-up. No NEWS.md entry is correct per the PR description (regression introduced in the current dev cycle).

@gtritchie gtritchie left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Addresses #17613.

The vanilla-JS data viewer rewrite dropped the column count from the
info bar. Reword the info text to include it, and use "rows" instead
of "entries" so it pairs cleanly with "columns".
Reverts an unintended wording change that dropped 'total' from the
column count, which broke the Playwright assertions in
pagination-sorting.test.ts. Also adds 'entries' to the filtered
suffix for clarity.
@kevinushey
kevinushey force-pushed the bugfix/17613-data-viewer-column-count branch from 2f47951 to e9fccf9 Compare May 13, 2026 21:40
@kevinushey
kevinushey changed the base branch from main to rel-golden-wattle May 13, 2026 21:40
@kevinushey
kevinushey merged commit bd71aaf into rel-golden-wattle May 14, 2026
@kevinushey
kevinushey deleted the bugfix/17613-data-viewer-column-count branch May 14, 2026 15:50
kevinushey added a commit that referenced this pull request May 14, 2026
* update BUILDTYPE to Release for Golden Wattle

* archive NEWS for golden wattle (#17623)

* trim "What's New" section for Golden Wattle release (#17629)

* limit data viewer horizontal overscroll (#17616)

* limit data viewer horizontal overscroll

Reserve room for the rightmost column when computing the table's
horizontal overscroll padding so it stays visible at maximum scroll;
previously the user could scroll every unpinned column off-screen.
Also sync paddingRight and the custom scrollbar thumb at the end of a
column resize drag (applyResizeDelta intentionally skips these on every
mousemove to avoid jank).

Addresses #17612.

* always allow horizontal overscroll in data viewer

Drop the totalTableWidth > viewport.clientWidth gate so the overscroll
padding is computed even when all columns fit in the viewport. This
keeps horizontal scrolling consistently available regardless of how
wide the table is relative to the viewport.

* skip data viewer overscroll padding when no unpinned columns

When every column is pinned (or no columns exist) there is no column
to scroll into view, so the overscroll formula would add
viewport.clientWidth - pinned.totalWidth of right padding for nothing,
producing a phantom horizontal scrollbar and shrinking the body.

getColumnOrder() places pinned columns before unpinned, so the last
columnOrder entry being unpinned is sufficient to confirm an unpinned
column exists. Gate the overscroll computation on that check; otherwise
leave overscroll = 0.

* add NEWS entry

* data viewer: restore column count in status bar (#17617)

* data viewer: restore column count in status bar

Addresses #17613.

The vanilla-JS data viewer rewrite dropped the column count from the
info bar. Reword the info text to include it, and use "rows" instead
of "entries" so it pairs cleanly with "columns".

* data viewer: keep 'entries' wording in info bar

* data viewer: restore 'total' qualifier in info bar text

Reverts an unintended wording change that dropped 'total' from the
column count, which broke the Playwright assertions in
pagination-sorting.test.ts. Also adds 'entries' to the filtered
suffix for clarity.

* add NEWS entry

* preserve top alignment of help argument names with r-devel (#17622)

Broaden the <h3>Arguments</h3> match so it also handles the id attribute
emitted by R >= 4.6.0 when the dynamic help server includes a table of
contents (the default in r-devel). Without this, the r-arguments-title
class is never added and the CSS rule that top-aligns argument names
never applies.

Addresses #17621.

* add scripts/merge-release-branch.sh

Wraps `git merge --no-ff -X no-renames <branch>` plus the post-merge
fixups needed for a rel-* -> main merge:

- Auto-resolve NEWS.md modify/delete by keeping main's version.
- Auto-resolve version/news/os/NEWS-<ver>-<codename>.md add/add by taking
  the rel branch's content (which has any bug-fix entries added after the
  rotation).
- Reset version/BUILDTYPE, version/RELEASE, version/CALENDAR_VERSION to
  HEAD's values to undo git's trivial-merge fast-take in cases where main
  has not modified the file (most notably BUILDTYPE, which silently flips
  Daily -> Release without intervention).

Stages the merge but does not commit it -- the user reviews with
`git diff --staged` and then runs `git commit`.

The earlier attempt to handle BUILDTYPE via a `merge=ours` driver in
.gitattributes does not work for this scenario: git only consults merge
drivers for true three-way merges (where both sides modified the file),
not for the one-sided trivial merge that BUILDTYPE actually hits.

* restore main's full whats-new/golden-wattle/index.html

The merge of rel-golden-wattle into main applied the trim from #17629,
which curated the What's New content for the release announcement.
Revert that on main so main retains the full pre-trim content; the
trimmed version remains on the rel branch where it ships.

---------

Co-authored-by: Skye Turriff <[email protected]>
Co-authored-by: Gary Ritchie <[email protected]>
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.

3 participants