Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix message long press taking too much time to show actions #648

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

# Upcoming

### 🐞 Fixed
- Fix message long press taking too much time to show actions [#648](https://github.com/GetStream/stream-chat-swiftui/pull/648)
### 🔄 Changed
- Message composer now uses `.uploadFile` capability when showing attachment picker icon [#646](https://github.com/GetStream/stream-chat-swiftui/pull/646)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,14 @@ public struct MessageContainerView<Factory: ViewFactory>: View {
handleGestureForMessage(showsMessageActions: true)
}
}
.onLongPressGesture(perform: {
if !message.isDeleted {
handleGestureForMessage(showsMessageActions: true)
}
})
.highPriorityGesture(
LongPressGesture()
.onEnded { _ in
if !message.isDeleted {
handleGestureForMessage(showsMessageActions: true)
}
}
)
.offset(x: min(self.offsetX, maximumHorizontalSwipeDisplacement))
.simultaneousGesture(
DragGesture(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -931,18 +931,20 @@ extension UserRobot {
let image = attributes.image(in: messageCell)
if isPresent {
image.wait()
sleep(2) // At the moment, this assert is flaky without it
if TestRunnerEnvironment.isCI {
sleep(2) // At the moment, this assert is flaky without it
}
} else {
image.waitForDisappearance()
}

let errMessage = isPresent ? "Image is not presented" : "Image is presented"
XCTAssertTrue(image.exists, errMessage, file: file, line: line)

image.safeTap()
image.tapFrameCenter()
image.waitForDisappearance(timeout: 2)
if image.exists {
image.safeTap()
image.tapFrameCenter()
}

let fullscreenImage = attributes.fullscreenImage().wait()
Expand Down
Loading