Repository navigation
Add --angle to ui touch pinch/stretch - #1098
Conversation
Rotates the two pinch/stretch fingers around the anchor (0 = horizontal, 90 = vertical). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🔵 Needs a closer look
No blocking defects were identified, but angled touch delivery into a real window remains unverified and needs human validation.
0 open findings
What changed in this PR
Adds --angle to ui touch pinch and stretch gestures, enabling vertical and diagonal zoom testing.
Changes:
- Rotates finger paths while preserving the existing public planner signature.
- Validates angle values and gesture compatibility, with coordinate and CLI tests.
- Updates user documentation and plugin examples.
| File | Description |
|---|---|
| src/winapp-CLI/WinApp.UIAutomation/Input/PointerGesturePlanner.cs | Adds angled finger paths and adjusts minimum travel. |
| src/winapp-CLI/WinApp.UIAutomation.Tests/PointerGesturePlannerTests.cs | Tests rotation, symmetry, and movement across all integer angles. |
| src/winapp-CLI/WinApp.Cli/Commands/UiTouchCommand.cs | Adds, validates, and forwards --angle. |
| src/winapp-CLI/WinApp.Cli.Tests/UiCommandTests.Touch.cs | Tests vertical movement and invalid arguments. |
| plugins/winapp/skills/winapp-ui-automation/SKILL.md | Documents angle usage for agents. |
| docs/ui-automation.md | Adds the option reference and diagonal example. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Build Metrics ReportValidation passed. All required build and validation jobs succeeded. Binary Sizes
.NET Test Results (TRX reports)Other suites are reflected in the overall validation status above. ✅ 8712 passed, 39 skipped out of 8751 tests in 1429.3s (+15 tests, -186.5s vs. baseline) Test Coverage✅ 87.5% line coverage, 81.9% branch coverage · ✅ no change vs. baseline CLI Startup Time71ms median (x64, Try This BuildInstalls the MSIX for your architecture, replacing any previously installed build. Needs the GitHub CLI — the command offers to install it and sign you in if it is missing. & ([scriptblock]::Create((irm https://raw.githubusercontent.com/microsoft/winappCli/main/scripts/winapp-pr.ps1))) 1098Switching between builds often?Put the tool on your PATH once: & ([scriptblock]::Create((irm https://raw.githubusercontent.com/microsoft/winappCli/main/scripts/winapp-pr.ps1))) -AddToPathThen this build is just: winapp-pr 1098Run Updated 2026-10-15 19:26:43 UTC · commit |
What and why
winapp ui touch --gesture pinchandstretchalways moved the two fingers left and right. To test a zoom that tracks both axes (for example a diagonal pinch on a map or photo), you had to write your own touch-injection code.Now
--angle <degrees>turns the line the two fingers move along:0is horizontal (the default, so existing commands behave the same),90is vertical, and45runs from lower-left to upper-right (counter-clockwise, like a math angle).invalid_arguments.--anglewithtap,double-tap,long-press, orswipefails withinvalid_arguments, matching how--directionand--to-pointare handled.For example,
--at 400,300 --distance 100 --angle 90moves the fingers from400,350and400,250toward400,304and400,296.Closes #1093
Part of #1084
Before / after
Before (main)
After (the first command gets past argument checks and only stops because no app named
myappis running)Not tested / risks
foreground_not_target). The injection code is unchanged; only the finger coordinates are new, and unit tests check them for every angle from 0 to 359.--distancebelow 12, each finger now starts 6 px from the center instead of 5. Without this, rounding at some angles (for example 26°) produced a finger that didn't move. With--distance12 or more, the default output is the same as before.Checklist
plugins/winapp/skills/updated if user-facing behavior changedNotes for reviewers
PointerGesturePlanner.PlanTouchis public in theMicrosoft.Windows.SDK.BuildTools.WinApp.UIAutomationNuGet package, which shipped in 0.7.1. To avoid a binary break, the old signature stays and forwards to a new overload that takesangleDegrees.450fails instead of quietly meaning90.