feat: System tray mode with background health monitoring#268
Conversation
- TrayIconService: manages NotifyIcon lifecycle, 60s background polling, tooltip with CPU/RAM/uptime, Windows toast notifications - Minimize-to-tray on window close (ShutdownMode.OnExplicitShutdown) - Context menu: Show SysManager / Exit - Notifications with 4h cooldown: RAM > 90%, uptime > 14 days, disk health degraded - App.xaml.cs: tray service init + explicit shutdown mode - MainWindow.xaml.cs: OnClosing override for minimize-to-tray, tray icon init in OnSourceInitialized - H.NotifyIcon.Wpf 2.2.1 NuGet package added - 10 new unit tests for service defaults and notification logic - README, ARCHITECTURE, CHANGELOG updated Closes #262
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR implements a complete system tray feature for background health monitoring. The application now minimizes to a tray icon, periodically polls CPU/RAM/uptime, displays the status in a tooltip, triggers Windows notifications when thresholds are exceeded, and provides a context menu for visibility control—all wired into the application and window lifecycle without blocking window close. ChangesSystem Tray Feature Implementation
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
| foreach (var disk in snapshot.Disks) | ||
| { | ||
| if (disk.HealthStatus != "Healthy" && now - _lastDiskNotification > NotificationCooldown) | ||
| { | ||
| _lastDiskNotification = now; | ||
| ShowNotification("Disk Health Warning", | ||
| $"{disk.FriendlyName} reports status: {disk.HealthStatus}. Consider backing up important data."); | ||
| break; | ||
| } | ||
| } |
## What changed Startup folder entries (shortcuts in the shell Startup folder) can now be properly disabled/enabled. ## Root cause Entries from the shell Startup folder were incorrectly tagged as `StartupSource.RegistryCurrentUser`. When toggling, the disable blob was written to `StartupApproved\Run` instead of `StartupApproved\StartupFolder`, so Windows never saw the change. ## Fix - Added `StartupFolder` to the `StartupSource` enum - `ReadStartupFolder` now sets `Source = StartupSource.StartupFolder` - `ApplyApprovedState` reads `StartupApproved\StartupFolder` for folder entries - `SetEnabled` writes to `StartupApproved\StartupFolder` for folder entries ## Files changed - `Models/StartupEntry.cs` — added `StartupFolder` enum value - `Services/StartupService.cs` — corrected source assignment and approved key routing Closes #268 Co-authored-by: laurentiu021 <laurentiu021@users.noreply.github.com>
Add CHANGELOG entries for the 4 bug-fix releases from today's session: - **v0.21.3** — buttons grayed out on focus loss (#252, #251, #248, #245) - **v0.21.4** — tab name consistency + log hover (#267, #247) - **v0.21.5** — startup manager disable (#268) - **v0.21.6** — speed test panel states + auto-trace (#257, #239) Co-authored-by: laurentiu021 <laurentiu021@users.noreply.github.com>
- TrayIconService: manages NotifyIcon lifecycle, 60s background polling, tooltip with CPU/RAM/uptime, Windows toast notifications - Minimize-to-tray on window close (ShutdownMode.OnExplicitShutdown) - Context menu: Show SysManager / Exit - Notifications with 4h cooldown: RAM > 90%, uptime > 14 days, disk health degraded - App.xaml.cs: tray service init + explicit shutdown mode - MainWindow.xaml.cs: OnClosing override for minimize-to-tray, tray icon init in OnSourceInitialized - H.NotifyIcon.Wpf 2.2.1 NuGet package added - 10 new unit tests for service defaults and notification logic - README, ARCHITECTURE, CHANGELOG updated Closes #262 Co-authored-by: laurentiu021 <laurentiu021@users.noreply.github.com>
Summary
Adds system tray integration: the app minimizes to tray on close and monitors system health in the background with Windows toast notifications.
Features
Technical
Files added
Files modified
Tests (10 new)
Docs
Closes #262
Summary by CodeRabbit
Release Notes
New Features
Tests
Documentation