Skip to content

fix(0.81, view): bridge safe-area inset changes on macOS - #3181

Open
Jason Morse (JasonVMo) wants to merge 1 commit into
0.81/user/jasonvmo/native-test-hostfrom
0.81/user/jasonvmo/safe-area-callback
Open

Jason Morse (JasonVMo) wants to merge 1 commit into
0.81/user/jasonvmo/native-test-hostfrom
0.81/user/jasonvmo/safe-area-callback

Conversation

@JasonVMo

Copy link
Copy Markdown

Summary:

The generated-app integration jobs on both stable branches currently fail in
react-native-safe-area-context@5.11.1:

no visible @interface for 'RCTViewComponentView' declares the selector 'safeAreaInsetsDidChange'

AppKit exposes safeAreaInsets but not UIKit's overridable callback.
Supply that API in the fork's existing RCTUIView compatibility class and
deliver notifications when its effective insets actually change during
attachment/layout. Record the new value before invoking subclasses, and do
not send duplicate notifications for unchanged layouts. UIKit/iOS behavior
is untouched.

The branch adapters use their existing UIKit implementation locations:
the modular RCTUIKit files on main/0.83, and the monolithic implementation
on 0.81. They register and extend the existing macOS XCTest source.
Release metadata follows the target branch: none on main, Nx on 0.81, and
a Changeset on 0.83.

This is deliberately separate from #3176/#3177/#3178's renderer
synchronization. No FURN input/layout/window-sizing code, dependency pin,
retry, CI workflow, or renderer mutex implementation changes are included.
No equivalent callback was found in the inspected future merge heads or
existing open PRs.

The stable adapters are middle layers above native-host repairs #3180
(0.81) and #3179 (0.83). Main reuses existing host repair #3095 rather than
opening a duplicate.

Test Plan:

Red/green: with the regression source actually registered in the macOS
Sources phase, the baseline fails compiling its superclass callback, matching
the integration failure. With the shim, both native callback tests pass.
The early zero-test invocation was not counted as coverage; source membership
was fixed before the red/green run.

  • Modern implementation: 2/2 tests passed in the existing 0.83 host.
  • Branch-specific 0.81 implementation: 11/11 passed, comprising both
    callback tests plus six existing Paper layout and three gzip regressions.
  • Scoped native formatting, project plutil -lint, and git diff --check
    passed for all three adapters.
  • NX_DAEMON=false yarn nx release plan:check --base=0.81/user/jasonvmo/native-test-host
    passed for the 0.81 middle layer.

Exact modern native command from its isolated qualification root
(NATIVE_PROPS_EVIDENCE denotes the local artifact directory):

RCT_NO_LAUNCH_PACKAGER=1 xcodebuild -workspace packages/rn-tester/RNTesterPods.xcworkspace -scheme RNTester-macOS -sdk macosx -destination 'platform=macOS,arch=arm64' -configuration Debug -jobs 2 -derivedDataPath "$NATIVE_PROPS_EVIDENCE/build-patched083-clean" -resultBundlePath "$NATIVE_PROPS_EVIDENCE/results-safe-area-patched.xcresult" CODE_SIGNING_ALLOWED=NO -enableAddressSanitizer NO -enableThreadSanitizer NO -enableUndefinedBehaviorSanitizer NO -parallel-testing-enabled NO -only-testing:RNTester-macOSUnitTests/RNTesterUnitTests_macOS test
# PASSED: TEST SUCCEEDED, 2 tests, 0 failures.

Exact legacy-port command:

RCT_NO_LAUNCH_PACKAGER=1 xcodebuild -workspace packages/rn-tester/RNTesterPods.xcworkspace -scheme RNTester-macOS -sdk macosx -destination 'platform=macOS,arch=arm64' -configuration Debug -jobs 2 -derivedDataPath "$NATIVE_PROPS_EVIDENCE/build-patched081-paper-app" -resultBundlePath "$NATIVE_PROPS_EVIDENCE/results-safe-area081.xcresult" CODE_SIGNING_ALLOWED=NO -enableAddressSanitizer NO -enableThreadSanitizer NO -enableUndefinedBehaviorSanitizer NO -parallel-testing-enabled NO -only-testing:RNTester-macOSUnitTests/RNTesterUnitTests_macOS -only-testing:RNTester-macOSUnitTests/RCTShadowViewTests -only-testing:RNTester-macOSUnitTests/RCTGzipTests test
# PASSED: TEST SUCCEEDED, 11 tests, 0 failures.

Qualification uses local-only single-run profiles, without the pre-existing
retry default; no test-plan changes are committed. These ordinary callback
tests are not sanitizer/race-freedom evidence. The separately instrumented
native-props comparisons belong to the renderer PRs.

Not run here: the entire native unit suite, a separate main callback execution,
iOS/device runtime, real notched-screen transitions, or FURN smokes. Hosted
CI will validate the generated-app failure path; no PR is merged.

Port the same UIKit callback bridge to 0.81's existing monolithic RCTUIKit implementation without copying the newer folder layout. The legacy native host passes both callback regressions plus all nine selected Paper layout/gzip regressions. Add an Nx patch plan for this branch's existing release group.

This compatibility layer is separate from the renderer synchronization fix and keeps iOS on UIKit.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 33ea5c72-8bbd-448d-aa21-c9b99dd03c96

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant