Add setting to select network speed units in Command Palette#46320
Add setting to select network speed units in Command Palette#46320
Conversation
|
@copilot try again |
…second Co-authored-by: niels9001 <9866362+niels9001@users.noreply.github.com>
Done! Implemented the network speed unit setting in commit The changes add a toggle setting "Display network speed in bytes per second" to the Performance Monitor extension. When enabled, network speeds display as KB/s, MB/s, GB/s — when disabled (default), they show as Kbps, Mbps, Gbps. The setting is accessible via the ⋯ context menu on the Performance Monitor command item and persisted to the shared CmdPal settings file. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
Note: this is not a binary setting. It should be a selection. Note that there's another (theoretical) possibility like MebiBits/-Bytes. |
@copilot, this is fair feedback. Can you update? |
…, bytes, binary bytes) Co-authored-by: niels9001 <9866362+niels9001@users.noreply.github.com> Agent-Logs-Url: https://github.com/microsoft/PowerToys/sessions/db3b1613-0b10-490e-8c55-fe0e01f41176
Updated in commit
The |
|
@copilot fix the merge conflicts |
…peed-unit-setting # Conflicts: # src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.PerformanceMonitor/PerformanceMonitorCommandsProvider.cs Co-authored-by: niels9001 <9866362+niels9001@users.noreply.github.com>
…ution Agent-Logs-Url: https://github.com/microsoft/PowerToys/sessions/59e7be56-1b7d-4c34-a831-44504fecfbde Co-authored-by: niels9001 <9866362+niels9001@users.noreply.github.com>
Merge conflicts resolved in commit |
Summary of the Pull Request
Adds a unit selection setting to the Performance Monitor extension in Command Palette that allows users to choose how network transmission speed is displayed. The setting offers three options: bits per second (Kbps/Mbps/Gbps, the default), bytes per second (KB/s/MB/s/GB/s), and binary bytes per second using IEC prefixes (KiB/s/MiB/s/GiB/s).
PR Checklist
Detailed Description of the Pull Request / Additional comments
The following files were changed:
NetworkSpeedUnit.cs(new): Enum defining the three supported unit modes —BitsPerSecond,BytesPerSecond, andBinaryBytesPerSecond.SettingsManager.cs(new): AJsonSettingsManagersubclass for the Performance Monitor extension. Defines aChoiceSetSettingforNetworkSpeedUnit(default:BitsPerSecond), stored under theperformanceMonitornamespace in the shared CmdPalsettings.json.PerformanceWidgetsPage.cs:PerformanceWidgetsPageconstructor now acceptsSettingsManagerand passes it toSystemNetworkUsageWidgetPage.SystemNetworkUsageWidgetPagestores the settings manager and callsSpeedToString(), which dispatches via a switch expression toFormatAsBitsPerSecString()(e.g.12.5 Mbps),FormatAsBytesPerSecString()(e.g.1.6 MB/s), orFormatAsBinaryBytesPerSecString()(e.g.1.5 MiB/s) based on the selected unit.PerformanceMonitorCommandsProvider.cs: Holds theSettingsManager, passes it to both the list page and dock band viaSetEnabledState(), exposesSettingson the provider, and adds the settings page to the command'sMoreCommands. The crash-recovery hardening from main (ProviderCrashSentinel,TryReactivateImmediately,SetDisabledState, thread-safe locking) is fully preserved and integrated with the settings manager.Resources.resw: UpdatedNetwork_Speed_Unit_Setting_TitleandNetwork_Speed_Unit_Setting_Descriptionto neutral language; added three choice label strings (Network_Speed_Unit_BitsPerSec,Network_Speed_Unit_BytesPerSec,Network_Speed_Unit_BinaryBytesPerSec). Also includes the disabled-state strings merged from main.Validation Steps Performed
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.