Spaces:
Running
Running
Commit History
-
feat(api): publish iconUrl on /api/js-apps from Space siblings
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>07a94f1