Fix WinOneShot ComboItems compatibility (#4957)

* Fix WinOneShot ComboItems compatibility

* Align ComboItems validation with renderer
This commit is contained in:
Chris Titus
2026-08-09 16:47:45 -05:00
committed by GitHub
parent bc607b6c91
commit 53fc260cc0
4 changed files with 19 additions and 9 deletions
+1 -5
View File
@@ -1465,11 +1465,7 @@
"category": "Customize Preferences",
"panel": "2",
"Type": "Combobox",
"ComboItems": [
"Enabled",
"Disabled (Compatibility)",
"Fully Disabled"
],
"ComboItems": "Enabled|Disabled (Compatibility)|Fully Disabled",
"ComboDescriptions": {
"Enabled": "Uses Windows' default overlay behavior.",
"Disabled (Compatibility)": "Disables MPO using OverlayTestMode=5, the less aggressive compatibility method.",
@@ -271,7 +271,11 @@ function Invoke-WPFUIElements {
[System.Windows.Automation.AutomationProperties]::SetName($comboBox, $entryInfo.Content)
$comboItems = if ($entryInfo.ComboItems -is [string]) {
if ($entryInfo.ComboItems.Contains("|")) {
$entryInfo.ComboItems -split "\|"
} else {
$entryInfo.ComboItems -split " "
}
} else {
@($entryInfo.ComboItems)
}
+9 -1
View File
@@ -439,7 +439,15 @@ Describe "UI-rendered config entries" {
}
$statefulRegistry = @($entry.Value.registry | Where-Object Values)
if ($statefulRegistry.Count -gt 0) {
$comboItems = @($entry.Value.ComboItems)
$comboItems = if ($entry.Value.ComboItems -is [string]) {
if ($entry.Value.ComboItems.Contains("|")) {
@($entry.Value.ComboItems -split "\|")
} else {
@($entry.Value.ComboItems -split " ")
}
} else {
@($entry.Value.ComboItems)
}
if ($statefulRegistry.Count -ne @($entry.Value.registry).Count) {
$invalidEntries.Add("$($entry.Name) registry states must all use Values")
} else {
+4 -2
View File
@@ -18,9 +18,11 @@ BeforeAll {
Describe "Multiplane Overlay configuration" {
It "keeps every state and registry action in tweaks.json" {
$script:config.WPFMultiplaneOverlay.Type | Should -Be "Combobox"
$script:config.WPFMultiplaneOverlay.ComboItems | Should -Be @("Enabled", "Disabled (Compatibility)", "Fully Disabled")
$script:config.WPFMultiplaneOverlay.ComboItems | Should -BeOfType [string]
$comboItems = @($script:config.WPFMultiplaneOverlay.ComboItems -split "\|")
$comboItems | Should -Be @("Enabled", "Disabled (Compatibility)", "Fully Disabled")
$script:states.Count | Should -Be 2
$script:states[0].Values.PSObject.Properties.Name | Should -Be $script:config.WPFMultiplaneOverlay.ComboItems
$script:states[0].Values.PSObject.Properties.Name | Should -Be $comboItems
$script:states[0].Values.PSObject.Properties.Value | Should -Be @("<RemoveEntry>", "5", "5")
$script:states[1].Values.PSObject.Properties.Value | Should -Be @("<RemoveEntry>", "<RemoveEntry>", "1")
}