Repository navigation
Add pointer-route tracing and a pointer-click test locator - #30
Merged
Merged
Conversation
A click that reaches the wrong handler used to need a debugger or a bespoke repro. Two additions make it observable: - UIContext.TracePointerRoutes (also FORMA_UI_EVENTS=1) records the dispatch chain for each press and release: the hit target, every bubbled stop with its MouseFilter and press ownership, and the row owner that receives a press the row content stopped. TakePointerRouteTrace() drains it; it allocates nothing while off. - Locator.ClickPointer() injects move + press + release, the path a user's click takes, instead of running the accessibility action. Click() cannot reproduce a routing bug because it bypasses dispatch entirely. AccessibilityTree.FindControl(id) resolves the live control behind a snapshot node, so template content (a row's buttons) can be clicked by automation id; walking Control.Children never reached it. The accessibility and inspect helpers now use it, and the docs say why a row test asserts both sides: the widget ran and the row did not activate.
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two tools for diagnosing "the click hit the wrong control":
UIContext.TracePointerRoutes(orFORMA_UI_EVENTS=1, which also echoes to stderr) records the dispatch chain for each press and release: the hit target, every bubbled stop with itsMouseFilterand press ownership, and theListBoxthat receives a press row content stopped.TakePointerRouteTrace()drains it. It allocates nothing while off.Locator.ClickPointer()injects move + press + release, the path a user's click takes, instead of running the accessibility action.Click()cannot reproduce a routing bug because it bypasses dispatch.AccessibilityTree.FindControl(id)resolves the live control behind a snapshot node, so template content (a row's buttons) can be targeted by automation id; walkingControl.Childrennever reached it. The accessibility and style-inspection helpers use it.Docs explain the trace and the rule that row-interaction tests assert both sides: the widget ran and the row did not activate.
Why
ui-press/Locator.Click()run a control's accessibility action directly. A press that travels the pointer path can run both a row button and the row owner's activation; only real pointer dispatch shows that. This makes the trace and the pointer click available to tests and to the live automation host without a debugger.Verification
bash scripts/check-compliance.sh: pass.verify: pass.Forma.TestsRelease, MonoGame and FNA: 1333 passed, 3 skipped each.