From b7f137c2a0001e02536eb733d9a054f3500069c0 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Mon, 10 Aug 2026 03:01:09 -0700 Subject: [PATCH] Render SVG project icons on native and fall back for ICO (#2579) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Render SVG project icons on native and fall back for ICO React Native's silently decodes neither SVG nor ICO, so any project whose discovered icon was one of those formats showed a blank slot on iOS/Android while web/Electron rendered it fine. Route SVG data URIs through react-native-svg on native and let ICO fall through to the initial-letter avatar instead of rendering nothing. Co-Authored-By: Claude Opus 5 * Import Buffer explicitly so SVG icons actually decode on device React Native has no global Buffer and the app installs no global polyfill, so projectIconSvgXml threw ReferenceError inside its try/catch and returned null on every SVG — the exact blank-slot bug the previous commit meant to fix. Vitest runs in Node where Buffer is global, which is why the tests passed anyway; the new regression test deletes globalThis.Buffer to keep the import honest. Co-Authored-By: Claude Fable 5 * Prefer renderable icon formats and unwrap PNG-bearing ICOs favicon.ico ranked first in ICON_PATTERNS, so any repo with a standard public/ layout served ICO — which native cannot decode — even when an SVG or PNG sat in the same directory. Rank SVG and PNG above ICO for each name, sniff magic bytes instead of trusting the extension (renamed PNGs shipped as image/x-icon are common), and extract the largest PNG-encoded frame from real ICO containers so native clients get a decodable image instead of falling back to the letter avatar. Co-Authored-By: Claude Fable 5 * Render SVG icons with CSS support and fall back on parse failure SvgXml ignores