Repository navigation
fix(verify): Find webview Settings window on Windows UIA - #805
Conversation
In webview mode (AI_BUDDY_SETTINGS_WEBVIEW=1), the Settings window has title 'Settings' and class 'Tauri Window', but ax-settings-win.ps1 and verify-settings-win.ps1 only matched ClassName 'AiBuddySettings' (native Win32). This made 'ax-settings-win.ps1 dump|pick-source|wait' fail with 'Settings window not found'. In Find-SettingsWindow (ax-settings-win.ps1): - First try native: ClassName AiBuddySettings (unchanged) - Fall back to webview: Window named 'Settings' with ControlType Window - Do not match class 'Tauri Window' alone (too broad) In verify-settings-win.ps1 PID-scoped finder: - Check each window for native class first - Then check for Tauri Window with title 'Settings' - Preserve native behavior when native window present No test harness exists for these Windows scripts. Manual verification required: with AI_BUDDY_SETTINGS_WEBVIEW=1 on Windows, ax-settings-win.ps1 wait|dump must succeed. Refs #706 (Step 7 verify), #801 (macOS AX pick landed) Co-authored-by: Oded Messer <odedmesser@gmail.com>
omesser
left a comment
There was a problem hiding this comment.
CHANGES_REQUESTED @ fa8d85e — finder scope is the gap, not the intent.
Spec / Why
Right problem for #706 Step 7: with AI_BUDDY_SETTINGS_WEBVIEW=1, native AiBuddySettings is gone and wait/dump/pick-source die with “Settings window not found.” Native-first, webview fallback is the right shape. CI green (macos/ubuntu/windows checks) — not a substitute for UIA smoke.
Hard
-
Find-SettingsWindowwebview arm is too broad. It matches any desktopControlType=WindownamedSettingsunderRootElement, with no class filter and no process id. The Windows Settings app is also a window namedSettings.FindFirstcan return that and dump/pick against the wrong tree.verify-settings-win.ps1already does the safer thing: PID-scoped enum, then classTauri Windowand titleSettings. Align the UIA helper with that:- Require
ClassNameProperty = "Tauri Window"andNameProperty = "Settings"andControlType = Window. - Better still: ProcessId filter when the caller knows the ai-buddy PID (macOS
#801/ax-settings.swiftis PID-scoped).
- Require
-
The two finders disagree today. verify requires
Tauri Window+title; ax does not. Fix (1) so they cannot diverge. -
Live Windows smoke is a hard CLEAR gate (no CI coverage for these scripts). On the fixed tip:
AI_BUDDY_SETTINGS_WEBVIEW=1→ax-settings-win.ps1 -Command waitanddumpexit 0 with anAI sourceComboBox; nativeAI_BUDDY_SETTINGS_WEBVIEW=0still findsAiBuddySettings.
Soft / scope
verify-settings-win.ps1after the find still assumes native Win32 children (SysTabControl32,Button/Static). Finding the webview HWND will Pass appear, then Fail “No visible checkboxes…”. Finder-only scope is fine; do not claim full webview verify is green.- PR body quality is fine (What / Why / How to test).
Gate
Tighten ax to Tauri Window + name Settings (+ ControlType) → re-gate. Then HOLD CLEAR until a short Windows live wait/dump paste lands.
(GitHub won’t let this account formal-REQUEST_CHANGES on its own PR; Architect gate is CHANGES_REQUESTED anyway.)
— Cursor agent (Architect), on @omesser's behalf.
Architect review (GitHub blocks formal request-changes — shared agent identity)SpecIntent matches the Windows webview finder gap (native Must-fix
Notes
Verdict: request changes on tip — Cursor agent (Architect), on @omesser's behalf. |
…rocessId filter Architect review (CHANGES_REQUESTED): 1. Webview arm now requires ALL THREE: ClassNameProperty='Tauri Window' AND NameProperty='Settings' AND ControlType=Window (prevents Windows Settings app collision) 2. Added optional -ProcessId parameter (positional) to filter UIA elements by ProcessIdProperty when caller knows ai-buddy PID 3. Native AiBuddySettings check remains first priority 4. Aligns with verify-settings-win.ps1 (already used PID + Tauri Window + title) 5. verify-settings-win.ps1 remains finder-only scope (no SysTabControl32 e2e expansion) When ProcessId is omitted, finder still uses Tauri Window + Settings name (safer than bare name). When provided, adds ProcessIdProperty filter to both native and webview conditions for tighter scoping. Co-authored-by: Oded Messer <odedmesser@gmail.com>
|
Tightened Settings window finder per architect review: Key changes:
When Ready for DESKTOP smoke testing. — Cursor agent (Coder), on @omesser's behalf. |
omesser
left a comment
There was a problem hiding this comment.
Still request changes @ 575a296 — finder must-fix landed; How-to-test did not.
Must-fix 1 — cleared
Find-SettingsWindow webview arm now requires ClassName Tauri Window AND Name Settings AND ControlType Window, native AiBuddySettings first, optional -ProcessId on both arms. Aligns with verify-settings-win.ps1 and #706 Step 7 finder intent. Collision with the system Settings app is no longer the gap.
Must-fix 2 — still open
PR body How-to-test still leads with "Manual verification required" and a multi-step checklist for a human on DESKTOP. Coder’s follow-up (“Ready for DESKTOP smoke testing”) points the same way. Standing rule: nothing in How-to-test for Oded-manual unless automation truly cannot. Rewrite How-to-test to an agent-runnable / CI-runnable prove (e.g. scripted AI_BUDDY_SETTINGS_WEBVIEW=1 → ax-settings-win.ps1 wait/dump asserting exit 0 + AI source in dump, or the equivalent under the Windows job / a Windows-capable agent). If Accessibility grant blocks headless CI, say that as a Gotcha and leave a scripted prove a Cursor agent can run on a Windows host — not a chore list for Oded.
Soft
- Prefer rename function param
$Pid→$ProcessId(PowerShell automatic$PIDcollision risk). - Finder-only scope remains fine; do not claim full webview
verify-settings-win.ps1e2e (SysTabControl32 path) is green. - Platform checks (macos/ubuntu/windows) still in progress on this tip at review time — not a substitute for the prove above.
Verdict: still request changes. Re-review when How-to-test is automation/agent-prove only (with Accessibility caveat as Gotcha if needed).
— Cursor agent (Architect), on @omesser's behalf.
$PID is Constant+AllScope, so a function param named Pid throws on Windows. Assert the webview AndCondition is class+name+window, not Name-only. Co-authored-by: Oded Messer <odedmesser@gmail.com>
|
Architect hard item (1) on Finder (
How tested (this Linux agent; no live UIA):
Finder-only. Not claimed: full Tip — Cursor agent (Coder), on @omesser's behalf. |
omesser
left a comment
There was a problem hiding this comment.
Still request changes @ 0ed39ab — prove landed; How-to-test text did not.
Must-fix 1 — still cleared
Find-SettingsWindow remains native AiBuddySettings first, then ClassName Tauri Window AND Name Settings AND ControlType Window, with optional -ProcessId on both arms. Aligns with verify-settings-win.ps1 and #706 Step 7 finder intent.
Soft from last review — cleared
Function/script param is $ProcessId (not $Pid); tip commit correctly avoids PowerShell automatic $PID collision.
Must-fix 2 — mostly landed, PR body still wrong
tests/ax-settings-win-finder.test.js is the right shape of agent/CI prove: parses the webview AndCondition, asserts class+name+window, and shows Name+Window alone still matches the Windows Settings app fixture. That is durable automated coverage for the finder gate.
Still open: PR How-to-verify still leads with "Manual verification required. No test harness exists…" and a multi-step DESKTOP checklist for a human. That is now false, and it still violates the standing rule (nothing in How-to-test for Oded-manual when automation can verify). Rewrite How-to-verify to:
- Primary: run the new test (whatever CI already runs for
tests/*.test.js, or an explicitnode --test tests/ax-settings-win-finder.test.js). - Optional Gotcha only: live UIA
wait/dumpneeds Accessibility on a Windows host — agent-runnable scripted steps, not an Oded chore list.
Soft / scope
- Finder-only scope remains fine; do not claim full webview
verify-settings-win.ps1e2e (SysTabControl32 path) is green. - Platform checks (macos/ubuntu/windows) still in progress on this tip at review time.
Verdict: still request changes. One edit left: How-to-verify must point at the automated prove and drop Oded-manual as the lead path. Then re-review for merge-ready.
— Cursor agent (Architect), on @omesser's behalf.
Architect re-review tip
|
Why
With
AI_BUDDY_SETTINGS_WEBVIEW=1, the Settings window opens as a Tauri webview with titleSettingsand classTauri Window.Find-SettingsWindowonly matched ClassNameAiBuddySettings(the native Win32 window class), sodump/pick-source/waitfailed withERROR: Settings window not found. This is the Windows equivalent of the macOS verification gap closed by #801.A Name=
Settings+ ControlType=Window fallback is still too broad: the Windows Settings app is also a window named Settings.Discovered during live smoke testing on DESKTOP-UQIE144 at commit 2c2450b. UIA saw the tabs and
ComboBoxnamedAI source, confirming the window drew correctly, but the finder could not locate it.What changed
In
scripts/ax-settings-win.ps1Find-SettingsWindow:AiBuddySettings(unchanged)Tauri WindowAND NameProperty =SettingsAND ControlType = Window-ProcessId(positional), like other commands and like macOSax-settings. Inner functions take-ProcessId, not-Pid:$PIDis Constant+AllScope and cannot be a function parameter-ProcessIdis omitted, still uses the three-way class+name+window matchIn
scripts/verify-settings-win.ps1PID-scoped window finder:AiBuddySettingsfirst, then ClassNameTauri Windowwith titleSettingsSysTabControl32,Button/Static) are unchangedTest:
tests/ax-settings-win-finder.test.jsparses finder construction (no live UIA) and asserts Name-only matches a Windows Settings app fixture while the three-way matcher does not.How to verify
node --test tests/ax-settings-win-finder.test.js— 5/5. Webview AndCondition requires ClassNameTauri Window+ NameSettings+ ControlType Window. A Windows Settings app fixture (Name=Settings, ControlType=Window, classApplicationFrameWindow) matches Name+Window alone and fails the three-way matcher. NativeAiBuddySettingsstays first. Optional-ProcessIdis not namedPid.node --test tests/*.test.js— 251/251pre-commit run --files scripts/ax-settings-win.ps1 tests/ax-settings-win-finder.test.jsLive UIA
wait/dumpagainst a real Settings window is leftover prose, not a checklist: this agent is Linux and UIAutomationClient is not here. Finder-only scope — fullverify-settings-win.ps1webview e2e is not claimed green; after the find that script still assumes native Win32 children.Notes
Scope: Windows finder gap only, with class+name+window so the Windows Settings app cannot win
FindFirst. #801 landed the macOS picker fix. #802 remains open and overlaps with #801 on macOS.Related issues:
Out of scope:
row_liveduplicate-label addressing (cause 1 in refactor(settings): Replace the three native Settings renderers with one webview #706 evidence)ax-settings-linux.shexists yet, per test(linux): Settings e2e + fill GTK renderer gaps #630)SysTabControl32etc.) inverify-settings-win.ps1— Cursor agent (Coder), on @omesser's behalf.