Skip to content

Fix Performance Monitor settings file path collision#48251

Open
namdpran8 wants to merge 1 commit into
microsoft:mainfrom
namdpran8:fix-48224
Open

Fix Performance Monitor settings file path collision#48251
namdpran8 wants to merge 1 commit into
microsoft:mainfrom
namdpran8:fix-48224

Conversation

@namdpran8
Copy link
Copy Markdown

Summary of the Pull Request

Fixes #48224

The Performance Monitor extension was still storing its settings in the shared settings.json file. Since Command Palette built-in extensions now use extension-specific sibling settings files, the extension's settings could be overwritten when Command Palette personalization settings were saved.

This change updates SettingsJsonPath() to store Performance Monitor settings in an extension-specific settings file (performanceMonitor.settings.json), ensuring the network speed unit setting persists correctly.

PR Checklist

  • Communication: I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected
  • Tests: Added/updated and all pass
  • Localization: All end-user-facing strings can be localized
  • Dev docs: Added/updated
  • New binaries: Added on the required places
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

The Performance Monitor extension had not been migrated to the newer extension-specific settings file architecture. As a result, its settings were stored in the shared settings.json file and could be lost when the Command Palette host rewrote its configuration.

Following @zadjii-msft's guidance in the issue, this PR updates SettingsManager.cs to store Performance Monitor settings in an extension-specific settings file:

performanceMonitor.settings.json

instead of the shared:

settings.json

This aligns the extension with the current Command Palette settings architecture and prevents the network speed unit setting from being overwritten.

Validation Steps Performed

  • Changed Network Speed Unit to "Binary bytes per second" in Performance Monitor settings.
  • Verified the setting was successfully saved to the newly created performanceMonitor.settings.json file.
  • Modified core Command Palette personalization settings.
  • Verified the Performance Monitor setting was preserved and not overwritten.
  • Restarted PowerToys and verified the setting persisted correctly.

Note to reviewers: I left the "Tests" box unchecked because this is a single-line file path configuration change. I did not add an automated test, but I have thoroughly verified the fix manually as described in the Validation steps above.

Copilot AI review requested due to automatic review settings June 1, 2026 20:32
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Fixes the settings file path for the Performance Monitor command palette extension so it no longer collides with the shared settings.json used by other CmdPal extensions.

Changes:

  • Updates SettingsJsonPath() to produce a namespaced file name ({Namespace}.settings.json).

var directory = Utilities.BaseSettingsPath("Microsoft.CmdPal");
Directory.CreateDirectory(directory);
return Path.Combine(directory, "settings.json");
return Path.Combine(directory, $"{Namespace}.settings.json");
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.

Performance monitor forgets its network transmission speed setting

2 participants