Repository navigation
Extensions: icons and categories, with a category filter in the Extensions tab - #93
Merged
Merged
Conversation
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>
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.
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.jsongetsicon(PNG, JPEG, WebP, GIF or SVG in the package, up to 256 KB) andcategories(up to 3).osms-catalog.jsonentries 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.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
<svg>element).GET /api/extensions/{id}/iconserves an installed extension's icon.GET /api/extensions/catalogs/icon?url=…&index=…downloads a catalog entry's icon fromraw.githubusercontent.com(no GitHub API rate limit) and caches it for an hour. It only works for catalogs the user has added.Content-Security-Policy: … sandboxandnosniff, so an SVG opened outside an<img>can't run anything with the dashboard's origin.ExtensionInfo,CatalogEntryViewand the preview returniconUrl/categories. An installed extension without its own falls back to its catalog's.Dashboard
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.🤖 Generated with Claude Code