Skip to content

Allow users to manually select tray icon theme#76

Merged
bepyan merged 2 commits into
mainfrom
fix/tray-icon-template
Feb 26, 2026
Merged

Allow users to manually select tray icon theme#76
bepyan merged 2 commits into
mainfrom
fix/tray-icon-template

Conversation

@bepyan

@bepyan bepyan commented Feb 26, 2026

Copy link
Copy Markdown
Collaborator

요약

시스템 테마 자동 감지(AppleInterfaceStyle) 대신, 사용자가 직접 트레이 아이콘 테마(밝은/어두운)를 선택하도록 변경합니다.

문제점

이전: macOS effectiveAppearance 자동 대응 시도 → 실제로는 시스템 테마만 감지

  • defaults read -g AppleInterfaceStyle로 시스템 설정 읽음
  • AppleInterfaceThemeChangedNotification 리스너로 변경 감지
  • 배경화면 기반 메뉴바 색상 변화에는 대응 불가

해결책

사용자 설정으로 전환:

  • MenubarIconTheme enum (Light/Dark) 추가
  • 트레이 메뉴에 "아이콘 테마" 서브메뉴 추가 (기본값: 밝은 아이콘)
  • 설정 화면에서도 아이콘 테마 선택 가능
  • IS_LIGHT_ICON AtomicBool로 런타임 캐싱 (애니메이션 중에도 즉시 전환)

구현

Rust 변경:

  • types.rs: MenubarIconTheme enum, UserSettings.menubar_icon_theme 필드
  • tray.rs: 라이트/다크 아이콘 2벌 유지, "아이콘 테마" 메뉴 추가, icon_as_template(false), auto-detection 제거
  • salary.rs: 설정 변경 시 refresh_icon_theme() 호출
  • lib.rs: setup_theme_change_listener 호출 제거
  • utils/macos.rs: register_distributed_listener + setup_theme_change_listener 제거

TypeScript 변경:

  • tauri-bindings.gen.ts: 자동 생성 (MenubarIconTheme 타입)
  • settings-screen.tsx: 아이콘 테마 SelectInput 추가

영향

사용자:

  • 트레이 메뉴와 설정 화면에서 아이콘 테마 선택 가능
  • 애니메이션 중에도 즉시 테마 전환 (AtomicBool 기반)

기술:

  • 자동 감지 로직 제거로 코드 단순화 (~34줄 삭제)
  • 이전 설정 호환성 유지 (MenubarIconTheme.Light 기본값)

시스템 테마 자동 감지(AppleInterfaceStyle) 대신 사용자가
직접 밝은/어두운 아이콘을 선택하도록 변경. 트레이 메뉴와
설정 화면 모두에서 아이콘 테마 선택 가능.
@coderabbitai

coderabbitai Bot commented Feb 26, 2026

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@bepyan has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 13 minutes and 15 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 290e707 and 010f65f.

📒 Files selected for processing (9)
  • apps/app/CLAUDE.md
  • apps/app/src-tauri/src/lib.rs
  • apps/app/src-tauri/src/salary.rs
  • apps/app/src-tauri/src/tray.rs
  • apps/app/src-tauri/src/types.rs
  • apps/app/src-tauri/src/utils/macos.rs
  • apps/app/src/features/settings/screens/settings-screen.tsx
  • apps/app/src/lib/tauri-bindings.gen.ts
  • apps/app/src/lib/tauri-bindings.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/tray-icon-template

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.

@bepyan bepyan merged commit 23edc26 into main Feb 26, 2026
1 check passed
@bepyan bepyan deleted the fix/tray-icon-template branch February 26, 2026 14:20
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