Commit Graph

2590 Commits

Author SHA1 Message Date
Johannes Klein
2ba2d366bf Update to react-native-vector-icons 10.2.0 (#2913) 2025-05-20 09:51:03 +02:00
Johannes Klein
83eed85a74 Update react-native-safe-area-context-to >4.10.1 (#2911)
* Update react-native-safe-area-context-to >4.10.1

Version 4.10.1 adds support for react native 0.74.

* Re-establish mock after it was reset

I think the better way forward would be to restructure these tests, so that we don't need to resetAllMocks in between the two describe blocks, but I don't want to increase the scope of this PR.
2025-05-20 09:50:32 +02:00
Angie
c84fb17591 check for last screen while navigation back from suggestions (#2906) 2025-05-19 11:25:41 -07:00
budowski
f12c03bce3 MOB-692 - suggestions result crash fix (#2908) 2025-05-19 11:20:43 -07:00
budowski
d824fe55ff MOB-677 - clean up locale name when loading i18next module (#2909) 2025-05-19 11:08:42 -07:00
budowski
5b026288fa MOB-772 - reset password field - change label (#2910) 2025-05-19 10:40:46 -07:00
Amanda Bullington
47bbcbd18f Maintenance: break upload code into smaller modules -- API calls (#2900)
* Split apart observation & media uploaders & add unit tests

* Use typescript

* Return only media items needed

* Fix tests related to uploading vs. uploaded status

* Remove undefined from union for observationUUID

Above and below in the callstack of those functions the type is only string, so that change seems to be fine for me to make directly on your PR.

* Extract an Operation interface (#2904)

* Type updates

* Update mapped param types

---------

Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
2025-05-16 15:19:34 -07:00
Johannes Klein
f82eb56496 Use TS in two .tsx files that used flow types (#2905) 2025-05-16 22:42:47 +02:00
Ken-ichi
256cb8fad8 New Crowdin translations by GitHub Action (#2898)
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2025-05-16 11:45:57 -07:00
Angie
40da621f9b AI camera shutter button not tappable after first press (#2848)
* prevent multiple taps on ai camera button

* remove console log

* Add PressableWithDebounce component

* Add accessibilityState

* Change podfile lock to use same cocoapods as gemfile

* remove useeffect

* Change file extension

* Indentation

* Update type

* Extend PropsWithChildren

* Import type

* Add function param type

* use useFocusEffect instead of PressableWithDebounce in TakePhoto

* adding blur listener instead of using PressableWithDebounce

* Remove unused props

* Adapt to existing code style

* Move blur effect to CameraContainer (#2899)

* Move blur effect to CameraContainer

We can reuse the already existing `takingPhoto` state to disable the camera UI until the user navigates away.

* Also disable photo library on tablets

---------

Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
2025-05-16 10:04:04 -07:00
Johannes Klein
a20a22bad8 Hide "id with ai button" for no media or sound only (#2896)
* Add Boolean to control button being shown

Same Button component, only with changed indentation

* Apply margin between buttons to hide button instead

* Move left margin to container

Because ID button is now optional but container is not.

* Increase margin between buttons

Not part of the ticket, but it was not according to designs.

* Use existing state for the button

* Update integration test

* Update duplicate testID

* Add unit test for showing button behaviour based on photos
2025-05-16 15:30:06 +02:00
Johannes Klein
ed3f0e982c Migrate SuggestionsResult to TypeScript (#2901)
* Rename file

* Use PressableProps interface for PressableWithTracking

* Remove TODO

* Update handleLayout types

* Update allowed prop type

If SuggestionsResult can have ApiTaxon | RealmTaxon, we have to enable it in DisplayTaxonName as well, and rank_level can be undefined according to this union.

* Allow null

accessibleTaxonName uses currentUser directly from useCurrentUser which can be null.

* Use as to declare which type is used

* Source might be null
2025-05-16 14:57:25 +02:00
Johannes Klein
bb2c549625 Request fewer update fields from API (#2902)
* Only request the update fields we need

* Update type
2025-05-15 20:49:49 +02:00
Angie
cd6d6543f1 Add login button where logout button is on menu (#2891)
* Add login button in menu where the logout button is

* Update snapshots

* Changes to fit design
2025-05-14 10:00:04 -07:00
Johannes Klein
e01b4aa9bf v1.0.3+162 v1.0.3+162 2025-05-13 14:29:02 +02:00
Johannes Klein
551fc1d372 Update version to 1.0.3 2025-05-13 14:27:36 +02:00
Ken-ichi
a50d6d981d New Crowdin translations by GitHub Action (#2897)
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2025-05-13 13:57:26 +02:00
Johannes Klein
041322cb59 Add a case for one member to string (#2894) 2025-05-13 12:33:36 +02:00
Johannes Klein
85a7385b62 Migrate MatchHeader and imported components/functions to TypeScript (#2890)
* Rename file

* Migrate flow to TS

* Update type

* Update type

* Rename file

* Update useTranslation.ts

* Check if instanceof Error

* Update imports

* Update type

* Rename file

* Migrate translatedRank to TS

* Migrate DisplayTaxonName to TS

* Also accept number for taxonId

* Those types are currently not optional

* Revert "Migrate translatedRank to TS"

This reverts commit c69cc18061.

* Rename taxon.js

* Add interfaces and types

* Remove adding a key to the function param

* Move fetchTaxonAndSave back to original file

* Move interface

* Update import

* Update types

* Rename some variables for clarity

* This is how it currently props down from only HOC

* Update imports

* Rename file

* Add param interface

* Update imports

* Revert "Move fetchTaxonAndSave back to original file"

This reverts commit 981ce228e8.

* Move fetchTaxonAndSave to own file

* Type inference is easiest way for React components

* Rename file

* Remove unused props

* Add types

* Update type

* Infer return type

* Update import

* Add interface

* Rename const and interface

* Update import (Merge conflict)
2025-05-13 11:34:59 +02:00
Johannes Klein
3f959913ff On notifications change "FOLLOWING" header to be "OTHERS" (#2895)
* Update Notifications tab string

* String sorting
2025-05-12 22:17:43 +02:00
Johannes Klein
ed340bc717 Add context for ID-WITH-AI string (#2893) 2025-05-12 22:17:12 +02:00
Ken-ichi
b97d87ae74 New Crowdin translations by GitHub Action (#2885)
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2025-05-12 12:18:35 -07:00
budowski
9aa5fe46d1 MOB-708 - suggestions screen - show percentages instead of confidence dots (#2888)
* MOB-708 - suggestions screen - show percentages instead of confidence dots

* Code review fixes

* Remove confidencePercentage from condition

* Reuse existing string from Match screen header

---------

Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
2025-05-12 12:17:46 -07:00
budowski
4c20939c1a MOB-704 - declutter explore obs grid items (#2889)
* MOB-704 - declutter explore obs grid items

* Code review fixes
2025-05-12 12:17:32 -07:00
Amanda Bullington
f592993889 Maintenance: break upload code into smaller modules -- data transformation (#2884)
* Create module for realm syncing and write unit tests before refactoring

* Refactor realmSync functions for readability & make sure realm errors aren't silently swallowed

* unit tests

* Update tests to use factory functions for media

* Update tests to use factory

* Remove sanitize function since it's redundant with mapping; move mapping & add unit tests

---------

Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
2025-05-12 12:16:52 -07:00
Johannes Klein
d2e867cdee Remove log from script (#2892) 2025-05-09 19:03:13 +02:00
Johannes Klein
9b760c322c v1.0.2+161 v1.0.2+161 2025-04-30 15:10:38 +02:00
Johannes Klein
6b2f867641 Update version number to 1.0.2 2025-04-30 15:08:29 +02:00
Amanda Bullington
6413ddb57f Maintenance: break upload code into smaller modules -- error handling (#2876)
* Create module for realm syncing and write unit tests before refactoring

* Refactor realmSync functions for readability & make sure realm errors aren't silently swallowed

* Move error handling to its own module and add unit tests

---------

Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
2025-04-30 13:42:17 +02:00
Johannes Klein
ee4e45aa05 Add fastlane script to download app reviews (#2882)
* Add fastlane script to download app reviews

* Add spaces to parens

* Use double quotes

* Rubocop autocorrect
2025-04-30 12:46:25 +02:00
Amanda Bullington
a4f65a57de Maintenance: break upload code into smaller modules -- progress tracking (#2875)
* Create module for realm syncing and write unit tests before refactoring

* Refactor realmSync functions for readability & make sure realm errors aren't silently swallowed

* Break progress tracking out into module with unit tests
2025-04-30 12:29:30 +02:00
Johannes Klein
929652fe14 Add some context to 429 errors (#2861)
* Add context to announcements API calls handleError

* Add context to handleError for calls in comments

* Add context to handleError for calls in computerVision

* Add context to handleError for calls in flags

* Add context to handleError for calls in identifications

* Add context to handleError for calls in messages

* Add context to handleError for calls in observations

* Add context to handleError for calls in observationSounds

* Add context to handleError for calls in places

* Add context to handleError for calls in projects

* Add context to handleError for calls in qualityMetrics

* Add context to handleError for calls in relationships

* Add context to handleError for calls in taxa

* Add context to handleError for calls in translations

* Add context to handleError for calls in users

* Move creation of error context to the handleError function

Also spread any other context that was passed into this function in the new context.

* Move logger for 429 errors to the handleError function

There are two codepaths that an error of 429 can follow here. Errors thrown from reactQueryRetry have a .status field whereas errors thrown from inaturalistjs have a .response.status field (and not the other in both cases).
I don't want to update the handleError function for now but instead keep its codepaths the same, so I added logging for both paths.

* Remove nullish values (null or undefined) from context
2025-04-30 11:11:23 +02:00
Angie
8b47eb329c show obs status after upload only in list view advanced mode (#2881) 2025-04-29 12:45:51 -07:00
Johannes Klein
3cff7326ae Change calculation of successful upload status stats (#2869)
* Show upload status also if we have no status but an error

E.g. if all uploads fail.

* Change number of successful upploads

Now to use number of attempts made minus number of failed uploads.

* Add unit tests

* Refactor state of successful uploads into store
2025-04-29 12:05:44 -07:00
Johannes Klein
844629bbf4 Revert "Maintenance: break upload code into smaller modules -- realm syncing functions (#2872)"
This reverts commit 43f9520b86.
2025-04-29 16:53:25 +02:00
Amanda Bullington
43f9520b86 Maintenance: break upload code into smaller modules -- realm syncing functions (#2872) 2025-04-29 16:50:02 +02:00
Johannes Klein
d71ab7a358 Copy of: Maintenance: break upload code into smaller modules -- realm syncing functions (#2883)
* Create module for realm syncing and write unit tests before refactoring

* Refactor realmSync functions for readability & make sure realm errors aren't silently swallowed

---------

Co-authored-by: Amanda Bullington <albullington@gmail.com>
2025-04-29 16:48:50 +02:00
Ken-ichi
54b9b64a0e New Crowdin translations by GitHub Action (#2874)
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2025-04-29 16:29:27 +02:00
Angie
b064684c3d Center align help text on ai camera (#2873)
Center AI camera text
2025-04-29 16:01:48 +02:00
Amanda Bullington
b362071b1b Change default explore view to observations map view (#2871)
* Set default explore view to observations

* Rearrange ObservationsViewBar buttons to always show grid first and map first in Explore

* Set initialRegion of Explore map to same zoom level as location picker, using delta

* Consolidate map code into MapView with ref forwarding to allow animation & initialRegion set

* Stop controlling the map region from zustand, since we're using initialRegion

* Make sure we're not double animating when navigating to a new place

* Use ref to only get map boundaries exactly when they're needed, instead of tracking in state

* Make sure current location button does the same as NEARBY button

* Update Explore integration tests to reflect observations view as first view

* Fix navigation Explore tests to reflect landing on observations view

* Update MapView unit tests

* Check location permissions in MapView on current location button

* Code cleanup

* Fix tests and add test for location permissions

* To Mob 720: add some types and null guards (#2878)

* Update Map with Region type

* Type initialRegion

* Guard against null

* Guard against undefined coordinates

* Center loading indicator but not fill space (#2880)

Move the loading indicator to the center of the parent (and back left and top for half its size).

---------

Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
2025-04-28 11:53:47 -07:00
Amanda Bullington
6e87dafae4 Limit 429 errors in Explore taxa search (#2867)
* Prevent lots of extra renders from useTaxonSearch; prevent TaxonResult from refetching remote taxon

* Add debounce to SearchBar to prevent unnecessary API calls

* Reset local value when clearing search
2025-04-24 07:00:24 -07:00
Amanda Bullington
5d01431578 Prevent multiple taps on all Button components (#2844)
* Change text on Match loading screen (#2838) (#2841)

* Change copy for Match header & omit check for already seen species (#2837) (#2840)

* Fix: prevent multiple taps on Buttons like Suggest Id (#2833)

* Add debounce to Button to make sure users can't double tap any buttons / navigate twice

* Fix tests by mocking the Button component with a quick debounce

* Remove useEffect
2025-04-24 07:00:08 -07:00
Johannes Klein
a3177c0868 Do not show loading state on Android (#2870) 2025-04-24 10:57:45 +02:00
Ken-ichi
95322bef56 New Crowdin translations by GitHub Action (#2857)
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2025-04-23 14:11:52 -07:00
budowski
af6ac3694a MOB703 - changes to obs edit screen identification section (#2865)
* MOB703 - changes to obs edit screen identification section

* Adjust size of magnifying glass icon

---------

Co-authored-by: Amanda Bullington <albullington@gmail.com>
2025-04-22 10:03:51 -07:00
Angie
6a61c3340d Decrease TaxonDetailHeader size to match ObsDetails header size (#2863)
* Decrease TaxonDetailHeader size to match ObsDetails header size

* Adjust taxondetails header to match obsdetails header
2025-04-22 09:57:12 -07:00
Johannes Klein
b7cf9d5a61 Fix: hrank/lrank 422 api error (#2860)
* Remove unsupported taxonomic rank

* Explicitly set state back to null

* Replace "NONE" with "ALL"

This also closes MOB-642

* Revert "Replace "NONE" with "ALL""

This reverts commit cf819acfc3.
2025-04-22 10:43:04 +02:00
budowski
121755c00e MOB705 - taxon details screen - change explore icon (#2866) 2025-04-21 10:39:57 -07:00
Johannes Klein
cec7caac46 Bundle update fastlane 2025-04-18 12:24:30 +02:00
Johannes Klein
86f75bea2b v1.0.1+160 v1.0.1+160 2025-04-18 11:54:55 +02:00