fix: 비근무 중 설정 화면에서 아이콘 테마 변경 미반영#94
Conversation
refresh_icon_theme이 IS_LIGHT_ICON 원자 변수만 갱신하고 실제 트레이 아이콘을 교체하지 않던 문제 수정
개요Tauri 앱의 트레이 아이콘 새로고침 로직을 개선하여, 설정 변경 시 변경 사항
예상 코드 리뷰 노력🎯 2 (Simple) | ⏱️ ~10 분 관련 가능성이 있는 PR
시
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
apps/app/src-tauri/src/tray.rs (1)
402-409: 아이콘 교체 로직을 공용 헬퍼로 추출하는 것을 권장합니다.Line 402-409 로직이
handle_icon_theme_change의 비슷한 블록과 중복되어 있어, 추후 동작 드리프트를 막기 위해apply_idle_icon_if_not_animating(app)같은 내부 헬퍼로 묶어두면 유지보수가 더 안전합니다.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/app/src-tauri/src/tray.rs` around lines 402 - 409, Extract the duplicated icon-replacement logic into a private helper (e.g., apply_idle_icon_if_not_animating) that takes the app handle, checks ANIMATING.load(Ordering::Relaxed), looks up tray via app.tray_by_id("tray"), builds the icon with Image::from_bytes(idle_icon()), and calls tray.set_icon(Some(icon)) if successful; then replace the duplicated blocks in the current location and inside handle_icon_theme_change with calls to this new helper so both callsites share the same implementation.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@apps/app/src-tauri/src/tray.rs`:
- Around line 402-409: Extract the duplicated icon-replacement logic into a
private helper (e.g., apply_idle_icon_if_not_animating) that takes the app
handle, checks ANIMATING.load(Ordering::Relaxed), looks up tray via
app.tray_by_id("tray"), builds the icon with Image::from_bytes(idle_icon()), and
calls tray.set_icon(Some(icon)) if successful; then replace the duplicated
blocks in the current location and inside handle_icon_theme_change with calls to
this new helper so both callsites share the same implementation.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 13f75f4d-e66d-4bda-8341-da0ae7717acb
📒 Files selected for processing (2)
apps/app/src-tauri/src/salary.rsapps/app/src-tauri/src/tray.rs
Summary
refresh_icon_theme이IS_LIGHT_ICON원자 변수만 갱신하고 실제 트레이 아이콘(tray.set_icon())을 교체하지 않던 버그 수정handle_icon_theme_change와 동일한 패턴)frames()를 읽어 자연 반영되므로 영향 없음Test plan
Summary by CodeRabbit
버그 수정