Skip to content

Commit 88a8bd2

Browse files
huntiemeta-codesync[bot]
authored andcommitted
Tweak LogBox notifications for iPhone Duo, fix rail touches (#58958)
Summary: Minimal fixes to the LogBox notification toasts for the iPhone Duo, where they stretch across the unfolded display and block the tab bar beside them when folded. - Cap the toasts at 600pt wide and center them, so they no longer span the unfolded display edge to edge. - **Fix**: Pass touches outside the toasts through to the app, so the folded Duo's rail tab bar beside them stays tappable. - **Fix**: Raise the dismiss ×'s contrast from about 2.5:1 to about 7:1. Previously, it drew in the toast's own color on a mid-gray circle and read as **faint/invisible**; the icon is unchanged. - **Tweak**: Round corners from 8 to 12px. | Before | After | |---|---| | <img src="https://github.com/user-attachments/assets/612d33c1-8d93-4a47-8bd5-5d3c118fb5c4" width="400" /> | <img src="https://github.com/user-attachments/assets/ae436c7d-06b6-4f7f-a07c-5ee7cbe51aef" width="400" /> | Changelog: [General][Fixed] - **LogBox**: Fix bottom notification appearance/touch targets on iPhone Duo Pull Request resolved: #58958 Test Plan: ``` yarn test packages/react-native/Libraries/LogBox ``` **iPhone Duo, folded** | Before | Before, tab bar blocked | After | |---|---|---| | <img src=--sanitized-- Reviewed By: vzaidman Differential Revision: D124115690 Pulled By: Abbondanzo fbshipit-source-id: 0844b21f898d309eff50235147dc5f0bb8b9ca3e
1 parent a948811 commit 88a8bd2

3 files changed

Lines changed: 28 additions & 8 deletions

File tree

‎packages/react-native/Libraries/LogBox/LogBoxNotificationContainer.js‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,21 @@ export function LogBoxNotificationContainer(props: Props): React.Node {
111111

112112
const styles = StyleSheet.create({
113113
list: {
114+
alignItems: 'center',
114115
bottom: 20,
115116
left: 10,
116117
right: 10,
118+
// The container spans the width of the screen, so it passes touches outside the toasts through to the app, such
119+
// as to a tab bar beside them.
120+
pointerEvents: 'box-none',
117121
position: 'absolute',
118122
},
119123
toast: {
120-
borderRadius: 8,
124+
borderRadius: 12,
121125
marginBottom: 5,
126+
maxWidth: 600,
122127
overflow: 'hidden',
128+
width: '100%',
123129
},
124130
});
125131

‎packages/react-native/Libraries/LogBox/UI/LogBoxNotificationDismissButton.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ export default function LogBoxNotificationDismissButton(props: {
2424
<LogBoxButton
2525
id={props.id}
2626
backgroundColor={{
27-
default: LogBoxStyle.getTextColor(0.3),
28-
pressed: LogBoxStyle.getTextColor(0.5),
27+
default: LogBoxStyle.getTextColor(0.15),
28+
pressed: LogBoxStyle.getTextColor(0.3),
2929
}}
3030
hitSlop={{
3131
top: 12,
@@ -64,6 +64,6 @@ const styles = StyleSheet.create({
6464
image: {
6565
height: 8,
6666
width: 8,
67-
tintColor: LogBoxStyle.getBackgroundColor(1),
67+
tintColor: LogBoxStyle.getTextColor(0.8),
6868
},
6969
});

‎packages/react-native/Libraries/LogBox/__tests__/__snapshots__/LogBoxNotificationContainer-test.js.snap‎

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ exports[`LogBoxNotificationContainer should render both an error and warning not
44
<SafeAreaView
55
style={
66
Object {
7+
"alignItems": "center",
78
"bottom": 20,
89
"left": 10,
10+
"pointerEvents": "box-none",
911
"position": "absolute",
1012
"right": 10,
1113
}
@@ -14,9 +16,11 @@ exports[`LogBoxNotificationContainer should render both an error and warning not
1416
<View
1517
style={
1618
Object {
17-
"borderRadius": 8,
19+
"borderRadius": 12,
1820
"marginBottom": 5,
21+
"maxWidth": 600,
1922
"overflow": "hidden",
23+
"width": "100%",
2024
}
2125
}
2226
>
@@ -59,9 +63,11 @@ exports[`LogBoxNotificationContainer should render both an error and warning not
5963
<View
6064
style={
6165
Object {
62-
"borderRadius": 8,
66+
"borderRadius": 12,
6367
"marginBottom": 5,
68+
"maxWidth": 600,
6469
"overflow": "hidden",
70+
"width": "100%",
6571
}
6672
}
6773
>
@@ -116,8 +122,10 @@ exports[`LogBoxNotificationContainer should render the latest error notification
116122
<SafeAreaView
117123
style={
118124
Object {
125+
"alignItems": "center",
119126
"bottom": 20,
120127
"left": 10,
128+
"pointerEvents": "box-none",
121129
"position": "absolute",
122130
"right": 10,
123131
}
@@ -126,9 +134,11 @@ exports[`LogBoxNotificationContainer should render the latest error notification
126134
<View
127135
style={
128136
Object {
129-
"borderRadius": 8,
137+
"borderRadius": 12,
130138
"marginBottom": 5,
139+
"maxWidth": 600,
131140
"overflow": "hidden",
141+
"width": "100%",
132142
}
133143
}
134144
>
@@ -175,8 +185,10 @@ exports[`LogBoxNotificationContainer should render the latest warning notificati
175185
<SafeAreaView
176186
style={
177187
Object {
188+
"alignItems": "center",
178189
"bottom": 20,
179190
"left": 10,
191+
"pointerEvents": "box-none",
180192
"position": "absolute",
181193
"right": 10,
182194
}
@@ -185,9 +197,11 @@ exports[`LogBoxNotificationContainer should render the latest warning notificati
185197
<View
186198
style={
187199
Object {
188-
"borderRadius": 8,
200+
"borderRadius": 12,
189201
"marginBottom": 5,
202+
"maxWidth": 600,
190203
"overflow": "hidden",
204+
"width": "100%",
191205
}
192206
}
193207
>

0 commit comments

Comments
 (0)