Skip to content

Add project-icon.svg for Collins - #34

Merged
ghackett merged 1 commit into
mainfrom
collins-project-icon
Aug 2, 2026
Merged

Add project-icon.svg for Collins#34
ghackett merged 1 commit into
mainfrom
collins-project-icon

Conversation

@ghackett

@ghackett ghackett commented Aug 2, 2026

Copy link
Copy Markdown
Member

Summary

Adds a project-icon.svg to the repo root — an SVG rendition of the app's adaptive launcher icon. Collins picks up a project-icon.svg from a project's root directory and shows it in place of the generic folder icon in its sidebar.

The SVG reproduces ic_launcher_background.xml + ic_launcher_foreground.xml faithfully: the same purple #6200EE background (drawn as a rounded square), the same 0.8x safe-zone transform on the foreground, and the calendar cropped to the adaptive icon's visible 72dp region.

project-icon.svg rendered at 256px

Verified by rasterizing with librsvg (the renderer Collins uses) at 256px (above) and 16px (sidebar size).

No app/build changes — the file lives outside app/, so the APK is untouched.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SGSF75haz1qsDQXq5admdR

SVG rendition of the adaptive launcher icon (purple tile + white
calendar with intensity dots), picked up by Collins as this project's
sidebar icon.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SGSF75haz1qsDQXq5admdR
@ghackett
ghackett marked this pull request as ready for review August 2, 2026 15:29
@ghackett
ghackett enabled auto-merge (squash) August 2, 2026 15:29
@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown

📦 Debug APK from this build

Built from commit 53e2232

Download the APK (workflow-run artifact; requires a GitHub login and expires with the run's retention window)

Scan to download on a device:

QR code linking to the APK

@ghackett
ghackett merged commit 07d5d19 into main Aug 2, 2026
7 checks passed
@ghackett
ghackett deleted the collins-project-icon branch August 2, 2026 15:34
ghackett added a commit that referenced this pull request Aug 2, 2026
## Summary

Fixes the `project-icon.svg` added in #34 not actually showing up in
Collins' sidebar — Collins was silently falling back to the generic
folder icon.

## Root cause

Collins rasterizes project icons through gdk-pixbuf's SVG loader
(`GdkPixbuf.PixbufLoader.new_with_type("svg")`), and that loader only
recognizes a file as SVG when the `<svg` tag appears **within the first
256 bytes** (verified empirically: padding a minimal SVG shows the
loader flips from OK to `Unsupported image format` exactly when `<svg`
moves from byte 257 to byte 258). Our XML declaration plus the 4-line
header comment pushed the tag to byte **270**, so the loader rejected
the file and Collins used its fallback icon.

The original PR verified the file with `rsvg-convert`, which parses the
document with a real XML parser and has no such sniff window — which is
why it looked fine there. (Collins' own `project-icon.svg` also has a
leading comment, but a shorter one: its `<svg` sits at byte 191.)

## Fix

Move the header comment *inside* the `<svg>` element, so the tag now
lands at byte 39. No change to the artwork. The comment also now
documents the 256-byte constraint so it doesn't regress.

## Verification

Rasterized through the exact loader path Collins uses
(`PixbufLoader.new_with_type("svg")` + `set_size`) at 16px (sidebar
size) and 256px — both succeed, and
`collins.projecticons.project_icon_data()` still accepts the file:

<img
src="https://raw.githubusercontent.com/episode6/screenshots/main/headache-tracker/fix-collins-project-icon/icon-256-gdkpixbuf-20260802-113934.png"
width="200" alt="project-icon.svg rendered via gdk-pixbuf at 256px after
the fix" />

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_012SHFReWXKqrmD4hBzUTT6q

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant