-
Notifications
You must be signed in to change notification settings - Fork 55
feat: favicon setup from logo-icon.svg (Closes #471) #623
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "name": "SolFoundry", | ||
| "short_name": "SolFoundry", | ||
| "description": "Autonomous AI Software Factory on Solana", | ||
| "icons": [ | ||
| { | ||
| "src": "/favicon.svg", | ||
| "sizes": "any", | ||
| "type": "image/svg+xml" | ||
| } | ||
| ], | ||
| "theme_color": "#0a0a0a", | ||
| "background_color": "#0a0a0a", | ||
| "display": "standalone", | ||
| "start_url": "/" | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| #!/usr/bin/env bash | ||
| # Generate favicon PNGs and ICO from logo-icon.svg | ||
| # Requires: librsvg2-bin (rsvg-convert) or inkscape, and imagemagick (convert) | ||
| # | ||
| # Usage: ./scripts/generate-favicons.sh | ||
| # | ||
| # Output goes to frontend/public/ | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" | ||
| ROOT_DIR="$(dirname "$SCRIPT_DIR")" | ||
| SRC="$ROOT_DIR/assets/logo-icon.svg" | ||
| OUT="$ROOT_DIR/frontend/public" | ||
|
|
||
| mkdir -p "$OUT" | ||
|
|
||
| # Check for rsvg-convert or inkscape | ||
| if command -v rsvg-convert &>/dev/null; then | ||
| SVG_CMD="rsvg" | ||
| elif command -v inkscape &>/dev/null; then | ||
| SVG_CMD="inkscape" | ||
| else | ||
| echo "Error: Install librsvg2-bin (rsvg-convert) or inkscape to generate PNGs." | ||
| echo " Ubuntu/Debian: sudo apt install librsvg2-bin" | ||
| echo " macOS: brew install librsvg" | ||
| exit 1 | ||
| fi | ||
|
|
||
| svg_to_png() { | ||
| local size=$1 | ||
| local output=$2 | ||
| if [ "$SVG_CMD" = "rsvg" ]; then | ||
| rsvg-convert -w "$size" -h "$size" "$SRC" -o "$output" | ||
| else | ||
| inkscape -w "$size" -h "$size" "$SRC" -o "$output" | ||
| fi | ||
| } | ||
|
|
||
| echo "Generating favicons from $SRC..." | ||
|
|
||
| # Generate PNGs | ||
| for pair in "16:favicon-16x16.png" "32:favicon-32x32.png" "180:apple-touch-icon.png" "192:android-chrome-192x192.png" "512:android-chrome-512x512.png"; do | ||
| size="${pair%%:*}" | ||
| name="${pair#*:}" | ||
| svg_to_png "$size" "$OUT/$name" | ||
| echo " ✓ $name (${size}x${size})" | ||
| done | ||
|
|
||
| # Generate ICO (multi-size) | ||
| if command -v convert &>/dev/null; then | ||
| convert "$OUT/favicon-16x16.png" "$OUT/favicon-32x32.png" \ | ||
| \( "$SRC" -resize 48x48 \) \ | ||
| "$OUT/favicon.ico" | ||
| echo " ✓ favicon.ico (16, 32, 48)" | ||
|
Comment on lines
+51
to
+55
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
# Verify ICO generation assumptions in the script:
# - only `convert` is checked
# - whether `magick` fallback is absent
# - SVG is fed directly into ICO conversion path
rg -n 'command -v convert|command -v magick|convert .*favicon\.ico|\$SRC" -resize 48x48' scripts/generate-favicons.shRepository: SolFoundry/solfoundry Length of output: 143 🏁 Script executed: cat -n scripts/generate-favicons.sh | head -70Repository: SolFoundry/solfoundry Length of output: 2485 🌐 Web query:
💡 Result: To convert SVG → ICO with ImageMagick, you need two things:
How to verify quickly
Typical working command
Sources: ImageMagick Examples (ICO auto-resize) [1]; ImageMagick delegate configuration / SVG decode delegate examples (Inkscape) [2][3]; librsvg / rsvg-convert overview [4]. ICO generation path is brittle across ImageMagick environments. Lines 51-55 pass the SVG directly to A more robust approach: generate the 48×48 PNG size using the already-verified SVG converter (rsvg-convert or inkscape), then create the ICO from PNG files only. 🤖 Prompt for AI Agents |
||
| else | ||
| echo " ⚠ Skipping favicon.ico (install imagemagick for ICO generation)" | ||
| fi | ||
|
|
||
| # Update webmanifest with PNG icons | ||
| cat > "$OUT/site.webmanifest" << 'EOF' | ||
| { | ||
| "name": "SolFoundry", | ||
| "short_name": "SolFoundry", | ||
| "description": "Autonomous AI Software Factory on Solana", | ||
| "icons": [ | ||
| { | ||
| "src": "/android-chrome-192x192.png", | ||
| "sizes": "192x192", | ||
| "type": "image/png" | ||
| }, | ||
| { | ||
| "src": "/android-chrome-512x512.png", | ||
| "sizes": "512x512", | ||
| "type": "image/png" | ||
| }, | ||
| { | ||
| "src": "/favicon.svg", | ||
| "sizes": "any", | ||
| "type": "image/svg+xml" | ||
| } | ||
| ], | ||
| "theme_color": "#0a0a0a", | ||
| "background_color": "#0a0a0a", | ||
| "display": "standalone", | ||
| "start_url": "/" | ||
| } | ||
| EOF | ||
|
Comment on lines
+61
to
+88
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
echo "== Check where favicon generation is wired =="
rg -n 'generate-favicons\.sh|apple-touch-icon\.png|android-chrome-192x192\.png|android-chrome-512x512\.png|site\.webmanifest'
echo
echo "== Check whether generated raster favicon assets are present in repo =="
fd -HI '^(favicon-16x16\.png|favicon-32x32\.png|apple-touch-icon\.png|android-chrome-192x192\.png|android-chrome-512x512\.png|favicon\.ico)$'
echo
echo "== Current committed manifest =="
cat frontend/public/site.webmanifestRepository: SolFoundry/solfoundry Length of output: 1214 Manifest and raster favicon generation breaks build reproducibility. Lines 61–88 write As a result:
This violates reproducibility: runtime correctness depends on an external, manual generation step rather than being derivable from committed sources. 🤖 Prompt for AI Agents |
||
|
|
||
| echo "Done! Favicons generated in $OUT" | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Manifest icon set is incomplete for the stated favicon/PWA targets.
Line 5-11 defines only an SVG icon. The committed manifest is missing raster icon references (notably 192×192 and 512×512 PNG), so the repository state does not currently satisfy the stated cross-browser/install-icon expectations without an extra generation step.
🤖 Prompt for AI Agents