Commit Graph

4199 Commits

Author SHA1 Message Date
Amanda Bullington
35f87cce43 Update title for unsynced observations, ObsEdit (#965)
* Show edit title; add tests; set current obs before nav to ObsEdit screen

* Use edit title when obs is not synced; rewrite ObsEdit tests to show nav works correctly with useStore

* Remove uuid in params to ObsEdit; no longer needed

* Fix e2e by ensuring ObsEdit doesn't rerender with deleted obs
2023-12-14 11:46:46 -08:00
Amanda Bullington
5c98d6665c Checkbox shared component (#963)
* Create shared checkbox component

* Add tests to Checkbox component

* Add snapshot and fix space in fill color
2023-12-14 10:01:48 -08:00
Amanda Bullington
04af1720d1 Show save button when user logged out; add BottomButtons tests (#964) 2023-12-13 15:48:47 -08:00
Johannes Klein
83cebe1d9c Refactor BottomSheet to always use dynamic snap points (#960)
* Refactor BottomSheet to always use dynamic snap points

For all usages in the app of the BottomSheet component, or components derived from it. This removes the possibility to specify snapPoints as a prop.
In other words, all instances of bottom sheet will scale, depending on the content to display.
This necessitated some changes in paddings at the bottom of existing bottom sheets.

* Add check if snapPoints are passed in and throw Error

* Fix max line length
2023-12-13 21:06:35 +01:00
Ken-ichi Ueda
0ec3f02d42 Test fix
It's not clear to me why this fixes the TaxonSearch test, which seems to fail
even when you mock those API responses with empty data.
2023-12-13 11:16:34 -08:00
Amanda Bullington
f32a8812f5 Offline suggestions (#961)
* Use offline model for displaying sugggestions

* Simplify Suggestions/TaxonSearch screens using hooks

* Use updateObsKeys function from useStore

* Simplify code and fix unit tests

* Fix tests for offline predictions

* Fix faker urls

* Fetch remote taxa to display taxon photos in Suggestions

* Fix useTaxon code and test

* Use online vision results as backup for offline results

* Fix tests and add test for online predictions

* Use Flatlist for Suggestions and fix tests

* Move API call out of Attribution and fix test

* Fix tests

* Fix test warnings
2023-12-13 10:11:21 -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
42ab5eafc5 Use scrollTo to make sure comment and edit button are visible in e2e tests (#959) 2023-12-07 14:25:30 -08:00
Amanda Bullington
bded964b0a Add vision property to AR camera & suggestions for observation/id creation (#952)
* Add vision param to identification create; test vision false on TaxonSearch and true elsewhere

* Test that vision attribute is only used from Suggestions screen

* Add owners_identification_from_vision attribute to observations

* Fixes for vision attribute

* Make sure taxon is applied from Suggestions/TaxonSearch via ObsEdit

* Fix for ids vision

* Fix Suggestions tests
2023-12-07 11:07:47 -08:00
Ken-ichi
f678e97919 Basaic Android adaptive icon (#956)
Since it's a vector and includes a monochrome variant, this can be styled
based on the user's theme and should look good with a variety of OEM masks.
2023-12-07 10:27:01 -08:00
Ken-ichi
171eab91fe White bird on green splash screen (#957) 2023-12-07 09:38:44 -08:00
Johannes Klein
5e213a71ed Return parameter unchanged if falsy (#958) 2023-12-07 14:00:35 +01:00
Angie
485b36055b Merge pull request #954 from inaturalist/883-obs-detail-screen-observation-without-media
Observation no media restyle
2023-12-05 21:54:48 -08:00
Angie Ta
c35c2fa25e Observation no media restyle 2023-12-05 21:19:16 -08:00
Angie
478e488e7d Merge pull request #951 from inaturalist/905-upload-success-notice-never-goes-away-from-upload-now
905 upload success notice never goes away from upload now
2023-12-05 17:35:42 -08:00
Johannes Klein
a59d9f567f Image recognition from local image (#953)
* Use different plugin branch

* Predict taxa for local image url in suggestions screen

WIP: This is working on iOS. On Android there is a crash. The pexample app in the plugin repository works on Android, so I assume the crash is happening because of some things here. Maybe the wrong url is passed in.
Anyway, I am only adding prediction for the local image and haven't wired up the results to state or UI.

* Use latest plugin commit

* Refactor cv model version to be imported from helper

* Refactor image prediction function call into helper module

* Mock for new vision plugin function
2023-12-06 00:38:42 +01:00
Ken-ichi Ueda
75119ef7ba More workarounds for invalidated Realm objects
I'm no wiser about why these started happening recently. These are basically
hacks.
2023-12-05 14:32:15 -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 Ueda
2fe2c46543 v0.18.1+66 v0.18.1+66 2023-12-04 19:50:05 -08:00
Ken-ichi Ueda
f311e4622b v0.18.1 2023-12-04 19:49:14 -08:00
Angie Ta
f01f6eabcf Change conditional statement 2023-12-04 18:48:46 -08:00
Ken-ichi Ueda
c6b0d62aea Bugfix: another ActivityHeader issue w/ stale react data
Also removed some redundant retry handling in useInfiniteObservationsScroll in
an attempt at better logging, particularly while offline.
2023-12-04 17:39:51 -08:00
Angie Ta
4996886a22 Fix changes to multi upload 2023-12-04 16:52:53 -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
Ken-ichi Ueda
e1ed1a1284 Updated interal release protocol 2023-12-04 12:35:35 -08:00
Ken-ichi Ueda
abede8ebdd v0.18.0+65 v0.18.0+65 2023-12-01 16:23:36 -08:00
Ken-ichi Ueda
452c991c1b v0.18.0 2023-12-01 16:22:45 -08:00
Angie Ta
a8979a882d Merge branch 'main' into 905-upload-success-notice-never-goes-away-from-upload-now 2023-11-30 18:58:05 -08:00
Angie Ta
2a7c9faf11 MyObservations reset upload state sync button and upload complete in single observation flow 2023-11-30 18:05:05 -08:00
Johannes Klein
66a0eda08d Dark mode styling button changes (#938)
* Add dark mode button snapshot tests

* Refactor dark mode styles to be a single function call

* Remove neutral button dark mode styling
2023-11-30 23:03:40 +01:00
Ken-ichi
13f3b21bc0 Bugfix: handle blank LocalPreferences.last_sync_time on first sync (closes #935) (#936) 2023-11-30 11:42:09 -08:00
Ken-ichi Ueda
de3e73cb88 Ensure upload errors get shown to the user
This changes the default behavior for API errors such that they get thrown by
default, forcing code closer to the user to handle them. While we were set up
to catch errors in the upload process, we were supressing them so they
weren't bubbling up to that level. No more!

This also adds some additional handling for the occasionally zany shape of our
API error responses.
2023-11-29 22:46:32 -08:00
Ken-ichi
21c7dd9bd7 Fix for failing e2e tests when UTC is tomorrow relative to PST (#937) 2023-11-29 22:32:27 -08:00
budowski
9642b6441e #861 - correctly identify if observation was synced, when deleting it (#922) 2023-11-29 17:44:08 -08:00
Amanda Bullington
ebcbcbe3c6 Add loading wheels to infinite scrolls; fix Species view; add tests; closes #888 (#934) 2023-11-29 15:46:28 -08:00
Amanda Bullington
3d3074077d Restyle unknown text; closes #881 2023-11-29 15:45:32 -08:00
Ken-ichi
105096412b Fix broken offline coord fetch by only reverse geocoding in one place (#932)
Fixes #907. Also adds an ObsEditOffline test for adding a new obs offline...
which doesn't actually catch this bug, but may catch others. This bug may
have been due to a race condition that doesn't happen in the test env for
some reason.
2023-11-29 10:57:53 -08:00
budowski
af3812f31b Support for adding ID for someone else's observation
Prevents adding an ID from suggestions from returning you to ObsEdit like it does in the new obs flow. Closes #851

---------

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2023-11-29 10:57:16 -08:00
Johannes Klein
a335955645 Update Podfile.lock 2023-11-29 17:53:58 +01:00
Johannes Klein
72623bf5a6 Update vision-camera patch version
This uses a new fork that uses an updated version of react-native-vision-camera v2.15.6. The biggest change in between these updates is the usage of stable Android CameraX libraries and no longer beta versions.
2023-11-29 17:53:16 +01:00
Johannes Klein
2c71fb223d Also rotate zoom button with different device orientations 2023-11-29 09:31:39 +01:00
Ken-ichi
cb6ce8b9ca Altered e2e test to wait for the correct comments count to be visible (#911) 2023-11-28 17:02:21 -08:00
Angie
019a27b2ec Merge pull request #928 from inaturalist/852-observations-show-upload-button-and-incorrect-no-photos-icon-on-explore
852 observations show upload button and incorrect no photos icon on explore
2023-11-28 16:21:57 -08:00
Amanda Bullington
74f4238079 Increase pressable area of back button, Obs Edit (#931)
* Use custom header instead of react nav set options; expand back button padding; closes #907

* Wrap ObsEdit in SafeAreaView
2023-11-28 15:51:09 -08:00
Johannes Klein
6189d1fe89 850 location picker zoom (#929)
* Rename state

* Zoom into map according to accuracy of geolocation

* Function to calc latitude delta

* Remove no longer needed region from useEffect

* Fix wrong commit
2023-11-28 17:42:59 +01:00
Angie Ta
ad60db9e62 Merge branch 'main' into 852-observations-show-upload-button-and-incorrect-no-photos-icon-on-explore 2023-11-27 19:46:00 -08:00
Amanda Bullington
a401854475 Sync deleted observations from server (#924)
* Realm updates for cascading deletions

* Delete local observations from remote list

* Add tests for deleting local obs which were deelted on server

* Fix: don't create embedded objects explicitly
2023-11-27 15:07:23 -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
Ken-ichi Ueda
4357995e20 v0.17.1+64 v0.17.1+64 2023-11-22 10:17:35 -08:00
Ken-ichi Ueda
f6454e78d0 v0.17.1 2023-11-22 10:14:27 -08:00