Skip to content

Add "item size" to toggle between rows / cards for the Packages pane#13156

Open
bricestacey wants to merge 5 commits intomainfrom
12925/packages-card-view
Open

Add "item size" to toggle between rows / cards for the Packages pane#13156
bricestacey wants to merge 5 commits intomainfrom
12925/packages-card-view

Conversation

@bricestacey
Copy link
Copy Markdown
Contributor

See #12925

Adds "Item Size" action button to the Packages pane.

  • Toggles between two views: One that looks like a row and the other a card.
  • Adds description and authorship metadata to the get packages API.
  • For python, authorship is not a simple lookup but some combination of author -> author email -> maintainer -> maintainer email

This PR adds ark support to supplement R packages posit-dev/ark#1165

Screenshot 2026-04-22 at 2 01 27 PM

Release Notes

New Features

  • Add support for card / row views on the Packages pane.
  • Add additional metadata including description and author to the Packages pane.

Bug Fixes

  • N/A

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

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 22, 2026

E2E Tests 🚀
This PR will run tests tagged with: @:critical @:packages-pane

readme  valid tags

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
@bricestacey bricestacey force-pushed the 12925/packages-card-view branch from 7b6f0ca to 41ecc76 Compare April 23, 2026 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant