Skip to content

Reduce Performance tab to optional diagnostics#17

Merged
PrimeBuild-pc merged 2 commits into
mainfrom
codex/optional-performance-diagnostics
May 21, 2026
Merged

Reduce Performance tab to optional diagnostics#17
PrimeBuild-pc merged 2 commits into
mainfrom
codex/optional-performance-diagnostics

Conversation

@PrimeBuild-pc
Copy link
Copy Markdown
Owner

@PrimeBuild-pc PrimeBuild-pc commented May 20, 2026

Summary

  • Hide the Performance/Diagnostics entry from primary navigation and the tray by default with AppNavigationOptions.ShowAdvancedDiagnostics = false.
  • Remove PerformanceViewModel from MainWindow startup construction; diagnostics now lazy-create the view model only when the diagnostics page is explicitly opened or activated.
  • Gate tray CPU/RAM metrics behind ShowAdvancedDiagnostics; hidden diagnostics now show non-performance tray status and do not schedule the lightweight metrics timer.
  • Lazily allocate PerformanceMonitoringService performance counters on first metrics use instead of service construction.
  • Preserve the existing diagnostics view, snapshots, live metrics command, hotspot list, and create/update rule command for future selected-process diagnostics work.

Tests

  • Added diagnostics provider tests proving startup construction does not create PerformanceViewModel and explicit creation is cached.
  • Added tray status updater tests proving hidden diagnostics do not resolve/call IPerformanceMonitoringService and do not request lightweight metrics.
  • Existing diagnostics ViewModel tests still cover no startup scans, explicit diagnostics activation, stop-on-suspend behavior, and default hidden diagnostics navigation flag.
  • dotnet test "ThreadPilot_1.sln" --configuration Release --no-restore passed: 303 passed, 0 failed, 0 skipped.

Limitations / next PR

  • The diagnostics route and view remain available internally; this PR only hides primary access by default and removes the hidden startup/tray runtime cost.
  • Selected-process diagnostics, CPU affinity changes, memory priority changes, persistent rule changes, versioning, and release notes are intentionally out of scope.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 20, 2026

@PrimeBuild-pc PrimeBuild-pc marked this pull request as ready for review May 21, 2026 21:46
@PrimeBuild-pc PrimeBuild-pc merged commit 266834c into main May 21, 2026
3 checks passed
@PrimeBuild-pc PrimeBuild-pc deleted the codex/optional-performance-diagnostics branch May 21, 2026 21:47
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

var processViewWillBeActive = tabTag == null
? this.ProcessManagementTab.Visibility == Visibility.Visible
: string.Equals(tabTag, "Process", StringComparison.Ordinal);

P1 Badge Apply diagnostics activity state when restoring Diagnostics tab

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".

Comment on lines +1017 to +1019
if (!this.systemTrayStatusUpdater.ShouldRunPerformanceStatusUpdates)
{
return;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

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.

2 participants