lyft / lyft/Hammer

Missing support for `.stationary` touches

Open
#51 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Swift
Stars
705
Forks
39
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
After two finger _downs_ it is not possible to _up_ single finger – both touches are ending

**To Reproduce**
Code to reproduce:
```swift
func testBug() throws {
try eventGenerator.wait(1)
try eventGenerator.fingerDown([.rightThumb, .rightIndex],
at: [
CGPoint(x: 200, y: 400),
CGPoint(x: 400, y: 400)
])
try eventGenerator.wait(1)
try eventGenerator.fingerUp([.rightThumb])
try eventGenerator.wait(3)
try eventGenerator.fingerUp([.rightIndex])
try eventGenerator.wait(3)
}

```

**Expected behavior**
Single finger released allowing to manipulate the second one.
I have a scenario where I do zooming then release one finger and starting to pan the map view.

**Screenshots**
If applicable, add screenshots to help explain your problem.
There is an [extra framework](https://github.com/mapbox/Fingertips) to visualise touches with handling phases and locations via `UIApplication.sendEvent`. Circle animation starts when touch in the Ended phase was received.

https://user-images.githubusercontent.com/735178/219018733-b4c3e380-0a50-4c1a-a6e7-4cc1af40a1a9.mov

**Environment (please complete the following information):**
- Devices: iPhone 14 Pro, iPad mini 5
- Simulator: iPad mini 6
- OS: iOS 16.3.1
- Xcode: 14.2

**Additional context**
`UIApplication.sendEvent` receives two UITouch events with the Ended phase.
Add any other context about the problem here.

Full UIApplication.sendEvent events report from sample code

```bash
Test Case '-[DebugAppTests.DebugAppTests testBug]' started (Iteration 1 of 3).
timestamp: 178537 touches: {(
phase: Began tap count: 1 force: 0.000 window: ; layer = > responder: (null) ,
phase: Began tap count: 1 force: 0.000 window: ; layer = > responder: > location in window: {200, 400} previous location in window: {200, 400} location in view: {200, 400} previous location in view: {200, 400}
)}

2023-02-15 13:41:11.608328+0200 DebugApp[69948:3352821] [Window] Manually adding the rootViewController's view to the view hierarchy is no longer supported. Please allow UIWindow to add the rootViewController's view to the view hierarchy itself.
timestamp: 178537 touches: {(
phase: Began tap count: 1 force: 0.000 window: ; layer = > responder: (null) ,
phase: Began tap count: 1 force: 0.000 window: ; layer = > responder: > location in window: {200, 400} previous location in window: {200, 400} location in view: {200, 400} previous location in view: {200, 400}
)}

2023-02-15 13:41:11.707522+0200 DebugApp[69948:3352821] [EventDispatcher] Found no UIEvent for backing event of type: 1; contextId: 0x91D53B81
timestamp: 178538 touches: {(
phase: Ended tap count: 0 force: 0.000 window: ; layer = > responder: (null) ,
phase: Ended tap count: 0 force: 0.000 window: ; layer = > responder: > location in window: {200, 400} previous location in window: {200, 400} location in view: {200, 400} previous location in view: {200, 400}
)}

timestamp: 178538 touches: {(
phase: Ended tap count: 0 force: 0.000 window: ; layer = > responder: (null) ,
phase: Ended tap count: 0 force: 0.000 window: ; layer = > responder: > location in window: {200, 400} previous location in window: {200, 400} location in view: {200, 400} previous location in view: {200, 400}
)}

2023-02-15 13:41:12.907412+0200 DebugApp[69948:3352821] [EventDispatcher] Found no UIEvent for backing event of type: 1; contextId: 0x91D53B81

```

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the provided testBug sequence through eventGenerator.fingerDown and fingerUp, then inspect the touch events delivered through UIApplication.sendEvent. Trace how the two-finger interaction is represented and identify why releasing one finger ends both touches. Done means releasing one finger produces an ended touch while the other remains available for manipulation.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, swift
Domain
mobile, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.