fix(desktop): keep the alpha channel every generated icon needs - #5356
Conversation
The new backdrop is opaque, and librsvg drops the alpha channel when nothing in a render is transparent. The result is a valid PNG and a broken icon: tauri::generate_context! refuses a window icon that is not RGBA, so the desktop app stops compiling with "icon .../icon.png is not RGBA". Fifteen of the sixteen committed rasters came out as truecolour; only the tray asset, which has real transparency, kept its alpha. Nothing in the repository could see this. The icon tests read dimensions and container structure, and no test or hosted job builds the Tauri bundle, so the first thing that notices is a release build or someone building locally. The generator now re-encodes a truecolour render as truecolour-with-alpha before writing it, which also stops the committed bytes depending on whether the local librsvg felt like optimising the channel away. The regression test asserts the colour type of every committed raster rather than trusting the renderer.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
✅ Deterministic PR hygiene checks passed. |
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Repository: lidge-jun/opencodex/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: ⛔ Files ignored due to path filters (16)
📒 Files selected for processing (3)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
리뷰 · 우선순위 73 / 80이 PR은 #5355 뒤에 데스크톱 빌드가 깨진 이유를 고칩니다. 앱 아이콘에 불투명 배경을 넣었더니, librsvg가 “투명 픽셀이 없다”고 보고 알파 채널을 빼 버립니다. PNG는 그대로 열려도, Tauri의 라인 라인 같은 함수의 청크 루프 - 라인 라인 손수 만든 PNG 인코더(~110줄) - 의존성 없이 끝낸 선택은 이해됩니다. 다만 필터·CRC·청크 경계가 앞으로 손댈 때마다 깨질 수 있는 면입니다. 메인테이너의 판단이 필요한 지점 inflate 길이 검사만 이 PR에 더 넣을지, 아니면 지금 회귀(색 타입 6)만으로 머지하고 디코더 방어는 후속으로 둘지. 손수 PNG 대신 이미 쓰는 이미지 도구가 있으면 그걸 쓸지도 정하면 됩니다. 호스티드 잡이 Tauri 번들을 안 돌리는 한계는 PR이 이미 적어 두었고, 이번 테스트가 CI에서 그 구멍을 대신 막는 역할입니다. 너의 추천 원인·고침·커밋된 산출물·색 타입 회귀가 한 줄로 맞습니다. 이 댓글은 grok-bot이 작성했습니다 |
Summary
tray/icon.png, which has real transparency, kept its alpha.tauri::generate_context!refuses a window icon that is not RGBA, so the desktop app stops compiling:error: proc macro panicked ... icon .../icons/icon.png is not RGBA.generate-icons.tsnow re-encodes a truecolour render as truecolour-with-alpha before writing it: inflate the IDAT, undo the scanline filters, widen each pixel to four bytes with alpha 255, and emit a fresh IHDR/IDAT/IEND. A render that already carries alpha is returned untouched. This also stops the committed bytes depending on whether the local librsvg felt like optimising the channel away.Verification
cd desktop && bun run iconsthenbun run icons:check— 18 artifacts regenerated, 18 matching.icon.png's minimum alpha is 255, so the visible artwork is unchanged.bun test tests/ci-workflows/build-desktop-icon-set.test.ts— 8 pass, 0 fail.cd desktop && bun run build:local— the bundle build that failed on the previous head is the check this change exists for; its result is recorded on the PR.Checklist