Commit Graph

59 Commits

Author SHA1 Message Date
Abbey Campbell
a7f262d9d6 add mock for worklets and update snapshots 2026-03-11 13:06:09 -07:00
Abbey Campbell
6aeb7ca87b update snapshots 2026-03-09 19:46:40 -07:00
Johannes Klein
ee59977501 Consolidate named and default export (#3387)
* Rely only on default export for savePhotosToPhotoLibrary

* Fix the same in useSuggestions

We already only use the default export.
2026-02-19 21:16:48 +01:00
Ryan Stelly
b78be9243d lint rule & autofix for "trailing comma" (#3299)
* (lint) MOB-1063 enforce trailing commas

* autofix trailing commas

* manually fix newly introduced maxlen violations

* add trailing comma convention to i18n build
2025-12-22 20:17:13 -06:00
Johannes Klein
9c90c2e45f Update react-native to 0.79 (#3051)
* Upgrade helper: package.json

* Upgrade helper: gems

* Upgrade helper: Android

* Update AppDelegate

* Fix error in compiling

* Update package-lock.json

* Update Podfile.lock

* Update package-lock.json

* Update Podfile.lock

* Remove no longer needed mock

* Comment out entire test and not only the expect call

* Most other unit tests use this render helper function that

wraps the component in the entire app.

* Mock react-native exports as esModule

* Update .flowconfig

* Update Gemfile

* Revert "Comment out entire test and not only the expect call"

This reverts commit 8785f81529.
2025-10-01 22:44:14 -05:00
Corey Farwell
a43446909c Remove the need to specify TypeScript file extensions in imports (#3094)
* Don't require TS extensions in imports

* Resolve all import extension errors

* Remove file extension from import paths used in mocks

* Remove .d of type definition file paths

* Remove .d of type definition file and import as type

---------

Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
2025-09-07 23:41:42 +02:00
Johannes Klein
b4516b7b25 Update react native to v0.78.x (#3043)
* Update package.json

* Update package.json

* Updates for native files with upgrade-helpers

* Update .flowconfig

* Update package-lock.json

* Update Podfile.lock

* Add react-dom types

* Update package-lock.json

* Wrong install

* Use types-react-codemod

* Update TaxonSearch.tsx

* Remove react-native-accessibility-engine dependency

This is currently not maintained and not compatible with RN 0.78

* Comment out accessibility tests

* Disable broken snapshot test

* Move broken test

* Move broken test

* Move broken test

* Remove duplicate file

* Move broken tests

* Move broken tests

* Move broken tests

* Move broken tests

* Move broken tests

* Move broken test

* Remove duplicate file

* Move broken tests
2025-08-09 13:47:46 +02:00
Johannes Klein
f2145dc86d Update react-native-reanimated (#2987)
* Update package.json

* Update package-lock.json

* Update Podfile.lock

* Reactivate snapshot tests

* Update Podfile.lock
2025-06-27 15:29:21 -07:00
budowski
836438cd1e MOB-752 - use FasterImageView for caching obs/taxon/project images (#2887) 2025-06-26 11:10:01 -07:00
Johannes Klein
b9b58bdfc4 Update react-native-reanimated to version 3.16.6 (#2957)
* Use updated version

Version 3.16.0 introduces support for RN 0.76. 3.16.7 introduces support vor RN 0.77 so I decided for 3.16.6 for now.

* Update package-lock.json

* Update Podfile.lock

* Update UploadStatus.test.js.snap

* Comment out snapshot tests

* Comment out snapshot tests
2025-06-16 10:56:52 -07:00
Amanda Bullington
7733ededfb Carousel, Permission, Match, Login, AI Camera copy edits (#2802)
* Text updates and AICamera icon update for onboarding carousel

* Update background image camera permission

* Update text for permission gates

* Update text match screen, login signup, and camera

* Fix AICamera test
2025-03-25 16:18:39 -07:00
Amanda Bullington
400f118ad9 Change terminology from gallery to photo library (#2663)
* Update user-facing terminology from gallery to photo library

* Update terminology for devs to make the user-facing change easier to remember

* Update snapshots
2025-02-13 17:11:28 -08:00
Amanda Bullington
20952ec7aa Add a loading wheel and freeze frame before awaiting logs in AICamera (#2632) 2025-01-22 18:47:07 -08:00
Amanda Bullington
970c686933 Camera refactor to potentially address lagginess (#2457)
* Add usePerformance load time to cameras and suggestions

* Declare when to hide delete photo mode without a useEffect

* Use StatusBar hidden component in CameraContainer, instead of useEffects

* Directly handle discards from bottom sheet instead of using useEffect

* Rewrite a whole bunch of camera code to be more declarative and less imperative

* Make sure permissions gate works as expected

* Code cleanup

* Consolidate focus/blur listeners in AICamera

* Fix timing issues in Suggestions tests

* Fix tests

* Ensure photos are still saving to gallery when write permission given & update saving photo state
2024-11-19 18:14:44 -08:00
Amanda Bullington
cf896a3a17 Toolbar upload status refreshes when user returns to MyObs (#1942)
* Write some failing navigation tests for MyObs navigation

* Add one more failing test to check for empty screen after all obs are deleted

* Update what happens on blur

* Changes to focus effect

* Revert "Changes to focus effect"

This reverts commit c779504cdf.

* Test: toolbar status reset when user leaves screen

* Unmock useFocusEffect in Jest; fix tests

* Minor nav mocking updates

* Fix import
2024-08-09 11:21:25 -07:00
Ken-ichi
899076e67a Only ask for permission to add photos from cameras (#1869)
* Patch camera roll to not ask for readwrite after addonly granted
* Only request add permission from cameras
2024-07-29 11:51:14 -07:00
Ken-ichi
61cbbc9ac1 Show all obs photos in StandardCamera preview (#1765)
* Show all obs photos in StandardCamera preview
* Clear camera Zustand state after saving photos as ObservationPhotos
* Load Photo URIs into Zustand state when entering the camera
* Rename rotatedOriginalCameraPhotos to cameraUris to match galleryUri and to
  save us all a few keystrokes
2024-07-03 17:25:24 -07:00
Ken-ichi Ueda
6788601751 Bugfix: first photo was not getting saved to gallery from StandardCamera 2024-06-14 10:44:15 -07:00
Johannes Klein
7c91bdf950 Obsedit add photo with StandardCamera, two fixes (#1677)
* Reorder hooks dependencies

* Return uri from take photo hook

* Keep state of photos added in this instance of the camera

* List2 TS

* INatIconButton TS

* Refactor useBackPress to show discard modal only if photos taken during this instance of the camera

* Remove newPhotoCount var

* TS refactors

* fetchUserLocation TS

* Increase timeout

* Fix error

* Hoist deletePhotoByUri

* Delete photos on discard

* Reorder code

* Set saving photo on checkmark press

Closes #1556

* Update snapshots

* Remove delete test

* Create StandardCamera.test.js

* Check if image is there before deletion

* Update react-native-share-menu+6.0.0.patch

* Update e2e_ios.yml

* Update some types
2024-06-14 14:04:24 +02:00
Ken-ichi
f3bcec2d2e Continuous location fetch in the cameras (#1673)
* Fetch location continuously in cameras until accuracy falls below threshold
* Unit test for useUserLocation
* Added untilAcc option to useUserLocation
* Bugfix: ObsEdit was not always fetching location for new camera photos

Closes #1340
2024-06-12 11:18:12 -07:00
Amanda Bullington
36240dafa2 Fix reposition evidence through drag and drop (#1632) 2024-06-03 14:10:47 -07:00
Johannes Klein
476dc7d560 1569 ai camera zoom (#1607)
* Add null check

* Update CameraWithDevice.tsx

* Refactor TS hook

* Reset zoom on navigation events
2024-05-24 12:33:00 +02:00
Amanda Bullington
e7c4fdbe5e Store original rotated photos temporarily during Camera -> ObsEdit flow (#1522)
* Check for CV directory

* Save original, rotated photos for processing; clear directory when user lands on MyObs

* Reset evidenceToAdd when user lands on StandardCamera

* Disable photo taking while loading so one photo doesn't overwrite another
2024-05-09 22:24:45 -07:00
Amanda Bullington
2b1bcd9363 Enable multi-camera (#1461)
* Use multi-cam; closes #1458

* Typescript conversion
2024-04-23 14:26:57 -07:00
Amanda Bullington
0833d2ddf0 Jest config updates; fixes for slower tests (#1401)
* Speed up ObsEdit test with jest-test-time

* Update jest config and standardize accessibility tests

* Add test:memory to package json
2024-04-17 10:07:29 -07:00
Johannes Klein
700990ba0b 1305 Remove predictions state on blur and focus (#1402)
* Remove predictions state on blur and focus

* Mock for plugin function

* Fix mock

* Update mock

* Rename ARCamera test files
2024-04-17 12:32:53 +02:00
Johannes Klein
a0e6284d54 AR camera rename files to AI camera (#1391)
* Rename ARCamera files to AICamera

* Update Podfile.lock
2024-04-15 12:02:39 +02:00
Johannes Klein
345171f77c Replace AR with AI in strings and mentions 2024-04-15 11:12:19 +02:00
Johannes Klein
d6afb4b386 Upgrade to RN 0.73 (#1339)
* Upgrade to RN 0.73 with upgrade helper

* Upgrade testing-library

* Comment announcements

* Comment out UserProfle test

* Mock function used to calculate masonry layout

* There should not be a modal here

* There is actually also no modal here

* Use View if SafeAreaView is undefined

* Replace fast image library that was failing tests because of not being maintained

* Clear mocks in useTaxon test

* Remove legacy deps from testing flow

* Snapshot update

* Revert "Snapshot update"

This reverts commit bca8b296df.

* Update package-lock.json

* Clean-start

* Update project.pbxproj

* Reenable test that failed before updating dependency

* Reenable test that failed because of dependencies

* Remove comment
2024-04-08 15:28:06 +02:00
Johannes Klein
0e0a6560ac Vision camera v3 (#1121)
* Bump vision-camera

* Refactor patch

* Move patched orientation into patch functions file

* Update react-native-vision-camera+3.4.1.patch

* Switch to MacOS 13 runner

Vision camera requires XCode 15 to compile.

* Add step to specify XCode 15

* Higher level of logging

* Increase test timeout

* Add comment

* Remove navigation to obs without evidence for signed out user

* Patch for location permission not working on iOS

* Increase setup timeout

* Increase some more timeouts

* Revert back to less logging in CI

* Does it have to do with timeouts?

* Trace log level

* Update README.md

* Disable Homebrew’s auto update and install cleanup

* Setup ruby step

* Install pods only if not cached

* Revert "Install pods only if not cached"

This reverts commit 42a2ea02f9.

* Run simulator in headless mode, record all logs

* Increase timeouts again

* Revert "Remove navigation to obs without evidence for signed out user"

This reverts commit 2b4718f5ce.

* Add boolean to run use effect only once

* Did merge wrong code

* There is one more permission gate when entering obs edit now

* Add permission gate dismissal to signed out user test

* Add comment, rename state

* Lower action timeout

* 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

* Update vision camera

* Bump vision camera

* Update vision camera patch version

* Remove superfluous patch

* Update vision camera

* Update vision-camera and plugin

* Use latest vision plugin = rebased v3

* Run npm clean-start

* No longer needed

* Duplicate prop

* Switch back to v3 code

* Upgrading Detox fixes issue with iOS tests failing

Because of previous lack of permissions.

* Update to latest detox version

* Npm i force

* Vision 3 e2e testing, (#1126)

* Remove jest detox config

* Revert e2e timeout increase

* Revert jest config timeout

* Use macos 14 runner which has XCode 15 per default

* Use latest bottom sheet

* Revert "Use latest bottom sheet"

This reverts commit c66cd09838.

* Adding comma back in

* Remove spaces

* Use latest vision-camera and plugin

* Use release version of vision-camera

* Remove force flag

* Update react-native-worklets-core

* Upgrade reanimated

* Update babel.config to allow nested worklets

* Run frame processor async

* Remove enableGpuBuffers flag

* Remove no longer needed comment

* Update comments about version

* Update vision-camera and plugin

* Code format

* Rename param

* Use latest-plugin

* Remove fps param from camera view

* Change confidenceThreshold to number

* API change for results structure

* Refactor fps to be checked inside hook

As of vision-camera 3.9.1 our camera feed is stuttering when calling the runAtTargetFps function inside the useFrameProcessor hook.
So, what I did here is to track the time and skip the frames that are received before the target fps is reached.

* Remove updates of non-camera related

* Update comment

* Code format

* Snapshot updates

* Revert changes to ios e2e

* Add a log for the average time it takes a frame to be processed

* Use release version of plugin

* Add a patch for runAsync to work in release builds

* Update react-native-worklets-core to 0.4.0

* Use latest plugin version

* Add a shift method to worklet arrays

* Use latest vision-plugin

This makes use of .shift() in worklet array and depends on the previous patch.

* Set result timestamp and show age of result in debug mode

* Fix an error with timestamp being undefined

* Remove log

* Use latest vision plugin

* Change result timestamp to pink

* Comment

---------

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2024-03-27 00:47:43 +01:00
Ken-ichi
6fdf3d2faf Taxon result updates (#1254)
* Only requests remote taxon if local is missing or hasn't been synced in a
  week
* Returns a localized version of the remote taxon immediately without waiting
  to get a newly-created record from realm
* Expands tests to use a unique realm, integrate more of our code, and check
  to ensure the API gets called
* Show indicator while loading taxon on ARCamera
* Show iconic taxon found in model results if we can't load a remote taxon
* Show iconic taxon as backdrop for ObsImage whenever possible
2024-03-05 16:54:42 -08:00
Ken-ichi Ueda
096af978f0 Test fixes
* updated snapshots
* move timezone setup to globalSetup
* renamed old global setup file to reflect what it actually does, which is
  setup i18next
2024-02-21 10:47:31 -08:00
Johannes Klein
45dfb12824 Snapshot test updates 2024-02-21 16:54:55 +01:00
Amanda Bullington
045ce6f789 Improve Jest performance (#1160)
* Use faker import with specific locale

* Add global beforeAll to initiate i18next
2024-02-16 16:17:00 -08:00
Amanda Bullington
9fd47453a1 Add Photo Permission Gate (#999)
* Add permission gate for adding photos

* Add permission gate for adding photos to library

* Show permission gate first time camera loads; allow navigation on future loads

* Show PermissionGate only when checkmark tapped

* Show permission gate when checkmark tapped

* Nav to obs edit when permission granted

* Fix ARCamera tests

* Update file names; remove unused files

* Rename method from usePrepareState hook
2024-01-09 11:18:10 -08:00
Ken-ichi
f7dc08a704 Suggestions fixes (#972)
* Bugfix: TaxonDetails was crashing if it received a null taxon
* Send lat and lng instead of latitude and longitude to the score_image
  endpoint
* Show offline suggestions when you are offline
* Show notice when viewing offline suggestions
* Moved code unique to useOnlineSuggestions into that file
* Ensure we use a medium size image to get suggestions when dealing with
  remote URLs
* More logging around React Query retries
* Use default retry logic for useAuthenticatedQuery
* Made a module-resolver shortcut for tests
* Move offline notice above top suggestion; hide when offlines exist but onlines do too
2023-12-15 19:58:12 -08:00
Ken-ichi
d3f1f8ed6e View photos in MediaViewer from ObsDetail (#962)
* Unit tests for MediaViewer
* Added editable prop to MediaViewer
* MediaViewer navigation test
* Made MediaViewer a modal
2023-12-13 09:33:06 -08:00
Amanda Bullington
808cbee452 Replace ObsEditProvider with zustand for global state management (#948)
* Add zustand to app

* Begin replacing ObsEditProvider with zustand for global state

* Use store and add tests

* Fix bugs

* Add test to check for deleted photos in StandardCamera

* Make sure evidence is only added to current observation; submit comment with ID on ObsDetail

* Fix ObsEditWithoutProvider tests

* Move store to where it's needed

* Fix tests

* Await evidence being added to obsPhotos from camera

* Add a note about slices to useStore
2023-12-05 14:10:00 -08:00
Ken-ichi
0c7c807b56 Realm & other bugfixes (#950)
* Updated faker; fixed bug w/ DisplayTaxonName trying to modify a Realm object
* Fixed crash going from ObsDetail to ObsEdit
* Fixed bug fetching observation dates (not clear how this didn't instantly crash_
* Bugfix: MyObs observation fetch was failing on taxa w/ float rank_level
2023-12-04 13:47:00 -08:00
Amanda Bullington
361ad1d1f5 Performance: simplify ObsEditProvider (#908)
* Simplify ObsEditProvider by moving functions into local state & calling reducer less frequently

* Fix delete all observations

* Fixes

* Move index selection to MediaViewer via params

* Access ObsEditContext on top level of ObsEdit and pass props

* Move context to top level screen components

* Fix tests

* Use waitFor to fix ObsDetails integration test

* Alphabetize props; remove realm check; refactor new Id method

---------

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2023-11-17 12:35:29 -08:00
Ken-ichi
3f83925774 Photos cant be deleted from camera preview (#910)
Separated PhotoCarousel view and delete into separate buttons

Fixes #837 by separating the two separate press interactions into two separate
buttons, which is probably also better for accessibility (screen reader can
read two separate labels for two separate actions). Also addresses a layout
bug in landscape on iPad.

Also *might* introduce a bug with orientation lock reverting when rotating
device while in delete mode. Only happens in Android, may not be new
2023-11-16 10:05:14 -08:00
Amanda Bullington
5913fb511e Energy usage / performance improvements (#844)
* Remove console statements in production build

* Move uploadReducer into separate file

* Create reducer for creating obs; combine reducers

* Fixes with createObsReducer

* Move album, passes test states out of global context

* Bug fixes for ObsEdit flow

* Create photo gallery container

* Set accessibility test todo for PhotoGallery

* Improve FlashList performance MyObs

* Prevent flicker on modal close

* Create less rerenders in MyObservations

* Memoize drawer items for less rerendering

* Memoize custom tab bar

* Remove unused libraries and update snapshot

* Fix and prune dependencies

* Add AddObsModal tests

* Fix e2e test android by making comment confirm button visible
2023-11-02 11:03:48 -07:00
Amanda Bullington
31b8ae161e Show taxon photo in AR camera (#842)
* Show taxon from realm in AR camera; closes #804

* Add tests for AR camera display

* Add AR camera test for photo display
2023-10-30 17:17:28 -07:00
Amanda Bullington
4942664432 Replace IconButton with INatIconButton (#749)
* Replace IconButton with INatIconButton

* Fix tests
2023-08-28 13:01:48 -07:00
Amanda Bullington
333ae489cd AR Camera UI (#705)
* Refactor camera buttons into their own components

* Standardize camera buttons & make TaxonResult a reusable component

* Fix button styling in tablet landscape; create confidence interval

* Create camera container with shared functionality for both cameras; fix tests

* Connect results & loading status from native predictions; standardize results on iOS/Android

* Fix Camera test by mocking CameraView and FrameProcessor components
2023-07-19 10:14:30 -07:00
Johannes Klein
5f81c49f85 ARCamera MVP: Basic screen with full screen camera and prediction labels (#684) 2023-07-15 07:53:18 +02:00
Amanda Bullington
9c6106f5d0 Refactor tests to use minimum viable test factories (#681)
* Make minimum viable RemoteComment

* Minimum vialbe RemoteIdentification

* Minimum viable remote project, place, and messages

* Create minimum viable records for all remote factories

* Remove factories for local device data

* Minimum viable local taxon, comment, id

* Minimum viable for local observation photo (photo has no primary key)

* Minimum viable LocalUser

* Minimum viable record for LocalObservation
2023-06-27 17:06:01 -07:00
Ken-ichi
00ae38ddda Standard camera photo delete (#615)
* Ensure layout of the PhotoCarousel photos doesn't change in delete mode
* Stop conflating screen-size layout differences with tablet layout differences
* Bugfix: deleting one photo in the StandardCamera removed all photos
* Animated rotation of rotatable elements on StandardCamera
* Ensure loading status shows while first photo is being taken
* Tried to remove some open handles and shore up some unhappy tests
2023-05-19 13:16:32 -07:00
Amanda Bullington
81be995ad4 Media Viewer with landscape UI (#608)
* Make MediaViewer a navigation screen; support changing landscape/portrait orientations

* Move device orientation into hook

* Minor fixes to styling

* Styling updates based on breakpoints
2023-05-15 13:04:40 -07:00
Johannes Klein
1439c40c6a Upgrading the app to react-native 0.71.7 (#592)
* Changes in the unproblematic files

* Remove manually linked react-native-config

* Updates to files because of upgrade

* RN 71 and dependencies packages

* Update snapshot tests

* RN 71.1

* Fix missing jest mock

* RN 71.7

* Missing mock

* Fix errors with apisauce and axios

* Remove react-native-codegen direct dependency

* Code style
2023-04-25 17:18:24 +02:00