Skip to content

fix: 비근무 중 설정 화면에서 아이콘 테마 변경 미반영#94

Merged
bepyan merged 1 commit into
mainfrom
fix/icon-setting-not-applied
Mar 25, 2026
Merged

fix: 비근무 중 설정 화면에서 아이콘 테마 변경 미반영#94
bepyan merged 1 commit into
mainfrom
fix/icon-setting-not-applied

Conversation

@bepyan

@bepyan bepyan commented Mar 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • 설정 화면에서 밝은/어두운 아이콘 변경 시, refresh_icon_themeIS_LIGHT_ICON 원자 변수만 갱신하고 실제 트레이 아이콘(tray.set_icon())을 교체하지 않던 버그 수정
  • 비애니메이션 상태일 때 idle 아이콘을 즉시 교체하는 로직 추가 (handle_icon_theme_change와 동일한 패턴)
  • 근무 중에는 애니메이션 루프가 매 프레임마다 frames()를 읽어 자연 반영되므로 영향 없음

Test plan

  • 비근무 상태에서 설정 화면 → 아이콘 테마 변경 → 메뉴바 아이콘 즉시 반영 확인
  • 근무 중 아이콘 테마 변경 → 애니메이션이 새 테마로 전환되는지 확인
  • 트레이 메뉴에서 아이콘 테마 변경 → 기존과 동일하게 동작하는지 확인

Summary by CodeRabbit

버그 수정

  • 설정 변경 시 트레이 아이콘 테마가 이제 더 즉각적으로 반영됩니다.

refresh_icon_theme이 IS_LIGHT_ICON 원자 변수만 갱신하고
실제 트레이 아이콘을 교체하지 않던 문제 수정
@coderabbitai

coderabbitai Bot commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

개요

Tauri 앱의 트레이 아이콘 새로고침 로직을 개선하여, 설정 변경 시 AppHandle을 전달하고 애니메이션 중이 아닐 때 트레이 아이콘을 즉시 업데이트하도록 변경했습니다.

변경 사항

Cohort / File(s) 요약
트레이 아이콘 새로고침 함수 시그니처 업데이트
apps/app/src-tauri/src/tray.rs
refresh_icon_theme 함수가 AppHandle 파라미터를 추가로 받도록 변경됨. 애니메이션 중이 아닐 때 IS_LIGHT_ICON 업데이트 후 트레이 아이콘을 idle_icon()으로 직접 설정하는 로직 구현
급여 티커에서 트레이 새로고침 호출 업데이트
apps/app/src-tauri/src/salary.rs
SETTINGS_CHANGED 감시 경로에서 tray::refresh_icon_theme(s)tray::refresh_icon_theme(&app_handle, s)로 변경하여 업데이트된 함수 시그니처에 대응

예상 코드 리뷰 노력

🎯 2 (Simple) | ⏱️ ~10 분

관련 가능성이 있는 PR

  • feat: 메뉴바 테마에 따른 아이콘 색상 자동 전환 #58: 트레이 아이콘 새로고침 동작과 급여 티커의 새로고침 함수 호출을 모두 수정하여 새로고침 API 및 즉시 아이콘 업데이트를 변경/추적합니다.
  • feat: 메뉴바 아이콘 상태 구현 #8: tray.rs의 트레이 아이콘 업데이트 로직을 수정하며, 하나는 refresh_icon_themeAppHandle을 받아 애니메이션 중이 아닐 때 트레이 아이콘을 즉시 설정하고 다른 PR은 트레이 아이콘을 설정하는 새 명령을 추가합니다.

🐰 설정이 바뀌니 앱 핸들을 쥐고,
트레이 아이콘 새로고침, 이제 빠르네!
애니메이션 아닐 땐 즉시 반영,
손가락 튕기듯 아이콘 다시 입혀! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목이 변경사항의 핵심을 정확하게 설명합니다. 설정 화면에서 아이콘 테마 변경이 비근무 중에 미반영되는 버그를 수정한다는 내용이 명확합니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/icon-setting-not-applied

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 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

📥 Commits

Reviewing files that changed from the base of the PR and between f722770 and 6dee450.

📒 Files selected for processing (2)
  • apps/app/src-tauri/src/salary.rs
  • apps/app/src-tauri/src/tray.rs

@bepyan bepyan merged commit c75f022 into main Mar 25, 2026
1 check passed
@bepyan bepyan deleted the fix/icon-setting-not-applied branch March 25, 2026 14:17
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