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

enhance: convert Message Touchable to React Native Gesture Handler #6218

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

jjinendra3
Copy link
Contributor

Proposed changes

Converted the message touchable to use React Native Gesture Handler (RNGH) instead of the default touchable.
Added left swipe to open thread functionality.

  • Handled read-only rooms appropriately.
  • Retained original onPress and onLongPress functionality while adding PanGestureHandler for smooth gestures.

Benefits of switching to RNGH:

  • Improved performance – RNGH processes gestures in the native thread, making interactions more fluid.
  • Better gesture handling – Prevents gesture conflicts and ensures smoother interactions across screens.
  • More control over touch events – Supports advanced gestures like swiping while maintaining existing press behaviors.

Issue(s)

#6193

How to test or reproduce

  1. Open any chat room.
  2. Try a left swipe on a message – it should open the thread.
  3. Test long press and tap to ensure they still work as expected.
  4. Try to left swipe a message inside thread room and it isn't enabled as expected.
  5. Check in read-only rooms to confirm the swipe action isn't enabled as expected.

Screenshots

Screenrecorder-2025-03-10-22-22-53-840.mp4

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves a current function)
  • New feature (non-breaking change which adds functionality)
  • Documentation update (if none of the other choices apply)

Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if applicable)
  • I have added necessary documentation (if applicable)
  • Any dependent changes have been merged and published in downstream modules

Further comments

Copy link
Member

@diegolmello diegolmello left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's promising!

@jjinendra3
Copy link
Contributor Author

Added Haptics to press as well as PanGesture. Switched to GestureDetector and redesigned the thread swipe gesture.

If there are any discrepancies or if any refactor is needed, please do comment it.

Screenrecorder-2025-03-11-17-45-20-688.mp4

@jjinendra3 jjinendra3 requested a review from diegolmello March 11, 2025 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants