Add external-link button to the Packages pane#14142
Conversation
Add an optional `url` to ILanguageRuntimePackage and the public LanguageRuntimePackage. The Packages pane renders an external-link button beside the help button when a package has a URL, validating the scheme (http/https only) before opening it externally. The help and link buttons share one icon-button style; the link glyph is nudged a touch smaller for optical balance. The Python kernel picks the single best URL per package from its Project-URL metadata (homepage > repository > documentation, with the legacy Home-page header as a homepage fallback) and returns it from getPackagesInstalled, so pip, uv, and conda all surface it. See #13890
|
E2E Tests 🚀 |
PETE's assessment 🧪Verdict: 🟢 Adequate -- the URL-selection logic carries thorough unit coverage and the new frontend button has e2e render coverage, matching the cheapest viable level for each change. What changed
Tests in this PR
Existing coverage
Suggested additionsNone. Optionally, the no-URL negative branch ("a package with no URL shows no button," per the PR's own validation steps) is asserted only on the Python side ( Deployment note (optional)The new e2e test is tagged PETE (Positron Extreme Test Experiment) - LLM-based test-coverage advisor, in pilot. Triggers on PR open and on |
`PackageMetadata` (the 3.14 typing protocol) doesn't expose `.get()`, and `_URL_CATEGORY_PRIORITY.get(category, ...)` was handed a `str | None` key. Route metadata access through an `Any`-typed local (as _get_packages_installed already does) and index the priority map only for recognized categories. See #13890
austin3dickey
left a comment
There was a problem hiding this comment.
This looks awesome, Brice! It's so cool to see this pane's progress.
Summary
Adds an external-link button to each Packages pane row. When a package
advertises a website, the row shows a button (beside the help button) that
opens it in the user's external browser.
The URL comes from the language runtime via the existing
getPackagescall-- no third-party API, so it works offline. A new optional
urlis added toILanguageRuntimePackage(and the publicLanguageRuntimePackage). ThePython kernel picks the single best URL from a distribution's
Project-URLmetadata (homepage > repository > documentation, with the legacy
Home-pageheader as a homepage fallback). The frontend validates the scheme (http/https
only) before rendering the button, so a malformed or non-web scheme from a
runtime can never reach the opener.
R support comes from a companion ark PR (posit-dev/ark#1261); the R button
lights up once that lands and the ark submodule is bumped in Positron.
See #13890
Screenshots
Release Notes
New Features
Bug Fixes
Validation Steps
@:packages-pane
numpy,pandas,requests).