Skip to content

Name Packages pane Browse and Remove buttons by package - #19522

Merged
gtritchie merged 7 commits into
mainfrom
bugfix/19470-packages-browse-remove-labels
Nov 9, 2026
Merged

gtritchie merged 7 commits into
mainfrom
bugfix/19470-packages-browse-remove-labels

Conversation

@gtritchie

@gtritchie gtritchie commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

In the Packages pane:

  • The Browse button now appears only when the package has a browse URL. Packages with none, such as those installed from a local path, used to show a Browse button with an empty alt text and tooltip that opened an empty URL.
  • The Browse button's alt text is now "Browse " (e.g. "Browse dplyr"), instead of "Browse package on []". The source is left out because the Source column's text often isn't the site Browse opens (a repository URL, Local [<path>], [Unknown]). The URL is the tooltip, as Name the Packages pane Help button by its action, not its URL #19519 did for the Help button.
  • The Remove button's alt text and tooltip are now "Remove " instead of "Remove package" on every row.
  • ImageButtonColumn ignores events on a cell whose button is hidden. A click on one used to throw a TypeError on the missing button element. This already happened for empty Help cells, and this change adds empty Browse cells.
  • showButtonImpl compares the source to "Base" with equals() instead of !=.
  • Browse labels left unused (browsePackageOn, browsePackageCRANLabel, browsePackageBioconductorLabel, browsePackageGitHubLabel) are removed. None has a caller in rstudio or rstudio-pro.

Tests: Playwright tests in packages_pane.test.ts cover the Browse and Remove names for DBI, no Browse button for a package with no browse URL, and no Browse or Remove button for a base package. They pass in server-dev mode, and the name and missing-URL tests fail without the fix. ImageButtonColumn unit tests cover clicks on an empty cell and on a rendered button.

Fixes #19470.

The Browse button showed for packages with no browse URL, such as those
installed from a local path, with an empty alt text and tooltip. It now
shows only when there is a URL. Its alt text was "Browse package on
<source> [<url>]"; it is now "Browse <pkg> on <source>", and the URL
moves to the tooltip. The Remove button's alt text and tooltip were
"Remove package" on every row; they are now "Remove <pkg>".

Addresses #19470
When showButton() hides a row's button, the cell renders nothing, and a
click on it read the missing first child and threw a TypeError. Rows
like a local package's Browse cell, empty since the previous commit,
now ignore the click instead.

Addresses #19470
browsePackageBioconductorLabel and browsePackageGitHubLabel had no callers
in rstudio or rstudio-pro.

Addresses #19470
@gtritchie gtritchie added this to the 2026.12 (Parrot Balsam) milestone Nov 8, 2026
@gtritchie

gtritchie commented Nov 8, 2026 •

Copy link
Copy Markdown
Member Author

Earlier review findings considered and deliberately not acted on, for any later reviewer:

  1. The Browse tooltip is the bare URL, without naming the action. Intentional: the action is in the alt text and the URL is in the tooltip, matching what Name the Packages pane Help button by its action, not its URL #19519 did for the Help button and what the issue comments asked for.
  2. The local-package e2e tests leave their temporary source directories and library on disk. They are created under the R session's tempdir() inside the test sandbox, which is discarded after the run. The tests' finally blocks restore .libPaths().
  3. Cleanup errors in those finally blocks can replace an assertion failure in the report. The other tests in the suite clean up the same way.

(Edited: three findings listed here earlier have since been fixed. They were the "[Unknown]" source in the Browse label, the showButtonImpl string comparison, and the null-value early return in ImageButtonColumn.)

@gtritchie gtritchie left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Review findings (none blocking): four inline comments, plus one outside the diff:

  • showButtonImpl (PackagesPane.java:603-607), which Browse and Remove both still call: getPackageSource() == null can't be true, because the JSNI getter returns this["source"] || "". Also, source != "Base" compares Strings by reference in Java and only works because compiled GWT compares JS strings by value. !"Base".equals(object.getPackageSource()) says what's meant. This is existing code, so the change is optional.

"Browse <pkg> on <source>" used the Source column's text, which isn't
where Browse goes for a local install (e.g. "Browse limma on Local
[/path]" for a bioconductor.org URL) or when the source is unknown
("Browse limma on [Unknown]"). Those now read "Browse <pkg>".

Addresses #19470
A null cell value already means showButton() hid the button, so return
early on it instead of inferring that from a missing child element.

Addresses #19470
showButtonImpl compared the source to "Base" with != and checked for a
null that getPackageSource() never returns. Use equals() instead, and
test that a base package has no Browse or Remove button.

Addresses #19470
@gtritchie

Copy link
Copy Markdown
Member Author

Re the showButtonImpl finding in the review summary: done in 7ddceee. It now uses !"Base".equals(object.getPackageSource()) with the impossible null check removed, and a new e2e test checks that stats has no Browse or Remove button.

The Source column's text is often not the site Browse opens. Packages
installed from a repository through RStudio's install hook have the
repository URL as their source, so the label read "Browse askpass on
https://cran.rstudio.com", putting a URL back in the name. Local and
unknown sources were special-cased already; drop the source instead.

Addresses #19470
@gtritchie

Copy link
Copy Markdown
Member Author

Re-review at 8617892: all review findings are resolved, and I found nothing new.

  • Browse label (source text such as [Unknown], an empty source, or a repository URL from RStudio's install hook): fixed by always using "Browse ".
  • Missing test for a non-repository source: no longer needed now that the label doesn't use the source. The DBI test checks the exact name.
  • ImageButtonColumn hidden-button guard: fixed (value == null early return).
  • showButtonImpl string comparison: fixed (equals).
  • Cleanup errors in finally hiding failures: left as is, for consistency with the suite.

I didn't compile the Java or run the tests locally.

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown

RStudio E2E - all platforms

All tests passed!

#################### 100% pass rate

Passed Failed Skipped Flaky
5243 0 238 1
Platform ✅ Passed ❌ Failed ⚠️ Skipped 🔁 Flaky
✅ auth-teardown 4 0 16 0
✅ desktop-linux 1312 0 45 0
✅ desktop-macos 1318 0 40 0
✅ desktop-windows 1309 0 53 1
✅ server-linux 1252 0 52 0
✅ setup 48 0 32 0
View / download the full report

View report online -- opens in the browser, no download needed. Available for 14 days.

Download playwright-report.zip -- extract and open index.html

Includes screenshots, traces, and step-by-step details for every test. Expires in 15 days.


All platforms - commit 86178921bcfd8909bf9a9240b45af03591888384 - Run #2093

@gtritchie
gtritchie merged commit 46a831e into main Nov 9, 2026
47 checks passed
@gtritchie
gtritchie deleted the bugfix/19470-packages-browse-remove-labels branch November 9, 2026 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Packages pane shows an unlabeled Browse button for packages with no browse URL

1 participant