From 20735e17c916a06ab0b7d08acb24389c7eb3ac78 Mon Sep 17 00:00:00 2001 From: Colin Neilens Date: Fri, 13 Nov 2026 01:52:27 -0700 Subject: [PATCH 1/3] Fix Windows Needs-you toolbar UIA identity Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: Colin Neilens --- ...ityProvider.Native.Tests.Harness.Tests.ps1 | 2 +- .../AccessibilityProvider.Native.Tests.cpp | 26 +++++++++++-------- .../AccessibilityProvider.Native.Tests.ps1 | 2 +- .../windows/Tests/ValidationRunner.Tests.ps1 | 1 + Tools/windows/uia-live-gate.ps1 | 2 +- .../src/AccessibilityProvider.cpp | 2 ++ 6 files changed, 21 insertions(+), 14 deletions(-) diff --git a/Tools/windows/Tests/AccessibilityProvider.Native.Tests.Harness.Tests.ps1 b/Tools/windows/Tests/AccessibilityProvider.Native.Tests.Harness.Tests.ps1 index 9c09a991..a6b71b66 100644 --- a/Tools/windows/Tests/AccessibilityProvider.Native.Tests.Harness.Tests.ps1 +++ b/Tools/windows/Tests/AccessibilityProvider.Native.Tests.Harness.Tests.ps1 @@ -27,7 +27,7 @@ foreach ($headless in @($false, $true)) { "Headless navigation selection: 179 checks, 0 failures") } else { @("", '"%GRAPHCODE_NATIVE_PROVIDER%"', "oleaut32.lib uiautomationcore.lib user32.lib", - "Native accessibility provider: 280 checks, 0 failures") + "Native accessibility provider: 281 checks, 0 failures") } $actual = @($plan.definitions, $plan.providerSource, $plan.libraries, $plan.summary) for ($index = 0; $index -lt $expected.Count; $index++) { diff --git a/Tools/windows/Tests/AccessibilityProvider.Native.Tests.cpp b/Tools/windows/Tests/AccessibilityProvider.Native.Tests.cpp index 44aaa016..b29a88fe 100644 --- a/Tools/windows/Tests/AccessibilityProvider.Native.Tests.cpp +++ b/Tools/windows/Tests/AccessibilityProvider.Native.Tests.cpp @@ -868,23 +868,27 @@ static void nativeHeaderOverflowChecks(IRawElementProviderSimple *provider, HWND "header overflow provider supports fragment hit-testing"); if (!root) return; const char *identity = "header-overflow:actions"; - const char *identities[] = {identity}; - const char *names[] = {"More actions"}; - const int parents[] = {1}; - const int none[] = {0}; - const int eligible[] = {1}; - const int invokable_flags[] = {1}; - const int bounds[] = {444, 5, 480, 29}; + const char *identities[] = {"header-attention:needs-you", identity}; + const char *names[] = {"1 need you", "More actions"}; + const int parents[] = {1, 1}; + const int none[] = {0, 0}; + const int eligible[] = {1, 1}; + const int invokable_flags[] = {1, 1}; + const int bounds[] = {300, 5, 412, 29, 444, 5, 480, 29}; auto update = &gc_uia_update; check(update(provider, "Header overflow", identities, names, parents, none, eligible, - invokable_flags, bounds, 1, 0, 1, 0, 0, 0, 0) == S_OK, + invokable_flags, bounds, 2, 0, 1, 0, 0, 0, 0) == S_OK, "header overflow publishes"); auto *projects = child(root_fragment, NavigateDirection_FirstChild); - auto *overflow = child(projects, NavigateDirection_FirstChild); + auto *attention = child(projects, NavigateDirection_FirstChild); + auto *overflow = child(attention, NavigateDirection_NextSibling); checkName(overflow, L"More actions"); - check(stringProperty(overflow, UIA_AutomationIdPropertyId).rfind(L"header-overflow-", 0) == 0, - "header overflow exposes its stable automation id prefix"); + check(stringProperty(attention, UIA_AutomationIdPropertyId) == + L"header-attention:needs-you" && + stringProperty(overflow, UIA_AutomationIdPropertyId).rfind( + L"header-overflow-", 0) == 0, + "Needs-you header exposes its exact public automation id while overflow stays stable"); IRawElementProviderSimple *simple = nullptr; check(overflow && overflow->QueryInterface(IID_PPV_ARGS(&simple)) == S_OK && simple, diff --git a/Tools/windows/Tests/AccessibilityProvider.Native.Tests.ps1 b/Tools/windows/Tests/AccessibilityProvider.Native.Tests.ps1 index c5952b73..37b84054 100644 --- a/Tools/windows/Tests/AccessibilityProvider.Native.Tests.ps1 +++ b/Tools/windows/Tests/AccessibilityProvider.Native.Tests.ps1 @@ -92,7 +92,7 @@ function Get-AccessibilityProviderNativeTestPlan([bool] $HeadlessSelection) { definitions = "" providerSource = '"%GRAPHCODE_NATIVE_PROVIDER%"' libraries = "oleaut32.lib uiautomationcore.lib user32.lib" - summary = "Native accessibility provider: 280 checks, 0 failures" + summary = "Native accessibility provider: 281 checks, 0 failures" } } $plan = Get-AccessibilityProviderNativeTestPlan ([bool]$HeadlessSelection) diff --git a/Tools/windows/Tests/ValidationRunner.Tests.ps1 b/Tools/windows/Tests/ValidationRunner.Tests.ps1 index 3c3d0379..601c2873 100644 --- a/Tools/windows/Tests/ValidationRunner.Tests.ps1 +++ b/Tools/windows/Tests/ValidationRunner.Tests.ps1 @@ -3795,6 +3795,7 @@ try { return $value.StartsWith($prefix, [StringComparison]::Ordinal) } foreach ($identity in @( + 'header-attention:needs-you', 'wire-node-1000000000000000001', 'mark-entry-1000000000000000002', 'overview-wire-node-1000000000000000003', diff --git a/Tools/windows/uia-live-gate.ps1 b/Tools/windows/uia-live-gate.ps1 index 68baae7e..93e8ae14 100644 --- a/Tools/windows/uia-live-gate.ps1 +++ b/Tools/windows/uia-live-gate.ps1 @@ -4443,7 +4443,7 @@ function Read-MultiProjectMetadataProperty($element, [string] $property) { function Test-MultiProjectSourceSupportedChromeId([string] $identity, [string] $ownership) { if ($ownership -cne "owned") { return $false } $staticIds = @("canvas-primary-action", "zoom-out", "actual-size", "zoom-in", "fit-canvas", - "overview-destination", "quick-chats-destination") + "overview-destination", "quick-chats-destination", "header-attention:needs-you") $chromePrefixes = @("sidebar-section-", "project-row-", "project-new-loop-", "project-disclosure-", "quick-chats-header-", "quick-chat-new-", "quick-chats-disclosure-", "quick-chat-row-", "sidebar-update-banner-", "workspace-footer-", diff --git a/graphcode-windows/src/AccessibilityProvider.cpp b/graphcode-windows/src/AccessibilityProvider.cpp index d716143c..7fd6f3e9 100644 --- a/graphcode-windows/src/AccessibilityProvider.cpp +++ b/graphcode-windows/src/AccessibilityProvider.cpp @@ -1354,6 +1354,8 @@ class Node final : public IRawElementProviderSimple, std::wstring automationIdLocked() const { if (isRowKey(id_)) { const Row &row = state_->rows.at(id_); + if (row.identity == "header-attention:needs-you") + return L"header-attention:needs-you"; const int parent = row.parent; const wchar_t *prefix = row.identity.rfind("sidebar-section:", 0) == 0 ? L"sidebar-section-" : From 6a1ac80130facf7f496e4c4543b68f610a2049fc Mon Sep 17 00:00:00 2001 From: Colin Neilens Date: Fri, 13 Nov 2026 02:25:52 -0700 Subject: [PATCH 2/3] Correct Needs-you UIA test invariants Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: Colin Neilens --- ...ityProvider.Native.Tests.Harness.Tests.ps1 | 19 +++++++++++++++++++ .../AccessibilityProvider.Native.Tests.cpp | 13 ++++++++----- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/Tools/windows/Tests/AccessibilityProvider.Native.Tests.Harness.Tests.ps1 b/Tools/windows/Tests/AccessibilityProvider.Native.Tests.Harness.Tests.ps1 index a6b71b66..b7310cd1 100644 --- a/Tools/windows/Tests/AccessibilityProvider.Native.Tests.Harness.Tests.ps1 +++ b/Tools/windows/Tests/AccessibilityProvider.Native.Tests.Harness.Tests.ps1 @@ -47,6 +47,25 @@ foreach ($literal in @( if (-not $nativeSource.Contains($literal)) { throw "Native compile plan is not enforced: $literal" } $planChecks++ } +function Test-NativeHeaderIdentityContract([string] $Source) { + $attention = 'check\(stringProperty\(attention,\s*UIA_AutomationIdPropertyId\)\s*==\s*L"header-attention:needs-you",\s*"Needs-you header exposes its exact public automation id"\);' + $overflow = 'check\(stringProperty\(overflow,\s*UIA_AutomationIdPropertyId\)\.rfind\(\s*L"header-overflow-",\s*0\)\s*==\s*0,\s*"header overflow exposes its stable automation id prefix"\);' + return $Source -match "(?s)$attention" -and $Source -match "(?s)$overflow" +} +$nativeCppSource = [IO.File]::ReadAllText((Join-Path $PSScriptRoot "AccessibilityProvider.Native.Tests.cpp")) +if (-not (Test-NativeHeaderIdentityContract $nativeCppSource)) { + throw "Native header checks do not independently assert Needs-you and overflow identities" +} +$planChecks++ +$mutatedNativeCppSource = $nativeCppSource.Replace( + 'L"header-attention:needs-you"', + 'L"header-attention:mutated"', + [StringComparison]::Ordinal) +if ($mutatedNativeCppSource -ceq $nativeCppSource -or + (Test-NativeHeaderIdentityContract $mutatedNativeCppSource)) { + throw "Native header mutation retained the exact Needs-you identity contract" +} +$planChecks++ Write-Host "Native accessibility compile plan: $planChecks checks, 0 failures (source/data only)" if ($PlanOnly) { if ($ArtifactRoot) { diff --git a/Tools/windows/Tests/AccessibilityProvider.Native.Tests.cpp b/Tools/windows/Tests/AccessibilityProvider.Native.Tests.cpp index b29a88fe..d2d4a1b2 100644 --- a/Tools/windows/Tests/AccessibilityProvider.Native.Tests.cpp +++ b/Tools/windows/Tests/AccessibilityProvider.Native.Tests.cpp @@ -882,13 +882,15 @@ static void nativeHeaderOverflowChecks(IRawElementProviderSimple *provider, HWND auto *projects = child(root_fragment, NavigateDirection_FirstChild); auto *attention = child(projects, NavigateDirection_FirstChild); - auto *overflow = child(attention, NavigateDirection_NextSibling); + IRawElementProviderFragment *overflow = nullptr; + if (attention) attention->Navigate(NavigateDirection_NextSibling, &overflow); checkName(overflow, L"More actions"); check(stringProperty(attention, UIA_AutomationIdPropertyId) == - L"header-attention:needs-you" && - stringProperty(overflow, UIA_AutomationIdPropertyId).rfind( - L"header-overflow-", 0) == 0, - "Needs-you header exposes its exact public automation id while overflow stays stable"); + L"header-attention:needs-you", + "Needs-you header exposes its exact public automation id"); + check(stringProperty(overflow, UIA_AutomationIdPropertyId).rfind( + L"header-overflow-", 0) == 0, + "header overflow exposes its stable automation id prefix"); IRawElementProviderSimple *simple = nullptr; check(overflow && overflow->QueryInterface(IID_PPV_ARGS(&simple)) == S_OK && simple, @@ -941,6 +943,7 @@ static void nativeHeaderOverflowChecks(IRawElementProviderSimple *provider, HWND "header overflow wins native UIA coordinate hit-testing"); if (overflow) overflow->Release(); + if (attention) attention->Release(); if (projects) projects->Release(); root->Release(); } From 781cca5153fa7cee7d5ee37fa1b65c756347e809 Mon Sep 17 00:00:00 2001 From: Colin Neilens Date: Fri, 13 Nov 2026 08:55:59 -0700 Subject: [PATCH 3/3] Update Needs-you runner plan coverage Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: Colin Neilens --- Tools/windows/ValidationRunner/Manifests/ui.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tools/windows/ValidationRunner/Manifests/ui.json b/Tools/windows/ValidationRunner/Manifests/ui.json index ac90d434..3a16678f 100644 --- a/Tools/windows/ValidationRunner/Manifests/ui.json +++ b/Tools/windows/ValidationRunner/Manifests/ui.json @@ -1,6 +1,6 @@ { "units": [ - { "id": "ui.navigation.headless-runner-plan", "owner": "Ui", "minimumCount": 14, "exactCount": 14, "requiredGroups": [] }, + { "id": "ui.navigation.headless-runner-plan", "owner": "Ui", "minimumCount": 16, "exactCount": 16, "requiredGroups": [] }, { "id": "ui.popup.effect.expected-modal-transition", "owner": "Ui", "minimumCount": 1, "exactCount": 1, "requiredGroups": [] }, { "id": "ui.popup.receipt.cancelled-after-queued-input", "owner": "Ui", "minimumCount": 1, "exactCount": 1, "requiredGroups": [] }, { "id": "ui.navigation.selection-event-controls", "owner": "Ui", "minimumCount": 12, "exactCount": 12,