Repository navigation
Conversation
|
@huntie-bot Once this lands, pick request it to both 88 and 89. |
| const {left, right} = event.nativeEvent.insets; | ||
| // Insets are physical edges. Logical edges resolve by layout direction | ||
| // alone, which keeps clear of the RTL left/right swap. | ||
| const {isRTL} = I18nManager.getConstants(); | ||
| setSafeAreaPadding({ | ||
| paddingStart: isRTL ? right : left, | ||
| paddingEnd: isRTL ? left : right, | ||
| }); |
There was a problem hiding this comment.
Can't we use paddingLeft and paddingRight here to avoid the manual RTL logic?
There was a problem hiding this comment.
Tested this on the iPhone Duo simulator in RTL, I think the manual RTL logic is needed regardless (for as long as doLeftAndRightSwapInRTL exists).
| RTL | Current (paddingStart/End + isRTL) |
paddingLeft/paddingRight |
|---|---|---|
doLeftAndRightSwapInRTL: true (default) |
![]() |
![]() |
doLeftAndRightSwapInRTL: false |
![]() |
![]() |
This mapping also holds with doLeftAndRightSwapInRTL: false, since paddingStart/End resolve by layout direction alone (verified on device), so I'll keep it as is.
I guess Left/Right might be a semantic improvement, but I don't think it reduces the logic, unless you had something else in mind?
0.88 doesn't have |
|
@robhogan Gah, yeah you're right. @huntie-bot Amend: Pick this to only 0.89 please. |




Summary
The LogBox inspector applies the safe area to its header and footer buttons only, so the error message, code frames and stacks run under a side inset, such as the iPhone Duo's status column or the notch in landscape. This affects the "Failed to compile" screen, which cannot be dismissed, and the dismissable inspector alike.
Changes
experimental_onSafeAreaInsetsChange, and apply the left and right insets as padding to the message header and to the content inside the body'sScrollView, so backgrounds stay edge to edge.paddingStartandpaddingEndbyisRTL, so the RTL left/right swap doesn't move them.This adds no
SafeAreaViewuse, ahead of its removal.Changelog:
[General][Fixed] - LogBox: Keep the inspector's message, code frames and stacks clear of horizontal safe area insets
Test Plan
✅ Passes, with no snapshot changes.
RNTester on the iPhone Duo simulator (iOS 27.1 runtime, Xcode 27.2), folded display, where the status column is a right inset. The syntax error is an unresolvable import added while the app runs, delivered by Fast Refresh; the render error is a
throwinRNTesterApp.✅ The message and code frame wrap before the status column; the header and message backgrounds still reach the edge.
✅ The dismissable inspector gets the same inset; the header and Dismiss, Minimize and Copy buttons are unchanged.
✅ With the message inside the
ScrollView, it and the component stack keep the inset while scrolling.✅ With no side insets, the layout is unchanged.
ℹ️ Not run locally: the Fantom LogBox snapshot tests (
yarn fantom), left to CI.