Commit Graph

8810 Commits

Author SHA1 Message Date
Yu Leng
6acd859d43 Sync LightSwitch event names, add monitor refresh delay
- Use shared constants for LightSwitch theme event names in both C++ and C# to ensure cross-module consistency.
- Replace "Brightness update rate" with "Monitor refresh delay" setting in PowerDisplay; user can now configure delay (1–30s) after display changes before monitor refresh.
- Update UI and resources to reflect new setting and remove old references.
- MainViewModel now uses the configurable delay instead of a hardcoded value.
- Improves user control and reliability of monitor detection after hot-plug events.
2025-12-15 13:53:23 +08:00
Yu Leng
4f4a724d35 Add PowerDisplay asset support and logger name constant
Added PowerDisplay asset group to generateAllFileComponents.ps1 for file/component generation. Introduced powerDisplayLoggerName constant in LogSettings and updated PowerDisplayModule to use it for logger initialization, improving consistency.
2025-12-15 12:01:59 +08:00
Yu Leng
da0b272fb3 Add new DLLs to ESRP signing list
Added PowerDisplay.Lib.dll, WmiLight.dll, and WmiLight.Native.dll to ESRPSigning_core.json to ensure these files are included in the code signing process. This enhances security and trust for the newly introduced components.
2025-12-12 17:41:58 +08:00
Yu Leng
2f4f079d97 Add PowerDisplay binaries to ESRP signing list
Included PowerToys.PowerDisplayModuleInterface.dll, WinUI3Apps\PowerToys.PowerDisplay.dll, and WinUI3Apps\PowerDisplay.exe in ESRPSigning_core.json for code signing. This supports integration of the new PowerDisplay module.
2025-12-12 15:12:03 +08:00
Copilot
dcf1767c23 Refactor: Extract duplicated boolean-to-visibility converter to shared helper (#44236)
<!-- Enter a brief description/summary of your PR here. What does it
fix/what does it change/how was it tested (even manually, if necessary)?
-->
## Summary of the Pull Request

Eliminates code duplication by extracting the `ConvertBoolToVisibility`
method that was duplicated across `MonitorViewModel.cs` and
`MainWindow.xaml.cs` into a shared `VisibilityConverter` helper class.

<!-- Please review the items on the PR checklist before submitting-->
## 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
- [ ] [JSON for
signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json)
for new binaries
- [ ] [WXS for
installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs)
for new binaries and localization folder
- [ ] [YML for CI
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml)
for new test projects
- [ ] [YML for signed
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml)
- [ ] **Documentation updated:** If checked, please file a pull request
on [our docs
repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys)
and link it here: #xxx

<!-- Provide a more detailed description of the PR, other things fixed,
or any additional comments/features here -->
## Detailed Description of the Pull Request / Additional comments

**Before:** Identical `ConvertBoolToVisibility` methods existed in two
places for x:Bind visibility conversions.

**After:** Single `VisibilityConverter.BoolToVisibility()` static method
in `Helpers/` namespace.

### Changes
- Created `PowerDisplay.Helpers.VisibilityConverter` with static
`BoolToVisibility` method
- Removed duplicate methods from `MonitorViewModel` and `MainWindow`
- Updated 8 XAML bindings to use
`helpers:VisibilityConverter.BoolToVisibility()`

Maintains AOT-compatible x:Bind pattern while eliminating duplication.

<!-- Describe how you validated the behavior. Add automated tests
wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed

Code review and security scan passed with no issues.

<!-- START COPILOT CODING AGENT TIPS -->
---

💬 We'd love your input! Share your thoughts on Copilot coding agent in
our [2 minute survey](https://gh.io/copilot-coding-agent-survey).

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: moooyo <42196638+moooyo@users.noreply.github.com>
2025-12-12 14:38:28 +08:00
Yu Leng
04de4b8357 fix spelling check 2025-12-12 14:30:06 +08:00
Copilot
53a6d45056 Extract EnsureProcessRunning helper to eliminate code duplication (#44235)
## Summary of the Pull Request

Addresses code review feedback on #42642 by extracting duplicated
process launching logic into a reusable helper method.

## 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
- [ ] [JSON for
signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json)
for new binaries
- [ ] [WXS for
installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs)
for new binaries and localization folder
- [ ] [YML for CI
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml)
for new test projects
- [ ] [YML for signed
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml)
- [ ] **Documentation updated:** If checked, please file a pull request
on [our docs
repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys)
and link it here: #xxx

## Detailed Description of the Pull Request / Additional comments

The `ApplyColorTemperature` and `ApplyProfile` custom action handlers
contained identical 6-line blocks for process state checking, launching,
and synchronization.

**Changes:**
- Added `EnsureProcessRunning()` helper encapsulating the pattern: check
if running → launch if needed → wait for ready signal
- Replaced duplicated blocks in both handlers with single helper call

**Before:**
```cpp
if (!is_process_running())
{
    Logger::trace(L"PowerDisplay process not running, launching before applying...");
    launch_process();
    wait_for_process_ready();
}
```

**After:**
```cpp
EnsureProcessRunning();
```

## Validation Steps Performed

Code review and security checks passed.

<!-- START COPILOT CODING AGENT TIPS -->
---

💬 We'd love your input! Share your thoughts on Copilot coding agent in
our [2 minute survey](https://gh.io/copilot-coding-agent-survey).

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: moooyo <42196638+moooyo@users.noreply.github.com>
2025-12-12 14:27:10 +08:00
Yu Leng
ab1561bfc4 Update to use GetWindowLongPtr for 64-bit compatibility
Replaced all usages of GetWindowLong with GetWindowLongPtr and updated the P/Invoke declaration to use "GetWindowLongPtrW". This ensures correct window style handling on 64-bit Windows systems.
2025-12-12 14:25:49 +08:00
Yu Leng
39c10ad039 Update keywords, docs, and WMI controller imports
- Refreshed keyword lists in expect.txt to reflect recent changes.
- Fixed documentation link casing in design.md.
- Added Copilot attribution note to mccsParserDesign.md.
- Reordered and added using directives in WmiController.cs for clarity and dependency resolution.
2025-12-12 14:07:28 +08:00
Yu Leng
132ed2128e Expand and reorganize design.md for clarity and depth
- Majorly restructured Table of Contents, splitting "Goals" and "Future Considerations" and adding new technical sub-sections.
- Added rationale sections: "Why WmiLight Instead of System.Management" (AOT, memory, API) and "Why We Need an MCCS Capabilities String Parser" (recursive parsing, regex limitations).
- Rewrote Settings UI ↔ PowerDisplay architecture diagram for clarity; summarized UI data models in a table.
- Reformatted Windows Events for IPC section with a new table and event name explanation.
- Overhauled Monitor Discovery Flow with step-by-step breakdowns, new Mermaid diagrams, and a DDC/CI vs. WMI comparison.
- Removed the inlined Data Models class diagrams for brevity.
- Split "Future Considerations" into "Already Implemented" and a focused "Potential Future Enhancements" list.
- Improved formatting, terminology, and explanations throughout.
2025-12-12 13:03:44 +08:00
Yu Leng
06a72f3c54 Refactor: update docs, diagrams, and PnpIdHelper namespace
- Improved PowerDisplay design docs for clarity and technical accuracy
- Rewrote DDC/CI section to better explain real-world issues
- Updated architecture diagrams and terminology (Helpers → Utils)
- Replaced ASCII diagrams with Mermaid for better visualization
- Clarified monitor identification and MST/Clone mode handling
- Corrected PnP Manufacturer ID attribution to UEFI Forum
- Moved PnpIdHelper.cs to Utils namespace and updated all references
2025-12-12 12:40:54 +08:00
Yu Leng
2083fcd143 Refactor PowerDisplay design: VCP, windowing, class updates
Update design docs to reflect major refactoring and enhancements:
- Merge VcpCodeNames.cs and VcpValueNames.cs into VcpNames.cs
- Add GlobalUsings.cs for global using directives
- Expand DdcCiController/WmiController diagrams with high-level methods
- Extend VcpCapabilities with windowing support and new APIs
- Add WindowCapability, WindowArea, WindowSize structs
- Extend MonitorInfo with new properties and VCP formatting
- Add VcpCodeDisplayInfo and VcpValueInfo for richer VCP display
- Update class relationships and remove obsolete files (e.g., Styles)
2025-12-12 11:26:14 +08:00
Yu Leng
ef9c26dd50 Refactor CreateMonitorInfo to use object initializer
Refactored the CreateMonitorInfo method to use object initializer syntax instead of a parameterized constructor. This change improves code readability and maintainability, and removes the deprecated hardwareId parameter.
2025-12-12 11:14:50 +08:00
Yu Leng
a001d5cacd Remove unused MonitorInfo properties and constructors
Clean up MonitorInfo by removing obsolete constructors and several computed properties (ColorTemperatureDisplay, VcpCodesSummary, HasColorPresets, BrightnessTooltip, ContrastTooltip). Update XML docs for clarity and rely on remaining properties for display logic.
2025-12-12 11:10:20 +08:00
Yu Leng
dea4cbd045 Remove batch notification support from MonitorInfo
Removed SuspendNotifications, NotificationResumer, and the custom OnPropertyChanged override from MonitorInfo. Property changes now trigger immediate notifications instead of batching updates for UI refresh. This simplifies the class and notification logic.
2025-12-12 11:01:13 +08:00
Yu Leng
f47abb43e9 Simplify color temp display names and VCP hex parsing
Refactored color temperature display name formatting to remove
hexadecimal values from user-facing strings, returning only the
preset or custom name. Updated fallback and custom value handling
to be more concise. Replaced the TryParseHexCode helper with
direct string slicing and parsing for VCP codes. Updated
documentation comments to match new formatting. These changes
improve code clarity and provide a cleaner UI.
2025-12-12 10:59:18 +08:00
Yu Leng
4557c509e5 Refactor logging and VCP naming; simplify capabilities status
Removed excessive debug/info logging and consolidated VCP code/value naming into a single VcpNames utility. Eliminated CapabilitiesStatus property in favor of simpler logic. Cleaned up exception handling and removed non-essential UI and service logs. No changes to core functionality.
2025-12-12 10:36:46 +08:00
Yu Leng
73dca1b598 Clean up usings and update IPC exception handling
Removed unused using directives across multiple files to reduce clutter and unnecessary dependencies. Updated IPCResponseService.cs to suppress debug output in the exception handler for IPC message processing.
2025-12-12 09:57:48 +08:00
Yu Leng
4c93fe01d0 PowerDisplay: overhaul design docs, remove obsolete IPC code
Expanded and clarified PowerDisplay design documentation:
- Added detailed section on monitor identification (handles, IDs, MST, clone mode, etc.) with diagrams and tables.
- Updated architecture, flowcharts, and class diagrams to reflect new helpers, services, and improved data flows.
- Expanded internal structure details for PowerDisplay.Lib and app, listing new helpers, models, and utilities.
- Updated sequence diagrams for LightSwitch integration and Settings UI interaction.
- Revised future considerations, marking hot-plug and rotation as implemented, and adding new feature ideas.

Removed all obsolete PowerDisplay IPC forwarding code from settings_window.cpp/h, including the send_powerdisplay_message_to_settings_ui function and related JSON dispatch logic. This reflects a refactor or deprecation of the previous custom IPC mechanism.
2025-12-12 09:44:28 +08:00
Yu Leng
865dd60a83 Update expect.txt terms and fix NCP spelling in PnpIdHelper
Updated expect.txt with new and modified terms. Corrected the manufacturer name for "NCP" in PnpIdHelper.cs from "Najing CEC Panda" to "Nanjing CEC Panda" to fix a spelling error.
2025-12-11 13:18:00 +08:00
Yu Leng
2880b5afce Improve monitor orientation sync for mirror/clone mode
Refactor orientation tracking to use property change notifications in the Monitor model. Add GetCurrentOrientation to DisplayRotationService and a RefreshAllOrientations method in MonitorManager to ensure all monitors sharing a GdiDeviceName are updated after rotation. Update MonitorViewModel to subscribe to orientation changes and forward them to the UI, and clean up event subscriptions on dispose. These changes ensure accurate orientation state in both UI and data models, especially for mirrored displays.
2025-12-11 13:02:00 +08:00
Yu Leng
9a175df510 Improve WMI internal display naming and refresh logic
Enhance monitor discovery by extracting manufacturer IDs from WMI and mapping them to user-friendly names using a new PnpIdHelper. Remove unreliable WmiMonitorID name parsing. Add detailed logging and allow forced monitor refreshes during display changes. Update asset paths in project file for better organization.
2025-12-11 12:46:15 +08:00
Yu Leng
f07fa4db60 Improve monitor identification and display change handling
- Add detailed WMI monitor logging and fallback for missing names
- Update IdentifyWindow to support multi-monitor (mirrored) labels
- Map GDI device names to multiple monitor numbers for mirror mode
- Show pipe-separated monitor numbers in identify overlay
- Delay monitor refresh after display changes for hardware stability
- Enhance debug logging for monitor detection and mapping
2025-12-11 12:12:28 +08:00
Yu Leng
19eb78e696 Fix spelling issue 2025-12-11 11:18:09 +08:00
Yu Leng
ac94b3d9a5 Merge main into yuleng/display/pr/3
Resolve conflict in LightSwitchStateManager.cpp by keeping
NotifyPowerDisplay function for PowerDisplay integration.
2025-12-11 11:08:34 +08:00
Yu Leng
570cff4590 Remove redundant Logger initialization in App.xaml.cs
Logger initialization is now handled in Program.cs before the App constructor, so the duplicate initialization in App.xaml.cs has been removed. A clarifying comment was added to document this change and improve startup sequence clarity.
2025-12-11 11:04:41 +08:00
Kai Tao
7b469f6327 Build: Fix a version check failure (#44199)
<!-- Enter a brief description/summary of your PR here. What does it
fix/what does it change/how was it tested (even manually, if necessary)?
-->
## Summary of the Pull Request
Version check failed for a dll, ignore it to let release pipeline pass

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist

- [ ] Closes: #xxx
<!-- - [ ] Closes: #yyy (add separate lines for additional resolved
issues) -->
- [ ] **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
- [ ] [JSON for
signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json)
for new binaries
- [ ] [WXS for
installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs)
for new binaries and localization folder
- [ ] [YML for CI
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml)
for new test projects
- [ ] [YML for signed
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml)
- [ ] **Documentation updated:** If checked, please file a pull request
on [our docs
repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys)
and link it here: #xxx

<!-- Provide a more detailed description of the PR, other things fixed,
or any additional comments/features here -->
## Detailed Description of the Pull Request / Additional comments

<!-- Describe how you validated the behavior. Add automated tests
wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed
2025-12-11 10:58:30 +08:00
Yu Leng
d3ebebc24c Add "Vcpkg" variant; fix typo in IsValid property comment
Updated expect.txt to include the "Vcpkg" variant assignment. Fixed a duplicated word typo in the XML comment for the IsValid property in VcpFeatureValue.cs.
2025-12-11 10:57:40 +08:00
Yu Leng
5f15229691 Refactor: use Polly, ConcurrentDictionary, unify VCP parsing
- Replace custom retry logic with Polly.Core resilience pipelines for DDC/CI operations
- Remove LockedDictionary and RetryHelper; use ConcurrentDictionary for thread safety
- Add MonitorFeatureHelper to centralize VCP feature parsing
- Simplify monitor state management and update code for clarity
- Add Polly.Core dependency and update documentation
- Remove obsolete helper files
2025-12-11 10:52:51 +08:00
Guilherme
94ace730c8 [CmdPal] Add Sections and Separators for List Pages and Grid Pages (#43952)
<!-- Enter a brief description/summary of your PR here. What does it
fix/what does it change/how was it tested (even manually, if necessary)?
-->
## Summary of the Pull Request

This pull request adds sections and separators to ListPages and
GridPages

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist

- [x] Closes: #38267
<!-- - [ ] Closes: #yyy (add separate lines for additional resolved
issues) -->
- [ ] **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
- [ ] [JSON for
signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json)
for new binaries
- [ ] [WXS for
installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs)
for new binaries and localization folder
- [ ] [YML for CI
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml)
for new test projects
- [ ] [YML for signed
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml)
- [ ] **Documentation updated:** If checked, please file a pull request
on [our docs
repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys)
and link it here: #xxx

<!-- Provide a more detailed description of the PR, other things fixed,
or any additional comments/features here -->
## Detailed Description of the Pull Request / Additional comments

Since `CollectionViewSource` was causing performance issues and
@zadjii-msft asked for a new approach, I came up with this idea, heavily
inspired by how separators work on the `ContextMenu`, `FiltersDropDown`
and `Details`.

The way this is currently working is: Any ListItem where `Section` is
not null and `Command` is null, is considered a Separator.

On my tests, this seems to be working fine. Tried to make this work
without changes to the API, but I think this needs to be discussed.

### Some of the possible enhancements to existing extensions

### Search apps

<img width="792" height="523" alt="Screenshot 2025-11-27 173618"
src="https://github.com/user-attachments/assets/f9f9a64d-3ec1-4f7e-922b-997a3a4d074d"
/>

### Window Walker

<img width="785" height="518" alt="Screenshot 2025-11-27 173728"
src="https://github.com/user-attachments/assets/230f647d-210a-4b60-9068-c8fff890d2c9"
/>

### Winget

<img width="809" height="497" alt="Screenshot 2025-11-27 174006"
src="https://github.com/user-attachments/assets/547529c1-7600-4438-8c3e-e872e0327650"
/>

### Search files

<img width="819" height="536" alt="image"
src="https://github.com/user-attachments/assets/e86accc0-3f85-412d-8fb0-914a5479baff"
/>

### Grid Pages

<img width="804" height="964" alt="Screenshot 2025-11-27 174055"
src="https://github.com/user-attachments/assets/a3bba7db-95df-47ec-9cfb-f38775ab960e"
/>



<!-- Describe how you validated the behavior. Add automated tests
wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed
2025-12-10 20:51:42 -06:00
Yu Leng
75f57f53f2 Simplify ProfileService XML doc comments
Removed the <remarks> section from the ProfileService class XML documentation, eliminating detailed design notes and usage guidelines. Only the summary description is now retained for clarity and brevity.
2025-12-11 10:28:44 +08:00
Yu Leng
a4770a84cf Refactor LightSwitchService to use PowerToys settings API
Replaced manual JSON parsing with strongly-typed settings access via SettingsUtils and LightSwitchSettings. Updated logic to use EnableLightModeProfile and EnableDarkModeProfile flags. Changed namespace to PowerDisplay.Services and updated using directives accordingly. Removed obsolete helper methods and improved code clarity.
2025-12-11 10:27:17 +08:00
Yu Leng
87eb7cc07f Refactor LightSwitch integration: decouple event handling
Removed LightSwitchListener and ThemeChangedEventArgs. Added LightSwitchService to centralize theme/profile logic. Updated event registration and MainViewModel to handle LightSwitch theme changes via service, decoupling event listening from profile application. Event listening now handled externally.
2025-12-11 10:08:51 +08:00
Yu Leng
54006a8ef1 Remove Manufacturer/ConnectionType from Monitor model
Simplifies monitor metadata by removing Manufacturer and ConnectionType properties and related extraction logic. Refactors WMI controller to always instantiate, relying on monitor discovery for support. Updates model property summaries for clarity, adjusts LightSwitchListener log prefix, and removes Manufacturer from MonitorViewModel. Streamlines code and improves documentation consistency.
2025-12-11 09:52:43 +08:00
Yu Leng
0fc2fc42d3 Refactor DDC/CI brightness initialization logic
Move brightness setup from MonitorDiscoveryHelper to DdcCiController to avoid slow I2C operations during monitor discovery. Set default brightness to 50 and update after discovery. Remove unused brightness methods and type aliases. Update comments to clarify initialization responsibilities.
2025-12-11 09:27:10 +08:00
Guilherme
a08fc0921f [CmdPal] Introduce Small, Medium, and Large sizing options for Details (#43956)
<!-- Enter a brief description/summary of your PR here. What does it
fix/what does it change/how was it tested (even manually, if necessary)?
-->
## Summary of the Pull Request
This PR introduces 3 new sizing options to the Details Panel in the
Extensions API.
- `Small` (Default)
- `Medium`
- `Large`
<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist

- [x] Closes: #43251
<!-- - [ ] Closes: #yyy (add separate lines for additional resolved
issues) -->
- [ ] **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
- [ ] [JSON for
signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json)
for new binaries
- [ ] [WXS for
installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs)
for new binaries and localization folder
- [ ] [YML for CI
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml)
for new test projects
- [ ] [YML for signed
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml)
- [ ] **Documentation updated:** If checked, please file a pull request
on [our docs
repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys)
and link it here: #xxx

<!-- Provide a more detailed description of the PR, other things fixed,
or any additional comments/features here -->
## Detailed Description of the Pull Request / Additional comments

Here's how it looks like:
```csharp
new ListItem(new NoOpCommand())
{
    Title = "Details on ListItems (Medium)",
    Details = new Details()
    {
        Title = "This item has medium details size",
        Body = "Each of these items can have a `Body` formatted with **Markdown**",
        Size = ContentSize.Medium,
    },
},
```

### Moving Pictures


![DetailsSize](https://github.com/user-attachments/assets/ae11b767-ecba-4b39-bd81-3e77eec93ed0)


<!-- Describe how you validated the behavior. Add automated tests
wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed
2025-12-10 19:25:45 -06:00
Gleb Khmyznikov
995bbdc62d Fix fancy zones UI tests #42249 (#44181)
- [ ] Closes: #42249

Contribution to https://github.com/microsoft/PowerToys/issues/40701
2025-12-10 10:04:04 -08:00
Jaylyn Barbee
f822826cf1 [Light Switch] Follow Night Light mode (#43683)
<!-- Enter a brief description/summary of your PR here. What does it
fix/what does it change/how was it tested (even manually, if necessary)?
-->
## Summary of the Pull Request
Introduces a new mode that will have Light Switch follow Windows Night
Light.

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist

- [x] Closes: https://github.com/microsoft/PowerToys/issues/42457
- [x] **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
- [x] **Localization:** All end-user-facing strings can be localized
- [ ] **Documentation updated:** If checked, please file a pull request
on [our docs
repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys)
and link it here: #xxx

<!-- Provide a more detailed description of the PR, other things fixed,
or any additional comments/features here -->
## Detailed Description of the Pull Request / Additional comments
Strictly follows the state of Night Light. When NL is on, LS will be
switch to dark mode and when NL is off, LS will switch to light mode
(with respect to the users system/app selection).

<!-- Describe how you validated the behavior. Add automated tests
wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed
Turn on Follow Night Light mode
Change night light!

## Notes
2025-12-10 08:15:34 -05:00
Yu Leng
cffdf72afb Fix spelling issue 2025-12-10 19:32:15 +08:00
Yu Leng
a05859efc8 Remove unused monitor helpers and simplify utilities
Removed obsolete helper methods and the MonitorFeatureHelper class, streamlining monitor feature parsing and value conversion logic. Cleaned up thread-safe dictionary utilities by dropping rarely used methods. Updated application icon path in project file. Documentation comments were clarified for consistency.
2025-12-10 19:30:17 +08:00
Yu Leng
762a6bce0c Remove GetPhysicalHandle from PhysicalMonitorHandleManager
Eliminated the GetPhysicalHandle method, which handled monitor handle lookup by Id or direct handle. This refactors PhysicalMonitorHandleManager to no longer provide handle retrieval logic.
2025-12-10 19:09:58 +08:00
Yu Leng
6aa7e2cdf6 Refactor: unify VCP feature handling with VcpFeatureValue
Replaced BrightnessInfo with generic VcpFeatureValue struct to represent any VCP feature (brightness, color temp, input source, etc.). Updated IMonitorController and all controller implementations to use VcpFeatureValue for relevant methods. Simplified and unified VCP set/get logic, removed redundant validation and obsolete DdcCiNative methods, and updated helper classes accordingly. Improved code clarity and maintainability by generalizing VCP feature handling throughout the codebase.
2025-12-10 19:04:19 +08:00
Yu Leng
ecd8331d51 Refactor controller selection and remove CanControlMonitorAsync
Refactored MonitorManager to use dedicated controller fields for
O(1) lookup based on CommunicationMethod, replacing the async
GetControllerForMonitorAsync with a synchronous method. Removed
CanControlMonitorAsync from IMonitorController and all
implementations, simplifying the interface and controller logic.
Updated controller discovery and disposal logic accordingly.
Improved performance and maintainability by eliminating
unnecessary async checks and streamlining controller management.
2025-12-10 17:17:13 +08:00
Yu Leng
e85797b449 Update PowerDisplay.wxs for WiX v4 and add to installer
Updated PowerDisplay.wxs to use WiX Toolset v4 schema URLs for compatibility. Added PowerDisplay.wxs to build and file restoration steps in PowerToysInstallerVNext.wixproj, ensuring it is included and managed in the installer package.
2025-12-10 17:03:29 +08:00
Yu Leng
b622e6249d Fix spelling issue 2025-12-10 14:27:11 +08:00
Yu Leng
5b2af47528 Move Twinkle Tray notice to PowerDisplay utility section
Relocated the Twinkle Tray license and attribution from after the NuGet packages list to a new "Utility: PowerDisplay" section in NOTICE.md, aligning it with the format used for other utilities. No changes were made to the content of the notice.
2025-12-10 14:18:26 +08:00
Yu Leng
77a7c04b2e Improve monitor rotation using GDI device name
Refactor monitor discovery and rotation logic to use the GdiDeviceName property for accurate display targeting, especially in multi-monitor setups. Update the Monitor model to include GdiDeviceName, adjust DisplayRotationService and MonitorManager to use it, and enhance logging for better traceability. Also, unify hardware property application in MonitorViewModel to reduce code duplication. These changes increase reliability and maintainability of monitor control operations.
2025-12-10 14:16:28 +08:00
Yu Leng
4817709fda Unify monitor identification using stable Id property
Refactor monitor matching and persistence to use a single, stable Id (format: "{Source}_{EdidId}_{MonitorNumber}") across all components. Remove HardwareId and DeviceKey properties from Monitor, update ProfileMonitorSetting to use MonitorId, and simplify MonitorMatchingHelper logic. Update DDC/CI, WMI, ViewModels, Settings UI, and unit tests to rely on Id for all lookups, state management, and handle mapping. Improves reliability for multi-monitor setups and simplifies codebase by removing legacy fallback logic.
2025-12-10 13:34:36 +08:00
Yu Leng
0965f814ce Refactor profile and color temp application logic
Simplify MainViewModel by removing legacy HardwareId matching and the ApplyColorTemperatureAsync method. Update ApplyProfileAsync to accept only monitor settings and match monitors by InternalName. Improve documentation in ThemeChangedEventArgs and ProfileService for clarity. Streamline method signatures and remove outdated compatibility code.
2025-12-10 12:42:01 +08:00
Yu Leng
d48438571e Improve monitor identification accuracy in IdentifyMonitors
Refactored IdentifyMonitors to use Windows API for mapping display areas to monitor numbers via HMONITOR and GDI device names. This ensures correct monitor numbering in identify windows, especially in complex setups. Added detailed logging and only counts successfully created windows.
2025-12-10 12:10:54 +08:00