Skip to content

Refactor core UI rendering, search matching, and service maintenance loops - #4906

Open
vyas-devgna wants to merge 7 commits into
ChrisTitusTech:mainfrom
vyas-devgna:ponytail/ultra-refactor
Open

Refactor core UI rendering, search matching, and service maintenance loops#4906
vyas-devgna wants to merge 7 commits into
ChrisTitusTech:mainfrom
vyas-devgna:ponytail/ultra-refactor

Conversation

@vyas-devgna

@vyas-devgna vyas-devgna commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Type of Change

  • New feature
  • Bug fix
  • Documentation update
  • Refactor
  • UI/UX improvement

Description

A performance and correctness pass over a few hot paths.

  • Invoke-WPFUIElements, Invoke-WinUtilTweaks, Invoke-WinUtilCurrentSystemList[object] instead of += array growth, and no intermediate hashtable conversions.
  • App and tweak search — literal IndexOf matching instead of wildcard -like, so [, * and ? are treated as text. Clearing the search now leaves collapsed categories collapsed.
  • Invoke-WinUtilISO — 30s mount timeout that dismounts before it throws, and the modify log writes beside the work directory so it exists from the first line and survives cleanup.
  • Invoke-WPFFixesUpdate — one loop for the repeated service commands, and throttled progress during DLL re-registration so it stops flooding the UI thread.
  • Write-WinUtilLog — skip Add-Content when Start-Transcript already owns the log file.
  • From review: a missing service now counts as a mismatch in Invoke-WinUtilCurrentSystem, and Test-WinUtilPackageManager checks both managers when -winget and -choco are passed together.

Invoke-Pester -Path 'pester/*.Tests.ps1' passes 471/471 and Compile.ps1 is clean.

Issue related to PR

  • None

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8781a506-7d91-4339-8d66-fc7b64579013

📥 Commits

Reviewing files that changed from the base of the PR and between 413ba25 and 9b60223.

📒 Files selected for processing (1)
  • functions/private/Find-TweaksByNameOrDescription.ps1
🚧 Files skipped from review as they are similar to previous changes (1)
  • functions/private/Find-TweaksByNameOrDescription.ps1

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Search now matches app and tweak text case-insensitively with category filtering.
    • ISO mounting includes a 30-second timeout and improved cleanup.
    • Logging provides more reliable file and console output.
  • Bug Fixes

    • Tweak filtering correctly restores category and item visibility.
    • Package manager checks and Windows Update operations provide clearer status and error reporting.
    • ISO cleanup and log handling are more resilient.
  • Documentation

    • Updated ISO log naming guidance.
  • Refactor

    • Streamlined event handling, configuration processing, and cleanup flows.

Walkthrough

The pull request updates search, system checks, tweak execution, ISO handling, logging, UI grouping, update repair, dialog setup, and parser tests. It adds literal matching, explicit loops, timeout handling, fallback cleanup, and consolidated state handling.

Changes

PowerShell workflows

Layer / File(s) Summary
Search and UI wiring
functions/private/Find-AppsByNameOrDescription.ps1, functions/private/Find-TweaksByNameOrDescription.ps1, pester/search-filter.Tests.ps1, functions/public/Invoke-WPFUIElements.ps1, scripts/main.ps1
Search uses case-insensitive literal matching and preserves collapsed categories during empty searches. UI grouping and control registration use direct iteration and consolidated type checks.
System detection and tweak application
functions/private/Invoke-WinUtilCurrentSystem.ps1, functions/private/Test-WinUtilPackageManager.ps1, functions/private/Invoke-WinUtilTweaks.ps1
Application, package-manager, service, registry, script, and APPX checks use explicit loops. Tweak detection uses a shared all-match state.
ISO processing and logging
functions/private/Invoke-WinUtilISO.ps1, functions/private/Write-WinUtilLog.ps1, docs/src/content/docs/code-reference/architecture.mdx
ISO mounting times out after 30 seconds. Cleanup uses batch deletion with a file-by-file fallback. Log paths and host-output handling were consolidated. Documentation describes the generated ISO log filename pattern.
Update, dialog, and parser maintenance
functions/public/Invoke-WPFFixesUpdate.ps1, functions/private/Show-CustomDialog.ps1, pester/sanity.Tests.ps1
Service stops and progress cleanup use loops. DLL progress output is throttled. Dialog initialization remains functionally equivalent. Parser test string handling was adjusted.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

Suggested labels: bug, ui update

Suggested reviewers: christitustech

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main refactoring work across UI rendering, search matching, and service maintenance loops.
Description check ✅ Passed The description directly explains the refactoring objectives, correctness fixes, performance changes, and test results.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ 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.

@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: 4

🧹 Nitpick comments (1)
functions/private/Find-TweaksByNameOrDescription.ps1 (1)

69-72: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Rename $matches to avoid PowerShell's automatic variable. Use $isMatch; PSScriptAnalyzer flags assignments to $matches, which stores regex results.

🤖 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 `@functions/private/Find-TweaksByNameOrDescription.ps1` around lines 69 - 72,
Rename the local `$matches` variable in `Find-TweaksByNameOrDescription` to
`$isMatch`, updating both its assignment and the subsequent conditional
reference. Preserve the existing search logic and matching behavior.
🤖 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/private/Find-TweaksByNameOrDescription.ps1`:
- Around line 34-44: Update the reset branch in Find-TweaksByNameOrDescription
so it restores each category according to its collapsed-label prefix instead of
making every item visible. Reuse the approach from Find-AppsByNameOrDescription:
detect labels starting with "+", keep those category items collapsed, and ensure
the label prefix remains consistent with item visibility.

In `@functions/private/Invoke-WinUtilCurrentSystem.ps1`:
- Around line 104-110: Update the service validation logic in
Invoke-WinUtilCurrentSystem so a missing service returned by Get-Service is
treated as a mismatch. Clear $allMatch and exit the validation loop whenever
$Service is null or its StartType differs from $tweak.StartupType; preserve the
existing matching behavior for present services with the expected startup type.

In `@functions/private/Invoke-WinUtilISO.ps1`:
- Around line 62-67: Update the timeout handling in the ISO mount flow around
Mount-DiskImage and the $mountElapsed check to dismount the mounted ISO before
raising the timeout error. Invoke the existing dismount mechanism for the target
image, then throw the same timeout message, while preserving normal mounting
behavior when the drive letter appears.

In `@functions/private/Test-WinUtilPackageManager.ps1`:
- Around line 18-24: Update the package-manager selection and validation in
Test-WinUtilPackageManager so passing both -winget and -choco cannot silently
check only winget; either reject the mutually exclusive combination or evaluate
both requested managers and return "installed" only when all requested commands
are available, while preserving the existing single-switch results.

---

Nitpick comments:
In `@functions/private/Find-TweaksByNameOrDescription.ps1`:
- Around line 69-72: Rename the local `$matches` variable in
`Find-TweaksByNameOrDescription` to `$isMatch`, updating both its assignment and
the subsequent conditional reference. Preserve the existing search logic and
matching behavior.
🪄 Autofix (Beta)

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: fb0f9660-cec9-48e4-81b6-214661337bc8

📥 Commits

Reviewing files that changed from the base of the PR and between e96f990 and af9d24e.

📒 Files selected for processing (12)
  • functions/private/Find-AppsByNameOrDescription.ps1
  • functions/private/Find-TweaksByNameOrDescription.ps1
  • functions/private/Invoke-WinUtilCurrentSystem.ps1
  • functions/private/Invoke-WinUtilISO.ps1
  • functions/private/Invoke-WinUtilTweaks.ps1
  • functions/private/Show-CustomDialog.ps1
  • functions/private/Test-WinUtilPackageManager.ps1
  • functions/private/Write-WinUtilLog.ps1
  • functions/public/Invoke-WPFFixesUpdate.ps1
  • functions/public/Invoke-WPFUIElements.ps1
  • pester/sanity.Tests.ps1
  • scripts/main.ps1

Comment thread functions/private/Find-TweaksByNameOrDescription.ps1
Comment thread functions/private/Invoke-WinUtilCurrentSystem.ps1
Comment thread functions/private/Invoke-WinUtilISO.ps1 Outdated
Comment on lines +18 to +24
$cmd = if ($winget) { "winget" } else { "choco" }
if (Get-Command $cmd -ErrorAction SilentlyContinue) {
Write-Host "$cmd is installed" -ForegroundColor Green
return "installed"
} else {
Write-Host "$cmd is not installed" -ForegroundColor Red
return "not-installed"

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.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Handle both package-manager switches.

When callers pass -winget -choco, $cmd is always "winget". The function ignores the Chocolatey check and can return "installed" although Chocolatey is not installed.

Either validate that exactly one switch is set, or check both commands and return "installed" only when both requested package managers are installed.

🤖 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 `@functions/private/Test-WinUtilPackageManager.ps1` around lines 18 - 24,
Update the package-manager selection and validation in
Test-WinUtilPackageManager so passing both -winget and -choco cannot silently
check only winget; either reject the mutually exclusive combination or evaluate
both requested managers and return "installed" only when all requested commands
are available, while preserving the existing single-switch results.

@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: af9d24ea5e

ℹ️ 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".

Comment thread functions/private/Invoke-WinUtilISO.ps1 Outdated
do {
Start-Sleep -Milliseconds 500
$mountElapsed += 0.5
if ($mountElapsed -ge $mountTimeout) { throw "ISO mount timed out after $($mountTimeout)s - drive letter never appeared." }

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 Dismount the ISO before timing out

When Mount-DiskImage succeeds but Windows does not assign a drive letter within 30 seconds, this new timeout throws directly into the catch block and the catch path does not dismount the image. In environments with automount disabled or slow volume arrival, the UI is re-enabled while the ISO remains attached, so a retry can run against stale mounted media; dismount the image before throwing or add cleanup in the catch/finally path.

Useful? React with 👍 / 👎.

})
Add-Content -Path (Join-Path $workDir "WinUtil_Win11ISO.log") -Value "[$ts] $msg"
# Write to host only; transcript captures it without file-locking conflicts
Write-Host "[$ts] $msg"

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 Restore the ISO workdir log

During Win11 ISO modification and cleanup, this replaces the per-workdir WinUtil_Win11ISO.log write with Write-Host, so completed or failed ISO runs no longer leave a persistent log beside the copied media. If the UI closes or a user resumes/export-diagnoses a prior work directory, the detailed DISM/robocopy/customization history is gone; keep writing the workdir log while avoiding only the transcript-owned file.

Useful? React with 👍 / 👎.

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

@ChrisTitusTech ChrisTitusTech left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Feedback needs to be resolved or this PR will be closed out.

vyas-devgna pushed a commit to vyas-devgna/winutil that referenced this pull request Aug 4, 2026
- Find-TweaksByNameOrDescription: respect collapsed category state on
  search reset (mirrors Find-AppsByNameOrDescription); rename $matches
  to $isMatch to avoid shadowing the PS automatic variable
- Invoke-WinUtilCurrentSystem: treat a missing service as a mismatch
  instead of silently passing validation
- Invoke-WinUtilISO: dismount ISO before throwing timeout error to
  prevent stale mounts; restore per-workdir log file for diagnostics
- Test-WinUtilPackageManager: check both managers when both -winget and
  -choco switches are passed
- Invoke-WPFFixesUpdate: restore per-service PercentComplete in the
  Stop-Service loop; abort on failure instead of silently continuing
@vyas-devgna

Copy link
Copy Markdown
Contributor Author

All review feedback addressed in b4b04e6:

CodeRabbit + Codex feedback:

  • Find-TweaksByNameOrDescription: Reset now respects collapsed category state (mirrors Find-AppsByNameOrDescription pattern). Renamed to to avoid shadowing the PowerShell automatic variable.
  • Invoke-WinUtilCurrentSystem: Missing service now treated as a mismatch (-not -or) instead of silently passing.
  • Invoke-WinUtilISO: ISO is dismounted before throwing timeout error. Restored per-workdir log file for resume/export diagnostics.
  • Test-WinUtilPackageManager: Both -winget and -choco switches are now evaluated when passed together.

@mewclouds feedback:

  • Invoke-WPFFixesUpdate: Restored per-service PercentComplete calculation in the Stop-Service loop. Changed -ErrorAction SilentlyContinue to -ErrorAction Stop with a try/catch that aborts the repair if a service cannot be stopped.

@coderabbitai coderabbitai Bot added bug Something isn't working and removed ui update UI/UX improvements labels Aug 4, 2026
@mewclouds

Copy link
Copy Markdown
Contributor

Thanks! Will review shortly.

@mewclouds

mewclouds commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Could the ISO log write directly to $workDir from the start? Win11ISOWorkDir is set only after success, so early failures still have no per-workdir log. Also, the test suite produces 470 passed, 1 failed. The empty-search test needs updating for the new collapsed-category behavior. Other than that it looks good, thanks for your contributions!

@vyas-devgna

Copy link
Copy Markdown
Contributor Author

Could the ISO log write directly to $workDir from the start? Win11ISOWorkDir is set only after success, so early failures still have no per-workdir log. Also, the test suite produces 470 passed, 1 failed. The empty-search test needs updating for the new collapsed-category behavior. Other than that it looks good, thanks for your contributions!

Both fair, thanks. The workdir log is still gated on Win11ISOWorkDir which is only set after the modify run succeeds, so I will point Log at the workDir the runspace already receives and create the folder before the first line, and since the failure path deletes workDir I will preserve the log before cleanup. For the test, the empty search case builds the category as "+ Privacy" and still expects everything visible, so I will update it to keep collapsed categories collapsed and add a "- Privacy" case for the other branch. Pushing shortly.

@coderabbitai coderabbitai Bot added the ui update UI/UX improvements label Aug 5, 2026
@vyas-devgna

Copy link
Copy Markdown
Contributor Author

Both fixed in d20279d.

The log now goes to <workDir>.log beside the working directory rather than inside it, which drops the $sync["Win11ISOWorkDir"] gate entirely — %TEMP% already exists, so the first line lands before the work directory is created, and the Remove-Item -Recurse on the failure path can't reach it. Writing inside $workDir would have needed a New-Item before the first line plus a move before cleanup, and that move sits in the catch block where a throw would replace the original ISO error.

The empty-search tweak test now covers both branches — + Privacy stays collapsed, - Explorer gets restored — mirroring the app-side test. 471/471 locally and in CI, no new PSScriptAnalyzer findings, Compile.ps1 clean. Also updated the one docs line that named the old log file.

Thanks for the catch.

@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/search-filter.Tests.ps1 (1)

395-414: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Assert the category markers after resetting the search.

The fixture uses + Privacy and - Explorer to represent collapsed and expanded states, but the test checks only visibility. A regression that changes either marker can pass. Add content assertions for both categories.

Proposed test assertions
         $collapsedCategory.Label.Visibility | Should -Be ([Windows.Visibility]::Visible)
+        $collapsedCategory.Label.Content | Should -Be "+ Privacy"
         $collapsedItem.Visibility | Should -Be ([Windows.Visibility]::Collapsed)
         $expandedCategory.Border.Visibility | Should -Be ([Windows.Visibility]::Visible)
         $expandedCategory.Label.Visibility | Should -Be ([Windows.Visibility]::Visible)
+        $expandedCategory.Label.Content | Should -Be "- Explorer"
         $expandedItem.Visibility | Should -Be ([Windows.Visibility]::Visible)
🤖 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/search-filter.Tests.ps1` around lines 395 - 414, Update the test
“restores category labels and respects collapsed category state for empty
search” to assert each category label’s Content after
Find-TweaksByNameOrDescription resets the search. Verify the collapsed category
retains “+ Privacy” and the expanded category retains “- Explorer”, alongside
the existing visibility assertions.
🤖 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/search-filter.Tests.ps1`:
- Around line 395-414: Update the test “restores category labels and respects
collapsed category state for empty search” to assert each category label’s
Content after Find-TweaksByNameOrDescription resets the search. Verify the
collapsed category retains “+ Privacy” and the expanded category retains “-
Explorer”, alongside the existing visibility assertions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 15635d3a-b994-4486-b1aa-ad71e104143d

📥 Commits

Reviewing files that changed from the base of the PR and between b4b04e6 and d20279d.

📒 Files selected for processing (3)
  • docs/src/content/docs/code-reference/architecture.mdx
  • functions/private/Invoke-WinUtilISO.ps1
  • pester/search-filter.Tests.ps1
🚧 Files skipped from review as they are similar to previous changes (1)
  • functions/private/Invoke-WinUtilISO.ps1

@coderabbitai coderabbitai Bot added ui update UI/UX improvements and removed ui update UI/UX improvements labels Aug 5, 2026

@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: 3b9a01e78d

ℹ️ 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".

$pct = [int](($i / $services.Count) * 100)
Write-Progress -Id 2 -ParentId 0 -Activity "Stopping Services" -Status "Stopping $svc..." -PercentComplete $pct
try {
Stop-Service -Name $svc -Force -ErrorAction Stop

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 Continue to restart services after stop failures

When Stop-Service fails for one of these services (for example because the service is protected, absent, or the current elevated context still cannot control it; the Stop-Service docs note that -Force only helps with dependent services and service control still depends on permissions), this new terminating path aborts before the later block that restarts BITS, wuauserv, AppIDSvc, and CryptSvc. If an earlier service in the loop was already stopped, Windows Update Reset can leave the machine with update services stopped and the repair half-applied; collect/report the stop failure but still run the restart/cleanup path.

Useful? React with 👍 / 👎.

Comment on lines +104 to +105
$Service = Get-Service -Name $tweak.Name -ErrorAction SilentlyContinue
if (-not $Service -or $tweak.StartupType -ne $Service.StartType) {

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 Ignore absent optional services during tweak detection

On Windows editions/builds where a configured tweak service is absent (for example optional services such as CscService or MapsBroker), applying the tweak already only logs a warning and continues via Set-WinUtilService, but this detection path now marks the whole tweak as not applied whenever Get-Service returns nothing. That makes “Get Installed” leave a successfully applied tweak unchecked forever on those systems; keep missing services neutral as before, or align apply/detect semantics so absent services do not block detection.

Useful? React with 👍 / 👎.

@vyas-devgna

Copy link
Copy Markdown
Contributor Author

This PR heavily refactors Find-AppsByNameOrDescription.ps1. It should be merged before #4955. #4955 has already been rebased and stacked on top of this branch to pre-resolve the resulting merge conflicts.

AI Agent and others added 4 commits August 10, 2026 17:18
…ce loops

- Replace O(N^2) array concatenations with generic lists in GUI item rendering and tweak checks
- Convert slow pipeline loops (ForEach-Object) to direct foreach runtime enumeration
- Replace wildcard regex matches in app and tweak search with fast string index lookups
- Add timeout protection and batch file cleanup in ISO mounting workflows
- Prevent file-locking exceptions when logging within an active transcript session
- Streamline Windows Update service repair routines and throttle progress updates during DLL reregistration
- Ensure command quote resilience in sanity tests when invoking nested Windows PowerShell parsers
- Find-TweaksByNameOrDescription: respect collapsed category state on
  search reset (mirrors Find-AppsByNameOrDescription); rename $matches
  to $isMatch to avoid shadowing the PS automatic variable
- Invoke-WinUtilCurrentSystem: treat a missing service as a mismatch
  instead of silently passing validation
- Invoke-WinUtilISO: dismount ISO before throwing timeout error to
  prevent stale mounts; restore per-workdir log file for diagnostics
- Test-WinUtilPackageManager: check both managers when both -winget and
  -choco switches are passed
- Invoke-WPFFixesUpdate: restore per-service PercentComplete in the
  Stop-Service loop; abort on failure instead of silently continuing
Write the modify log to <workDir>.log in %TEMP% instead of a file gated
on $sync["Win11ISOWorkDir"], which is only assigned after a successful
run. The log now starts at the first line, before the work directory is
created, and survives the cleanup that removes that directory, so early
failures leave a diagnostic behind.

Update the empty-search tweak test for the collapsed-category reset
behavior and cover the expanded branch as well.
The reset branch leaves Label.Content alone while the search branch
rewrites "+ X" to "- X". Without these assertions a reset that started
rewriting the marker would desync the label from its collapsed items
and still pass.
@vyas-devgna
vyas-devgna force-pushed the ponytail/ultra-refactor branch from 3b9a01e to 3e0fa36 Compare August 10, 2026 11:50

@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: 3e0fa360bc

ℹ️ 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".

Comment on lines +68 to +69
$ic = $categoryBorder.Child.Children | Where-Object { $_ -is [Windows.Controls.ItemsControl] } | Select-Object -First 1
if ($null -eq $ic) { continue }

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 Restore filtering for the rendered tweak panels

When the real Tweaks/AppX tabs are rendered through Invoke-WPFUIElements, each category border's DockPanel contains a StackPanel directly (or a ScrollViewer in targets without an outer scroll viewer), not an ItemsControl. This new lookup therefore leaves $ic null and skips every category, so typing in the search box on the Tweaks or AppX tab becomes a no-op against the actual UI even though the synthetic tests use ItemsControl.

Useful? React with 👍 / 👎.

@mewclouds

Copy link
Copy Markdown
Contributor

@coderabbitai resume

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Reviews resumed.

@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/private/Find-TweaksByNameOrDescription.ps1`:
- Around line 106-108: Update the category expansion logic around
$categoryLabel.Content to record categories expanded by search in $sync before
changing the "+ " prefix to "- ". When the search is cleared, use that shared
state to restore each affected category’s "+ " prefix and collapsed items, while
preserving categories that were already expanded and using $sync for the shared
state and UI references.
🪄 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: c7600339-7466-4ce4-88d1-905adee87230

📥 Commits

Reviewing files that changed from the base of the PR and between 600c737 and 413ba25.

📒 Files selected for processing (8)
  • docs/src/content/docs/code-reference/architecture.mdx
  • functions/private/Find-AppsByNameOrDescription.ps1
  • functions/private/Find-TweaksByNameOrDescription.ps1
  • functions/private/Invoke-WinUtilCurrentSystem.ps1
  • functions/private/Invoke-WinUtilTweaks.ps1
  • functions/public/Invoke-WPFUIElements.ps1
  • pester/search-filter.Tests.ps1
  • scripts/main.ps1
🚧 Files skipped from review as they are similar to previous changes (6)
  • docs/src/content/docs/code-reference/architecture.mdx
  • pester/search-filter.Tests.ps1
  • scripts/main.ps1
  • functions/public/Invoke-WPFUIElements.ps1
  • functions/private/Invoke-WinUtilCurrentSystem.ps1
  • functions/private/Invoke-WinUtilTweaks.ps1

Comment thread functions/private/Find-TweaksByNameOrDescription.ps1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ui update UI/UX improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants