Commit Graph
3766 Commits
Author SHA1 Message Date
Alan LeeandFacebook GitHub Bot 352e440459 Back out "Fix Dimensions window values on Android < 15" (#53149)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53149

Reverting PR https://github.com/facebook/react-native/pull/52738

Changelog: [Internal]
reverting D78738516

Original commit changeset: fdb22f3cc76b

Original Phabricator Diff: D78738516

Reviewed By: mdvacca, lenaic, Abbondanzo

Differential Revision: D79835424

fbshipit-source-id: 44b5ee34b4df6752e5a6f959a54e104eef20ffca
2025-08-08 00:40:42 -07:00
David VaccaandFacebook GitHub Bot aaf471278c Back out "Add tests for DisplayMetricsHolder" (#53148)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53148

Reverting D78981753 because it's causing tests to OOM
https://github.com/facebook/react-native/commit/384677f58ea0af498f548a043be86e6876af58b1

changelog: [internal] internal

Reviewed By: shwanton

Differential Revision: D79828375

fbshipit-source-id: 3de01dca3d9a9fc4530c84855049eb4ec132a485
2025-08-07 14:33:33 -07:00
Nicola CortiandFacebook GitHub Bot 384677f58e Add tests for DisplayMetricsHolder (#52946)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52946

This just add a set of unit tests for `DisplayMetricsHolder` as I'm working on this class recently.

Changelog:
[Internal] [Changed] -

Reviewed By: rshest, mdvacca

Differential Revision: D78981753

fbshipit-source-id: 5800d44d3131a58770a0049eb2d08306874b7183
2025-08-07 11:01:37 -07:00
Nicola CortiandFacebook GitHub Bot 2e76fc8e8e Correctly create the first modal state (#52835)
Summary:
There is currently a bug with Modals with New Architecture where the first frame is rendered incorrectly, specifically not accounting for all the vertical insets (only the status bar). This fixes it.

Specifically:
1. I've removed the caching of the statusbar height from `ReactModalHostView` as that was not working correctly. Sometimes the value returned `0` meaning that it was not yet computed when Fabric was asking for it. In the updated implementation we now query `FabricUIManager` given the `surfaceId` of the modal.
2. I've modified the logic to account for all the vertical insets, not just the status bar.

## Changelog:

[ANDROID] [FIXED] - Correctly account for insets on first render of Modals on New Arch

Pull Request resolved: https://github.com/facebook/react-native/pull/52835

Test Plan:
Tested on Marketplace Location Picker and the picker is still working correctly:

 https://pxl.cl/7NjtJ

Reviewed By: mdvacca

Differential Revision: D78975126

Pulled By: cortinico

fbshipit-source-id: d7afb4fa5d2f43a7e33da3860432fa6dfe0dc8d7
2025-08-07 11:01:37 -07:00
Nicola CortiandFacebook GitHub Bot e92da16a9b Migrate ClipboardModuleTest to use BridgelessReactContext (#53131)
Summary:
This test was still using the old `BridgeReactContext`, I'm migrating it to `BridgelessReactContext`.

## Changelog:

[INTERNAL] -

Pull Request resolved: https://github.com/facebook/react-native/pull/53131

Test Plan: CI

Reviewed By: mdvacca

Differential Revision: D79801564

Pulled By: cortinico

fbshipit-source-id: 9bb96185505703a773597aeadfeeaeeb194532de
2025-08-07 10:42:26 -07:00
Nicola CortiandFacebook GitHub Bot ede037ade7 Cleanup heightOfTallestInlineImage field (#52978)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52978

This field is never written anywhere (neither in the internal codebase, nor in OSS).
I'm cleaning this us and simplifying the logic:
- Deprecating `effectiveLineHeight`
- Replacing all the usage of `effectiveLineHeight` with just `lineHeight`

Changelog:
[Android] [Changed] - Deprecate the field `TextAttributeProps.effectiveLineHeight`. This field was public but never used in OSS.

Reviewed By: mdvacca

Differential Revision: D79442393

fbshipit-source-id: c424a6def0257264cd160a2d7be48c2d0f47135e
2025-08-07 09:49:46 -07:00
Mateo GuzmánandFacebook GitHub Bot fa921b3c7b Migrate TextAttributeProps to Kotlin (#52452)
Summary:
Migrate com.facebook.react.views.text.TextAttributeProps to Kotlin.

## Changelog:

[Android][Changed] - Migrated TextAttributeProps to Kotlin. You might need to update your property access to use camelCase instead of Hungarian notation.

Pull Request resolved: https://github.com/facebook/react-native/pull/52452

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: rshest

Differential Revision: D79341238

Pulled By: cortinico

fbshipit-source-id: 455c7b48f47a0cf240aaf330e1fa3674798e7237
2025-08-07 09:49:46 -07:00
Nicola CortiandFacebook GitHub Bot 026e22bb8d Deprecate the DefaultDevSupportManagerFactory.create() method used for Old Arch (#53137)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53137

One of those 2 methods can be deprecated as it was used only for old architecture.
We'll be removing it at some point in the future.

Changelog:
[Android] [Deprecated] - DefaultDevSupportManagerFactory.create() method used for Old Arch

Reviewed By: rshest

Differential Revision: D79806116

fbshipit-source-id: ad2d5515f93bb85e3b7c495b369078f4c66d143b
2025-08-07 08:56:26 -07:00
Mateo GuzmánandFacebook GitHub Bot f1894393ca Initial Kotlin setup and migrate YogaConstants (#53133)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53133

# Changelog:
[Internal] -

As part of the ongoing effort to migrate the React Native codebase to Kotlin, this PR introduces the initial setup required for Kotlin support in Yoga.

- Added initial basic Kotlin configuration to the project.
- Migrated `YogaConstants` as an initial file to try out the first migration steps.

X-link: https://github.com/facebook/yoga/pull/1829

Test Plan:
- Tested the migrated class directly against facebook/react-native, see the PR [here](https://github.com/facebook/react-native/pull/52998).
- Run: `./gradlew :yoga:assembleDebug` & `./gradlew :yoga:compileDebugSources`

I am not able to run the Java tests in this repo (even before the initial Kotlin setup) – not sure if I am missing something there but any pointers are welcome – it seems like there is some missing configuration. Currently trying with `./gradlew :yoga:test`

Reviewed By: cortinico

Differential Revision: D79545992

Pulled By: rshest

fbshipit-source-id: 8257ff53e6b6f2436980be98b6c94e1ac526b207
2025-08-07 08:17:56 -07:00
David VaccaandFacebook GitHub Bot f67078df07 Deprecate all LegacyArchitecture classes on LayoutAnimation package (#53101)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53101

Deprecate all LegacyArchitecture classes on LayoutAnimation package

changelog: [Android][Changed] Deprecate LegacyArchitecture classes from LayoutAnimation package

Reviewed By: alanleedev

Differential Revision: D79658935

fbshipit-source-id: 34ab2f674868dbee459f2018e82a7d50d0d7333a
2025-08-07 05:11:31 -07:00
Mathieu ActhernoeneandFacebook GitHub Bot 3b185e4bce Fix Dimensions window values on Android < 15 (#52738)
Summary:
This PR (initially created for edge-to-edge opt-in support, rebased multiple times) fixes the `Dimensions` API `window` values on Android < 15, when edge-to-edge is enabled.

Currently the window height doesn't include the status and navigation bar heights (but it does on Android >= 15):

<img width="300" alt="Screenshot 2025-06-27 at 16 23 02" src="https://github.com/user-attachments/assets/c7d11334-9298-4f7f-a75c-590df8cc2d8a" />

Using `WindowMetricsCalculator` from AndroidX:

<img width="300" alt="Screenshot 2025-06-27 at 16 34 01" src="https://github.com/user-attachments/assets/7a4e3dc7-a83b-421b-8f6d-fd1344f5fe81" />

Fixes https://github.com/facebook/react-native/issues/47080

## Changelog:

[Android] [Fixed] Fix `Dimensions` `window` values on Android < 15 when edge-to-edge is enabled

Pull Request resolved: https://github.com/facebook/react-native/pull/52738

Test Plan:
Run the example app on an Android < 15 device.

Rollback Plan:

Reviewed By: cipolleschi, Abbondanzo

Differential Revision: D78738516

Pulled By: alanleedev

fbshipit-source-id: fdb22f3cc76b0bda987db426cb015124bcacdc84
2025-08-07 02:17:14 -07:00
Alan LeeandFacebook GitHub Bot 8b2e309479 replace getWindowDisplayMetrics with getScreenDisplayMetrics (#53041)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53041

update `DisplayMetricsHolder.getWindowDisplayMetrics()` to `getScreenDisplayMetrics()`.

Where window width and height is not needed, prefer to use `screenDisplayMetrics` as with upcoming diff `windowDisplayMetrics` initialization only happen using UiContext and have potential to cause more issues if used unnecessarily.

Changelog: [Internal] Update `DisplayMetricsHolder.getWindowDisplayMetrics()` to use `.getScreenDisplayMetrics()`

Reviewed By: mlord93

Differential Revision: D79571226

fbshipit-source-id: d90fca36c119318e7a2dfa6953fc2148b35e83d4
2025-08-07 02:17:14 -07:00
David VaccaandFacebook GitHub Bot d4bf644e47 Update deprecation message for ReactNativeHost class (#53118)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53118

Update deprecation message for ReactNativeHost class

changelog: [internal] internal

Reviewed By: shwanton

Differential Revision: D79677829

fbshipit-source-id: 5013e0988a1ffbfea49a261fd23ac71af76c3313
2025-08-06 23:58:34 -07:00
Tim YungandFacebook GitHub Bot c861804325 VirtualView: Simplify Window Focus Detection
Summary:
Refactors the window focus detection feature flag logic in `VirtualView` (Android) to eliminate one instance property and instead utilize the existence of the focus listener to determine whether window focus detection is enabled.

Changelog:
[Internal]

Reviewed By: mdvacca

Differential Revision: D79743782

fbshipit-source-id: d12e70d8e52b72d546ff097c3b1bcfbd29fb9129
2025-08-06 20:49:05 -07:00
Alex HuntandFacebook GitHub Bot 2768c84445 Implement local connection for perf metrics in HostTarget (#52838)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52838

**Context**

Experimental V2 Performance Monitor prototype, beginning by bringing the [Interaction to Next Paint (INP)](https://web.dev/articles/inp) metric to React Native.

**This diff**

Wires up a client/subscriber for the `"__chromium_devtools_metrics_reporter"` runtime binding (to which we emit live metrics events since D78904748). This will be used to unpack these performance updates to send to the host platform.

- Creates a new `HostRuntimeBinding` helper, which establishes a local/private CDP session.
- Conditionally installs our perf metrics runtime binding in `HostTarget` when `perfMonitorV2Enabled` is set.
- Wires up a new `onPerfMonitorUpdate` event on `HostTargetDelegate` (unimplemented until the next diff).

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D78904766

fbshipit-source-id: 991f17a4cc69f574917750053a5da31bbc6dc0d5
2025-08-06 16:05:28 -07:00
David VaccaandFacebook GitHub Bot 54770cecc4 Mark JSInstance as InteropLegacyArchitecture (#53100)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53100

Mark JSInstance as InteropLegacyArchitecture

changelog: [internal] internal

Reviewed By: mlord93, cortinico

Differential Revision: D79732414

fbshipit-source-id: fc66d6cfef34b4ac66af724bf4336f4f4c38f447
2025-08-06 14:13:32 -07:00
Alex HuntandFacebook GitHub Bot b4164cd97c Move JInspectorNetworkReporter, add missing SoLoader call (#53055)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53055

Moves the C++ part of `InspectorNetworkReporter.kt` into the `react_devsupportjni` JNI library, and adds missing `SoLoader.loadLibrary` call.

Replaces D79568759 / https://github.com/facebook/react-native/pull/53036.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D79638331

fbshipit-source-id: 5df450ad80e4532d6ada1e4dab51a1de6418a4e0
2025-08-06 08:14:31 -07:00
Sophie LandFacebook GitHub Bot 4b8dbe7642 fix: turn off build IDs for reproducibility (#53089)
Summary:
these cause issues for apps that want to be "reproducible" (i.e. the same code leads to the same output, which can be helpful for detemining if there's been any tampering or similar). see also https://gitlab.com/IzzyOnDroid/repo/-/wikis/Reproducible-Builds/RB-Hints-for-Developers#no-funny-build-time-generated-ids

I'm not exactly sure why this was set. it seems to have been introduced in https://github.com/facebook/react-native/commit/e3830ddffd9260fe071e0c9f9df40b379d54cf26 without any (public) explanation as to why it was needed?

## Changelog:

[ANDROID] [FIXED] - Turned off build IDs for native libraries, fixing issues with reproducibility

Pull Request resolved: https://github.com/facebook/react-native/pull/53089

Test Plan: I've successfully used similar patches in my own app for a while.

Reviewed By: cipolleschi

Differential Revision: D79718924

Pulled By: cortinico

fbshipit-source-id: 7c609fa0b5b305cb759586fb1c7f332589ca9cc7
2025-08-06 08:07:14 -07:00
Peter AbbondanzoandFacebook GitHub Bot 4503068117 Make ReactAccessibilityDelegate nullsafe (#53068)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53068

Adds some assertion annotations and small null checks to `ReactAccessibilityDelegate` to comply with FB's Nullsafe annotation

Changelog: [Internal]

Reviewed By: arushikesarwani94

Differential Revision: D79645332

fbshipit-source-id: 707e4e6d4a5f09232af168c2f7c57c2fdbb1f08d
2025-08-05 16:11:34 -07:00
Peter AbbondanzoandFacebook GitHub Bot 0f0a3cfce2 Provide ReactContext to experimental JSTouchDispatcher method (#53003)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53003

The new `onChildStartedNativeGesture` method accepts a nullable `ReactContext` value for the purpose of flushing active touch events. This change updates all callsites of that method to pass a `ReactContext`

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D79258727

fbshipit-source-id: 7b2950f514295dbe26822442c98079b8121cb3bf
2025-08-05 09:42:36 -07:00
Nicola CortiandFacebook GitHub Bot 36bdd7b9cb Remove unused ReactSafeAreaViewShadowNode (#52985)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52985

This class is essentially a wrapper of LayoutShadowNode with no extra logic added.
Let's remove it.

Changelog:
[Internal] [Changed] -

Reviewed By: alanleedev

Differential Revision: D79450688

fbshipit-source-id: 943e10e602cb9a5b77fca81e11d2333828b27813
2025-08-05 05:16:57 -07:00
Nicola CortiandFacebook GitHub Bot d5d21d0614 Remove possibility to newArchEnabled=false in 0.82 (#53025)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53025

It's now time to say goodbye to the Legacy Architecture :')

This change hardcodes the `newArchEnabled` property to true, and warns the users
if they're attempting to set it to false.

Changelog:
[Android] [Breaking] - Remove possibility to newArchEnabled=false in 0.82

Reviewed By: cipolleschi

Differential Revision: D78560296

fbshipit-source-id: ccfc45d2f7f21cc20e063cb901d76be3d41458d6
2025-08-05 05:11:12 -07:00
Fabrizio CucciandFacebook GitHub Bot 893730633c Use buttonState to distinguish ACTION_DOWN and ACTION_HOVER_EXIT (#53033)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53033

This diff replaces the logic introduced in D72078450 to prevent `onPointerEnter`/`onPointerLeave` from firing when a button is pressed. The new approach trades off some complexity for reliability: instead of deferring `ACTION_HOVER_EXIT` handling to the next frame, we now suppress it immediately if any button is pressed (`buttonState != 0`). This simpler logic appears to work reliably on Quest devices, though it may behave differently on the Android emulator (something we’ll monitor).

The main reason for this change is that deferring ACTION_HOVER_EXIT introduces problems in newer Spatial React use cases, particularly when a single component hierarchy spans multiple roots. For example, when hovering between ReactSurfaceRoot and another root like VolumetricWindow, deferring ACTION_HOVER_EXIT can lead to incorrect enter/exit ordering:

* Cursor starts hovering over `ReactSurfaceRoot`
* Cursor moves to `VolumetricWindow`
* `ACTION_HOVER_EXIT` (`ReactSurfaceRoot`) — deferred
* `ACTION_HOVER_ENTER` (`VolumetricWindow`) — processed
* `ACTION_HOVER_EXIT` (`ReactSurfaceRoot`) — processed (too late)

This results in inconsistent hover state updates across roots, which this diff resolves by handling `ACTION_HOVER_EXIT` immediately when appropriate.

Changelog: [Internal]

Reviewed By: Abbondanzo

Differential Revision: D79504775

fbshipit-source-id: ea97bff48ddf4d3d09caf56ca29057c202b12409
2025-08-04 11:10:10 -07:00
Mateo GuzmánandFacebook GitHub Bot d547d9e56e Kotlin: redundant unit return type [1/2] (#52993)
Summary:
Fixing some warnings from static code analysis regarding [redundant unit return type](https://www.jetbrains.com/help/inspectopedia/RedundantUnitReturnType.html).

## Changelog:

[INTERNAL] - Kotlin: redundant unit return type [1/2]

Pull Request resolved: https://github.com/facebook/react-native/pull/52993

Test Plan:
```sh
yarn test-android
yarn android
```

Reviewed By: cortinico

Differential Revision: D79546007

Pulled By: rshest

fbshipit-source-id: 017cb3b70333fe652ecb1bdca751fa4f56f737fd
2025-08-04 11:04:51 -07:00
Alex HuntandFacebook GitHub Bot fa66e314b2 Implement Network.loadingFailed (#53023)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53023

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D79555222

fbshipit-source-id: bfbe36edc867b1fc7a44d8e998489ef1d8896331
2025-08-04 10:04:02 -07:00
Alex HuntandFacebook GitHub Bot ea50245e1e Update InspectorNetworkReporter to avoid overhead for CDP-only methods (#53022)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53022

Following D77799617, D77927896, updates `InspectorNetworkReporter.kt` to check `isDebuggingEnabled` internally and avoid work/communication over the JNI layer — to minimise impact on the Android Network stack.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D78004462

fbshipit-source-id: 2bea2ee0592d68d1cb330ac82e8b3b227b54a675
2025-08-04 10:04:02 -07:00
Peter AbbondanzoandFacebook GitHub Bot 1828c53f85 Emit scroll end events when fling animator completes (#52989)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52989

Adds a call to `NativeAnimatedModule`'s `userDrivenScrollEnded` method whenever a scroll event completes a smooth scroll animation. This is necessary in cases where Animated events control any layout properties of children and we need to force the shadow tree to resync with the native tree. For example, if a scroll view's child transforms its scale based on the scrollX or scrollY properties and the user triggers a `scrollToOffset` or `scrollToIndex` call, we don't update the layout of that child until the next state change.

Changelog: [Android][Fixed] - Fixed an issue where shadow tree and native tree layouts mismatch at the end of a scroll event

Reviewed By: sammy-SC

Differential Revision: D79464176

fbshipit-source-id: fee5f1c522714dbcddf8836de291c05d10e6e90e
2025-08-04 08:19:16 -07:00
Nicola CortiandFacebook GitHub Bot ea1aff455a Make ReactCxxErrorHandler internal (#53024)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53024

This class is Legacy Arch and is not used in OSS. Let's make it internal.

Changelog:
[Internal] [Changed] -

Reviewed By: RSNara

Differential Revision: D79556615

fbshipit-source-id: d157fe8f04784038d64657c6d240b0c51e41d82d
2025-08-04 07:51:30 -07:00
Nicola CortiandFacebook GitHub Bot c37f3ed8c6 Remove unnecessary ReactNoCrashBridgeNotAllowedSoftException (#52987)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52987

This class is unnecessary. Is also public for no real reason.
Instead we should use `ReactNoCrashSoftException` directly.

I'm not marking this as breaking as users hsould not be catching this class.

Changelog:
[Internal] [Changed] -

Reviewed By: mdvacca

Differential Revision: D79451567

fbshipit-source-id: 4d6f45b3006c79969fcf141002d34a72bf88901a
2025-08-04 04:50:59 -07:00
lukmccallandFacebook GitHub Bot 2f46a49b8d Fix ReactHostImpl.nativeModules always returning an empty list (#52986)
Summary:
During the Expo QA process, we discovered that `ReactContext.reactApplicationContext.nativeModules` always returns an empty list (https://github.com/expo/expo/blob/4e2bbb23edda74d0e24756fd1735b8763e38f7a7/packages/expo-modules-core/android/src/main/java/expo/modules/kotlin/ReactExtensions.kt#L12). This happens because, during object creation, the `reactInstance` is always null.

## Changelog:

[ANDROID] [FIXED] - Fix `ReactHostImpl.nativeModules` always returning an empty list

Pull Request resolved: https://github.com/facebook/react-native/pull/52986

Test Plan: - RN tester compiles 

Reviewed By: mdvacca

Differential Revision: D79451613

Pulled By: cortinico

fbshipit-source-id: d5341bcc1193eb948db4e99f16ba32a63073a6db
2025-08-04 04:46:56 -07:00
Mateo GuzmánandFacebook GitHub Bot f273c63d37 Kotlin: obvious explicit type (#52990)
Summary:
Fixing some warnings from static code analysis regarding [obvious explicit type](https://www.jetbrains.com/help/inspectopedia/RedundantExplicitType.html#locating-this-inspection).

## Changelog:

[INTERNAL] - Kotlin: obvious explicit type

Pull Request resolved: https://github.com/facebook/react-native/pull/52990

Test Plan:
```sh
yarn test-android
yarn android
```

Reviewed By: cortinico

Differential Revision: D79546014

Pulled By: rshest

fbshipit-source-id: 1b66edde3185911b137e2c77673779cc613fae74
2025-08-04 04:28:50 -07:00
Nicola CortiandFacebook GitHub Bot 691d4744b3 Mark NotThreadSafeBridgeIdleDebugListener as LegacyArchitecture (#52988)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52988

This class should be marked as `LegacyArchitecture` while it was not.

Changelog:
[Internal] [Changed] -

Reviewed By: mdvacca

Differential Revision: D79451041

fbshipit-source-id: 62c5d35821e354ea851eaccac909bf6bd9157f09
2025-08-04 03:51:08 -07:00
Peter AbbondanzoandFacebook GitHub Bot 87749470cc Ensure active touches are swept before accepting a child native gesture (#52995)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52995

Fabric retains views by ID when `JSTouchDispatcher` receives a touch event, but does not sweep these same views if a child native gesture is started between the `ACTION_DOWN` and `ACTION_UP` actions of the touch. As a result, we never end up calling into that view's manager's `onDropViewInstance` method and can't perform reliable teardown of the view since it's stuck in this "touched" state.

This is change adds a new condition to check if `JSTouchDispatcher` should sweep active touches when a child native gesture is started, and only applies the check to `ReactSurfaceView` to start. The check is also only enabled if the `sweepActiveTouchOnChildNativeGesturesAndroid` flag is set.

Changelog: [Internal]

Reviewed By: jehartzog

Differential Revision: D79230277

fbshipit-source-id: c15b888ec932319f1bda05b8ef5eec39e5d08710
2025-08-03 18:04:43 -07:00
Peter AbbondanzoandFacebook GitHub Bot f2964e17cd Add feature flag to perform gesture sweep in JSTouchDispatcher (#52972)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52972

Fabric retains views by ID when `JSTouchDispatcher` receives a touch event, but does not sweep these same views if a child native gesture is started between the `ACTION_DOWN` and `ACTION_UP` actions of the touch. As a result, we never end up calling into that view's manager's `onDropViewInstance` method and can't perform reliable teardown of the view since it's stuck in this "touched" state.

This is the first of a few changes to add a new feature flag `sweepActiveTouchOnChildNativeGesturesAndroid` to allow the `JSTouchDispatcher` to sweep active touches when a child native gesture is started. Running experiments internally to confirm that there are no unintended side effects from flushing the active touch.

Changelog: [Internal]

Reviewed By: jehartzog

Differential Revision: D79257465

fbshipit-source-id: 1ca79e77b21d8086c4df6753b16b1d8d922cd8d5
2025-08-03 18:04:43 -07:00
Artem KholodnyiandFacebook GitHub Bot e8c6a5397b Fix react-native build
Summary:
bypass-github-export-checks

Changelog: [internal]

Reviewed By: Abbondanzo

Differential Revision: D79441010

fbshipit-source-id: 249912a6cf3350b98af6cf910151fc5a95edce2d
2025-08-01 10:17:47 -07:00
Artem KholodnyiandFacebook GitHub Bot f70c39d836 Fix obfuscated scale type names (#52958)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52958

Changelog: [Internal]

Reviewed By: kartavya-ramnani, oprisnik, rshest

Differential Revision: D79354202

fbshipit-source-id: d4e84749324ff75a283c940631ac1199694bc92e
2025-08-01 06:07:14 -07:00
Mateo GuzmánandFacebook GitHub Bot 77be1a3dc4 Kotlin: accessor call can be replaced with property access syntax (#52950)
Summary:
Fixing a few warnings from static code analysis regarding the [accessor call can be replaced with property access](https://www.jetbrains.com/help/inspectopedia/UsePropertyAccessSyntax.html) rule

## Changelog:

[INTERNAL] - Kotlin: accessor call can be replaced with property access syntax

Pull Request resolved: https://github.com/facebook/react-native/pull/52950

Test Plan:
```sh
yarn test-android
yarn android
```

Reviewed By: cortinico

Differential Revision: D79431292

Pulled By: rshest

fbshipit-source-id: 09ad40c09512def9ab33eaeb70da057f742ae4a1
2025-08-01 04:33:29 -07:00
Wandji Emmanuel juniorandFacebook GitHub Bot 626568f9a3 fix(android): Stabilize custom accessibility action IDs for TalkBack (#52724)
Summary:
This pull request resolves a critical accessibility bug on Android where custom `accessibilityActions` fail to execute when activated via TalkBack's swipe gestures.

**The Problem:**
- When a user focuses a component with custom `accessibilityActions` (like a `TouchableOpacity`), TalkBack correctly announces the action labels as the user swipes up or down.
- However, when the user double-taps to activate the selected action, TalkBack reports an "incompatible action," and the `onAccessibilityAction` event is never triggered.

**The Root Cause:**
The investigation revealed that the `ReactAccessibilityDelegate` was generating **new, unstable IDs** for custom actions on every UI update. This instability prevents the Android accessibility service from reliably tracking and invoking the selected action.

**The Solution:**
This change introduces a static, thread-safe cache (`ConcurrentHashMap`) within `ReactAccessibilityDelegate`. This ensures that each unique action name is mapped to a single, stable ID for the entire lifecycle of the application. This provides the consistency required by TalkBack to function correctly.

This addresses the issue described in https://github.com/facebook/react-native/issues/47268.

 ---

## Changelog:

[Android] [Fixed] - Stabilize custom accessibility action IDs to prevent "incompatible action" errors in TalkBack.
 ---

Pull Request resolved: https://github.com/facebook/react-native/pull/52724

Test Plan:
The fix was validated extensively using the RNTester app on a physical Android device and an Android emulator.

### Steps to Reproduce (Before Fix)

1.  Enable TalkBack on an Android device.
2.  Navigate to a `TouchableOpacity` component with several custom `accessibilityActions`.
3.  Swipe up or down to cycle through the actions. TalkBack correctly announces them (e.g., "add to cart").
4.  Double-tap to execute the selected action.
5.  **Result (Bug):** TalkBack announces *"incompatible action"*, and the `onAccessibilityAction` event is not triggered.

### Validation Steps (After Fix)

1.  Follow the same steps as above on the patched version.
2.  **Result (Fixed):** After double-tapping, the `onAccessibilityAction` event is **correctly triggered** with the appropriate action name. The "incompatible action" issue is fully resolved.

*A screen recording demonstrating the successful fix can be provided if needed.*

Uploading fixed bugs view problems (1).mp4…

Fixes https://github.com/facebook/react-native/issues/47268

Reviewed By: jorge-cab

Differential Revision: D78737471

Pulled By: cipolleschi

fbshipit-source-id: 877b196597472ac6a4f6df81a05a43956fb34629
2025-07-31 10:28:28 -07:00
Alex HuntandFacebook GitHub Bot a3bf989450 Implement reporting InteractionEntry live metrics to runtime (#52839)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52839

**Context**

Experimental V2 Performance Monitor prototype, beginning by bringing the [Interaction to Next Paint (INP)](https://web.dev/articles/inp) metric to React Native.

**This diff**

Adds and configures a `CdpMetricsReporter` class to report `InteractionEntry` live metrics over CDP via the `"__chromium_devtools_metrics_reporter"` runtime binding.

**Notes**

- Introduces a new `react/performance/cdpmetrics` package, and a listener API on `PerformanceEntryReporter` (both to avoid a `jni` dependency in `react/performance/timeline`).

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D78904748

fbshipit-source-id: c75971aba43d9929912b3d1dba7576c2a2342214
2025-07-30 07:13:58 -07:00
David VaccaandFacebook GitHub Bot 0d3791ca0a Throw Exception if ReactApplication.reactNativeHost is not overriden (#52912)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52912

This diff throws an Exception if ReactApplication.reactNativeHost is not overriden. This field is deprecated and it will be deleted in the near future.
The goal of this diff is to be able to remove usages of reactNativeHost for classes that implement ReactApplication

changelog: [Android][Breaking] Throw Exception if ReactApplication.reactNativeHost is not overriden

Reviewed By: mlord93

Differential Revision: D79186336

fbshipit-source-id: 9f8f34739c0f04056ff3d795bda45bc0dbca7624
2025-07-29 18:22:53 -07:00
Nicola CortiandFacebook GitHub Bot 04ae15d99b Remove the com.facebook.react.bridge.JSONArguments class (#52901)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52901

I'm removing this class as we should not expose it publicly.
It's not used at all inside react-native and can potentally be moved internally.

The only usage I've found in OSS is patched with this PR:
- https://github.com/fabOnReact/react-native-wear-connectivity/pull/46

Changelog:
[Android] [Removed] - Remove the `com.facebook.react.bridge.JSONArguments` class

Reviewed By: javache, mdvacca

Differential Revision: D78265165

fbshipit-source-id: 704575e7b9cfd6d40980511d6064d39991b3eb48
2025-07-29 08:54:10 -07:00
Nicola CortiandFacebook GitHub Bot dde4d34a02 Add more tests for MatrixMathHelper (#52885)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52885

Since we recently touched the `MatrixMathHelper` class, as we're looking into moving more matrix operations from Kotlin to C++,
I'm going to add more tests to make sure that those matrix math function are behaving correctly.

Changelog:
[Internal] [Changed] -

Reviewed By: mdvacca

Differential Revision: D79094323

fbshipit-source-id: 34967b42dc92338724dd20fb7f70a68734f6db28
2025-07-29 02:35:27 -07:00
Joe VilchesandFacebook GitHub Bot e17e3e3f38 Decouple ReactAndroidHWInputDeviceHelper from ReactRootView (#52891)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52891

Right now these are tightly coupled for no reason. The device helper just asks the root view to send the event out, which it uses ReactContext for. We can just have that be passed in and accomplish the same task.

Changelog: [Internal]

Reviewed By: Abbondanzo, rozele

Differential Revision: D79007328

fbshipit-source-id: ef0a5ac4ec0acb52fc7c2a26010811767e3c1e67
2025-07-28 19:31:02 -07:00
David VaccaandFacebook GitHub Bot 8c1d191f1a EZ cleanup of unnecessary variable (#52892)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52892

 EZ cleanup of unnecessary variable

changelog: [internal] internal

Reviewed By: mlord93

Differential Revision: D79119092

fbshipit-source-id: 10b8675763dd203a832648ef3c99520dcdaa08da
2025-07-28 18:16:05 -07:00
Alex HuntandFacebook GitHub Bot a3e99264a2 Introduce V2 Perf Monitor feature flags (#52809)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52809

**Context**

Experimental V2 Performance Monitor prototype, beginning by bringing the [Interaction to Next Paint (INP)](https://web.dev/articles/inp) metric to React Native.

**This diff**

Add two new feature flags:

- `fuseboxInteractionMetricsEnabled` — Will configure sending of interaction live metrics to CDP clients, independent of an active performance profiling session.
- `perfMonitorV2Enabled` — Will enable the backend + UI for the V2 Perf Monitor.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D78894857

fbshipit-source-id: 7605357b3cc9255d76f66bde605f9e520dda9750
2025-07-25 10:29:13 -07:00
Samuel SuslaandFacebook GitHub Bot 0d13474161 provide option to fabric commits in C++ Animated (#52834)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52834

changelog: [internal]

we have seen some problems with the fabric commit and believe there is a race condition in the implementation.

Here, we introduce an option to disable it.

Reviewed By: rozele

Differential Revision: D78972655

fbshipit-source-id: 99005c77dbe4dde3816b9e6a692f170cf287f7cd
2025-07-25 07:27:39 -07:00
Christoph PurrerandFacebook GitHub Bot 2c683c5787 Apply clang-tidy setting; RN Android (#52774)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52774

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D78634966

fbshipit-source-id: daee3ed21b6f2229049e6a09e2b9c48dfb7e0264
2025-07-24 17:50:27 -07:00
Jorge Cabiedes AcostaandFacebook GitHub Bot e1ae619fce Implement accessibilityOrder by building the accessibilityTree through addChildrenForAccessibility (#52743)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52743

We can build an accessibility tree for Talkback by overriding addChildrenForAccessibility of ViewGroup.

With this we just manually build a tree that contains the elements we care about in the order we want.

We also try to keep most of the tree intact so that coopting works properly
Changelog: [Internal]

EDITS: After backout, fixed the issue where we were incorrectly setting the `accessibility_order_parent` tag the ReactAxOrderHelper class instead of the actual view. Also, made the cast safe to prevent any unexpected issues.

Also refactored the ReactAxOrderHelper functions to not have the block scoped `traverse` functions in favor of just looping through the children of a view when calling them

Reviewed By: joevilches

Differential Revision: D78669715

fbshipit-source-id: e714367c28e722ce42895531cf18e6f2dc926556
2025-07-23 18:08:29 -07:00
Rubén NorteandFacebook GitHub Bot 2de4984970 Implement solution for ShadowTree commmit exhaustion using recursive locks (behind a flag) (#52795)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52795

Changelog: [internal]

This is another attempt to fix https://github.com/facebook/react-native/issues/51870, inspired by https://github.com/facebook/react-native/pull/52314 but gated behind a feature flag until we've tested it carefully.

Reviewed By: sammy-SC

Differential Revision: D78817100

fbshipit-source-id: 45e6cae019b212528f2b2e74b9f52fe43d07f537
2025-07-23 15:06:12 -07:00
Rubén NorteandFacebook GitHub Bot c6c7c3720f Clean up feature flag preventShadowTreeCommitExhaustionWithLocking (#52791)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52791

Changelog: [internal]

This cleans up this feature flag as it doesn't work as intended. We'll try another approach with a different flag instead.

Reviewed By: sammy-SC

Differential Revision: D78815892

fbshipit-source-id: 4c651a3a225de9cfb54d00346343c7f2e3bea1d5
2025-07-23 15:06:12 -07:00