Skip to content

Expose native Windows navigation selection - #968

Merged
coneilen merged 17 commits into
mainfrom
coneilen-native-navigation-selection
Nov 11, 2026
Merged

coneilen merged 17 commits into
mainfrom
coneilen-native-navigation-selection

Conversation

@coneilen

Copy link
Copy Markdown
Collaborator

Summary

Expose native selection for Graph, Quick Chats, and canonical sidebar destinations through one common UI Automation selection container. Relates to #801; the native contract is locally qualified, without claiming overall Windows/macOS visual parity or closing mixed criteria.

Changes

  • Expose SelectionItem through QueryInterface, pattern availability, IsSelected, and a common ancestor Selection container with single-selection GetSelection.
  • Route Select through existing navigation actions without optimistic state changes, report dispatch failures, and emit selection/property events after publication.
  • Keep duplicate action aliases present without competing selection patterns; resolve Quick Chats coordinate hits to the canonical destination.
  • Preserve independent worktree selection and invalidate retired/shut-down provider references, including retained selection arrays.
  • Share surface-aware, project-qualified loop/chat selection between painting and accessibility; synchronously forward the active chat ID without changing navigation routing or composite project-surface behavior.
  • Add intercepted C++ headless contracts, no-HWND App/Sidebar tests, and an explicitly separate headless runner mode.
  • Require native root/container/runtime/process coherence and actual ElementSelected delivery for five distinct navigation destinations. Keep the parity ledger Partial rather than promoting broader visual or hardware parity.
  • Add bounded, acceptance-gated edge popup/input observations used to investigate the full gate. These do not change dispatch, input fallback, guards, or popup command selection; input receipts explicitly leave the selection outcome unobserved.
  • Integrate narrowly scoped acceptance prerequisites: preserve primary descendant-ownership refusals when diagnostics fail, admit only the exact optional receipt block in the source oracle, and emit timeout-fixture markers before nested PowerShell startup. Ownership guards, capture pumps, and original timeout budgets are unchanged.

Test plan

RED: & $env:GRAPHCODE_ZIG0152 test src\Accessibility.zig --test-filter 'UIA contract exposes' -> 1 executed, 1 failed at the missing root Selection pattern assertion
GREEN: & $env:GRAPHCODE_ZIG0152 test src\Accessibility.zig --test-filter 'UIA contract exposes' -> 1 executed, 1 passed
REGRESSION: & Tools\windows\validate.ps1 -Task windows-shell -SkipTrayLive -ShellValidationRoot D:\a81 -ShellTestManifest D:\a81utf8-full-2428b5ae-20261111-0507\manifests\all.json -SwiftExecutable $env:GRAPHCODE_SWIFT633 -> full unit and integration payload passed; 66 sections, 280 native checks, 179 headless checks, and five actual navigation-selection events

The historical Zig RED/GREEN commands ran from graphcode-windows with the pinned environment. Their original failing logs remain unchanged. Current acceptance is bound to HEAD 2428b5ae9ff52415508ecb245ca18731c1e37818, tree 68c2177a70c2c555eb1af69778fd3e53777ba28a:

  • Tools\windows\Build-CompiledValidationRunner.ps1 -> Release build passed, zero warnings/errors.
  • ValidationRunner.exe --repository-root $PWD.Path --artifact-root D:\a81timeout-fix-2428b5ae\affected-report --suite ui.native-runner-safety --suite ui.navigation-runner-contracts -> two registered units passed, exactly 16 safety and 14 plan executions. Selected exit 1/incomplete is intentional, not full acceptance.
  • ValidationRunner.exe --repository-root $PWD.Path --artifact-root D:\a81timeout-fix-2428b5ae\compiled-unfiltered-report -> unfiltered 693/693 unique units Passed, 2,817 counted executions, no nonpositive units/errors, complete=true/fullInvocation=true, exit 0. Exactly one PASS marker and one execution marker.
  • The full windows-shell payload on the REGRESSION line -> exit 0; 66/66 unique sections in exact catalog order, 65 Zig invocations and 69 positive summaries. App reported 1,734 passed, 19 skipped, zero failures; skipped tests are not runtime evidence.
  • The same full payload compiled and executed the headless C++ contracts (179 checks, zero failures) and default native provider suite (280 checks, zero failures). Headless interception is not substituted for native UIA evidence.
  • The same payload's live gate -> Graph, Quick Chats, project, loop, and chat each produced exactly one ElementSelected receipt with the exact subscribed sender/runtime/PID, followed by single-selection/container/GetSelection readback.
  • & Tools\windows\Test-ShellSectionManifests.ps1 -Directory D:\a81utf8-full-2428b5ae-20261111-0507\manifests -ShardCount 1 -> aggregate passed, exit 0.
  • pwsh -NoProfile -File Tools\windows\validate.ps1 -Task privacy -> investigation privacy gate passed, exit 0.

The canonical shell and aggregate payloads were invoked with the displayed named parameters inside an audited, argv-safe encoded bootstrap under OwnedChildSupervisor. Only that owned child sets UTF-8 no-BOM Console.OutputEncoding and OutputEncoding; both supervisor readers remain strict UTF-8. Before qualification, one owned no-GUI producer proved both raw streams exactly 555446385F50524F4F465FC2B70A, including the middle dot, and exact empty/space/quoted/Unicode parameter binding. The actual live caption also retained its exact middle dot, not a replacement character. The outer environment has no GRAPHCODE_UIA_GATE key; the canonical live gate alone sets/restores it.

All accepted supervised phases have root-exited/job-empty/stdout-EOF/stderr-EOF/resources-closed/CanRelease=true and retainedLeaseCount=0. The live gate also recorded owned-job cleanup and exact DPI-context restoration. Raw logs and candidate/binding/source hashes are retained privately.

Preserved failures are not relabeled: earlier capture/source-oracle/timeout-fixture failures motivated the narrow acceptance prerequisites. One full-shell controller incorrectly inherited UIA_GATE=1 into the bare-zmx fixture; another lacked an explicit child output-encoding contract and correctly failed strict capture on raw byte FA. Neither is counted as a passing qualification. Historical interrupted cleanup remains quarantined UNKNOWN under the separately approved fresh-run plan.

Limits: no actual PR HEAD CI had completed at publication. Physical tray interaction was explicitly skipped; paired macOS captures, overall visual parity, physical devices, and broader daemon-persistence claims are not established. An earlier popup cancellation's cause remains unattributed; a successful receipt-enabled run is not proof of a causal product fix. macOS make test/make check were not run on this Windows host. The extra Zig fmt check still reports only two identical pre-existing main-baseline hunks in App and GraphContextMenu; those unrelated hunks were preserved, not repaired or described as a green style check.

Checklist

  • I have read the Contributing Guidelines
  • I have signed off my commits (git commit -s) per the DCO
  • Tests pass locally (make test)
  • Code follows the existing style (make check)
  • I added the test/contract before the implementation and observed the intended RED failure

coneilen and others added 16 commits November 9, 2026 11:13
Provide SelectionItem state, existing Select actions and selection events for Graph, Quick Chats and canonical sidebar rows through their common root container. Preserve independent worktree selection and retire stale provider references.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Colin Neilens <coneilen@microsoft.com>
Use one surface-aware, project-qualified loop/chat selection predicate for painting and accessibility. Forward the active chat identity synchronously through canvas painting, retain composite project-surface behavior, and resolve coordinate hits to the canonical Quick Chats destination instead of its duplicate action alias.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Colin Neilens <coneilen@microsoft.com>
Keep the default native 280-check entry separate. Require the intercepted C++ branch, exact 179-check summary, retained scratch, and source-only compile-plan controls.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Colin Neilens <coneilen@microsoft.com>
(cherry picked from commit 8476d42c592d4ceb4978a555700b4704bd4a924c)
Reuse the existing shell scope and capture pump for live create-new logs, preserve shared cleanup budgets and UNKNOWN retention, and exercise actual dispatch with owned non-GUI children.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Colin Neilens <coneilen@microsoft.com>
(cherry picked from commit e0be8fee56f0af798513112c4a0335ceaf93816b)
…ance

Bind all five canonical destination classes to the root selection container and exact runtime identities. Exercise the actual read-only wrapper with audited fake pattern tokens; retain aliases without admitting them into navigation selection.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Colin Neilens <coneilen@microsoft.com>
(cherry picked from commit 8f3b4315783f49481c610e2481c1872a618df42d)
Use the existing owned-child supervisor for discovery and compile/test under one clock, preserve raw streams and unknown leases, and verify 16 headless safety controls without executing a C++ fixture.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Colin Neilens <coneilen@microsoft.com>
(cherry picked from commit 18fa59f93cf0d3c2534bd4d46a6a8974328f1871)
Reconcile shared acceptance registration with landed #967 changes. Keep one copy of landed runner/custody support, preserve Jump edit-buffer suites, and retain #801 selection contracts.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Colin Neilens <coneilen@microsoft.com>
Bind five non-idempotent navigation Select transitions to exact owned event senders and single-selection readback; retain separate headless receipt controls.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Colin Neilens <coneilen@microsoft.com>
(cherry picked from commit e4ab18dd1c63a4c6c24de5594076103548f1c8d7)
Require only project selection on project surfaces and only loop selection on workspace surfaces; cover all 32 surface/owner/selection combinations without weakening roster checks.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Colin Neilens <coneilen@microsoft.com>
(cherry picked from commit 6d0211fb1ba67986990dc12a127667fcb4568f7e)
Add bounded diagnostic receipts for popup return/action dispatch, App callback target checks and selection, and edge-edit guards/modal entry. Require both UIA gate and explicit edge trace flags, avoid raw identity/draft text, and retain existing dispatch and refusal semantics.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Colin Neilens <coneilen@microsoft.com>
Restore pre-existing card-transfer fixture formatting; diagnostic behavior and assertions are unchanged.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Colin Neilens <coneilen@microsoft.com>
Gate bounded thread-local focus, capture, foreground and cancel/activation receipts around TrackPopupMenu behind the existing diagnostic flags. A zero return still dispatches nothing. No hooks, input, retry or guard changes.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Colin Neilens <coneilen@microsoft.com>
Gate diagnostic-only before/after/closure receipts behind both edge trace flags and prove accepted input plus popup cancellation does not establish a selected command.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Colin Neilens <coneilen@microsoft.com>
(cherry picked from commit 98acbe44c445cd2f63d736723f288267b1732a73)
Project bounded scalar refusal receipts, keep original in-memory error context, and expose secondary diagnostic faults without replacing ownership rejection. Cover fault stages, metadata compatibility and failed rehearsal data.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Colin Neilens <coneilen@microsoft.com>
(cherry picked from commit f06290f7c36eb8890edde4fee0786e7446432789)
Preserve the no-receipt positive case and all hilite/ownership/forwarding controls; reject six malformed or input-emitting receipt boundaries without widening the safety regex.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Colin Neilens <coneilen@microsoft.com>
(cherry picked from commit 95346104dc025ea597e4694cc24144a07837fc29)
Keep the original one-second deadline and collision/cleanup assertions while writing partial stdout and stderr from the existing mock cmd host; assert generated marker ordering.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Colin Neilens <coneilen@microsoft.com>
(cherry picked from commit bdd8cb5659758eaa382116ce302c8522c896d5ed)
Normalize CRLF to LF before exact closure matching and semantic mutations. Exercise LF and CRLF actual-source controls without weakening the existing ownership, hilite, receipt or forwarding refusals.

RED: source contract 15 executed, 14 passed, 1 failed on the new CRLF closure assertion. GREEN: 15/15 source contracts, LF and CRLF checkout fixtures each 15/15. REGRESSION: combined source/root-source/managed 129/129; full unfiltered runner 693/693 complete and positive.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Colin Neilens <coneilen@microsoft.com>
@coneilen
coneilen merged commit 56b63b5 into main Nov 11, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant