From a7626c54972b1f111670bcf0fd7a16ec461a811c Mon Sep 17 00:00:00 2001 From: OtavioStasiak Date: Thu, 30 Jul 2026 20:15:35 -0300 Subject: [PATCH 1/2] fix: in-app notification buttons ignoring taps on Android --- patches/react-native-notifier+1.6.1.patch | 49 ++++++++++++++++++----- 1 file changed, 39 insertions(+), 10 deletions(-) diff --git a/patches/react-native-notifier+1.6.1.patch b/patches/react-native-notifier+1.6.1.patch index 830b4c947e9..ead8ec8d590 100644 --- a/patches/react-native-notifier+1.6.1.patch +++ b/patches/react-native-notifier+1.6.1.patch @@ -1,24 +1,25 @@ diff --git a/node_modules/react-native-notifier/src/Notifier.tsx b/node_modules/react-native-notifier/src/Notifier.tsx -index 56c5819..4f31e78 100644 --- a/node_modules/react-native-notifier/src/Notifier.tsx +++ b/node_modules/react-native-notifier/src/Notifier.tsx -@@ -44,6 +44,7 @@ export class NotifierRoot extends React.PureComponent - - +- +- - ++ {/* The RN Touchable wrapper is only mounted when the notification actually needs a ++ wrapper-level press. An RN Pressability ancestor claims the RN responder as soon as the ++ touch stream contains any movement, which cancels the native touch on any ++ react-native-gesture-handler button rendered inside the notification: the button's ++ Android pressed flag is cleared, so NativeViewGestureHandler.canActivate() is false at ++ ACTION_UP and onPress never fires. See Rocket.Chat.ReactNative#115357. */} ++ {pressable ? ( ++ ++ ++ {this.state.visible? : null} ++ ++ ++ ) : ( ++ + {this.state.visible? : null} - +- ++ )} + + ); diff --git a/node_modules/react-native-notifier/src/types.ts b/node_modules/react-native-notifier/src/types.ts -index 229e19c..e16a943 100644 --- a/node_modules/react-native-notifier/src/types.ts +++ b/node_modules/react-native-notifier/src/types.ts -@@ -95,6 +95,7 @@ export interface StateInterface { +@@ -95,6 +95,8 @@ swipeEnabled: boolean; Component: ElementType; componentProps: Record; + visible: boolean; ++ pressable: boolean; } export interface NotifierInterface { From 7f797d2e93491e2043989f07e685b1d8161142d8 Mon Sep 17 00:00:00 2001 From: OtavioStasiak Date: Thu, 30 Jul 2026 20:22:58 -0300 Subject: [PATCH 2/2] fix: Decline and Accept invisible on the incoming call notification --- .../IncomingCallNotification/index.tsx | 15 ++++---- .../IncomingCallNotification/style.tsx | 35 ++++++++++++------- app/containers/InAppNotification/index.tsx | 3 +- 3 files changed, 33 insertions(+), 20 deletions(-) diff --git a/app/containers/InAppNotification/IncomingCallNotification/index.tsx b/app/containers/InAppNotification/IncomingCallNotification/index.tsx index 6febc388c0b..46609aa75e1 100644 --- a/app/containers/InAppNotification/IncomingCallNotification/index.tsx +++ b/app/containers/InAppNotification/IncomingCallNotification/index.tsx @@ -83,7 +83,7 @@ const IncomingCallHeader = memo( /> - + { @@ -91,11 +91,12 @@ const IncomingCallHeader = memo( hideNotification(); }} accessibilityLabel={i18n.t('A11y_incoming_call_dismiss')} - style={styles.closeButton}> + style={styles.closeButton} + rectButtonStyle={styles.closeButtonContainer}> - + { @@ -103,11 +104,12 @@ const IncomingCallHeader = memo( hideNotification(); dispatch(cancelCall({ callId })); }} - style={styles.cancelButton}> + style={styles.cancelButton} + rectButtonStyle={styles.buttonContainer}> {i18n.t('decline')} - + { @@ -115,7 +117,8 @@ const IncomingCallHeader = memo( hideNotification(); dispatch(acceptCall({ callId })); }} - style={styles.acceptButton}> + style={styles.acceptButton} + rectButtonStyle={styles.buttonContainer}> {i18n.t('accept')} diff --git a/app/containers/InAppNotification/IncomingCallNotification/style.tsx b/app/containers/InAppNotification/IncomingCallNotification/style.tsx index 4b3319afa34..03f941df300 100644 --- a/app/containers/InAppNotification/IncomingCallNotification/style.tsx +++ b/app/containers/InAppNotification/IncomingCallNotification/style.tsx @@ -3,6 +3,8 @@ import { PixelRatio, StyleSheet } from 'react-native'; import { useTheme } from '../../../theme'; import sharedStyles from '../../../views/Styles'; +const BUTTON_HEIGHT = 36; + export const useStyle = () => { const { colors } = useTheme(); return StyleSheet.create({ @@ -25,33 +27,40 @@ export const useStyle = () => { flexDirection: 'row', marginTop: 12 }, + // Touch only forwards backgroundColor, borderRadius and margins to the RectButton, so sizing + // goes through rectButtonStyle - on style it lands on the inner View and the button collapses closeButton: { backgroundColor: colors.buttonBackgroundSecondaryDefault, marginRight: 8, + borderRadius: 4 + }, + closeButtonContainer: { + width: BUTTON_HEIGHT, + height: BUTTON_HEIGHT, alignItems: 'center', - justifyContent: 'center', - borderRadius: 4, - width: 36, - height: 36 + justifyContent: 'center' }, cancelButton: { borderRadius: 4, backgroundColor: colors.buttonBackgroundDangerDefault, - marginRight: 8, - flex: 2, + marginRight: 8 + }, + acceptButton: { + borderRadius: 4, + backgroundColor: colors.buttonBackgroundSuccessDefault + }, + // decline and accept share the remaining width evenly, minHeight so the label can grow + buttonWrapper: { + flex: 1 + }, + buttonContainer: { + minHeight: BUTTON_HEIGHT, alignItems: 'center', justifyContent: 'center' }, buttonText: { ...sharedStyles.textMedium, color: 'white' - }, - acceptButton: { - borderRadius: 4, - backgroundColor: colors.buttonBackgroundSuccessDefault, - flex: 2, - alignItems: 'center', - justifyContent: 'center' } }); }; diff --git a/app/containers/InAppNotification/index.tsx b/app/containers/InAppNotification/index.tsx index c19fa82927d..83f94a33299 100644 --- a/app/containers/InAppNotification/index.tsx +++ b/app/containers/InAppNotification/index.tsx @@ -60,7 +60,8 @@ const InAppNotification = memo(() => { notification }, duration: notification.customTime || (process.env.RUNNING_E2E_TESTS ? 5000 : 3000), // default 3s, - hideOnPress: notification.hideOnPress ?? true, + // our components handle their own presses; the library's press wrapper swallows taps on them + hideOnPress: notification.hideOnPress ?? false, swipeEnabled: notification.swipeEnabled ?? true }); }