From 74bc15680f83e5112d31e7d869b82f8d171a3ed2 Mon Sep 17 00:00:00 2001 From: Johannes Klein Date: Tue, 24 Oct 2023 13:57:57 +0200 Subject: [PATCH 01/84] Bump vision-camera --- ios/Podfile.lock | 4 ++-- package-lock.json | 13 +++++++------ package.json | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 3323488c6..8c73bb32f 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -452,7 +452,7 @@ PODS: - React-Core - RNVectorIcons (9.2.0): - React-Core - - VisionCamera (2.15.6): + - VisionCamera (3.4.1): - React - React-callinvoker - React-Core @@ -759,7 +759,7 @@ SPEC CHECKSUMS: RNShareMenu: cb9dac548c8bf147d06f0bf07296ad51ea9f5fc3 RNSVG: d00c8f91c3cbf6d476451313a18f04d220d4f396 RNVectorIcons: fcc2f6cb32f5735b586e66d14103a74ce6ad61f8 - VisionCamera: 523b49054bee9dace64189ab6631cb41e8b83fe0 + VisionCamera: 633c2a7f0d20e060b3cfc664851319f0bfadfc75 VisionCameraPluginInatVision: 79bb258db75218889c74d0897ecba676492c4def Yoga: e29645ec5a66fb00934fad85338742d1c247d4cb diff --git a/package-lock.json b/package-lock.json index b4559266b..cfe10fd60 100644 --- a/package-lock.json +++ b/package-lock.json @@ -90,7 +90,7 @@ "react-native-svg-transformer": "^1.1.0", "react-native-uuid": "^2.0.1", "react-native-vector-icons": "^9.1.0", - "react-native-vision-camera": "github:inaturalist/react-native-vision-camera#our-main-fork-2", + "react-native-vision-camera": "3.4.1", "react-native-webview": "^11.26.1", "react-native-worklets-core": "^0.2.0", "realm": "^12.3.0", @@ -23092,9 +23092,9 @@ } }, "node_modules/react-native-vision-camera": { - "version": "2.15.6", - "resolved": "git+ssh://git@github.com/inaturalist/react-native-vision-camera.git#e5a8a91759843e1255742ce44e5638e8fab19fe1", - "license": "MIT", + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/react-native-vision-camera/-/react-native-vision-camera-3.4.1.tgz", + "integrity": "sha512-MOVmkNnQl40ROSDXd+RwF18lacJX8CsRZRcKnEJGZ3VtX4fAM1fd+C1I9PxIu7lWiyqDa6SU7EKu8NDb4Tu1VA==", "peerDependencies": { "react": "*", "react-native": "*" @@ -42926,8 +42926,9 @@ } }, "react-native-vision-camera": { - "version": "git+ssh://git@github.com/inaturalist/react-native-vision-camera.git#e5a8a91759843e1255742ce44e5638e8fab19fe1", - "from": "react-native-vision-camera@github:inaturalist/react-native-vision-camera#our-main-fork-2", + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/react-native-vision-camera/-/react-native-vision-camera-3.4.1.tgz", + "integrity": "sha512-MOVmkNnQl40ROSDXd+RwF18lacJX8CsRZRcKnEJGZ3VtX4fAM1fd+C1I9PxIu7lWiyqDa6SU7EKu8NDb4Tu1VA==", "requires": {} }, "react-native-webview": { diff --git a/package.json b/package.json index 00586d0a4..3205dc8d6 100644 --- a/package.json +++ b/package.json @@ -115,7 +115,7 @@ "react-native-svg-transformer": "^1.1.0", "react-native-uuid": "^2.0.1", "react-native-vector-icons": "^9.1.0", - "react-native-vision-camera": "github:inaturalist/react-native-vision-camera#our-main-fork-2", + "react-native-vision-camera": "3.4.1", "react-native-webview": "^11.26.1", "react-native-worklets-core": "^0.2.0", "realm": "^12.3.0", From 184adfcea17dbcdd5089ebe764a6cf1f25f09d1a Mon Sep 17 00:00:00 2001 From: Johannes Klein Date: Tue, 24 Oct 2023 13:58:30 +0200 Subject: [PATCH 02/84] Refactor patch --- patches/react-native-vision-camera+3.4.1.patch | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 patches/react-native-vision-camera+3.4.1.patch diff --git a/patches/react-native-vision-camera+3.4.1.patch b/patches/react-native-vision-camera+3.4.1.patch new file mode 100644 index 000000000..3cead56ad --- /dev/null +++ b/patches/react-native-vision-camera+3.4.1.patch @@ -0,0 +1,18 @@ +diff --git a/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/core/VideoPipeline.kt b/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/core/VideoPipeline.kt +index af34761..4460171 100644 +--- a/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/core/VideoPipeline.kt ++++ b/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/core/VideoPipeline.kt +@@ -104,7 +104,12 @@ class VideoPipeline( + frame.incrementRefCount() + frameProcessor?.call(frame) + +- imageWriter!!.queueInputImage(image) ++ try { ++ imageWriter!!.queueInputImage(image) ++ } ++ catch (exception: RuntimeException){ ++ // Handling exception ++ } + + frame.decrementRefCount() + }, CameraQueues.videoQueue.handler) From 4949fc952d303edc9fbb6b33efb7b1f22502b715 Mon Sep 17 00:00:00 2001 From: Johannes Klein Date: Tue, 24 Oct 2023 14:03:15 +0200 Subject: [PATCH 03/84] Move patched orientation into patch functions file --- .../Camera/ARCamera/FrameProcessorCamera.js | 18 ++++++++++++++++++ src/sharedHelpers/visionCameraPatches.js | 17 +++++++++++++---- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/src/components/Camera/ARCamera/FrameProcessorCamera.js b/src/components/Camera/ARCamera/FrameProcessorCamera.js index 4a1553432..89fd58f78 100644 --- a/src/components/Camera/ARCamera/FrameProcessorCamera.js +++ b/src/components/Camera/ARCamera/FrameProcessorCamera.js @@ -14,6 +14,8 @@ import { // react-native-vision-camera v3 // import { Worklets } from "react-native-worklets-core"; import { modelPath, modelVersion, taxonomyPath } from "sharedHelpers/cvModel"; +import { Worklets } from "react-native-worklets-core"; +import { orientationPatchFrameProcessor } from "sharedHelpers/visionCameraPatches"; import { useDeviceOrientation } from "sharedHooks"; import * as InatVision from "vision-camera-plugin-inatvision"; @@ -76,6 +78,7 @@ const FrameProcessorCamera = ( { // onClassifierError( error ); // } ); + const patchedOrientationAndroid = orientationPatchFrameProcessor( deviceOrientation ); const frameProcessor = useFrameProcessor( frame => { "worklet"; @@ -117,6 +120,21 @@ const FrameProcessorCamera = ( { // handleError( classifierError ); // } // } ); + // Reminder: this is a worklet, running on the UI thread. + try { + const results = InatVision.inatVision( frame, { + version, + modelPath, + taxonomyPath, + confidenceThreshold, + patchedOrientationAndroid + } ); + handleResults( results ); + } catch ( classifierError ) { + console.log( `Error: ${classifierError.message}` ); + handleError( classifierError ); + } + } ); }, [modelVersion, confidenceThreshold, takingPhoto, deviceOrientation] ); diff --git a/src/sharedHelpers/visionCameraPatches.js b/src/sharedHelpers/visionCameraPatches.js index 00c2c5fb1..5321b694b 100644 --- a/src/sharedHelpers/visionCameraPatches.js +++ b/src/sharedHelpers/visionCameraPatches.js @@ -22,6 +22,7 @@ export const visionCameraMajorVersion = dependencies["react-native-vision-camera ); // Needed for react-native-vision-camera v3.3.1 +// Needed for react-native-vision-camera v3.4.1 // This patch is used to set the pixelFormat prop which should not be needed because the default // value would be fine for both platforms. // However, on Android for the "native" pixelFormat I could not find any method or properties to @@ -31,7 +32,7 @@ export const pixelFormatPatch = () => ( Platform.OS === "ios" ? "native" : "yuv" ); -// Needed for react-native-vision-camera v3.3.1 +// Needed for react-native-vision-camera v3.4.1 // This patch is used to determine the orientation prop for the Camera component. // On Android, the orientation prop is not used, so we return null. // On iOS, the orientation prop is undocumented, but it does get used in a sense that the @@ -43,7 +44,15 @@ export const orientationPatch = deviceOrientation => { : deviceOrientation; }; -// Needed for react-native-vision-camera v2 and v3.3.1 +// Needed for react-native-vision-camera v3.4.1 in combination +// with our vision-camera-plugin-inatvision +// This patch is used to determine the orientation prop for the FrameProcessor. +// This is only needed for Android, so on iOS we return null. +export const orientationPatchFrameProcessor = deviceOrientation => ( Platform.OS === "android" + ? deviceOrientation + : null ); + +// Needed for react-native-vision-camera v3.4.1 // As of this version the photo from takePhoto is not oriented coming from the native side. // E.g. if you take a photo in landscape-right and save it to camera roll directly from the // vision camera, it will be tilted in the native photo app. So, on iOS, depending on the @@ -86,7 +95,7 @@ export const rotationTempPhotoPatch = ( photo, deviceOrientation ) => { return photoRotation; }; -// Needed for react-native-vision-camera v3.3.1 +// Needed for react-native-vision-camera v3.4.1 // This patch is used to rotate the photo taken with the vision camera. // Because the photos coming from the vision camera are not oriented correctly, we // rotate them with image-resizer as a first step, replacing the original photo. @@ -111,7 +120,7 @@ export const rotatePhotoPatch = async ( photo, rotation ) => { await RNFS.moveFile( tempUri, photo.path ); }; -// Needed for react-native-vision-camera v3.3.1 +// Needed for react-native-vision-camera v3.4.1 // This patch is here to remember to replace the rotation used when resizing the original // photo to a smaller local copy we keep in the app cache. Previously we had a flow where // we would resize the original photo to a smaller version including rotation. Now, we From f96d2cc886d0cbdc7b6b3b6b52ad3e0d1c96c402 Mon Sep 17 00:00:00 2001 From: Johannes Klein Date: Tue, 24 Oct 2023 16:38:37 +0200 Subject: [PATCH 04/84] Update react-native-vision-camera+3.4.1.patch --- .../react-native-vision-camera+3.4.1.patch | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/patches/react-native-vision-camera+3.4.1.patch b/patches/react-native-vision-camera+3.4.1.patch index 3cead56ad..76b707a6e 100644 --- a/patches/react-native-vision-camera+3.4.1.patch +++ b/patches/react-native-vision-camera+3.4.1.patch @@ -1,17 +1,25 @@ diff --git a/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/core/VideoPipeline.kt b/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/core/VideoPipeline.kt -index af34761..4460171 100644 +index af34761..313ca94 100644 --- a/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/core/VideoPipeline.kt +++ b/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/core/VideoPipeline.kt -@@ -104,7 +104,12 @@ class VideoPipeline( +@@ -70,6 +70,9 @@ class VideoPipeline( + private var imageReader: ImageReader? = null + private var imageWriter: ImageWriter? = null + ++ private val hasOutputs: Boolean ++ get() = recordingSession != null ++ + init { + Log.i( + TAG, +@@ -104,7 +107,10 @@ class VideoPipeline( frame.incrementRefCount() frameProcessor?.call(frame) - imageWriter!!.queueInputImage(image) -+ try { ++ if (hasOutputs) { ++ // If we have outputs (e.g. a RecordingSession), pass the frame along to the OpenGL pipeline + imageWriter!!.queueInputImage(image) -+ } -+ catch (exception: RuntimeException){ -+ // Handling exception + } frame.decrementRefCount() From 699662de8142d01841f664d32e776f67603b63e9 Mon Sep 17 00:00:00 2001 From: Johannes Klein Date: Wed, 25 Oct 2023 14:55:00 +0200 Subject: [PATCH 05/84] Switch to MacOS 13 runner Vision camera requires XCode 15 to compile. --- .github/workflows/e2e_ios.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/e2e_ios.yml b/.github/workflows/e2e_ios.yml index de4faae43..3d48ffc03 100644 --- a/.github/workflows/e2e_ios.yml +++ b/.github/workflows/e2e_ios.yml @@ -11,7 +11,7 @@ on: jobs: setup: - runs-on: macos-latest + runs-on: macos-13 steps: - uses: fkirc/skip-duplicate-actions@master with: @@ -21,7 +21,7 @@ jobs: checksecret: name: check for oauth client needs: setup - runs-on: macos-latest + runs-on: macos-13 outputs: is_SECRETS_PRESENT_set: ${{ steps.checksecret_job.outputs.is_SECRETS_PRESENT_set }} steps: @@ -36,7 +36,7 @@ jobs: test: needs: checksecret if: needs.checksecret.outputs.is_SECRETS_PRESENT_set == 'true' - runs-on: macos-latest + runs-on: macos-13 # Kill the task if not finished after 60 minutes timeout-minutes: 60 @@ -119,7 +119,7 @@ jobs: name: Notify Slack needs: test if: ${{ success() || failure() }} - runs-on: macos-latest + runs-on: macos-13 steps: - uses: iRoachie/slack-github-actions@v2.3.0 if: env.SLACK_WEBHOOK_URL != null From f994dd7f1082eaa030e6f9442a18bcc0f885c018 Mon Sep 17 00:00:00 2001 From: Johannes Klein Date: Wed, 25 Oct 2023 15:47:59 +0200 Subject: [PATCH 06/84] Add step to specify XCode 15 --- .github/workflows/e2e_ios.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/e2e_ios.yml b/.github/workflows/e2e_ios.yml index 3d48ffc03..eadcda3b0 100644 --- a/.github/workflows/e2e_ios.yml +++ b/.github/workflows/e2e_ios.yml @@ -41,6 +41,11 @@ jobs: timeout-minutes: 60 steps: + - name: Set up Xcode + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: '15' + - name: Check out Git repository uses: actions/checkout@v3 with: From b948eaa223609a736518dcff77089e38083ea939 Mon Sep 17 00:00:00 2001 From: Johannes Klein Date: Wed, 25 Oct 2023 23:49:17 +0200 Subject: [PATCH 07/84] Higher level of logging --- .github/workflows/e2e_ios.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e_ios.yml b/.github/workflows/e2e_ios.yml index eadcda3b0..fb6f26037 100644 --- a/.github/workflows/e2e_ios.yml +++ b/.github/workflows/e2e_ios.yml @@ -110,7 +110,7 @@ jobs: run: npm run e2e:build:ios - name: Run e2e test - run: npm run e2e:test:ios -- --cleanup --take-screenshots failing --record-videos failing -l debug + run: npm run e2e:test:ios -- --cleanup --take-screenshots failing --record-videos failing -l trace # The artifacts for the failing tests are available for download on github.com on the page of the individual actions run - name: Store Detox artifacts on test failure From e2c58dd3b2a01e494d9773a7485f0f7047bdacc3 Mon Sep 17 00:00:00 2001 From: Johannes Klein Date: Thu, 26 Oct 2023 13:12:23 +0200 Subject: [PATCH 08/84] Increase test timeout --- e2e/jest.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/jest.config.js b/e2e/jest.config.js index cc280b10e..ddfe438ae 100644 --- a/e2e/jest.config.js +++ b/e2e/jest.config.js @@ -1,6 +1,6 @@ module.exports = { maxWorkers: 1, - testTimeout: 300000, + testTimeout: 500000, rootDir: "..", testMatch: ["/e2e/**/*.e2e.js"], verbose: true, From 35bbd69afbe81ec97787470ee38d74ad66e42d77 Mon Sep 17 00:00:00 2001 From: Johannes Klein Date: Thu, 26 Oct 2023 14:08:50 +0200 Subject: [PATCH 09/84] Add comment --- .github/workflows/e2e_ios.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/e2e_ios.yml b/.github/workflows/e2e_ios.yml index fb6f26037..ace04cacf 100644 --- a/.github/workflows/e2e_ios.yml +++ b/.github/workflows/e2e_ios.yml @@ -41,6 +41,7 @@ jobs: timeout-minutes: 60 steps: + # react-native-vision-camera > v3.4 requires Xcode 15 to compile, which is currently not the default in the runner - name: Set up Xcode uses: maxim-lobanov/setup-xcode@v1 with: From 28e56ba631c62cd556a13eb8889c5e097bc8b15d Mon Sep 17 00:00:00 2001 From: Johannes Klein Date: Thu, 26 Oct 2023 15:46:12 +0200 Subject: [PATCH 10/84] Remove navigation to obs without evidence for signed out user --- e2e/signedOut.e2e.js | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/e2e/signedOut.e2e.js b/e2e/signedOut.e2e.js index 211480c86..291019d63 100644 --- a/e2e/signedOut.e2e.js +++ b/e2e/signedOut.e2e.js @@ -17,15 +17,4 @@ describe( "Signed out user", () => { await waitFor( loginText ).toBeVisible( ).withTimeout( 10000 ); await expect( loginText ).toBeVisible( ); } ); - - it( "should add an observation without evidence", async () => { - const addObsButton = element( by.id( "add-obs-button" ) ); - await waitFor( addObsButton ).toBeVisible( ).withTimeout( 10000 ); - await addObsButton.tap( ); - await expect( element( by.id( "evidence-text" ) ) ).toBeVisible( ); - const obsWithoutEvidenceButton = element( by.id( "observe-without-evidence-button" ) ); - await expect( obsWithoutEvidenceButton ).toBeVisible( ); - await obsWithoutEvidenceButton.tap( ); - await waitFor( element( by.id( "new-observation-text" ) ) ).toBeVisible( ).withTimeout( 10000 ); - } ); } ); From a8c1b829cb1d7e74f031af6fd6d217bc640d3f24 Mon Sep 17 00:00:00 2001 From: Johannes Klein Date: Thu, 26 Oct 2023 15:47:18 +0200 Subject: [PATCH 11/84] Patch for location permission not working on iOS --- e2e/signedIn.e2e.js | 14 ++++++++++++++ src/components/SharedComponents/PermissionGate.js | 1 + 2 files changed, 15 insertions(+) diff --git a/e2e/signedIn.e2e.js b/e2e/signedIn.e2e.js index c6a9321df..3f55e9c5f 100644 --- a/e2e/signedIn.e2e.js +++ b/e2e/signedIn.e2e.js @@ -57,6 +57,20 @@ describe( "Signed in user", () => { ); await expect( obsWithoutEvidenceButton ).toBeVisible(); await obsWithoutEvidenceButton.tap(); + /* + / 2.Insert.: On iOS setting location permission is currently not working + / react-native-vision-camera >v3.4 only compiles with XCode >15 + / AppleSimUtils v0.9.10 used to set the location permission (other permissions afre fine) + / does not work on a Simulator with XCode15 + iOS17, so in order for this test to pass we + / disable usage of a location for now. + */ + if ( device.getPlatform() === "ios" ) { + // Permission gate modal, press close icon to exit + const closePermissionGate = element( by.id( "close-permission-gate" ) ); + await waitFor( closePermissionGate ).toBeVisible().withTimeout( 10000 ); + await closePermissionGate.tap(); + } + // Check that the new observation screen is visible await waitFor( element( by.id( "new-observation-text" ) ) ) .toBeVisible() diff --git a/src/components/SharedComponents/PermissionGate.js b/src/components/SharedComponents/PermissionGate.js index 0d86c01f4..257297cc7 100644 --- a/src/components/SharedComponents/PermissionGate.js +++ b/src/components/SharedComponents/PermissionGate.js @@ -52,6 +52,7 @@ const PermissionGate = ( { )} > onClose( )} From 542699bfa5a4f8c2e11b49c51591dffe6c2af59a Mon Sep 17 00:00:00 2001 From: Johannes Klein Date: Thu, 26 Oct 2023 17:18:39 +0200 Subject: [PATCH 12/84] Increase setup timeout --- .detoxrc.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.detoxrc.js b/.detoxrc.js index a97769a61..65dedb830 100644 --- a/.detoxrc.js +++ b/.detoxrc.js @@ -13,6 +13,9 @@ module.exports = { config: "e2e/jest.config.js", _: ["e2e"], }, + jest: { + setupTimeout: 600000, + }, }, apps: { "ios.debug": { From f0d86f1fa0726cadabca815b8a4e6248dd3f913f Mon Sep 17 00:00:00 2001 From: Johannes Klein Date: Thu, 26 Oct 2023 18:30:20 +0200 Subject: [PATCH 13/84] Increase some more timeouts --- .detoxrc.js | 1 + .github/workflows/e2e_ios.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.detoxrc.js b/.detoxrc.js index 65dedb830..2f764b2d7 100644 --- a/.detoxrc.js +++ b/.detoxrc.js @@ -15,6 +15,7 @@ module.exports = { }, jest: { setupTimeout: 600000, + teardownTimeout: 600000, }, }, apps: { diff --git a/.github/workflows/e2e_ios.yml b/.github/workflows/e2e_ios.yml index ace04cacf..09ca2999d 100644 --- a/.github/workflows/e2e_ios.yml +++ b/.github/workflows/e2e_ios.yml @@ -38,7 +38,7 @@ jobs: if: needs.checksecret.outputs.is_SECRETS_PRESENT_set == 'true' runs-on: macos-13 # Kill the task if not finished after 60 minutes - timeout-minutes: 60 + timeout-minutes: 100 steps: # react-native-vision-camera > v3.4 requires Xcode 15 to compile, which is currently not the default in the runner From 02742bf4a65256e6b61a7c06c562e701f665ea23 Mon Sep 17 00:00:00 2001 From: Johannes Klein Date: Fri, 27 Oct 2023 09:43:30 +0200 Subject: [PATCH 14/84] Revert back to less logging in CI --- .github/workflows/e2e_ios.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e_ios.yml b/.github/workflows/e2e_ios.yml index 09ca2999d..cf443d6ad 100644 --- a/.github/workflows/e2e_ios.yml +++ b/.github/workflows/e2e_ios.yml @@ -111,7 +111,7 @@ jobs: run: npm run e2e:build:ios - name: Run e2e test - run: npm run e2e:test:ios -- --cleanup --take-screenshots failing --record-videos failing -l trace + run: npm run e2e:test:ios -- --cleanup --take-screenshots failing --record-videos failing -l debug # The artifacts for the failing tests are available for download on github.com on the page of the individual actions run - name: Store Detox artifacts on test failure From 010a8fbf55c4d5a2e034af90aebb4e7a08259fd6 Mon Sep 17 00:00:00 2001 From: Johannes Klein Date: Fri, 27 Oct 2023 23:27:20 +0200 Subject: [PATCH 15/84] Does it have to do with timeouts? --- .detoxrc.js | 4 ++-- .github/workflows/e2e_ios.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.detoxrc.js b/.detoxrc.js index 2f764b2d7..e7697c37a 100644 --- a/.detoxrc.js +++ b/.detoxrc.js @@ -14,8 +14,8 @@ module.exports = { _: ["e2e"], }, jest: { - setupTimeout: 600000, - teardownTimeout: 600000, + setupTimeout: 900000, + teardownTimeout: 900000, }, }, apps: { diff --git a/.github/workflows/e2e_ios.yml b/.github/workflows/e2e_ios.yml index cf443d6ad..884d33e3d 100644 --- a/.github/workflows/e2e_ios.yml +++ b/.github/workflows/e2e_ios.yml @@ -38,7 +38,7 @@ jobs: if: needs.checksecret.outputs.is_SECRETS_PRESENT_set == 'true' runs-on: macos-13 # Kill the task if not finished after 60 minutes - timeout-minutes: 100 + timeout-minutes: 120 steps: # react-native-vision-camera > v3.4 requires Xcode 15 to compile, which is currently not the default in the runner From dfe87994ffe025c29ddf6851ad1163e6cb4daeaf Mon Sep 17 00:00:00 2001 From: Johannes Klein Date: Sat, 28 Oct 2023 21:53:30 +0200 Subject: [PATCH 16/84] Trace log level --- .github/workflows/e2e_ios.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e_ios.yml b/.github/workflows/e2e_ios.yml index 884d33e3d..9ab12051c 100644 --- a/.github/workflows/e2e_ios.yml +++ b/.github/workflows/e2e_ios.yml @@ -111,7 +111,7 @@ jobs: run: npm run e2e:build:ios - name: Run e2e test - run: npm run e2e:test:ios -- --cleanup --take-screenshots failing --record-videos failing -l debug + run: npm run e2e:test:ios -- --cleanup --take-screenshots failing --record-videos failing -l trace # The artifacts for the failing tests are available for download on github.com on the page of the individual actions run - name: Store Detox artifacts on test failure From 450c27ed7dbc4a2b1be667b94759d32067dc5e1d Mon Sep 17 00:00:00 2001 From: Johannes Klein Date: Mon, 30 Oct 2023 14:02:10 +0100 Subject: [PATCH 17/84] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cff7933f1..51fc9e5c0 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ See [CONTRIBUTING](CONTRIBUTING.md) for guidelines on contributing to this proje ### Requirements -* Xcode 13 or above +* Xcode 15 or above * [Android and iOS environment setup](https://reactnative.dev/docs/environment-setup) described in the RN docs ### Install packages and pods From a6b0831dd4fb4d10fee6e49a62235d54fc503882 Mon Sep 17 00:00:00 2001 From: Johannes Klein Date: Tue, 31 Oct 2023 10:31:18 +0100 Subject: [PATCH 18/84] =?UTF-8?q?Disable=20Homebrew=E2=80=99s=20auto=20upd?= =?UTF-8?q?ate=20and=20install=20cleanup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/e2e_ios.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/e2e_ios.yml b/.github/workflows/e2e_ios.yml index 9ab12051c..a723385fb 100644 --- a/.github/workflows/e2e_ios.yml +++ b/.github/workflows/e2e_ios.yml @@ -104,9 +104,14 @@ jobs: run: echo "MOCK_MODE=e2e" >> "$GITHUB_ENV" # Install prerequisites for detox and build app, and test - - run: brew tap wix/brew - - run: brew install applesimutils - + - name: Install macOS dependencies + env: + HOMEBREW_NO_AUTO_UPDATE: 1 + HOMEBREW_NO_INSTALL_CLEANUP: 1 + run: | + brew tap wix/brew + brew install applesimutils + - name: Build test app run: npm run e2e:build:ios From 2f473abe697aaf8fcdef3f57f7c59862db9e10f8 Mon Sep 17 00:00:00 2001 From: Johannes Klein Date: Tue, 31 Oct 2023 10:42:24 +0100 Subject: [PATCH 19/84] Setup ruby step --- .github/workflows/e2e_ios.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/e2e_ios.yml b/.github/workflows/e2e_ios.yml index a723385fb..2881de04d 100644 --- a/.github/workflows/e2e_ios.yml +++ b/.github/workflows/e2e_ios.yml @@ -57,6 +57,11 @@ jobs: with: node-version: 18 + - name: Setup Ruby version according to .ruby-version with cached gems + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + - name: Cache node modules uses: actions/cache@v3 id: cache From 88c01f60ea50cedd6c7f762f31f3ce157bba1565 Mon Sep 17 00:00:00 2001 From: Johannes Klein Date: Tue, 31 Oct 2023 10:58:27 +0100 Subject: [PATCH 20/84] Install pods only if not cached --- .github/workflows/e2e_ios.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/e2e_ios.yml b/.github/workflows/e2e_ios.yml index 2881de04d..2d7a8f68c 100644 --- a/.github/workflows/e2e_ios.yml +++ b/.github/workflows/e2e_ios.yml @@ -84,10 +84,9 @@ jobs: path: ios/Pods key: pods-${{ hashFiles('**/Podfile.lock') }} - - name: Update Pods - run: | - gem update cocoapods xcodeproj - cd ios && pod install && cd .. + - name: Install CocoaPods + if: steps.podcache.outputs.cache-hit != 'true' + run: cd ios && pod install && cd .. # Generate the secret files needed for a release build - name: Create .env file From ef41f11a2d0fec47ec8b922e0f5b733f5eda8e8b Mon Sep 17 00:00:00 2001 From: Johannes Klein Date: Tue, 31 Oct 2023 11:19:08 +0100 Subject: [PATCH 21/84] Revert "Install pods only if not cached" This reverts commit 42a2ea02f93067722866ccbfbdca5175a9b91000. --- .github/workflows/e2e_ios.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/e2e_ios.yml b/.github/workflows/e2e_ios.yml index 2d7a8f68c..2881de04d 100644 --- a/.github/workflows/e2e_ios.yml +++ b/.github/workflows/e2e_ios.yml @@ -84,9 +84,10 @@ jobs: path: ios/Pods key: pods-${{ hashFiles('**/Podfile.lock') }} - - name: Install CocoaPods - if: steps.podcache.outputs.cache-hit != 'true' - run: cd ios && pod install && cd .. + - name: Update Pods + run: | + gem update cocoapods xcodeproj + cd ios && pod install && cd .. # Generate the secret files needed for a release build - name: Create .env file From e5e20129c948170bc1209f040c13dfcddac40f36 Mon Sep 17 00:00:00 2001 From: Johannes Klein Date: Tue, 31 Oct 2023 11:36:17 +0100 Subject: [PATCH 22/84] Run simulator in headless mode, record all logs --- .github/workflows/e2e_ios.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e_ios.yml b/.github/workflows/e2e_ios.yml index 2881de04d..4f6919349 100644 --- a/.github/workflows/e2e_ios.yml +++ b/.github/workflows/e2e_ios.yml @@ -121,7 +121,7 @@ jobs: run: npm run e2e:build:ios - name: Run e2e test - run: npm run e2e:test:ios -- --cleanup --take-screenshots failing --record-videos failing -l trace + run: npm run e2e:test:ios -- --cleanup --headless --record-logs all --take-screenshots failing --record-videos failing -l trace # The artifacts for the failing tests are available for download on github.com on the page of the individual actions run - name: Store Detox artifacts on test failure From eb614b490c2ca89cf7c8a896d670f828389bfb30 Mon Sep 17 00:00:00 2001 From: Johannes Klein Date: Tue, 31 Oct 2023 14:09:11 +0100 Subject: [PATCH 23/84] Increase timeouts again --- .detoxrc.js | 4 ++-- .github/workflows/e2e_ios.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.detoxrc.js b/.detoxrc.js index e7697c37a..34113d37f 100644 --- a/.detoxrc.js +++ b/.detoxrc.js @@ -14,8 +14,8 @@ module.exports = { _: ["e2e"], }, jest: { - setupTimeout: 900000, - teardownTimeout: 900000, + setupTimeout: 1800000, + teardownTimeout: 1800000, }, }, apps: { diff --git a/.github/workflows/e2e_ios.yml b/.github/workflows/e2e_ios.yml index 4f6919349..f93968ac8 100644 --- a/.github/workflows/e2e_ios.yml +++ b/.github/workflows/e2e_ios.yml @@ -37,8 +37,8 @@ jobs: needs: checksecret if: needs.checksecret.outputs.is_SECRETS_PRESENT_set == 'true' runs-on: macos-13 - # Kill the task if not finished after 60 minutes - timeout-minutes: 120 + # Kill the task if not finished after 150 minutes + timeout-minutes: 150 steps: # react-native-vision-camera > v3.4 requires Xcode 15 to compile, which is currently not the default in the runner From edd77a9fa7740da6c2fb4fb5e3e83ca0c1eb76c3 Mon Sep 17 00:00:00 2001 From: Johannes Klein Date: Mon, 6 Nov 2023 10:06:14 +0100 Subject: [PATCH 24/84] Revert "Remove navigation to obs without evidence for signed out user" This reverts commit 2b4718f5ce464ae3314e75a574dcc41c21919a45. --- e2e/signedOut.e2e.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/e2e/signedOut.e2e.js b/e2e/signedOut.e2e.js index 291019d63..211480c86 100644 --- a/e2e/signedOut.e2e.js +++ b/e2e/signedOut.e2e.js @@ -17,4 +17,15 @@ describe( "Signed out user", () => { await waitFor( loginText ).toBeVisible( ).withTimeout( 10000 ); await expect( loginText ).toBeVisible( ); } ); + + it( "should add an observation without evidence", async () => { + const addObsButton = element( by.id( "add-obs-button" ) ); + await waitFor( addObsButton ).toBeVisible( ).withTimeout( 10000 ); + await addObsButton.tap( ); + await expect( element( by.id( "evidence-text" ) ) ).toBeVisible( ); + const obsWithoutEvidenceButton = element( by.id( "observe-without-evidence-button" ) ); + await expect( obsWithoutEvidenceButton ).toBeVisible( ); + await obsWithoutEvidenceButton.tap( ); + await waitFor( element( by.id( "new-observation-text" ) ) ).toBeVisible( ).withTimeout( 10000 ); + } ); } ); From 6665091cffa100bf9300ee83204ef01e84ac65ca Mon Sep 17 00:00:00 2001 From: Johannes Klein Date: Tue, 7 Nov 2023 10:36:34 +0100 Subject: [PATCH 25/84] Add boolean to run use effect only once --- src/components/Camera/ARCamera/ARCamera.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/components/Camera/ARCamera/ARCamera.js b/src/components/Camera/ARCamera/ARCamera.js index c7be6af06..46a18dea1 100644 --- a/src/components/Camera/ARCamera/ARCamera.js +++ b/src/components/Camera/ARCamera/ARCamera.js @@ -73,6 +73,8 @@ const ARCamera = ( { const { t } = useTranslation(); const theme = useTheme(); + // const [hasFinishedHere, setHasFinishedHere] = useState( false ); + // only show predictions when rank is order or lower, like we do on Seek const showPrediction = ( result && result?.taxon?.rank_level <= 40 ) || false; @@ -90,6 +92,16 @@ const ARCamera = ( { : null ); }; + // useEffect( () => { + // if ( hasFinishedHere ) { + // return; + // } + // if ( photoSaved ) { + // setHasFinishedHere( true ); + // navToObsEdit( { prediction: result } ); + // } + // }, [hasFinishedHere, photoSaved, navToObsEdit, result] ); + return ( <> {device && ( From 715e3cba1298e43d1de5fb289160fa5dd6f9446b Mon Sep 17 00:00:00 2001 From: Johannes Klein Date: Tue, 7 Nov 2023 11:10:02 +0100 Subject: [PATCH 26/84] Did merge wrong code --- src/components/Camera/ARCamera/ARCamera.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/Camera/ARCamera/ARCamera.js b/src/components/Camera/ARCamera/ARCamera.js index 46a18dea1..69a1bb83b 100644 --- a/src/components/Camera/ARCamera/ARCamera.js +++ b/src/components/Camera/ARCamera/ARCamera.js @@ -8,7 +8,7 @@ import useZoom from "components/Camera/hooks/useZoom"; import { Body1, INatIcon, TaxonResult } from "components/SharedComponents"; import { View } from "components/styledComponents"; import type { Node } from "react"; -import React from "react"; +import React, { useEffect, useState } from "react"; import DeviceInfo from "react-native-device-info"; import LinearGradient from "react-native-linear-gradient"; import { useTheme } from "react-native-paper"; @@ -74,6 +74,7 @@ const ARCamera = ( { const theme = useTheme(); // const [hasFinishedHere, setHasFinishedHere] = useState( false ); + // const localTaxon = useTaxon( result?.taxon ); // only show predictions when rank is order or lower, like we do on Seek const showPrediction = ( result && result?.taxon?.rank_level <= 40 ) || false; @@ -98,9 +99,9 @@ const ARCamera = ( { // } // if ( photoSaved ) { // setHasFinishedHere( true ); - // navToObsEdit( { prediction: result } ); + // navToObsEdit( localTaxon ); // } - // }, [hasFinishedHere, photoSaved, navToObsEdit, result] ); + // }, [hasFinishedHere, photoSaved, navToObsEdit, localTaxon] ); return ( <> From 0d07332b22d4b9b646dc159d283871df708739b4 Mon Sep 17 00:00:00 2001 From: Johannes Klein Date: Tue, 7 Nov 2023 21:26:33 +0100 Subject: [PATCH 27/84] There is one more permission gate when entering obs edit now --- e2e/signedIn.e2e.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/e2e/signedIn.e2e.js b/e2e/signedIn.e2e.js index 3f55e9c5f..000cb3cda 100644 --- a/e2e/signedIn.e2e.js +++ b/e2e/signedIn.e2e.js @@ -121,6 +121,21 @@ describe( "Signed in user", () => { await waitFor( editButton ).toBeVisible().withTimeout( 10000 ); // Navigate to the edit screen await editButton.tap(); + + /* + / 2.Insert.: On iOS setting location permission is currently not working + / react-native-vision-camera >v3.4 only compiles with XCode >15 + / AppleSimUtils v0.9.10 used to set the location permission (other permissions afre fine) + / does not work on a Simulator with XCode15 + iOS17, so in order for this test to pass we + / disable usage of a location for now. + */ + if ( device.getPlatform() === "ios" ) { + // Permission gate modal, press close icon to exit + const closePermissionGate = element( by.id( "close-permission-gate" ) ); + await waitFor( closePermissionGate ).toBeVisible().withTimeout( 10000 ); + await closePermissionGate.tap(); + } + // Check that the edit screen is visible await waitFor( element( by.text( "EVIDENCE" ) ) ) .toBeVisible() From 6e3aad3fab5742eb1fd793c1136d47d7d48ce904 Mon Sep 17 00:00:00 2001 From: Johannes Klein Date: Tue, 7 Nov 2023 21:35:01 +0100 Subject: [PATCH 28/84] Add permission gate dismissal to signed out user test --- e2e/signedOut.e2e.js | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/e2e/signedOut.e2e.js b/e2e/signedOut.e2e.js index 211480c86..bbc306b6b 100644 --- a/e2e/signedOut.e2e.js +++ b/e2e/signedOut.e2e.js @@ -20,12 +20,31 @@ describe( "Signed out user", () => { it( "should add an observation without evidence", async () => { const addObsButton = element( by.id( "add-obs-button" ) ); - await waitFor( addObsButton ).toBeVisible( ).withTimeout( 10000 ); - await addObsButton.tap( ); - await expect( element( by.id( "evidence-text" ) ) ).toBeVisible( ); - const obsWithoutEvidenceButton = element( by.id( "observe-without-evidence-button" ) ); - await expect( obsWithoutEvidenceButton ).toBeVisible( ); - await obsWithoutEvidenceButton.tap( ); - await waitFor( element( by.id( "new-observation-text" ) ) ).toBeVisible( ).withTimeout( 10000 ); + await waitFor( addObsButton ).toBeVisible().withTimeout( 10000 ); + await addObsButton.tap(); + await expect( element( by.id( "evidence-text" ) ) ).toBeVisible(); + const obsWithoutEvidenceButton = element( + by.id( "observe-without-evidence-button" ) + ); + await expect( obsWithoutEvidenceButton ).toBeVisible(); + await obsWithoutEvidenceButton.tap(); + + /* + / 2.Insert.: On iOS setting location permission is currently not working + / react-native-vision-camera >v3.4 only compiles with XCode >15 + / AppleSimUtils v0.9.10 used to set the location permission (other permissions afre fine) + / does not work on a Simulator with XCode15 + iOS17, so in order for this test to pass we + / disable usage of a location for now. + */ + if ( device.getPlatform() === "ios" ) { + // Permission gate modal, press close icon to exit + const closePermissionGate = element( by.id( "close-permission-gate" ) ); + await waitFor( closePermissionGate ).toBeVisible().withTimeout( 10000 ); + await closePermissionGate.tap(); + } + + await waitFor( element( by.id( "new-observation-text" ) ) ) + .toBeVisible() + .withTimeout( 10000 ); } ); } ); From 9c81cd8d9ee42de38f307b1f3cb8f07263c9bcf9 Mon Sep 17 00:00:00 2001 From: Johannes Klein Date: Mon, 13 Nov 2023 15:33:11 +0100 Subject: [PATCH 29/84] Add comment, rename state --- src/components/Camera/ARCamera/ARCamera.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/components/Camera/ARCamera/ARCamera.js b/src/components/Camera/ARCamera/ARCamera.js index 69a1bb83b..fcfdce65a 100644 --- a/src/components/Camera/ARCamera/ARCamera.js +++ b/src/components/Camera/ARCamera/ARCamera.js @@ -73,7 +73,7 @@ const ARCamera = ( { const { t } = useTranslation(); const theme = useTheme(); - // const [hasFinishedHere, setHasFinishedHere] = useState( false ); + // const [hasRunEffectOnce, setHasRunEffectOnce] = useState( false ); // const localTaxon = useTaxon( result?.taxon ); // only show predictions when rank is order or lower, like we do on Seek @@ -93,15 +93,20 @@ const ARCamera = ( { : null ); }; + // This effect is triggered when the photo is saved but also every time the localTaxon changes, + // i.e. a frame is processed. With react-native-vision-camera v.3.4 the camera keeps processing + // frames after the we have taken a photo. This leads to the effect being triggered multiple + // times. We only want to trigger the navToObsEdit cascade only once though, so we use the + // hasRunEffectOnce state variable to keep track of that. // useEffect( () => { - // if ( hasFinishedHere ) { + // if ( hasRunEffectOnce ) { // return; // } // if ( photoSaved ) { - // setHasFinishedHere( true ); + // setHasRunEffectOnce( true ); // navToObsEdit( localTaxon ); // } - // }, [hasFinishedHere, photoSaved, navToObsEdit, localTaxon] ); + // }, [hasRunEffectOnce, photoSaved, navToObsEdit, localTaxon] ); return ( <> From 59e67da2c1b0b876513dd0213699132069df9dfc Mon Sep 17 00:00:00 2001 From: Johannes Klein Date: Mon, 13 Nov 2023 17:15:42 +0100 Subject: [PATCH 30/84] Lower action timeout --- .github/workflows/e2e_ios.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e_ios.yml b/.github/workflows/e2e_ios.yml index f93968ac8..e8e88ea3e 100644 --- a/.github/workflows/e2e_ios.yml +++ b/.github/workflows/e2e_ios.yml @@ -37,8 +37,8 @@ jobs: needs: checksecret if: needs.checksecret.outputs.is_SECRETS_PRESENT_set == 'true' runs-on: macos-13 - # Kill the task if not finished after 150 minutes - timeout-minutes: 150 + # Kill the task if not finished after 100 minutes + timeout-minutes: 100 steps: # react-native-vision-camera > v3.4 requires Xcode 15 to compile, which is currently not the default in the runner From d715bfcc7e42b2d4713ea504e539b2d76a23960f Mon Sep 17 00:00:00 2001 From: Johannes Klein Date: Tue, 28 Nov 2023 17:53:42 +0100 Subject: [PATCH 31/84] Update react-native-vision-camera to 3.6, update Reanimated to v3 (#838) * Bump camera and plugin * Upgrade Reanimated and libs using it * Update vision-camera mock * Remove superfluous patch * Fix type * Add mocks for e2e tests because bottom sheet does not work on AOSP * Update package-lock.json --- ios/Podfile.lock | 12 +- package-lock.json | 151 ++++++++++-------- package.json | 14 +- .../react-native-vision-camera+3.4.1.patch | 26 --- .../react-native-worklets-core+0.2.2.patch | 26 +++ .../Sheets/TextInputSheet.android.e2e-mock | 89 +++++++++++ .../Sheets/WarningSheet.android.e2e-mock | 58 +++++++ tests/jest.setup.js | 4 +- 8 files changed, 273 insertions(+), 107 deletions(-) delete mode 100644 patches/react-native-vision-camera+3.4.1.patch create mode 100644 patches/react-native-worklets-core+0.2.2.patch create mode 100644 src/components/SharedComponents/Sheets/TextInputSheet.android.e2e-mock create mode 100644 src/components/SharedComponents/Sheets/WarningSheet.android.e2e-mock diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 8c73bb32f..930133646 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -302,7 +302,7 @@ PODS: - React-Core - react-native-webview (11.26.1): - React-Core - - react-native-worklets-core (0.2.0): + - react-native-worklets-core (0.2.2): - React - React-callinvoker - React-Core @@ -416,11 +416,12 @@ PODS: - React-Core - RNPermissions (3.10.0): - React-Core - - RNReanimated (2.17.0): + - RNReanimated (3.5.4): - DoubleConversion - FBLazyVector - FBReactNativeSpec - glog + - hermes-engine - RCT-Folly - RCTRequired - RCTTypeSafety @@ -430,6 +431,7 @@ PODS: - React-Core/RCTWebSocket - React-CoreModules - React-cxxreact + - React-hermes - React-jsi - React-jsiexecutor - React-jsinspector @@ -452,7 +454,7 @@ PODS: - React-Core - RNVectorIcons (9.2.0): - React-Core - - VisionCamera (3.4.1): + - VisionCamera (3.6.4): - React - React-callinvoker - React-Core @@ -754,12 +756,12 @@ SPEC CHECKSUMS: RNGestureHandler: 6e4dc6b7ab3a385386d4e36228bd065e5a611394 RNLocalize: d4b8af4e442d4bcca54e68fc687a2129b4d71a81 RNPermissions: 0332875c444efe864dd97071dc848529bd7cc692 - RNReanimated: f186e85d9f28c9383d05ca39e11dd194f59093ec + RNReanimated: be07c7ae209074d0e8a84cf38b7909457ac59a32 RNScreens: d3675ab2878704de70c9dae57fa5d024802404cc RNShareMenu: cb9dac548c8bf147d06f0bf07296ad51ea9f5fc3 RNSVG: d00c8f91c3cbf6d476451313a18f04d220d4f396 RNVectorIcons: fcc2f6cb32f5735b586e66d14103a74ce6ad61f8 - VisionCamera: 633c2a7f0d20e060b3cfc664851319f0bfadfc75 + VisionCamera: db57ca079c4f933f1ddd07f2f8fb2d171a826b85 VisionCameraPluginInatVision: 79bb258db75218889c74d0897ecba676492c4def Yoga: e29645ec5a66fb00934fad85338742d1c247d4cb diff --git a/package-lock.json b/package-lock.json index cfe10fd60..717d2a087 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "@bam.tech/react-native-image-resizer": "^3.0.7", "@formidable-webview/webshell": "^2.6.0", - "@gorhom/bottom-sheet": "^4.4.7", + "@gorhom/bottom-sheet": "^4.5.1", "@react-native-async-storage/async-storage": "^1.19.5", "@react-native-camera-roll/camera-roll": "^5.9.0", "@react-native-clipboard/clipboard": "^1.11.2", @@ -20,7 +20,7 @@ "@react-native-community/netinfo": "^9.4.1", "@react-native-picker/picker": "^2.5.0", "@react-navigation/bottom-tabs": "^6.5.8", - "@react-navigation/drawer": "^6.6.3", + "@react-navigation/drawer": "^6.6.6", "@react-navigation/elements": "^1.3.17", "@react-navigation/native": "^6.1.7", "@react-navigation/native-stack": "^6.9.13", @@ -79,8 +79,8 @@ "react-native-paper": "^5.10.5", "react-native-permissions": "^3.10.0", "react-native-picker-select": "8.0.4", - "react-native-reanimated": "^2.17.0", - "react-native-reanimated-carousel": "^3.4.0", + "react-native-reanimated": "^3.5.4", + "react-native-reanimated-carousel": "^3.5.1", "react-native-render-html": "^6.3.4", "react-native-safe-area-context": "^4.7.4", "react-native-screens": "^3.21.1", @@ -90,14 +90,14 @@ "react-native-svg-transformer": "^1.1.0", "react-native-uuid": "^2.0.1", "react-native-vector-icons": "^9.1.0", - "react-native-vision-camera": "3.4.1", + "react-native-vision-camera": "3.6.4", "react-native-webview": "^11.26.1", - "react-native-worklets-core": "^0.2.0", + "react-native-worklets-core": "^0.2.2", "realm": "^12.3.0", "reassure": "^0.10.1", "sanitize-html": "^2.11.0", "use-debounce": "^9.0.4", - "vision-camera-plugin-inatvision": "github:inaturalist/vision-camera-plugin-inatvision#image-prediction-from-file", + "vision-camera-plugin-inatvision": "github:inaturalist/vision-camera-plugin-inatvision#vision-v3.6", "zustand": "^4.4.7" }, "devDependencies": { @@ -2717,9 +2717,9 @@ } }, "node_modules/@gorhom/bottom-sheet": { - "version": "4.4.7", - "resolved": "https://registry.npmjs.org/@gorhom/bottom-sheet/-/bottom-sheet-4.4.7.tgz", - "integrity": "sha512-ukTuTqDQi2heo68hAJsBpUQeEkdqP9REBcn47OpuvPKhdPuO1RBOOADjqXJNCnZZRcY+HqbnGPMSLFVc31zylQ==", + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/@gorhom/bottom-sheet/-/bottom-sheet-4.5.1.tgz", + "integrity": "sha512-4Qy6hzvN32fXu2hDxDXOIS0IBGBT6huST7J7+K1V5bXemZ08KIx5ZffyLgwhCUl+CnyeG2KG6tqk6iYLkIwi7Q==", "dependencies": { "@gorhom/portal": "1.0.14", "invariant": "^2.2.4" @@ -6271,11 +6271,11 @@ } }, "node_modules/@react-navigation/drawer": { - "version": "6.6.3", - "resolved": "https://registry.npmjs.org/@react-navigation/drawer/-/drawer-6.6.3.tgz", - "integrity": "sha512-oQzHqH6svtSIun6+rikQtku6ye2CyyxT4xf3RQLVsBvK7+g4tDdKKLcjgoJmuT1zBZC3SSu3wNeqp8cg4cr2PQ==", + "version": "6.6.6", + "resolved": "https://registry.npmjs.org/@react-navigation/drawer/-/drawer-6.6.6.tgz", + "integrity": "sha512-DW/oNRisSOGOqvZfCzfhKBxnzT97Teqtg1Gal85g+K3gnVbM1jOBE2PdnYsKU0fULfFtDwvp/QZSbcgjDpr12A==", "dependencies": { - "@react-navigation/elements": "^1.3.18", + "@react-navigation/elements": "^1.3.21", "color": "^4.2.3", "warn-once": "^0.1.0" }, @@ -6290,9 +6290,9 @@ } }, "node_modules/@react-navigation/elements": { - "version": "1.3.18", - "resolved": "https://registry.npmjs.org/@react-navigation/elements/-/elements-1.3.18.tgz", - "integrity": "sha512-/0hwnJkrr415yP0Hf4PjUKgGyfshrvNUKFXN85Mrt1gY49hy9IwxZgrrxlh0THXkPeq8q4VWw44eHDfAcQf20Q==", + "version": "1.3.21", + "resolved": "https://registry.npmjs.org/@react-navigation/elements/-/elements-1.3.21.tgz", + "integrity": "sha512-eyS2C6McNR8ihUoYfc166O1D8VYVh9KIl0UQPI8/ZJVsStlfSTgeEEh+WXge6+7SFPnZ4ewzEJdSAHH+jzcEfg==", "peerDependencies": { "@react-navigation/native": "^6.0.0", "react": "*", @@ -22907,34 +22907,42 @@ } }, "node_modules/react-native-reanimated": { - "version": "2.17.0", - "resolved": "https://registry.npmjs.org/react-native-reanimated/-/react-native-reanimated-2.17.0.tgz", - "integrity": "sha512-bVy+FUEaHXq4i+aPPqzGeor1rG4scgVNBbBz21ohvC7iMpB9IIgvGsmy1FAoodZhZ5sa3EPF67Rcec76F1PXlQ==", + "version": "3.5.4", + "resolved": "https://registry.npmjs.org/react-native-reanimated/-/react-native-reanimated-3.5.4.tgz", + "integrity": "sha512-8we9LLDO1o4Oj9/DICeEJ2K1tjfqkJagqQUglxeUAkol/HcEJ6PGxIrpBcNryLqCDYEcu6FZWld/FzizBIw6bg==", "dependencies": { "@babel/plugin-transform-object-assign": "^7.16.7", "@babel/preset-typescript": "^7.16.7", - "invariant": "^2.2.4", - "lodash.isequal": "^4.5.0", - "setimmediate": "^1.0.5", - "string-hash-64": "^1.0.3" + "convert-source-map": "^2.0.0", + "invariant": "^2.2.4" }, "peerDependencies": { "@babel/core": "^7.0.0-0", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.0.0-0", + "@babel/plugin-proposal-optional-chaining": "^7.0.0-0", + "@babel/plugin-transform-arrow-functions": "^7.0.0-0", + "@babel/plugin-transform-shorthand-properties": "^7.0.0-0", + "@babel/plugin-transform-template-literals": "^7.0.0-0", "react": "*", "react-native": "*" } }, "node_modules/react-native-reanimated-carousel": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/react-native-reanimated-carousel/-/react-native-reanimated-carousel-3.4.0.tgz", - "integrity": "sha512-mbEeAMbX+mqOLf2bN55wnWQt/LMx5FFxVneV9XjLvJ69ySMN0yVc3r/lS9/nHx8MdmW2ZUfAsQ4C139Taq+GPQ==", + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/react-native-reanimated-carousel/-/react-native-reanimated-carousel-3.5.1.tgz", + "integrity": "sha512-9BBQV6JAYSQm2lV7MFtT4mzapXmW4IZO6s38gfiJL84Jg23ivGB1UykcNQauKgtHyhtW2NuZJzItb1s42lM+hA==", "peerDependencies": { "react": ">=16.8.0", "react-native": ">=0.6.0", - "react-native-gesture-handler": "*", - "react-native-reanimated": ">=2.7.0" + "react-native-gesture-handler": ">=2.0.0", + "react-native-reanimated": ">=3.0.0" } }, + "node_modules/react-native-reanimated/node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==" + }, "node_modules/react-native-redash": { "version": "18.1.0", "resolved": "https://registry.npmjs.org/react-native-redash/-/react-native-redash-18.1.0.tgz", @@ -23092,9 +23100,9 @@ } }, "node_modules/react-native-vision-camera": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/react-native-vision-camera/-/react-native-vision-camera-3.4.1.tgz", - "integrity": "sha512-MOVmkNnQl40ROSDXd+RwF18lacJX8CsRZRcKnEJGZ3VtX4fAM1fd+C1I9PxIu7lWiyqDa6SU7EKu8NDb4Tu1VA==", + "version": "3.6.4", + "resolved": "https://registry.npmjs.org/react-native-vision-camera/-/react-native-vision-camera-3.6.4.tgz", + "integrity": "sha512-DDWb8aB5tE7sM7YuU5f31AuhJVDJS3amZoZMQgHWa8S9h0acp3hY3uyriKzXshj/asYu2UAo5QUUglwl7Mcd1Q==", "peerDependencies": { "react": "*", "react-native": "*" @@ -23122,9 +23130,12 @@ } }, "node_modules/react-native-worklets-core": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/react-native-worklets-core/-/react-native-worklets-core-0.2.0.tgz", - "integrity": "sha512-gxpfl3KnoRmDtBBVs08K7Ru3xaOrBTGXKQtcjwDzgIcaiNhPfKiJdUz1AIa3SX+M2I/f/7fgWK2W9OFYae/AzA==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/react-native-worklets-core/-/react-native-worklets-core-0.2.2.tgz", + "integrity": "sha512-VPAIWMvGHL6mTI9mR4x5wN/EybtnzyNT1zhYIimJQvLABvC8TUyCXcHQVu9Eo95BSYXx3E+ImF8VA+np1tCAQg==", + "dependencies": { + "string-hash-64": "^1.0.3" + }, "engines": { "node": ">= 16.0.0" }, @@ -25692,7 +25703,7 @@ }, "node_modules/vision-camera-plugin-inatvision": { "version": "0.1.0", - "resolved": "git+ssh://git@github.com/inaturalist/vision-camera-plugin-inatvision.git#b7a6d6aabb78630b72aa709455c24af40a1f6b08", + "resolved": "git+ssh://git@github.com/inaturalist/vision-camera-plugin-inatvision.git#9ae0fb9d7a93cd966950292fe20dc19b172174a1", "license": "MIT", "engines": { "node": ">= 16.0.0" @@ -25700,8 +25711,7 @@ "peerDependencies": { "react": "*", "react-native": "*", - "react-native-reanimated": ">=2.1.0", - "react-native-vision-camera": ">=2.0.0" + "react-native-vision-camera": ">=3.6.3" } }, "node_modules/vlq": { @@ -27837,9 +27847,9 @@ "requires": {} }, "@gorhom/bottom-sheet": { - "version": "4.4.7", - "resolved": "https://registry.npmjs.org/@gorhom/bottom-sheet/-/bottom-sheet-4.4.7.tgz", - "integrity": "sha512-ukTuTqDQi2heo68hAJsBpUQeEkdqP9REBcn47OpuvPKhdPuO1RBOOADjqXJNCnZZRcY+HqbnGPMSLFVc31zylQ==", + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/@gorhom/bottom-sheet/-/bottom-sheet-4.5.1.tgz", + "integrity": "sha512-4Qy6hzvN32fXu2hDxDXOIS0IBGBT6huST7J7+K1V5bXemZ08KIx5ZffyLgwhCUl+CnyeG2KG6tqk6iYLkIwi7Q==", "requires": { "@gorhom/portal": "1.0.14", "invariant": "^2.2.4" @@ -30540,19 +30550,19 @@ } }, "@react-navigation/drawer": { - "version": "6.6.3", - "resolved": "https://registry.npmjs.org/@react-navigation/drawer/-/drawer-6.6.3.tgz", - "integrity": "sha512-oQzHqH6svtSIun6+rikQtku6ye2CyyxT4xf3RQLVsBvK7+g4tDdKKLcjgoJmuT1zBZC3SSu3wNeqp8cg4cr2PQ==", + "version": "6.6.6", + "resolved": "https://registry.npmjs.org/@react-navigation/drawer/-/drawer-6.6.6.tgz", + "integrity": "sha512-DW/oNRisSOGOqvZfCzfhKBxnzT97Teqtg1Gal85g+K3gnVbM1jOBE2PdnYsKU0fULfFtDwvp/QZSbcgjDpr12A==", "requires": { - "@react-navigation/elements": "^1.3.18", + "@react-navigation/elements": "^1.3.21", "color": "^4.2.3", "warn-once": "^0.1.0" } }, "@react-navigation/elements": { - "version": "1.3.18", - "resolved": "https://registry.npmjs.org/@react-navigation/elements/-/elements-1.3.18.tgz", - "integrity": "sha512-/0hwnJkrr415yP0Hf4PjUKgGyfshrvNUKFXN85Mrt1gY49hy9IwxZgrrxlh0THXkPeq8q4VWw44eHDfAcQf20Q==", + "version": "1.3.21", + "resolved": "https://registry.npmjs.org/@react-navigation/elements/-/elements-1.3.21.tgz", + "integrity": "sha512-eyS2C6McNR8ihUoYfc166O1D8VYVh9KIl0UQPI8/ZJVsStlfSTgeEEh+WXge6+7SFPnZ4ewzEJdSAHH+jzcEfg==", "requires": {} }, "@react-navigation/native": { @@ -42790,22 +42800,27 @@ } }, "react-native-reanimated": { - "version": "2.17.0", - "resolved": "https://registry.npmjs.org/react-native-reanimated/-/react-native-reanimated-2.17.0.tgz", - "integrity": "sha512-bVy+FUEaHXq4i+aPPqzGeor1rG4scgVNBbBz21ohvC7iMpB9IIgvGsmy1FAoodZhZ5sa3EPF67Rcec76F1PXlQ==", + "version": "3.5.4", + "resolved": "https://registry.npmjs.org/react-native-reanimated/-/react-native-reanimated-3.5.4.tgz", + "integrity": "sha512-8we9LLDO1o4Oj9/DICeEJ2K1tjfqkJagqQUglxeUAkol/HcEJ6PGxIrpBcNryLqCDYEcu6FZWld/FzizBIw6bg==", "requires": { "@babel/plugin-transform-object-assign": "^7.16.7", "@babel/preset-typescript": "^7.16.7", - "invariant": "^2.2.4", - "lodash.isequal": "^4.5.0", - "setimmediate": "^1.0.5", - "string-hash-64": "^1.0.3" + "convert-source-map": "^2.0.0", + "invariant": "^2.2.4" + }, + "dependencies": { + "convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==" + } } }, "react-native-reanimated-carousel": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/react-native-reanimated-carousel/-/react-native-reanimated-carousel-3.4.0.tgz", - "integrity": "sha512-mbEeAMbX+mqOLf2bN55wnWQt/LMx5FFxVneV9XjLvJ69ySMN0yVc3r/lS9/nHx8MdmW2ZUfAsQ4C139Taq+GPQ==", + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/react-native-reanimated-carousel/-/react-native-reanimated-carousel-3.5.1.tgz", + "integrity": "sha512-9BBQV6JAYSQm2lV7MFtT4mzapXmW4IZO6s38gfiJL84Jg23ivGB1UykcNQauKgtHyhtW2NuZJzItb1s42lM+hA==", "requires": {} }, "react-native-redash": { @@ -42926,9 +42941,9 @@ } }, "react-native-vision-camera": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/react-native-vision-camera/-/react-native-vision-camera-3.4.1.tgz", - "integrity": "sha512-MOVmkNnQl40ROSDXd+RwF18lacJX8CsRZRcKnEJGZ3VtX4fAM1fd+C1I9PxIu7lWiyqDa6SU7EKu8NDb4Tu1VA==", + "version": "3.6.4", + "resolved": "https://registry.npmjs.org/react-native-vision-camera/-/react-native-vision-camera-3.6.4.tgz", + "integrity": "sha512-DDWb8aB5tE7sM7YuU5f31AuhJVDJS3amZoZMQgHWa8S9h0acp3hY3uyriKzXshj/asYu2UAo5QUUglwl7Mcd1Q==", "requires": {} }, "react-native-webview": { @@ -42948,10 +42963,12 @@ } }, "react-native-worklets-core": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/react-native-worklets-core/-/react-native-worklets-core-0.2.0.tgz", - "integrity": "sha512-gxpfl3KnoRmDtBBVs08K7Ru3xaOrBTGXKQtcjwDzgIcaiNhPfKiJdUz1AIa3SX+M2I/f/7fgWK2W9OFYae/AzA==", - "requires": {} + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/react-native-worklets-core/-/react-native-worklets-core-0.2.2.tgz", + "integrity": "sha512-VPAIWMvGHL6mTI9mR4x5wN/EybtnzyNT1zhYIimJQvLABvC8TUyCXcHQVu9Eo95BSYXx3E+ImF8VA+np1tCAQg==", + "requires": { + "string-hash-64": "^1.0.3" + } }, "react-refresh": { "version": "0.4.3", @@ -44757,8 +44774,8 @@ "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==" }, "vision-camera-plugin-inatvision": { - "version": "git+ssh://git@github.com/inaturalist/vision-camera-plugin-inatvision.git#b7a6d6aabb78630b72aa709455c24af40a1f6b08", - "from": "vision-camera-plugin-inatvision@github:inaturalist/vision-camera-plugin-inatvision#image-prediction-from-file", + "version": "git+ssh://git@github.com/inaturalist/vision-camera-plugin-inatvision.git#9ae0fb9d7a93cd966950292fe20dc19b172174a1", + "from": "vision-camera-plugin-inatvision@github:inaturalist/vision-camera-plugin-inatvision#vision-v3.6", "requires": {} }, "vlq": { diff --git a/package.json b/package.json index 3205dc8d6..3a4ddf3d0 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "dependencies": { "@bam.tech/react-native-image-resizer": "^3.0.7", "@formidable-webview/webshell": "^2.6.0", - "@gorhom/bottom-sheet": "^4.4.7", + "@gorhom/bottom-sheet": "^4.5.1", "@react-native-async-storage/async-storage": "^1.19.5", "@react-native-camera-roll/camera-roll": "^5.9.0", "@react-native-clipboard/clipboard": "^1.11.2", @@ -45,7 +45,7 @@ "@react-native-community/netinfo": "^9.4.1", "@react-native-picker/picker": "^2.5.0", "@react-navigation/bottom-tabs": "^6.5.8", - "@react-navigation/drawer": "^6.6.3", + "@react-navigation/drawer": "^6.6.6", "@react-navigation/elements": "^1.3.17", "@react-navigation/native": "^6.1.7", "@react-navigation/native-stack": "^6.9.13", @@ -104,8 +104,8 @@ "react-native-paper": "^5.10.5", "react-native-permissions": "^3.10.0", "react-native-picker-select": "8.0.4", - "react-native-reanimated": "^2.17.0", - "react-native-reanimated-carousel": "^3.4.0", + "react-native-reanimated": "^3.5.4", + "react-native-reanimated-carousel": "^3.5.1", "react-native-render-html": "^6.3.4", "react-native-safe-area-context": "^4.7.4", "react-native-screens": "^3.21.1", @@ -115,14 +115,14 @@ "react-native-svg-transformer": "^1.1.0", "react-native-uuid": "^2.0.1", "react-native-vector-icons": "^9.1.0", - "react-native-vision-camera": "3.4.1", + "react-native-vision-camera": "3.6.4", "react-native-webview": "^11.26.1", - "react-native-worklets-core": "^0.2.0", + "react-native-worklets-core": "^0.2.2", "realm": "^12.3.0", "reassure": "^0.10.1", "sanitize-html": "^2.11.0", "use-debounce": "^9.0.4", - "vision-camera-plugin-inatvision": "github:inaturalist/vision-camera-plugin-inatvision#image-prediction-from-file", + "vision-camera-plugin-inatvision": "github:inaturalist/vision-camera-plugin-inatvision#vision-v3.6", "zustand": "^4.4.7" }, "devDependencies": { diff --git a/patches/react-native-vision-camera+3.4.1.patch b/patches/react-native-vision-camera+3.4.1.patch deleted file mode 100644 index 76b707a6e..000000000 --- a/patches/react-native-vision-camera+3.4.1.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/core/VideoPipeline.kt b/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/core/VideoPipeline.kt -index af34761..313ca94 100644 ---- a/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/core/VideoPipeline.kt -+++ b/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/core/VideoPipeline.kt -@@ -70,6 +70,9 @@ class VideoPipeline( - private var imageReader: ImageReader? = null - private var imageWriter: ImageWriter? = null - -+ private val hasOutputs: Boolean -+ get() = recordingSession != null -+ - init { - Log.i( - TAG, -@@ -104,7 +107,10 @@ class VideoPipeline( - frame.incrementRefCount() - frameProcessor?.call(frame) - -- imageWriter!!.queueInputImage(image) -+ if (hasOutputs) { -+ // If we have outputs (e.g. a RecordingSession), pass the frame along to the OpenGL pipeline -+ imageWriter!!.queueInputImage(image) -+ } - - frame.decrementRefCount() - }, CameraQueues.videoQueue.handler) diff --git a/patches/react-native-worklets-core+0.2.2.patch b/patches/react-native-worklets-core+0.2.2.patch new file mode 100644 index 000000000..83a9dd6f0 --- /dev/null +++ b/patches/react-native-worklets-core+0.2.2.patch @@ -0,0 +1,26 @@ +diff --git a/node_modules/react-native-worklets-core/cpp/WKTJsiWorklet.h b/node_modules/react-native-worklets-core/cpp/WKTJsiWorklet.h +index 8e34955..ea82623 100644 +--- a/node_modules/react-native-worklets-core/cpp/WKTJsiWorklet.h ++++ b/node_modules/react-native-worklets-core/cpp/WKTJsiWorklet.h +@@ -274,14 +274,15 @@ private: + jsi::Value locationProp = initDataProp.asObject(runtime).getProperty( + runtime, PropNameWorkletInitDataLocation); + +- if (locationProp.isUndefined() || locationProp.isNull() || +- !locationProp.isString()) { +- return; ++ // Check location must be a string if it is defined ++ if (!locationProp.isUndefined() && !locationProp.isNull() && ++ locationProp.isString()) { ++ // Set location ++ _location = locationProp.asString(runtime).utf8(runtime); ++ } else { ++ _location = "(unknown)"; + } + +- // Set location +- _location = locationProp.asString(runtime).utf8(runtime); +- + // Let us try to install the function in the worklet context + _code = initDataProp.asObject(runtime) + .getProperty(runtime, PropNameWorkletInitDataCode) diff --git a/src/components/SharedComponents/Sheets/TextInputSheet.android.e2e-mock b/src/components/SharedComponents/Sheets/TextInputSheet.android.e2e-mock new file mode 100644 index 000000000..6b5e6ee68 --- /dev/null +++ b/src/components/SharedComponents/Sheets/TextInputSheet.android.e2e-mock @@ -0,0 +1,89 @@ +// @flow + +import { BottomSheetTextInput } from "@gorhom/bottom-sheet"; +import { Body3, BottomSheet, Button } from "components/SharedComponents"; +import { View } from "components/styledComponents"; +import type { Node } from "react"; +import React, { useRef, useState } from "react"; +import { Platform, StyleSheet } from "react-native"; +import { TextInput, useTheme } from "react-native-paper"; +import useTranslation from "sharedHooks/useTranslation"; +import colors from "styles/tailwindColors"; + +type Props = { + handleClose: Function, + confirm: Function, + initialInput?: ?string, + placeholder: string, + headerText: string, + snapPoints: Array, +}; + +const TextInputSheet = ( { + handleClose, + confirm, + initialInput = null, + placeholder, + headerText, + snapPoints +}: Props ): Node => { + const textInputRef = useRef(); + const theme = useTheme(); + const [input, setInput] = useState( initialInput ); + const { t } = useTranslation(); + + return ( + + + setInput( text )} + placeholder={placeholder} + testID="ObsEdit.notes" + // eslint-disable-next-line react-native/no-inline-styles + style={{ + height: 223, + fontFamily: `Whitney-Light${Platform.OS === "ios" + ? "" + : "-Pro"}`, + fontSize: 14, + lineHeight: 17, + color: theme.colors.primary, + borderRadius: 8, + borderColor: colors.lightGray, + borderWidth: 1, + padding: 15, + textAlignVertical: "top" + }} + autoFocus + defaultValue={input} + /> + { + textInputRef?.current?.clear(); + }} + > + {t( "Clear" )} + +