Skip to content

Support selected-area capture on mobile touch screens#180

Merged
neonwatty merged 7 commits into
mean-weasel:mainfrom
sudo-eugene:codex/mobile-area-picker-touch
May 19, 2026
Merged

Support selected-area capture on mobile touch screens#180
neonwatty merged 7 commits into
mean-weasel:mainfrom
sudo-eugene:codex/mobile-area-picker-touch

Conversation

@sudo-eugene
Copy link
Copy Markdown
Contributor

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.ts
  • LIVE_TARGET=local PLAYWRIGHT_BASE_URL=http://localhost:8788 CI=true npx playwright test --project=chromium --shard=1/2
  • LIVE_TARGET=local PLAYWRIGHT_BASE_URL=http://localhost:8788 CI=true npx playwright test --project=chromium --shard=2/2
  • make check
  • make test
  • make build-all

@sudo-eugene sudo-eugene marked this pull request as ready for review May 19, 2026 10:35
Copy link
Copy Markdown
Collaborator

@neonwatty neonwatty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@neonwatty neonwatty added this pull request to the merge queue May 19, 2026
Merged via the queue into mean-weasel:main with commit 5b75abe May 19, 2026
7 checks passed
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 1.37.3 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Selected-area capture does not work on mobile touch screens

2 participants