Skip to content

Conversation

@0Chencc
Copy link
Owner

@0Chencc 0Chencc commented Jan 30, 2026

Summary

  • Fix crash when clicking system tray icon on macOS
  • Use system_tray's AppWindow.show() instead of window_manager to avoid nil pointer crash
  • Set applicationShouldTerminateAfterLastWindowClosed to false to keep app running when minimized to tray
  • Save ref.listenManual() subscription to prevent garbage collection

Root Cause

window_manager package's WindowManager.swift:60 crashes with "Unexpectedly found nil while unwrapping an Optional value" when the window reference becomes invalid after hiding.

Test plan

  • Build and run on macOS
  • Close window to minimize to tray
  • Click tray icon - window shows without crash

@github-actions github-actions bot added the core label Jan 30, 2026
- Use system_tray's AppWindow instead of window_manager for showing
  window on macOS to avoid nil pointer crash in WindowManager.swift
- Set applicationShouldTerminateAfterLastWindowClosed to false to
  keep app running when minimized to tray
- Save ref.listenManual() subscription to prevent GC
@0Chencc 0Chencc force-pushed the fix/macos-tray-crash branch from bf79ea7 to aebb4ab Compare January 30, 2026 10:32
@codecov
Copy link

codecov bot commented Jan 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.42%. Comparing base (dfe708a) to head (aebb4ab).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main       #4   +/-   ##
=======================================
  Coverage   71.42%   71.42%           
=======================================
  Files           1        1           
  Lines           7        7           
=======================================
  Hits            5        5           
  Misses          2        2           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@0Chencc 0Chencc merged commit 0740002 into main Jan 30, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants