tfrere HF Staff Cursor commited on
Commit
07a94f1
·
1 Parent(s): 4055f89

feat(api): publish iconUrl on /api/js-apps from Space siblings

Browse files

Detects a custom app glyph by scanning each Space's `siblings`
(returned by HF's `?full=true`) for `icon.svg` or `icon.png` at
the repo root, then emits an absolute `resolve/main/<file>` URL
on the app entry as `iconUrl`. Falls back to `null` when neither
candidate is present, so clients keep painting the front-matter
emoji for the long tail of apps that don't ship a custom icon.

SVG wins over PNG when both are present so authors can rely on a
single vector asset across every mount point.

Resolution lives server-side behind the existing 5-minute catalog
cache, so the lookup cost stays O(apps) per refresh - independent
of client fleet size. The HF API call already pulls `siblings` via
`full=true`; no extra network roundtrip.

Documents the convention in docs/APP_ICON_CONVENTION.md for app
authors.

Co-authored-by: Cursor <cursoragent@cursor.com>

2 files changed +181 -1
Files changed (2)
docs/APP_ICON_CONVENTION.mdAdded+113
server/index.js+68-1