Add "item size" to toggle between rows / cards for the Packages pane#13156
Open
bricestacey wants to merge 7 commits intomainfrom
Open
Add "item size" to toggle between rows / cards for the Packages pane#13156bricestacey wants to merge 7 commits intomainfrom
bricestacey wants to merge 7 commits intomainfrom
Conversation
|
E2E Tests 🚀 |
8189712 to
7b6f0ca
Compare
Introduces a 'card' item size mode alongside the existing compact row layout. Cards show the package name and version on the first line, a description on the second, and the author on the third, with long values truncated to a single line. The mode is toggled from the view title (Show as Cards / Show as Rows) or via the 'Toggle Packages List Layout' command and persisted per-user. Python and R RPCs now return description and author fields populated from distribution metadata and DESCRIPTION, respectively. See #12925
- Expose `author?` on the public LanguageRuntimePackage API so extensions can populate what the cards render. - Python: fall back through Author, Author-email, Maintainer, and Maintainer-email, stripping trailing `<email>` so packages that only set a maintainer (e.g. click -> "Pallets") still show one. - Persist the card/row preference in profile storage instead of application-wide storage. - Search filter now matches description and author in addition to name. - Tighten the card's left padding. See #12925
Drop the IStorageService integration so the item size resets to 'row' on each window. We can revisit persistence (profile vs. workspace, or with additional state) in a follow-up. See #12925
Drop the `_itemSize` field on PositronPackagesService; read through `_itemSizeContextKey.get()` instead. The RawContextKey's default supplies the initial 'row' value. See #12925
PackageMetadata (the protocol typing importlib.metadata.Distribution.metadata in 3.14) doesn't expose .get(), so pyright rejects the calls that parse Summary/Author/Maintainer. The runtime object (email.message.Message) still has .get(); bind it through an Any local so the calls pass type-checking. See #12925
7b6f0ca to
41ecc76
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an “Item Size” toggle to the Positron Packages view so users can switch between a compact row layout and an expanded card layout that shows additional package metadata. This extends the runtime package model/API to include description and author information and wires the new layout into the Packages UI.
Changes:
- Add row/card layout toggles (View Title actions + command palette toggle) and propagate layout state through the packages service.
- Extend package metadata with
descriptionandauthor, and include these fields in filtering + card rendering. - Populate Python package description/author from distribution metadata with reasonable fallbacks.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/services/runtimeSession/common/runtimeSessionService.ts | Extends ILanguageRuntimePackage with description/author. |
| src/vs/workbench/contrib/positronPackages/browser/positronPackagesService.ts | Tracks item size state via context key + emits change events for UI. |
| src/vs/workbench/contrib/positronPackages/browser/positronPackagesContextKeys.ts | Adds positronPackages.itemSize context key and PackagesItemSize type. |
| src/vs/workbench/contrib/positronPackages/browser/positronPackages.contribution.ts | Registers actions/commands to switch between row/card layouts. |
| src/vs/workbench/contrib/positronPackages/browser/interfaces/positronPackagesService.ts | Exposes item size API and change event on the service interface. |
| src/vs/workbench/contrib/positronPackages/browser/components/listPackages.tsx | Renders row vs card layout, filters by description/author, updates list item heights. |
| src/vs/workbench/contrib/positronPackages/browser/components/listPackages.css | Adds styling for row/card layouts and card metadata lines. |
| src/positron-dts/positron.d.ts | Updates public typings to include description/author for packages. |
| extensions/positron-python/python_files/posit/positron/ui.py | Adds Python backend fields for package description/author. |
…ositronPackagesService.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Brice Stacey <bricestacey@gmail.com>
- Add JSDoc to ILanguageRuntimePackage description/author fields - Fix misleading CSS comment about card padding alignment - Revert filter scope to name/displayName only (description/author matches surprised users in row mode where the field isn't visible)
Contributor
Contributor
Contributor
Contributor
softwarenerd
left a comment
There was a problem hiding this comment.
I approve of the code. I left some notes for things I ran into and observed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.





See #12925
Adds "Item Size" action button to the Packages pane.
This PR adds ark support to supplement R packages posit-dev/ark#1165
Release Notes
New Features
Bug Fixes
QA Notes
Until the ark PR lands, you'll want to build that.
Otherwise, you can test for python.
When you expand to card view, everything should kinda just stay the same but turn into cards.
@:packages-pane