Support selected-area capture on mobile touch screens#180
Merged
neonwatty merged 7 commits intoMay 19, 2026
Conversation
neonwatty
approved these changes
May 19, 2026
Collaborator
neonwatty
left a comment
There was a problem hiding this comment.
Reviewed with three independent sub-agents. Fixed the actionable findings by tightening coarse-pointer behavior, using a semantic mobile Cancel button with a minimum touch target, clearing test localStorage per test, and strengthening area-picker cancellation/touch E2E coverage. PR CI is green.
|
🎉 This PR is included in version 1.37.3 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
Closes #179
What changed
This makes selected-area capture usable on touch screens by letting finger drags draw the selection rectangle, while preserving the existing desktop mouse and Escape-key behavior.
On mobile, the area-picker prompt now stays below the phone safe area and uses an inline Cancel link instead of desktop-only Escape instructions.
Why this shape
The important constraint is that the prompt must not intercept selection gestures. Making the whole prompt tappable would make the new mobile Cancel control easy to wire up, but it would also block drags that start over the prompt text. This keeps the prompt itself pass-through and only lets the inline Cancel link receive taps.
The drag handling uses pointer events instead of adding a separate touch-only path. That keeps mouse, pen, and touch input on the same behavior path and avoids maintaining two versions of the same selection logic.
Test plan
npx prettier --check src/widget/area-picker.ts e2e/widget.spec.ts e2e/widget.live.spec.ts test/setup.tsLIVE_TARGET=local PLAYWRIGHT_BASE_URL=http://localhost:8788 CI=true npx playwright test --project=chromium --shard=1/2LIVE_TARGET=local PLAYWRIGHT_BASE_URL=http://localhost:8788 CI=true npx playwright test --project=chromium --shard=2/2make checkmake testmake build-all