diff --git a/app/NativeComponents/Conversation.php b/app/NativeComponents/Conversation.php index ddde62a5..279bb99b 100644 --- a/app/NativeComponents/Conversation.php +++ b/app/NativeComponents/Conversation.php @@ -154,11 +154,6 @@ class Conversation extends NativeComponent public const int LeastSlide = 16; - /** - * How long after a swipe brings a message's actions up a tap is taken as part of the swipe (see $actionsShownAt). - */ - public const float SwipeTapWindow = 0.75; - /** * The alert that asks before pinning, as the web's does, and its answers. */ @@ -280,13 +275,6 @@ class Conversation extends NativeComponent */ public ?int $actionsForId = null; - /** - * When a drag last brought a message's actions up. On Android a drag that ends inside the bubble or its row could - * also land as a tap on them, a moment later once the double tap has had its chance, which would put the actions - * straight away again; a tap that close behind the drag is the drag's own. - */ - public float $actionsShownAt = 0; - /** * Where each message sits sideways, shared with the gesture area that drags it (see panFor()). They're kept across * renders, so the area moves the same value the row and its buttons follow, and a new resting place from here @@ -748,7 +736,6 @@ public function draggedMessage(int $id, float $x, float $y = 0): void if ($toward >= $this->slideOf($message) / 2) { $this->actionsForId = $id; - $this->actionsShownAt = self::now(); } elseif ($this->actionsForId === $id) { $this->actionsForId = null; } @@ -759,10 +746,6 @@ public function draggedMessage(int $id, float $x, float $y = 0): void */ public function hideActions(): void { - if (self::now() - $this->actionsShownAt < self::SwipeTapWindow) { - return; - } - $this->actionsForId = null; } diff --git a/tests/Feature/Screens/ConversationTest.php b/tests/Feature/Screens/ConversationTest.php index 6f206193..8f608140 100644 --- a/tests/Feature/Screens/ConversationTest.php +++ b/tests/Feature/Screens/ConversationTest.php @@ -289,11 +289,9 @@ function showsActions(TestableComponent $screen, string $key): bool $screen->dragEnd('swipe-1', 200); expect(showsActions($screen, '1'))->toBeFalse(); - // On Android a swipe that ends inside the bubble also lands as a tap on it, just after: that one is the swipe's own. - $screen->dragEnd('swipe-1', -200)->tap($tap); + $screen->dragEnd('swipe-1', -200); expect(showsActions($screen, '1'))->toBeTrue(); - $this->travel(1)->seconds(); $screen->tap($tap); expect(showsActions($screen, '1'))->toBeFalse(); })->with(['its bubble' => 'bubble-1', 'another bubble' => 'bubble-2', 'beside another message' => 'message-2']); @@ -306,7 +304,6 @@ function showsActions(TestableComponent $screen, string $key): bool expect(childRefs($screen, 'content-1'))->toBe(['photos-1', 'actions-1']) ->and(showsActions($screen, '1'))->toBeTrue(); - $this->travel(1)->seconds(); $screen->tap('image-1-0'); expect(showsActions($screen, '1'))->toBeFalse(); });