Commit Graph

445 Commits

Author SHA1 Message Date
Johannes Klein
081cc6e3f8 1689 signout designs (#1698)
* Add and remove strings

* Drawer TS

* INatIcon TS

* Fix import

* INatIcon TS

* ActivityIndicator TS

* Button TS

* Optional param

* Add ViewStyle prop back in

* WarningSheet TS

* Add string

* Update Logout.js

* Add types

* Change log out label to not navigate but set state

* Imports

* Show warning sheet on log out press

* Actually sign out user from warning sheet

* Remove sign out fct from Logout screen

* Change logger context

* Remove Logout

* Use Heading4 instead of local style

* Use Icon instead of Button

* Pixel pushing

* Prop testID down

* Remove unused login state

* Login TS

* Update type
2024-06-21 09:12:25 +02:00
Johannes Klein
4793b716ff 1520 explore offline notice (#1697)
* OfflineNotice TS

* Show OfflineNotice on Explore
2024-06-20 16:06:48 +02:00
Johannes Klein
68f026d76c Changes to email confirmation screen. (#1695)
* Add bottom padding to Login text

* Body2 TS

* Checkbox TS

* Add bottom padding

* Add transparent mode to Checkbox

* Use transparent Checkbox in License form

* Update string

* Bit more padding

* Update SignUpConfirmation.js

* Navigate to home screen for text

* Error TS

* Authenticate user immediately after registration

* Update List2.tsx

* Update Checkbox.test.js.snap

* If authentication fails after reigstration only log an error but proceed

* Add loading state to register button
2024-06-20 12:15:05 +02:00
Amanda Bullington
771e5c810b Changes to syncing process (#1670)
* Refactor syncing code and add preUploadProgress checks

* Progress on sync button functionality

* Fix deletions progress and toolbar test

* Time out deletion complete if no uploads

* Delete and then upload from sync button

* Test cleanup

* try to fix tests

* Improvements to automatic and button sync logging

* Code cleanup

* Renaming and rewriting sync functionality

* Restore MyObs test

* Add tests for useSyncObservations

* Code cleanup

* Use unique realm instance in useSyncObservations test

* Fixes for e2e crash

* Fix deletions, tests, and deletion errors

* Show and clear deletions on toolbar

* Sleep longer before resetting toolbar

* Remove sleep to pass e2e test
2024-06-18 19:04:28 -07:00
Amanda Bullington
76824636ef Human treatment in suggestions (#1693)
* Fix human suggestions

* Fix human test

* Fix tests
2024-06-18 12:39:59 -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
6d553daa0b Made status text in Toolbar clickable to start upload (#1678)
Also refactored layout code to be a bit more rational and added Toolbar to the
UI library to help visualize its many states.

Closes #1453
2024-06-13 18:36:24 -07:00
Ken-ichi Ueda
15029631f3 Removed redundant cleanup, hopefully deflakeing tests a bit 2024-06-13 10:43:46 -07: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
Ken-ichi Ueda
4f01c08ca8 Upload fixes
* Rename numObservationsInQueue to initialNumObservationsInQueue for clarity
* Change upload timeout to 5 minutes (from 15 seconds)
* Mint a new abortController at the beginning of an upload queue, not for each
  observation
2024-06-07 12:57:18 -07:00
Ken-ichi
4f46cf5dfd Explore nearby and map area (#1655)
* Bugfix: map area search was broken after Nearby filter set
* Made EXPLORE_ACTION.SET_MAP_BOUNDARIES remove lat, lng, and radius
  attributes so we don't end up applying both kinds of geographic filters at
  the same time
* Renamed setExploreLocation to defaultExploreLocation because it doesn't set
  anything
* Added a unit test fot the Explore reducer
* Bugfix: zoom Explore to nearby after granting permission
2024-06-05 17:10:49 -07:00
Ken-ichi
5c6e88cbc1 Typescrpt path aliases (#1648)
* Typescrpt path aliases;
* Tried to resolve all ts errors in one file
2024-06-05 14:35:49 -07:00
Amanda Bullington
3b35e072b1 Default to first photo in Suggestions (#1649)
* Default to first photo in Suggestions; closes

* Fix tests for default selection on Suggestions
2024-06-05 12:12:14 -07:00
Ken-ichi
8dbbca04d9 Fail upload when network request failed (#1651)
* Fixed cancel upload button
* Uploads will timeout after 15s
* Moved MyObs tests unrelated to unsynced into the synced block
2024-06-04 18:23:59 -07:00
Amanda Bullington
806f786b2f Limit suggestions displayed when human suggestion is in suggestions list (#1650)
* Filter suggestions when human is a result; closes #1505

* Fix tests
2024-06-04 16:30:01 -07:00
Amanda Bullington
829fa70f34 Make explore view sticky; default to species view (#1647)
* Remove tab bar when sharing photos into app; closes #1645

* Make explore view sticky with species as default view; closes #1614

* Fix Explore integration test; use default species view
2024-06-04 15:07:15 -07:00
Amanda Bullington
a91d7e8226 Hide DQA voting if no current user (#1640)
* Hide DQA voting if no current user; closes

* Fix DQA tests
2024-06-03 17:47:10 -07:00
Amanda Bullington
36240dafa2 Fix reposition evidence through drag and drop (#1632) 2024-06-03 14:10:47 -07:00
Amanda Bullington
7e228e8223 Fully delete observation photos from media viewer (#1624)
* 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

* Delete photos from observation; allow upload once photos deleted; closes #1575

* Only pass photo uri into evidence list; fix test

* Fix merge
2024-05-30 22:05:07 -07:00
Amanda Bullington
aa167c669d Refactor upload functionality into hook/zustand (#1606)
* 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>
2024-05-30 20:36:50 -07:00
Ken-ichi Ueda
1aed88b9f9 Several attempts at error handling
* 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
2024-05-29 17:32:43 -07:00
Ken-ichi Ueda
b7a6693125 Minor logging cleanup
* Log the actual message we intended for JSON parsing errors
* Always use the configured tile URL instead of hard-coding it
* Use tiles.inaturalist.org whenever possible
2024-05-28 12:15:57 -07:00
Ken-ichi Ueda
0e6d5d3d1f Test fix: integration tests with unique realms must pass that realm to signIn 2024-05-25 23:00:02 -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
2d74c72e37 Fetch remotely deleted observations automatically (#1602)
* Start automatically syncing remotely deleted observations

* Fix query invalidation in ObsDetails

* Fix deletion process

* Call deletions once every time a user lands on MyObs

* Fix deletion tests

* Fix tests
2024-05-22 20:34:57 -07:00
Ken-ichi
84c3b3c96d Track number of failed uploads (#1601) 2024-05-22 17:40:06 -07:00
budowski
137f9f1b03 Display taxon name according to user settings (#1496)
* display taxon name according to user settings
* Cleaned up Taxonomy style a bit

---------

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2024-05-21 20:45:34 -07:00
Amanda Bullington
e17045ca45 Show correct view in Explore when tapping species count (#1587)
* Show correct view in Explore when tapping species count; closes #1573

* Fix test
2024-05-21 15:35:52 -07:00
Amanda Bullington
86054225d2 Grow pressable area in TaxonResult (#1557)
* Grow pressable area in TaxonResult; closes #1545

* Update snapshot
2024-05-15 14:06:39 -07:00
Ken-ichi
059c4ab8c4 Return to ObsEdit after taking additional photo (#1555)
* Renamed parseExif test
* Bugfix: could not import photo w/o exif from ObsEdit for new obs
* Ensure Camera screen is pushed onto stack from ObsEdit
2024-05-15 13:22:48 -07:00
Amanda Bullington
995d6b67a3 Open local observation to edit, not remote observation; closes #1509 (#1531) 2024-05-13 14:58:43 -07:00
Amanda Bullington
b12057cbc3 Clear synced photoUploads paths (#1527)
* Clear synced photoUploads paths

* Add mock for useQuery
2024-05-10 16:30:49 -07: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
Ken-ichi
0a1069fce9 Show notifications obs photos for remote obs (#1519)
---------

Co-authored-by: Angie Ta <angie@inaturalist.org>
2024-05-09 20:31:04 -07:00
Amanda Bullington
917f9da7be Clear cached photos for computervision/score_image (#1518)
* 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
2024-05-09 13:32:52 -07:00
Ken-ichi Ueda
8f0b5f654f Oh yeah tests 2024-05-08 17:11:25 -07:00
Amanda Bullington
e19221ddf0 Reduce app size (fonts and model/taxonomy assets) (#1513)
* Remove material community icons

* Remove unneeded font files from app

* Show app size in Debug on Android

* Update snapshots

* Code cleanup
2024-05-08 09:22:01 -07:00
Johannes Klein
ea6539e35a Vision camera v4.0.3 (#1515)
* Upgrade vision-camera, worklets and plugin

* Update Podfile.lock

* Update runAsync patch

* Update comment

* Update jest.setup.js
2024-05-08 13:48:16 +02:00
budowski
1cc3b7300d Always use latest added photo on suggestions (#1421)
* Close #1309 - suggestions screen - always use latest added photo; AR camera - replace all existing photos
* #1421 - in case of backing out from suggestions screen, back to AI camera, delete previous obs photo

---------

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2024-05-06 18:04:13 -07:00
Ken-ichi
a7a2e1c10f Show up-to-date metadata for observations immediately after upload (#1497)
This fetches a remote copy of each observation after upload to make sure the
client has the freshest copy of the data immediately.
2024-05-06 17:50:46 -07:00
Ken-ichi Ueda
9bd856f636 Bugfix: photos were not appearing on ObsEdit from ObsDetails 2024-05-03 21:35:46 -07:00
Amanda Bullington
146e00bb5f Keep previous explore view when changing filters (#1469)
* Keep previous explore view when changing filters; closes #1454

* Fix test; navigating back to Explore will navigate to previous explore view
2024-04-25 15:45:29 -07:00
Amanda Bullington
1484bc7749 Display saved photos after app updates (#1468)
* Correctly access local photos in ObsList/MediaViewer after app updates; closes #1420

* Use displayLargePhoto method in masonry layout

* Map bug fix; snapshot fix
2024-04-25 14:52:52 -07:00
Amanda Bullington
2b1bcd9363 Enable multi-camera (#1461)
* Use multi-cam; closes #1458

* Typescript conversion
2024-04-23 14:26:57 -07:00
Angie
f10b25fecc 1198 photos on taxondetails should be swipable (#1432)
* TaxonDetails carousel

* Fix tests, disable taxondetails accessibility test because of photo carousel

* spacing change

* Fix failing tests
2024-04-23 09:59:13 -07:00
Johannes Klein
05b6309307 Vision camera 4.0.1 (#1437)
* 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.
2024-04-23 14:27:27 +02:00
budowski
44c12e1af9 Adding ID for photo-less obs goes directly to TaxonSearch (#1422)
* Closes #1186 - in case of photo-less observations, adding an ID will go directly to taxon search
2024-04-22 16:38:33 -07:00
Johannes Klein
84d506f184 Mock format 2024-04-22 13:36:04 +02:00
Amanda Bullington
21b9cc6a97 Update Eslint to support TypeScript (#1419)
* 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
2024-04-18 21:35:26 -07:00