Commit Graph

13 Commits

Author SHA1 Message Date
Amanda Bullington
f4dae74fe8 Animate AddObsModal with fade in/out; closes #2350 (#2372) 2024-11-06 15:26:03 -08:00
Johannes Klein
5c8e3be12c test AI camera in e2e (#2188)
* Add a cameraZoomRange default
* Small detox version bump
* Add a mocked camera with a take photo button
* An e2e mock for the computer vision plugin predicting a frame
* Mock taking a photo by loading the first photo from the CameraRoll

Closes #1981
2024-11-01 10:38:37 -07:00
budowski
a1792bb507 Dismissable add obs modal help (#2236)
Closing the add-obs help text, only closes the help text + never shows up again

Close #2039

---------

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2024-10-17 11:03:19 -07:00
Amanda Bullington
36ae3f6660 Navigate via help text in AddObsModal (#2096)
* Make add obs help text pressable; closes #2077

* Fix test

* Styling updates; closes #2077
2024-09-18 10:24:37 -07:00
Johannes Klein
345171f77c Replace AR with AI in strings and mentions 2024-04-15 11:12:19 +02:00
Johannes Klein
efd88802ed 1364 UI setting (#1384)
* Show settings menu item to all users

* Add strings

* Update strings.ftl

* Add a logged out section to Settings

* Refactor logged in section

* Prop to use small label

* Restyle radio buttons

* Add react-native-mmkv

* Show logged in section only when logged in

* Add a boolean if user is advanced

* Hook for storage

* Change bottom tab button based on isAdvancedUser

* Add string

* Change supported AR camera version

* Refactor navigation out of AddObsModal

* Create new observation only on ObsEdit navigation inside Modal

* Reset store needs to happen before making new observation

* Merge conflicts removed some strings, put them back

* Remove comment

* Refactor AddObsModal test to unit test only

* Refactor navigation parts into integration test

* Add test case for advanced user

* Code style

* Add test case for advanced user to Tab bar

* Do not use a user object for snapshot tests, only the advanced user layout

* Use advanced user layout in navigation tests

* StandardCamera test with advanced user layout

* Add default value for boolean setting

* Remove default value as it is breaking immediate update of UI

* Refactor persisted layout value to be a part of zustand store

* Refactor persisted state into one bound store

* Explicit state for snapshot needed?

* Revert "Explicit state for snapshot needed?"

This reverts commit d448edc3dc.

* Remove snapshot test
2024-04-12 16:47:10 +02: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
budowski
f5fbc3ce11 Return to original screen after canceling photo import
Closes #1051

---------

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2024-02-13 16:59:11 -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
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
Amanda Bullington
1a27ef68cb Upgrade to Realm 12 (#925)
* Update to realm 12

* Remove unused mocks to fix some tests

* Fix test by unmocking ObsEditProvider

* Fix more tests by removing mocks/changing when tests write to realm

* Remove mocks on ObsEdit component test and fix accessibility labels

* Fix hooks tests with realm

* Set test path for realm; finish fixing tests

* Small tweak

* Upgrade realm/react library

* Migrate schema
2023-11-22 13:01:59 -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
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