Reduce Performance tab to optional diagnostics#17
Conversation
|
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
💡 Codex Review
ThreadPilot/MainWindow.Behaviors.partial.cs
Lines 1467 to 1470 in e1af4d9
Update ShowWindowFromTray so that tabTag == "Performance" maps to ForegroundDiagnosticsView instead of falling through to ForegroundOtherTab. In this commit, ForegroundOtherTab now disables diagnostics monitoring, so opening Diagnostics from the tray first activates it in SelectMainTab and then immediately applies the non-diagnostics policy, which suspends the diagnostics session right away.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (!this.systemTrayStatusUpdater.ShouldRunPerformanceStatusUpdates) | ||
| { | ||
| return; |
There was a problem hiding this comment.
Continue tray status refreshes when diagnostics are disabled
This early return disables the tray refresh timer in the default configuration (ShowAdvancedDiagnostics == false), and there is no alternate periodic path to call UpdateSystemTrayStatusAsync afterward. That leaves the tray status line stale after startup (for example, after power plan changes), even though the non-diagnostics status still needs current plan information; only CPU/RAM sampling needed to be gated.
Useful? React with 👍 / 👎.
Summary
AppNavigationOptions.ShowAdvancedDiagnostics = false.PerformanceViewModelfromMainWindowstartup construction; diagnostics now lazy-create the view model only when the diagnostics page is explicitly opened or activated.ShowAdvancedDiagnostics; hidden diagnostics now show non-performance tray status and do not schedule the lightweight metrics timer.PerformanceMonitoringServiceperformance counters on first metrics use instead of service construction.Tests
PerformanceViewModeland explicit creation is cached.IPerformanceMonitoringServiceand do not request lightweight metrics.dotnet test "ThreadPilot_1.sln" --configuration Release --no-restorepassed: 303 passed, 0 failed, 0 skipped.Limitations / next PR