-
Notifications
You must be signed in to change notification settings - Fork 3k
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 - Reduce the haptic feedback vibration to a short bip #5960
Conversation
This comment has been minimized.
This comment has been minimized.
@rushatgabhane we've fixed the e2e tests on main, please merge main into your branch to confirm they pass again! |
All checks have passed! |
I believe that we should be good to drop |
Yup, from Rory's comment #4355 (comment) If this draft PR is given a go ahead, I'll remove those libs as cleanup commits. |
cc @Julesssss @Beamanator since they volunteered to test this previously, could you confirm the feedback pattern is the same as slack on your physical Android devices on this PR? |
ref={props.forwardedRef} | ||
onPress={props.onPress} | ||
onPressIn={props.onPressIn} | ||
delayLongPress={200} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use the default value of 500? If this is to precisely match Slack, then does Slack not match the native delay length on iOS?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't notice it.
Changing long press delay to 500ms for iOS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was intentional. Menu itself takes 300 to show so adding 500 here means 800ms delay before menu is completely visible and interactive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a reasonable choice, but I would prefer to keep longPress time at the iOS default. If the menu is slow to appear we should optimise that instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm getting a crash on Android 8.1:
Error when loading lib: dlopen failed: library "libjsc.so" not found lib hash: eae0e884bac6a338b8c53618b45e2515 search path is /data/app/com.expensify.chat-4zdOjJAUwAHOSjq0TXDQ8Q==/lib/arm64
2021-10-26 11:36:08.075 16636-16636/com.expensify.chat W/System.err: java.lang.UnsatisfiedLinkError: dlopen failed: library "libjsc.so" not found
2021-10-26 11:36:08.076 16636-16636/com.expensify.chat W/System.err: at com.facebook.soloader.SoLoader$1.load(SoLoader.java:384)
2021-10-26 11:36:08.077 16636-16636/com.expensify.chat W/System.err: at com.facebook.soloader.DirectorySoSource.loadLibraryFrom(DirectorySoSource.java:77)
2021-10-26 11:36:08.077 16636-16636/com.expensify.chat W/System.err: at com.facebook.soloader.DirectorySoSource.loadLibrary(DirectorySoSource.java:50)
2021-10-26 11:36:08.077 16636-16636/com.expensify.chat W/System.err: at com.facebook.soloader.ApplicationSoSource.loadLibrary(ApplicationSoSource.java:89)
@Julesssss Thanks for testing it out! Tested it on Samsung S8 (android 9), Pixel 3 (android 11), and the haptics match Slack. Also tested on android 5, 6, 7, 8 on emulator to check for crashes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on my physical iPhone and the 500ms matches slack exactly 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests well on Android, the vibration pattern matches slack.
I requested one minor change, but once that's done I think we're good to merge 👍
@rushatgabhane is there any reason for this to still be a draft? |
@Julesssss from this comment, I think we're good to remove Should I remove it in this PR, or create a new one? |
src/components/PressableWithSecondaryInteraction/index.android.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nnoticed a few small things to change
@rushatgabhane nice spot, it would be great if you remove it in this PR so we can run the vibration tests against it. |
Status: PR ready for review. ToDo
|
src/components/PressableWithSecondaryInteraction/index.android.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed the vibration pattern matches on Android.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, great work on this!
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to production by @yuwenmemon in version: 1.1.12-3 🚀
|
cc: @Jag96 Creating a draft PR. Looking forward for your feedback!
Details
This PR removes
react-native-unimodules
andexpo-haptics
as they aren't required anymore.Now that my PR is merged into
react-native-haptic-feedback
, we can use it directly instead of Expensify's fork.Use the lib
junina-de/react-native-haptic-feedback
for haptic feedback.Android
Create a new file: components/PressableWithSecondaryInteraction/index.android.js
Call
ReactNativeHapticFeedback.trigger('effectHeavyClick');
for a long press.iOS
Create a new file: components/PressableWithSecondaryInteraction/index.ios.js
Call
ReactNativeHapticFeedback.trigger('selection');
for a long press.Fixed Issues
$ #4355
Tests / QA
Tested On
Screenshots
Not Applicable