mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2026-10-09 21:21:18 +11:00
Show preset JSON key in app, tweak, and feature tooltips (#4995)
* Add Get-WinUtilEntryToolTip helper for preset-key tooltips * Show preset JSON key in app and tweak tooltips * Match apps search against preset key for consistency with tweaks * Limit preset-key tooltips to preset-representable controls Comboboxes and package-manager radio buttons cannot appear in a preset file. Update-WinUtilSelections routes a flat list of keys by the WPFInstall/WPFTweaks/WPFToggle/WPFFeature/WPFAppx prefixes, so a preset can carry neither a combobox selected value nor a radio group choice; WingetRadioButton and ChocoRadioButton do not even carry a WPF prefix. Advertising those control names as preset keys invited users to add keys that fall through the switch and abort the whole import. Revert the combobox label and radio button tooltips to the plain description, and add tests that fail if the key is reattached to a control the preset importer cannot accept. * fix: address preset key review feedback * docs: clarify preset key search scope --------- Co-authored-by: Chris Titus <contact@christitus.com>
This commit is contained in:
co-authored by
Chris Titus
parent
a7074963a6
commit
b8b81edcdb
@@ -0,0 +1,25 @@
|
||||
function Get-WinUtilEntryToolTip {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Builds the tooltip string for an app/tweak/feature entry: its description plus its preset JSON key
|
||||
|
||||
.PARAMETER Description
|
||||
The entry's description from the config JSON. May be null or empty.
|
||||
|
||||
.PARAMETER Key
|
||||
The entry's JSON key as used in preset files (e.g. WPFInstallbrave, WPFTweaksTele).
|
||||
#>
|
||||
param(
|
||||
[Parameter(Mandatory = $false)]
|
||||
[string]$Description,
|
||||
|
||||
[Parameter(Mandatory = $true)]
|
||||
[string]$Key
|
||||
)
|
||||
|
||||
if ([string]::IsNullOrWhiteSpace($Description)) {
|
||||
return "Preset key: $Key"
|
||||
}
|
||||
|
||||
return "$Description`n`nPreset key: $Key"
|
||||
}
|
||||
Reference in New Issue
Block a user