Repository navigation
Name Packages pane Browse and Remove buttons by package - #19522
Conversation
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
|
Earlier review findings considered and deliberately not acted on, for any later reviewer:
(Edited: three findings listed here earlier have since been fixed. They were the "[Unknown]" source in the Browse label, the |
gtritchie
left a comment
There was a problem hiding this comment.
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() == nullcan't be true, because the JSNI getter returnsthis["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
|
Re the |
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
|
Re-review at 8617892: all review findings are resolved, and I found nothing new.
I didn't compile the Java or run the tests locally. |
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 |
In the Packages pane:
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.ImageButtonColumnignores 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.showButtonImplcompares the source to "Base" withequals()instead of!=.browsePackageOn,browsePackageCRANLabel,browsePackageBioconductorLabel,browsePackageGitHubLabel) are removed. None has a caller in rstudio or rstudio-pro.Tests: Playwright tests in
packages_pane.test.tscover 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.ImageButtonColumnunit tests cover clicks on an empty cell and on a rendered button.Fixes #19470.