* Change connectivity url to ping inat; remove unnecessary useIsConnected hook; closes#1770
* Ensure inaturalist.org/ping is being pinged
* Fix e2e tests by using isConnected, not isInternetReachable
* Refactor to use watchPosition
* Update useWatchPosition with permissions/retry
* Replace useUserLocation with useWatchPosition and fix tests; return userLocation from watch position hook
* Only update observation keys when there's an observation
* Improve TypeScript definitions
* Revert TypeScript commit
* Revert "Only update observation keys when there's an observation"
This reverts commit a4cd17a513.
* Code cleanup: make useWatchPosition more modular
* Code cleanup; location permission in ObsEdit instead of subcomponent
* Use correct accuracy in Camera photos
* Camera fixes
* Fixes to watching position in ObsEdit
* Fix useWatchPosition tests
* Fix tests
* Make sure state updates when renavigating to OsEdit; test fixes
* Replace name in permission requests
* TakePhoto TS
* PermissionGate TS
* Type
* PermissionGateContainer TS
* Interface
* Types
* LocationGate TS
* Remove LocationPermissionGate from Camera
* Remove write only permission
* Type
* ObsPhotoSelectionList TS
* Code style
* Show the improve with location button
* Create useLocationPermission.tsx
* Use new hook on suggestions
* Doc comment
* Use new hook in camera view
* Add strings
* Refactor Explore main content
* Use permission hook on RootExplore
* Add no location permission component
* Rename function
* Prop request permissions and use with button
* Default to Nearby label
* Remove Node type
* Projects TS
* Use useLocationPermission hook in projects screen
* Add string
* Prop permission down
* Refactor list render
* Refactor tab id into enum
* Tab type
* On nearby tab if without permission show button to prompt
* Leftovers
* Remove location permission gate from ObsEdit
* Use location permission hook on evidence section
* SearchBar TS
* Do not autoFocus on search bar in location picker.
Closes#1743
* Update type
* LocationSearch TS
* Show location permission gate on location picker's mount
* Add location permission to CurrentLocationButton
* Remove unused props of Map
* Remove unused exports from useMapLocation
* Migration
* Revert "Show location permission gate on location picker's mount"
This reverts commit 30ff75698c53d54d0b14cd2bd629f7155b743bf8.
* Add callbacks to useLocationPermission hook
* Show location permission ask on Obs Edit
* Remove unused string
* Reset explore filters should set location always to worldwide
* Add helper function to show place text in Explore
* Remove unused state of filter modal
* Show place text in filters modal with helper
* Show location permission button only for Nearby explore state
* Add a placeMode state
* Do not send placeMode to API
* Also treat limited permission as yes
* useLocationPermission in ExploreLocationSearch
* Refactor to setting place mode
Instead of logic based on the translated text of the place_guess string that is stored in ExploreContext, we are switching to an enum state that signifies which mode to show on explore:
1.) Nearby: Filters explore results based on the user's location. This also has a state without location permission that does not query the API.
2.) Place: Filtering by a specific place (as retrieved by /places API).
3.) Worldwide: Retrieve worldwide results, i.e. not having a place filter set.
4.) Map area: Filtering explore results precisely to the map rectangle shown on the explore map.
* Remove import from test
* Remove export
* Use blocked title only for blocked permission asks
* Move gallery permission container to Tab navigator as are the others
* Add gallery save title
* Split location permission explanation into two
* Update strings.ftl
* Only nav to location picker if permission was not granted
* Check permission on app being foregrounded
* The location permission part is handled by useLocationPermission
* Do not store permission result in hook
* Use hasPermission from permissions hook
* Update fetchUserLocation.e2e-mock
* Move hook one higher
* Show user location if permission is given
* PermissionGate callbacks should use useCallback
* Add permission hook to map usage
* Fix test
* Update layout to be asserted
* Add location permission hook to Explore
* Remove console.log
* Few TS fixes
* Indentation
* Remove superficial check
* Update Podfile.lock
* Restore photo deletion
* Rename methods for accessing media files
* Added integration test for photo deletion
* Cleaned up some accessibility labels
Closes#1429
* (Re-)Fix bug where shared photo got deleted before it could be used
* Only run cleanup when MyObs has focus
* Only run cleanup once a minute
* Only delete files that are a day old or more
* UI changes to suggestions screen
* Update offline suggestions UI and allow refetch
* Allow user to search online suggestions with and without evidence location
* Add improve location button and refactor header
* Use loading screen correctly between location/ignore location
* Hide location permission button and code cleanup
* Fix test for suggestions changes
* Try to avoid stale coordinates when fetching from cameras by removing the location in state when the screen blurs... I think. This might not be working. The other approach I tried was to wrap the Camera in Mortal, but that led to test problems. Might be worth revisiting if this approach doesn't work
* Bugfix: shared photos w/o coords were fetching current location
* Restored relative path to get fetchUserLocation.e2e-mock working again
* 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
* 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
* Map realm observations to smaller objects for displaying in MyObservations
* Handle obs remotely deleted in upload UI and process; closes#1579
* Multiple modified and remotely deleted observations handled in upload process
* Revert to using full Realm objects in FlashList
* Refactor upload code into hook and zustand slice
* Create a single source of truth for toolbar and individual progress
* Fix unit tests
* Fix more tests
* Continue trying to simplify upload progress and status code
* Continued overhaul of upload code
* Fix exclamation point in Toolbar
* Fix total toolbar progress
* Fix tests
* Update snapshots
* Code cleanup
* Update MyObs test
* Fix most tests by not deleting realm
* Keep attempting to make toolbar text clear in subsequent tests
* Mock Zustand and reset state after all tests
In theory this should make testing with Zustand simpler. The real kicker is
that resetting state will fail if we're not careful about manually replacing
nested objects in Zustand state updates.
* Bugfix: removeAllFilesFromDirectory works with File objects, not raw paths
* Update status text when uploads canceled
* Only show red exclamation rotating icon after all uploads attempted
* Fix progress bar with zustand nested object
* Fix toolbar progress
---------
Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
* Catch 401 errors when we try to fetch remotely deleted obs for signed out
users
* Skip the check to see if a user is a friend on UserProfile when signed out
* Replace uses of RNFS.unlink() with a wrapper that ignores errors about files
not existing
* Tried to get safeRealmWrite to preserve error type before re-throwing
Uses an altered version of inaturalistjs to pass in an AbortController signal
that will be passed through to fetch requests and can be used to cancel those
requests.
Errors from this library with a message like "Protected data not available
yet" are the most-logged error from the app, even if the user doesn't see
them, so this will hopefully stop them from polluting our logs so much.
* 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
* Refactor image-resizer into helper function for easy logging
* Create a folder for computerVisionSuggestions
* Display iNat app directories in Debug
* Delete old images from computerVisionSuggestions/ when navigating away from Suggestions
* Fix online suggestions API call
* Fix tests
* Clear computer vision directory when landing on Suggestions screen
* Update camera and plugin packages
* Remove one patch
* Replace deprecated function
* Update runAsync patch
Removing this patch leads to non-functioning frame processors in release builds. Contrary to what the original issue's solution states.
* Add typescript parser and fix Flow errors in JS files
* Uninstall packages from react-native/eslint-config
* Fix all flow errors (or ignore them for unknowns
FYI, this also essentially outlaws variables in translation keys because a key
that is only used with interpolated strings will never appear as "used".
Also starts using a convention of adding info to i18n keys that do not relate
to the text after double dashes, e.g. `Unknown--taxon = Unknown` for a string
that is specifically meant to describe a missing taxon but only needs to have
the word "Unknown".
* Changed several accessibilityHints to 3rd person
* Made several accessibilityLabels shorter and more verb-oriented
* Removed many unused i18n keys
* Refactored variables in i18n keys
* Removed some unused code from the old Settings
* Navigate user to Suggestions after Camera; add location check to usePrepareStateForObsEdit function
* Test that Camera advances to Suggestions when checkmark tapped
* Use vision result as top suggestion on Suggestions screen
* Write AR nav test; filter vision result from all suggestions list
* Show LocationPermission on camera screen; navigate back from ObsEdit
* Updates to flow so user can back out of ObsEdit to cameras
* Fixes
* Add evidence to existing observation when backing out of ObsEdit flow
* Fix tests
* Add mocks for worklet functions
---------
Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
* 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>
* Try to catch and log errors during upload
* Wraps some upload async methods with try/catch to attempt to log some
potential bugs
* Adjusts upload param mappings
* Try to get upload status to more accurately reflect the upload state
* Consistent upload success messaging after single upload
* Only emit progress on finished upload
* Set one initial progress increment on upload start
* Comments
* Send only half step increment on evidence upload
Because this function gets called twice per evidence.
* Update comment
* Also calculate sounds as increments towards progress bar
* Wrong order
* Only emit progress on finished upload
* Set one initial progress increment on upload start
* Comments
* Send only half step increment on evidence upload
Because this function gets called twice per evidence.
* Update comment
* Also calculate sounds as increments towards progress bar
* Wrong order
* Remove the initial progress being set as totalProgressIncrement
* Show an initial toolbar progress even if no progress made yet
* Fix for completion of no media obs upload
* Add comment
* Wait to fetch until at least 10s after deletion finished
* Bottom sheet warning and immediate departure when landing on ObsDetails for
an obs that was deleted
* Use latest vision-plugin from feature branch
* Change model helper to TS
* Update prediction from image to the new return structure
* Rename variable
* Change ARCamera to new return structure
* Update all test that make use of predictions
* Update to use plugins main branch
* when importing photos, try to fill out EXIF data (location+date) from all photos, by order
* handle cases of adding photos to existing unsynced obs
Closes#1093