Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions app/NativeComponents/Conversation.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
}

Expand Down
5 changes: 1 addition & 4 deletions tests/Feature/Screens/ConversationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand All @@ -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();
});
Expand Down
Loading