Skip to content

Extensions: icons and categories, with a category filter in the Extensions tab - #93

Merged
mlopezsegura merged 1 commit into
masterfrom
feature/extension-icons-categories
Nov 24, 2026
Merged

mlopezsegura merged 1 commit into
masterfrom
feature/extension-icons-categories

Conversation

@mlopezsegura

Copy link
Copy Markdown
Collaborator

Why

Extensions only had a name and free-text tags. As catalogs grow, it should be easy to tell extensions apart at a glance and to narrow the list down.

What changes

Format (docs/extensions.md)

  • osms-extension.json gets icon (PNG, JPEG, WebP, GIF or SVG in the package, up to 256 KB) and categories (up to 3).
  • osms-catalog.json entries get the same two fields. The catalog's icon is a path relative to the catalog's folder, so it shows before anything is installed. The catalog's categories override the extension's own.
  • Fixed list of categories: remote-desktop, streaming, display, input, audio, network, games, monitoring, tools. Unknown ones are accepted and ignored, so an extension written for a newer OpenStreamMS still installs on an older one. Older versions ignore both fields.

Backend

  • The preview checks that the icon exists, is under 256 KB and that its first bytes match its extension (for SVG, that it really has an <svg> element).
  • GET /api/extensions/{id}/icon serves an installed extension's icon.
  • GET /api/extensions/catalogs/icon?url=…&index=… downloads a catalog entry's icon from raw.githubusercontent.com (no GitHub API rate limit) and caches it for an hour. It only works for catalogs the user has added.
  • Both icon routes send Content-Security-Policy: … sandbox and nosniff, so an SVG opened outside an <img> can't run anything with the dashboard's origin.
  • ExtensionInfo, CatalogEntryView and the preview return iconUrl/categories. An installed extension without its own falls back to its catalog's.

Dashboard

  • Icon on every card. Without one, or if it fails to load, the card shows the name's first letter.
  • Category chips on the cards, and a filter bar above the lists: "All" plus each category that has at least one extension, with counts. The filter applies to installed and available extensions, works together with the search, and is remembered in the browser.
  • The install dialog shows the categories.
  • New texts in all 22 languages.

Testing

  • dotnet test: 171/171. New tests cover icon and category parsing, invalid paths and categories, catalog fields, image signatures, SVG detection, catalog icon download and caching, installed icon resolution, and rejecting an "icon" that isn't an image.
  • Not tried in a running dashboard yet.

🤖 Generated with Claude Code

osms-extension.json and catalog entries can declare an icon and up to
three categories from a fixed list. The dashboard shows the icon on each
card and adds a category filter above the installed and available lists.
Icons are checked at preview time, served with a sandbox CSP, and catalog
icons come from raw.githubusercontent.com with a one-hour cache.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mlopezsegura
mlopezsegura merged commit 36e394e into master Nov 24, 2026
2 checks passed
@mlopezsegura
mlopezsegura deleted the feature/extension-icons-categories branch November 24, 2026 21:47
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