Skip to content

feat(plugins): page, sort and filter the marketplace through the center - #2397

Merged
vastsa merged 3 commits into
mainfrom
feat/market-browse-paging
Nov 17, 2026
Merged

vastsa merged 3 commits into
mainfrom
feat/market-browse-paging

Conversation

@vastsa

@vastsa vastsa commented Nov 17, 2026

Copy link
Copy Markdown
Owner

Why

The Marketplace tab loaded the whole catalog into the renderer and filtered it client-side, with no ordering and no paging.

What

  • host-core market.browse: one page from the plugin center's new GET /api/v1/catalog/search (AIUO-Net/pi-plugin-center 46e042d, release-v1.0.48), fetched off the AppState lock, bounded (5 s / 8 MiB), cached 60 s; negative caches for a center without the route (5 min) or unreachable (30 s); cleared by an explicit refresh. Entries go through the existing summary/trust/installable rules; install still resolves against a fresh full catalog.
  • Fallback: unreachable / older center / non-http source → pages the local snapshot with the same semantics (source: "local", fallbackReason), shown as a "Saved catalog" chip.
  • Renderer: category chips with match counts, sort (recommended / popular / newest / name; a session seed keeps recommended stable across pages), result total, numbered pager (24 per page). Only the newest request lands; query / category / sort changes reset to page 1; out-of-range pages snap to the last page.
  • market.search is kept for the MCP control surface.
  • i18n (9 locales), changelog 0.23.0, specs (marketplace §7, host RPC, IPC list).

Tests

  • cargo test -p host-core: new unit and RPC fixture tests (remote page, cache, unsupported / failing center backoff, oversized page rejection, remote-only detail). Full run: 1323 pass; the 2 failures (a_valid_id_cannot_take_over_a_legacy_plugin…, review_rpc_records_workspace_scratch…) fail identically on base ecb2d9894 (machine environment).
  • clippy / fmt clean for new code; desktop typecheck, biome, style tokens and i18n tests pass.
  • New: market-browse-render.test.mjs, market-browse-user-path.test.mjs (Electron: page → sort → category → search with a held stale response; verified to fail when the stale-response guard is removed), and browse cases in market-review-ipc.test.mjs.
  • Updated source-contract tests for the new call shape.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Deploying pi-desktop with  Cloudflare Pages  Cloudflare Pages

Latest commit: 157b12b
Status: ✅  Deploy successful!
Preview URL: https://ccf35c8d.pi-desktop.pages.dev
Branch Preview URL: https://feat-market-browse-paging.pi-desktop.pages.dev

View logs

The marketplace tab held the whole catalog in the renderer and filtered
it client-side, which does not scale and offered no ordering. A new
market.browse RPC asks the plugin center's paged search off the host
state lock, caches pages for a minute, and maps entries through the same
summary rules, so trust, installability and update state are unchanged.

When the center is unreachable, predates the route, or the source is not
an http(s) center, the host pages the last valid snapshot with the same
semantics and the tab labels it as the saved catalog. The renderer lets
only the newest request land and returns to page one whenever the query,
category or sort changes.
A numbered pager made browsing a shuffled catalog a series of clicks
with no sense of position. The marketplace is now one list that asks
for the next page as its end comes into view, with a Load more button
for keyboard users and retries, and an "N of M loaded" line.

Every change of query, category, sort or language starts a new
generation, so a first or next page for something the user has left is
dropped instead of mixed into the list. A failed page pauses automatic
loading until the user retries, and an install updates its card in
place rather than reloading every page scrolled through.
The center answers JSON through a compressing CDN, so the review and
browse reads were transferring the uncompressed body. curl now asks for
the compressed form; the size limit still applies to the decoded body.
@vastsa
vastsa force-pushed the feat/market-browse-paging branch from 93e404a to 157b12b Compare November 17, 2026 06:48
@vastsa
vastsa merged commit f91799f into main Nov 17, 2026
7 checks passed
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