Skip to content

Show configuration keys in UI tooltips - #4968

Open
Rene-Kuhm wants to merge 3 commits into
ChrisTitusTech:mainfrom
Rene-Kuhm:agent/show-config-keys-in-tooltips
Open

Show configuration keys in UI tooltips#4968
Rene-Kuhm wants to merge 3 commits into
ChrisTitusTech:mainfrom
Rene-Kuhm:agent/show-config-keys-in-tooltips

Conversation

@Rene-Kuhm

@Rene-Kuhm Rene-Kuhm commented Aug 11, 2026

Copy link
Copy Markdown

What changed

  • Append each application's configuration key to its existing hover tooltip.
  • Use the same tooltip format for tweak, feature, and AppX checkbox selections consumed by automation.
  • Leave action-only controls such as DNS and O&O unchanged so the UI does not advertise identifiers that configuration import cannot use.
  • Document where manual configuration authors can find these keys.
  • Add focused Pester coverage for tooltip formatting and renderer wiring.

Why

Users editing exported configuration files currently need to search the source JSON to discover identifiers such as WPFInstallfirefox and WPFTweaksTelemetry. Exposing the identifier alongside the existing description keeps that information available in the UI without changing the configuration format or interaction model.

Closes #4921.

Validation

  • Invoke-Pester -Path 'pester/*.Tests.ps1' -Output Normal -CI — 557 passed
  • ./Compile.ps1 — passed
  • PSScriptAnalyzer on the changed PowerShell files — no new diagnostics

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Configuration controls now display helpful tooltips containing descriptions and corresponding configuration keys.
    • App installation entries and selectable controls provide consistent tooltip information.
    • Added guidance for manually editing exported configuration files using tooltip-provided keys.
  • Bug Fixes

    • Improved tooltip behavior when descriptions are unavailable by showing the configuration key alone.
    • Preserved existing descriptions for non-selectable controls.
  • Tests

    • Added coverage for tooltip generation and integration across configuration controls.

Walkthrough

WinUtil now includes configuration keys in application and tweak tooltips. A shared formatter handles blank descriptions. Application entries and generated controls use the formatted tooltips. Tests and automation documentation cover the behavior.

Changes

Configuration tooltips

Layer / File(s) Summary
Tooltip formatting contract
functions/private/Get-WinUtilConfigToolTip.ps1, pester/config-tooltips.Tests.ps1
Adds Get-WinUtilConfigToolTip, which returns the configuration key alone or appends it to a description. Unit tests cover both outputs.
UI tooltip integration
functions/private/Initialize-InstallAppEntry.ps1, functions/public/Invoke-WPFUIElements.ps1, pester/config-tooltips.Tests.ps1, docs/src/content/docs/guides/automation.mdx
Applies formatted tooltips to application entries and generated controls. Tests cover selectable and non-selectable controls. Automation guidance documents key discovery through hover tooltips.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ConfigEntry
  participant InvokeWPFUIElements
  participant GetWinUtilConfigToolTip
  participant WPFControl
  ConfigEntry->>InvokeWPFUIElements: Provide description and selectable key
  InvokeWPFUIElements->>GetWinUtilConfigToolTip: Format tooltip
  GetWinUtilConfigToolTip-->>InvokeWPFUIElements: Return formatted tooltip
  InvokeWPFUIElements->>WPFControl: Assign tooltip
Loading

Possibly related PRs

Suggested labels: ui update, documentation

Suggested reviewers: christitustech

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes satisfy issue #4921 by displaying application and tweak configuration commands in hover tooltips.
Out of Scope Changes check ✅ Passed The documentation, tooltip helper, UI wiring, and focused tests are directly related to the linked issue objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title clearly and concisely describes the primary change: showing configuration keys in UI tooltips.
Description check ✅ Passed The description directly explains the tooltip changes, supported controls, documentation, tests, and user benefit.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Rene-Kuhm
Rene-Kuhm marked this pull request as ready for review August 11, 2026 12:42
@coderabbitai coderabbitai Bot added documentation Improvements or additions to documentation ui update UI/UX improvements labels Aug 11, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
pester/config-tooltips.Tests.ps1 (1)

32-37: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Cover every generated control in the renderer test.

Line 35 verifies the computed tooltip property, but it does not verify the six assignments at Lines 194, 228, 272, 402, 453, and 495. A regression in one control type can pass this test. Add one assertion for each assignment, or render the controls and inspect their ToolTip values.

The PR objective covers all generated control types, so the test should cover each changed assignment.

Suggested focused assertions
         $rendererScript | Should -Match 'ToolTip\s*= Get-WinUtilConfigToolTip -Description \$entryInfo\.description -ConfigKey \$entry'
         $rendererScript | Should -Not -Match '\.ToolTip = \$entryInfo\.Description'
+        $rendererScript | Should -Match '\$toggleButton\.ToolTip = \$entryInfo\.ToolTip'
+        $rendererScript | Should -Match '\$button\.ToolTip = \$entryInfo\.ToolTip'
+        $rendererScript | Should -Match '\$radioButton\.ToolTip = \$entryInfo\.ToolTip'
+        $rendererScript | Should -Match '\$checkBox\.ToolTip = \$entryInfo\.ToolTip'
+        ([regex]::Matches($rendererScript, '\$label\.ToolTip = \$entryInfo\.ToolTip')).Count |
+            Should -Be 2
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pester/config-tooltips.Tests.ps1` around lines 32 - 37, Expand the test in
“uses configuration-key tooltips for generated tweak controls” to verify tooltip
assignment for every generated control type, covering each of the six renderer
assignments referenced in Invoke-WPFUIElements.ps1. Add focused assertions for
each assignment or render controls and inspect their ToolTip values, while
retaining the existing computed-tooltip assertion.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@pester/config-tooltips.Tests.ps1`:
- Around line 32-37: Expand the test in “uses configuration-key tooltips for
generated tweak controls” to verify tooltip assignment for every generated
control type, covering each of the six renderer assignments referenced in
Invoke-WPFUIElements.ps1. Add focused assertions for each assignment or render
controls and inspect their ToolTip values, while retaining the existing
computed-tooltip assertion.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 995dec37-4ea7-404f-86bb-41a2428f8eb3

📥 Commits

Reviewing files that changed from the base of the PR and between ea5de27 and f9db6f5.

📒 Files selected for processing (5)
  • docs/src/content/docs/guides/automation.mdx
  • functions/private/Get-WinUtilConfigToolTip.ps1
  • functions/private/Initialize-InstallAppEntry.ps1
  • functions/public/Invoke-WPFUIElements.ps1
  • pester/config-tooltips.Tests.ps1

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f9db6f5208

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Checked = $entryInfo.Checked
ButtonWidth = $entryInfo.ButtonWidth
GroupName = $entryInfo.GroupName # Added for RadioButton groupings
ToolTip = Get-WinUtilConfigToolTip -Description $entryInfo.description -ConfigKey $entry

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Limit configuration tooltips to importable keys

When a user follows the new automation guide and copies the advertised key from a generated but non-selectable control—such as WPFchangedns, WPFOOSUbutton, or WPFFixesNTPPool—this unconditional tooltip labels the identifier as a usable configuration key. However, functions/private/Update-WinUtilSelections.ps1:4-12 recognizes only the install, tweak, toggle, feature, and AppX prefixes, then calls Add through a null list name for unmatched identifiers, so importing a file containing one of these advertised keys fails. Restrict these tooltips to entries that the import/export format supports, or extend that format to represent these controls.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Addressed in 3aa72d6. Generated tooltips now add a configuration key only when the control is selectable and its prefix is handled by Update-WinUtilSelections. Buttons, combo boxes, radio buttons, and notes retain their existing description behavior and no longer advertise non-importable identifiers. I also expanded the focused assertions and reran all 557 Pester tests plus Compile.ps1 successfully.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@functions/public/Invoke-WPFUIElements.ps1`:
- Around line 69-73: Update the tooltip-selection logic around
$isSelectableEntry in Invoke-WPFUIElements so every supported importable control
type, including ComboBox, RadioButton, and Button, receives the formatted
tooltip from Get-WinUtilConfigToolTip via $entryInfo.ToolTip. Extend the
predicate beyond empty, Toggle, and ToggleButton types, and replace the affected
direct $entryInfo.Description uses at the referenced control branches.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ff1dedee-47ba-4235-b828-cc34d0c93cde

📥 Commits

Reviewing files that changed from the base of the PR and between f9db6f5 and 3aa72d6.

📒 Files selected for processing (2)
  • functions/public/Invoke-WPFUIElements.ps1
  • pester/config-tooltips.Tests.ps1
🚧 Files skipped from review as they are similar to previous changes (1)
  • pester/config-tooltips.Tests.ps1

Comment thread functions/public/Invoke-WPFUIElements.ps1 Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3aa72d6d9d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

$entryInfo = $configHashtable[$entry]
$entryToolTip = $entryInfo.description
$isSelectableEntry = [string]::IsNullOrWhiteSpace([string]$entryInfo.type) -or $entryInfo.type -in @("Toggle", "ToggleButton")
$isImportableKey = $entry -match '^(WPFTweaks|WPFToggle|WPFFeature|WPFAppx)'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Do not advertise toggle keys for headless configs

When a user adds an advertised WPFToggle* key to a configuration and launches the documented -Config workflow, Update-WinUtilSelections stores it only in selectedToggles, but the scripts/main.ps1 config path calls Invoke-WinUtilAutoRun, which processes only tweaks, features, apps, and AppX entries. Because this headless path never creates the form whose Checked handlers apply toggles, the key is silently ignored; exclude WPFToggle here or add toggle handling to the automation path.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Addressed in 8b1c15c. WPFToggle entries are now excluded from advertised configuration keys because Invoke-WinUtilAutoRun does not process selectedToggles in the documented headless -Config path. The tooltip is now limited to checkbox selections that automation actually consumes, and the focused test locks in that exclusion. All 557 tests and Compile.ps1 pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation ui update UI/UX improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Add "WPFInstall..." and "WPFTweak..." command to application/tweak info popup.

1 participant