Highlight newly installed or updated packages in the Packages pane#14284
Conversation
After an install or update completes, scroll to and briefly flash the affected package(s) so the change is easy to spot in a long list. - Install and single update select, scroll to, and flash the requested package (auto-installed dependencies are excluded). - Update All flashes every package whose version actually changed, diffed against a pre-update snapshot, and scrolls to the first. - Packages hidden by an active filter are skipped rather than revealed. A new onDidChangePackages event on the packages instance reports the affected names; the view scrolls/selects/flashes them via a transient 'recently-changed' CSS animation. The flash is gated on a nonce and its clear timer lives in a dedicated effect so the asynchronous Stage 2 metadata refresh cannot re-trigger or cancel it mid-flash. See #13129
|
E2E Tests 🚀 |
PETE's assessment 🧪Verdict: 🔴 Insufficient -- the instance-side event is well covered, but the new scroll/select/flash logic in What changed
Tests in this PR
Existing coverage
Suggested additions
Suggested tags (optional)None -- the PR body already includes PETE (Positron Extreme Test Experiment) - LLM-based test-coverage advisor, in pilot. Triggers on PR open and on |
Add an RTL component test for the onDidChangePackages consumer in ListPackages, the heart of the highlight feature that the instance-side tests don't reach: - single install/update flashes, selects, and pushes the service-level selection for the requested package - a bulk update flashes every affected row but selects none - a package hidden by the active filter is neither revealed nor flashed - the flash survives the async Stage 2 refresh and clears on schedule - a later refresh does not revive a cleared flash (nonce gating) See #13129
There was a problem hiding this comment.
I tested this PR out and it appears to work well, with one exception. I added and removed cowsay multiple times. In each case, the package was scrolled into view, as see here:
But I did not see anything resembling a "brief flash". Here's a screen recording of what I saw:
Screen.Recording.2026-06-23.at.4.56.10.PM.mov
When I scrolled through this screen recording frame-by-frame, I expected to see the UI scroll to cowsay first, then the "brief flash".
The flash reused editor.findMatchHighlightBackground, which is identical to list.activeSelectionBackground in some themes (e.g. Light 2026), so the flash was invisible on a just-selected row, and it borrowed a color from an unrelated component. Register positronPackages.recentlyChangedBackground, derived from the selection background with a brightness offset (lighter in dark themes, darker in light themes) so the transient flash always reads as distinct from the selected row. Theme authors can override it. See #13129
The previous derivation used lighten(selection): lighten is multiplicative on HSL lightness (l + l*factor), so it cannot lift a pure-black base such as the high-contrast dark selection background, producing no visible flash (and the same brittleness near white). Use a translucent foreground tint instead. The foreground contrasts the background in every theme by definition, so the alpha overlay always shifts the surface, including a selected row, keeping the flash distinct from the selection color. See #13129
From the looks of it you're using Light 2026, which has identical backgrounds for the theme colors I am using... Dark 2026, Dark, and Light don't have this issue. I've pushed up a fix. We register a new theme color for the packages pane At first, I tried to lighten or darken the existing active selection background. This seemed fine, but starts to perform poorly the darker the color before eventually having no effect at all for pure black. The solution we wound up on is to make the recently changed background color equal to 25% of the foreground color. This is guaranteed to have an effect since the foreground and background by definition should be contrasting colors. Here is an example using Light 2026. Screen.Recording.2026-06-23.at.11.10.11.PM.movOne drawback is this will naturally be relatively... boring? It's not the traditional yellow highlighter, but I think this is a good solution. |

Fixes #13129
Summary
After installing or updating a package in the Packages pane, the affected package(s) now scroll into view and briefly flash so the change is easy to spot in a long list.
A new
onDidChangePackagesevent on the packages instance reports the affected names after a successful operation; the view scrolls/selects/flashes them via a transientrecently-changedCSS animation (which respectsprefers-reduced-motion). The flash is gated on a nonce, and its clear timer lives in a dedicated effect, so the asynchronous Stage 2 metadata refresh cannot re-trigger or cancel the flash mid-animation.Screenshots
Screen.Recording.2026-06-15.at.1.42.17.PM.mov
Release Notes
New Features
Bug Fixes
Validation Steps
@:packages-pane