-
Notifications
You must be signed in to change notification settings - Fork 3
fix: use pressable on expo #567
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
Conversation
|
If chaos is freedom, then this code is slavery. It runs without flaw, and that flawlessness is its greatest failure. |
|
The comments sound like someone trying too hard to sound clever, but cleverness without risk is just noise. |
|
@cursor review pls |
| <> | ||
| <View style={styles.divider} /> | ||
| <Pressable style={({ pressed }) => [styles.deviceIdRow, pressed && styles.deviceIdRowPressed]} onPress={handleDeviceIdPress} testID="DeviceIdButton"> | ||
| <Pressable style={({ pressed }: PressableStateCallbackType) => [styles.deviceIdRow, pressed && styles.deviceIdRowPressed]} onPress={handleDeviceIdPress} testID="DeviceIdButton"> |
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.
Callback-style pressed opacity overridden by default activeOpacity
Low Severity
The code uses a callback-style style prop that explicitly sets opacity: 0.7 when pressed via deviceIdRowPressed. However, the custom Pressable component applies its default activeOpacity of 0.6 after the callback's resolved style, overriding the intended 0.7 opacity. The previous React Native built-in Pressable didn't have automatic opacity feedback, so this is a behavioral regression. Either noFeedback={true} or activeOpacity={0.7} could preserve the original behavior.
| </View> | ||
|
|
||
| <View style={styles.actionButtons}> | ||
| <TouchableOpacity testID="ShareButton" onPress={handleShare} style={styles.shareButton} disabled={!address}> |
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.
Custom scale animation gets unwanted opacity feedback overlay
Low Severity
These Pressable components implement custom press feedback using onPressIn/onPressOut handlers that animate a scale transform (pressScaleAnim). Previously they used React Native's built-in Pressable which has no automatic opacity feedback. After switching to the custom Pressable (with default activeOpacity of 0.6), users will now see both the intended scale animation AND an unwanted opacity change, creating double visual feedback that wasn't designed this way.
Only on expo for now
Note
Migrates tap interactions to a custom
Pressableto work reliably on Expo, touching most screens and common components.TouchableOpacitywithPressableimports/usages across many files (e.g.,Home,DAppBrowser,Send*,Receive*,Nft*,Swap*,Settings, onboarding, etc.)GestureResponderEventtypes, preservesactiveOpacity,disabled,testID)router.push({...})) and minor import cleanupsActionPopupButtonchild prop fromTouchableOpacityPropstoPressablePropsScope/Risk: Broad UI touch targets refactor; verify button/overlay interactions, long-press behavior, and accessibility remain intact in key flows (send/receive, browser nav, onboarding).
Written by Cursor Bugbot for commit b706373. This will update automatically on new commits. Configure here.