Prevent square app icons on older macOS builds

Older macOS versions can surface the bundled app icon without applying the
modern rounded-mask treatment, which exposed the legacy AI-generated white
background around the Claude Code Haha mark. This replaces the icon source with
a transparent-background vector mark and regenerates the bundled macOS and
cross-platform icon assets from that canonical source so packaging stays
consistent.

Constraint: Older macOS releases may display bundled icons without automatic corner masking
Constraint: The Tauri bundle references pre-rendered icon assets, so the source and generated files must stay aligned
Rejected: Patch only icon.icns | would leave PNG and ICO assets inconsistent across platforms
Rejected: Keep the AI icon and post-process the JPEG background | brittle extraction and no canonical source of truth
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: If the brand icon changes again, regenerate every file under desktop/src-tauri/icons from desktop/src-tauri/app-icon.svg in the same change
Tested: desktop bun run lint; desktop bun run test; extracted regenerated icon.icns to verify alpha transparency
Not-tested: Full packaged app launch in macOS Dock after rebuilding the desktop bundle
This commit is contained in:
程序员阿江(Relakkes) 2026-04-21 14:01:47 +08:00
parent 5a86ab097f
commit 4ec0c622ce
8 changed files with 44 additions and 8 deletions

View File

@ -1,13 +1,49 @@
<svg width="512" height="512" viewBox="0 0 512 512" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="512" height="512" rx="132" fill="#1F1714"/>
<rect x="42" y="42" width="428" height="428" rx="112" fill="url(#surface)"/>
<path d="M352 178C327 153 292 140 252 140C166 140 108 197 108 256C108 314 166 372 252 372C291 372 326 360 351 335L316 298C300 315 278 324 253 324C197 324 159 287 159 256C159 224 197 188 253 188C279 188 301 198 317 215L352 178Z" fill="#FFF7F0"/>
<path d="M381 166L401 146L438 183L418 203L381 166Z" fill="#D07A57"/>
<path d="M369 224L395 198L419 222L393 248L369 224Z" fill="#F0B08E"/>
<defs>
<linearGradient id="surface" x1="66" y1="78" x2="432" y2="436" gradientUnits="userSpaceOnUse">
<stop stop-color="#A85E42"/>
<stop offset="1" stop-color="#7A4330"/>
<linearGradient id="brandStroke" x1="158" y1="136" x2="378" y2="390" gradientUnits="userSpaceOnUse">
<stop stop-color="#FF9568"/>
<stop offset="0.5" stop-color="#F07C54"/>
<stop offset="1" stop-color="#C65F35"/>
</linearGradient>
<linearGradient id="brandSpark" x1="256" y1="120" x2="256" y2="284" gradientUnits="userSpaceOnUse">
<stop stop-color="#FFB08B"/>
<stop offset="0.55" stop-color="#FF885F"/>
<stop offset="1" stop-color="#E76A43"/>
</linearGradient>
</defs>
<g transform="translate(-31 -31) scale(1.12)">
<path
d="M161 191L226 255L161 320"
stroke="url(#brandStroke)"
stroke-width="38"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path
d="M353 176L402 188L348 356L308 345"
stroke="url(#brandStroke)"
stroke-width="35"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path
d="M224 343C246 362 275 363 298 344"
stroke="url(#brandStroke)"
stroke-width="20"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path
d="M302 259C312 246 327 247 336 255"
stroke="url(#brandStroke)"
stroke-width="18"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path
d="M256 136L266 176L306 167L274 197L303 225L264 217L256 257L248 217L209 225L238 197L206 167L246 176L256 136Z"
fill="url(#brandSpark)"
/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 855 B

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 264 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 51 KiB