fix: swipe to reply not working on first try 🍒 #3069
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR was automatically cherry-picked based on the following PR:
Original PR description:
PR Submission Checklist for internal contributors
The PR Title
The PR Description
What's new in this PR?
Issues
As noticed by some, the
swipeToReply
doesn't work properly on first time.Causes
1.6.x
stable version of Compose Foundation.1.7.0-alpha
version.1.7.0-beta
version.But, it seems that it has a breaking change now that I'm not sure if is intended or not, so I opened an issue on Google's Issue Tracker.
We override the local touchSlop to make easier to scroll through the messages without activating the swipe action.
But with these new versions of Foundation, when overriding the the
touchSlop
locally using aCompositionLocalProvider
, we need to make sure that both theAnchoredDraggableState
and theanchoredDraggable
modifier are used within the same local composition provider.Solutions
Just move the
AnchoredDraggableState
initialisation inside theCompositionLocalProvider
.ALSO, a slight improvement: reduce a bit the drag required to reply. When developing it I was a bit unsure if 25% or 33% of the screen was best initially, but 33% is a bit too much compared to the experience in other messengers.
Testing
Manually tested
PR Post Merge Checklist for internal contributors
References
feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764
.