fix(repo-icon): detect Tauri, WebP, and SVG icons#7942
Conversation
Expand conventional icon path candidates (including src-tauri/icons and public/icon) and accept PNG, WebP, and SVG by magic/format checks so auto-detect no longer falls back to the GitHub avatar for common CLI and Tauri layouts. SVG is only stored as a data URL for <img> rendering. Fixes stablyai#7902
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughThis PR expands repo icon support from PNG-only to PNG, WebP, and SVG formats. The shared 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Fixes #7902: repository icon auto-detect was limited to a short list of PNG-only paths aimed at JS web apps. Tauri apps (
src-tauri/icons/icon.png), CLI tools (public/icon.webp), and SVG assets were missed and fell back to the GitHub owner avatar.Changes
src-tauri/icons/icon,public/icon,app-icon, rooticon, etc..png→.webp→.svgdata:image/png|webp|svg+xml;base64,…insanitizeRepoIcon(SVG only as<img>data URL, never inline HTML)Not in this PR
.icns/.ico(need conversion for web display)Test plan
repo-icon-autodetecttests: Tauri path, WebP, SVGsanitizeRepoIconaccepts webp/svg; still rejects gif/javascriptsrc-tauri/icons/icon.png→ sidebar shows app iconpublic/icon.webp→ uses that iconFixes #7902