Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
<title>SolFoundry — AI Software Factory on Solana</title>
<meta name="description" content="Autonomous AI Software Factory on Solana. Post bounties, earn $FNDRY, build with AI agents." />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
<link rel="manifest" href="/site.webmanifest" />
<script>
// Prevent theme flash by applying theme before React hydrates
(function() {
Expand Down
74 changes: 74 additions & 0 deletions frontend/public/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions frontend/public/site.webmanifest
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"
}
],
Comment on lines +5 to +11
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

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
Verify each finding against the current code and only fix it if needed.

In `@frontend/public/site.webmanifest` around lines 5 - 11, The manifest currently
lists only an SVG favicon in the "icons" array, which breaks cross-browser/PWA
install expectations; update the site.webmanifest "icons" array to include
raster PNG entries for 192x192 and 512x512 (e.g., add objects with "src":
"/favicon-192.png", "sizes": "192x192", "type": "image/png" and "src":
"/favicon-512.png", "sizes": "512x512", "type": "image/png"), optionally include
"purpose": "any maskable" for one entry, and ensure the referenced files are
added to your static/assets so the build serves them (look for the "icons" array
in site.webmanifest to apply the changes).

"theme_color": "#0a0a0a",
"background_color": "#0a0a0a",
"display": "standalone",
"start_url": "/"
}
90 changes: 90 additions & 0 deletions scripts/generate-favicons.sh
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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 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.sh

Repository: SolFoundry/solfoundry

Length of output: 143


🏁 Script executed:

cat -n scripts/generate-favicons.sh | head -70

Repository: SolFoundry/solfoundry

Length of output: 2485


🌐 Web query:

ImageMagick convert SVG to ICO delegate support requirements

💡 Result:

To convert SVG → ICO with ImageMagick, you need two things:

  1. An SVG “decode” delegate (rasterizer) available at runtime
    ImageMagick generally rasterizes SVG via an external delegate defined in delegates.xml, most commonly:
  • librsvg via the rsvg-convert command, or
  • Inkscape via the inkscape CLI (also configured via delegates.xml).
    If neither delegate is present/usable, SVG reading may fail or fall back to a limited renderer depending on your build. [2][3][4]
  1. ICO encoding support + PNG support (strongly recommended)
    ICO creation is typically done by generating multiple raster sizes and writing a single .ico. ImageMagick supports building multi-resolution ICOs via -define icon:auto-resize=.... [1]
    For modern Windows-style icons, the 256×256 icon image inside an ICO is commonly stored as PNG, so having PNG support in your ImageMagick build is important. [1]

How to verify quickly

  • Check compiled features/delegates: magick -version (look at the “Delegates” line).
  • Check format support: magick -list format | findstr /i "SVG ICO PNG" (Windows) or grep -E 'SVG|ICO|PNG' (Linux/macOS).
  • Check/override which SVG delegate is used: inspect delegates.xml entries for svg:decode (Inkscape) and/or rsvg-convert. [2][3]

Typical working command

  • magick -background none input.svg -define icon:auto-resize=256,128,64,48,32,16 output.ico (requires an SVG delegate to rasterize first). [1][2]

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 convert, but only verify that the convert command exists—not whether it has SVG delegate support (rsvg-convert or inkscape). In environments where ImageMagick is installed without an SVG delegate, the convert command fails and aborts the entire script (due to set -euo pipefail at line 9).

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
Verify each finding against the current code and only fix it if needed.

In `@scripts/generate-favicons.sh` around lines 51 - 55, The ICO creation is
brittle because convert is given the SVG directly; instead generate a 48x48 PNG
from the verified SVG converter (rsvg-convert or inkscape) and then invoke
convert only with PNG inputs. Update the block that currently calls convert with
"\( "$SRC" -resize 48x48 \)" to first run the existing SVG converter (use the
same check that validated rsvg-convert or inkscape) to produce
"$OUT/favicon-48x48.png", then call convert "$OUT/favicon-16x16.png"
"$OUT/favicon-32x32.png" "$OUT/favicon-48x48.png" "$OUT/favicon.ico"; also
change the echo to reference 16, 32, 48 and ensure any temporary file is cleaned
if needed.

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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 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.webmanifest

Repository: SolFoundry/solfoundry

Length of output: 1214


Manifest and raster favicon generation breaks build reproducibility.

Lines 61–88 write site.webmanifest with PNG icon references (android-chrome-192x192.png, android-chrome-512x512.png), while the committed manifest in frontend/public/site.webmanifest contains only an SVG icon entry. The script also generates raster PNG assets on lines 43 (favicon-16x16.png, favicon-32x32.png, apple-touch-icon.png, android-chrome-192x192.png, android-chrome-512x512.png), none of which are committed to the repository.

As a result:

  • Raster favicon assets are not available in the repo; they must be generated by manually executing the script.
  • The generated manifest will differ from the committed manifest.
  • frontend/index.html (lines 9–10) references /apple-touch-icon.png and the manifest file, but these won't match the expected PNG icons without running the generation step.
  • The build cannot produce the correct manifest and assets from repo state alone.

This violates reproducibility: runtime correctness depends on an external, manual generation step rather than being derivable from committed sources.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/generate-favicons.sh` around lines 61 - 88, The script writes a
site.webmanifest that lists PNG icons while also generating raster PNGs
(favicon-16x16.png, favicon-32x32.png, apple-touch-icon.png,
android-chrome-192x192.png, android-chrome-512x512.png), causing the generated
manifest to diverge from the committed frontend/public/site.webmanifest and
breaking reproducibility; update scripts/generate-favicons.sh so the cat >
"$OUT/site.webmanifest" block only references the SVG (favicon.svg) to match the
committed manifest and remove or disable the code that generates raster PNGs
(the generation of favicon-16x16.png, favicon-32x32.png, apple-touch-icon.png,
android-chrome-192x192.png, android-chrome-512x512.png), and then either update
frontend/index.html to reference the SVG (instead of apple-touch-icon.png) or
commit the raster assets to the repo so manifest, index.html, and repository
state remain consistent.


echo "Done! Favicons generated in $OUT"
Loading