Commit Graph

818 Commits

Author SHA1 Message Date
Johannes Klein
26ff426a3f Merge pull request #3647 from inaturalist/mob-1395-potential-disagreement-not-allowing-you-to-choose-first
PotentialDisagreementSheet not allowing you to choose first value
2026-05-26 19:56:39 +02:00
Johannes Klein
ea5e4bb20b MOB-1328: location permissions for ExploreV2 (#3623)
* MOB-1328: add NEEDS_PERMISSION place mode

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* MOB-1328: wire up location permissions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* MOB-1328: omit low value tests

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
2026-05-26 13:09:48 +02:00
Johannes Klein
fab478db7a Add some radio button sheet unit tests 2026-05-21 17:28:07 +02:00
Johannes Klein
372326dbb0 Update radio values mock as to current prop structure 2026-05-21 17:14:49 +02:00
Johannes Klein
f8c2e55007 Add fetchPlaceName mock (#3640)
* WIP: fetchPlaceName mock to workaround issue on Android phones without Play Services

* Update vision-camera.js

* Fixes an error while rendering this mock
2026-05-20 15:18:46 +02:00
Johannes Klein
4ccf8e6cae Fallback UI for hidden content (#3628)
* Do not filter out hidden comments and IDs when getting an obs from server

* Do not add a filtered set of comments and IDs to local obs

Searching for visibleComments and visibleIdentifications anyways gives 0 results outside this file.

* Move file

* Remove flow

* Type fcts

* Add a type to item

* More types

* Add field to RealmTaxon

* Type navigation as used in ObsDetails

* Update ActivityItem.tsx

* Migrate FloatingButtons to TS

* Change prop type

* Rename ActivityHeader

* Migrate ActivityHeaderKebabMenu to TS

* Type functions

* Add undefined as possibility from TextInputSheet callback

* Revert "Add undefined as possibility from TextInputSheet callback"

This reverts commit 95b5fef2b9.

* Revert "Type functions"

This reverts commit 6997f195ce.

* Revert "Rename ActivityHeader"

This reverts commit e384c1f5a5.

* Revert "Update ActivityItem.tsx"

This reverts commit c1dc151b9a.

* Revert "Add field to RealmTaxon"

This reverts commit 965af041c0.

* Revert "More types"

This reverts commit 73af10bfcd.

* Revert "Add a type to item"

This reverts commit 5e5bf0ebae.

* Revert "Type fcts"

This reverts commit 84cac53e33.

* Revert "Type navigation as used in ObsDetails"

This reverts commit 9febf9ea30.

* Revert "Remove flow"

This reverts commit dca054c212.

* Revert "Move file"

This reverts commit bf62c0db95.

* Add UI for a hidden comment/ID

* Rename export like file name

* Update ID category text in tests

* Ask for hidden status from API and persist in realm

* Show fallback UI for hidden photos in PhotoContainer

* Update strings.ftl

* Show fallback UI for hidden sounds in SoundContainer

* Change mock to remoteObservation

Previously, this test file was relying on a faulty remoteObservation. The passed in remoteObservation was {} and because of the now removed filter code in useRemoteObservation what was passes into the test was {comments:[], identifications:[]} which made this test pass without ever using the useLocalObervation mock.

* Add eye icon to photo

* Add eye icon to sound

* Add eye icon to comments/IDs
2026-05-20 00:47:34 +02:00
Johannes Klein
626b25314f Update existing android detox tests (#3632)
* Remove android specific launch and early return

* Remove no longer needed other launchApp command

* Update installData e2e mock

* Tap container to dismiss keyboard

* Add testID to login container

* Push a test image into the app's external files directory

* Mock camer takePhoto on Android

* Use a jpg that results in suggestions

* Update e2e camera mock to not use frameProcessor when not active

* Change vision camera mock to create a destination path with additional /

* To remove possibility for flakiness prescribe an emulator

* Add a geocoder wrapper file

* Revert "Add a geocoder wrapper file"

This reverts commit 6c7b6c61a5.
2026-05-19 20:35:38 +02:00
sepeterson
b8e0adf384 Merge branch 'main' into mob-1328-observations-location-permission-states 2026-05-14 15:14:14 -05:00
sepeterson
dc7fa949b1 MOB-1328: omit low value tests 2026-05-14 15:12:39 -05:00
sepeterson
7112547280 MOB-1328: add NEEDS_PERMISSION place mode
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-14 15:04:51 -05:00
Seth Peterson
1da2a8eb62 Merge pull request #3613 from inaturalist/mob-1396-multiple-taps-of-submitting-id-suggestion-create-multiple
MOB-1396: disable suggest id buttons while pending
2026-05-14 11:02:50 -05:00
Seth Peterson
a4e13cad9e Merge pull request #3616 from inaturalist/mob-1321-minimal-2
MOB-1321 minimal
2026-05-13 14:28:09 -05:00
Seth Peterson
ac2a560d10 Merge pull request #3585 from inaturalist/mob-1329-search-context-storage-observation-fetching
MOB-1329 ExploreV2 state and initial obs fetching
2026-05-13 10:59:28 -05:00
sepeterson
1e8dc771a0 Reapply "MOB-1321 minimal"
This reverts commit 24e1f1afb5.
2026-05-12 13:15:10 -05:00
Seth Peterson
24e1f1afb5 Revert "MOB-1321 minimal" 2026-05-12 12:54:23 -05:00
sepeterson
56db9a15bc MOB-1321: fix test mock 2026-05-11 18:23:16 -05:00
sepeterson
5e3f6b8f80 Merge branch 'main' into mob-1321-minimal 2026-05-11 17:02:43 -05:00
sepeterson
cdeaaef512 MOB-1396: first pass 2026-05-08 11:33:38 -05:00
sepeterson
58e0d7367c MOB-1321: unit tests 2026-05-08 10:38:28 -05:00
Johannes Klein
9cab2a4008 Fix: sounds getting deleted during upload (#3598)
* Rename for consistency with obs photos

* Refactor to be similar to obs photos

* Include Sound as type

* Revert "Include Sound as type"

This reverts commit 3db88ae031.

* Revert "Refactor to be similar to obs photos"

This reverts commit 8ed7454be0.

* Revert "Rename for consistency with obs photos"

This reverts commit 674b921bab.

* Git mv without changes

* Add types

* Type api sound param

* Type fields s const

* Type fields as const

* Type api param

* Type new param

* The only call site of this function passes in only defined strings

* Adapted from Photo check for local path before deleting

* Type fct params

* Refactor constructor to only have a uri as param

* Refactor Sound constructor to have string as param

* Update Sound.ts

* Remove unused param

* Type fct params

* Type realm

* Also collect unsyncedSounds

* Create operations for sound uploads based on Sound only

* Add Evidence type

* Change a sound upload operation to work with a RealmSound

* Update realmSync to also just pass through Sounds

* Use server ID for attaching obs_sound to obs

* Also split photo pipeline for clarity

This is not a functional change. Also previously, only RealmPhoto s are uploaded, only RealmObservationPhoto s are attached or modified. Same as for sounds now.

* Update realmSync.ts

* Remove log

* Update realmSync.test.js

* Update mocks

* Update Sound map test

* Update prepareMediaForUpload.test.js

* Update prepareMediaForUpload.test.js

* Update mediaUploader.test.js
2026-05-07 21:22:27 +02:00
Abbey Campbell
92d81d7be8 Mob 1239 obs sheet not dismissing (#3576)
* use bottom sheet api instead of returning null when hidden

* dedupe inside modal dismiss logic

* rename handleSnapPress -> openSheet

* ts fixes and split render into two branches

* fix integration test so we check for BottomSheet behavior rather than child absence

* snapshot updates + comments

* prevent hidden-state BottomSheet dismiss from triggering onPressClose

* port changes from BottomSheet to BottomSheetV2
2026-05-04 20:40:10 +02:00
sepeterson
289bc228c0 MOB-1329: tests 2026-05-01 10:16:34 -05:00
Ryan Stelly
3e5c85f9b8 retrigger notification query on effect rather than new query (#3573)
* retrigger notification query on effect rather than new query

* move unviewedObs refetch to effect

* fix test

* Remove trailing whitespaces

---------

Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
2026-04-28 13:28:02 -05:00
Johannes Klein
a29bfc07b9 Toggle advanced mode for users that have 100 obs while logging in (#3560)
* Type navigation

* Refactor return type of authenticate user to be an object

* Update AuthenticationService.test.js

* Also return number of uploaded observations from user authentication

* Type navigation

* Update types.ts

* Update types.ts

* We do check if this is defined above

* If a user has more than 100 uploaded obs switch them to advanced mode

* Update LoginForm.tsx

* Add test coverage for remote user with observations
2026-04-28 15:20:09 +02:00
Abbey Campbell
f4f1e62e10 Merge pull request #3538 from inaturalist/mob-713-project-search-typing-in-k-causes-a-crash
Mob 713 project search typing in k causes a crash
2026-04-23 12:20:49 -07:00
sepeterson
a174cd2261 MOB-1317: update snaps 2026-04-22 17:11:51 -05:00
Abbey Campbell
5d981fd150 fix tests to stay consistent with handling of traditional projects 2026-04-22 14:23:01 -07:00
Johannes Klein
2efb99fb74 Switch to @native-html/render to support markdown again (#3553)
* Update package.json

Without the babel plugin the app does not start because of an error with the new package.

* Update babel.config.js

* Update package-lock.json

* Switch to new package for Wikipedia text

* Update Podfile.lock

* Use new package in UserText

* Link underline was blue, now green again

* Make headings in user text the same as in the app

* Fix typo?

Not hundred percent sure about this, but MDN docs show no t tag and the original list in inaturalist has tfoot in this place here.

* Remove tag that is not supported on web

* Refactor making of html into helper function

* Update index.ts

* Create a snapshot test for build html function
2026-04-21 22:03:34 +02:00
Abbey Campbell
8b5f7ff33b add tests 2026-04-14 12:34:38 -07:00
Johannes Klein
3036529323 Switch react-native-fs (#3524)
* Update package.json

* Update package-lock.json

* Update Podfile.lock

* Update PrivacyInfo.xcprivacy

* Update react-native-logs.config.ts

* Update paths.ts

* Update savePhotoToDocumentsDirectory.ts

* Update useAppSize.ts

* Update installData.ts

* Update mlModel.ts

* Update storageMetrics.ts

* Update removeAllFilesFromDirectory.ts

* Update util.ts

* Update removeSyncedFilesFromDirectory.ts

* Update contexts.ts

* Update index.ts

* Update Photo.ts

* Update Sound.js

* Update logManagementHelpers.ts

* Update PhotoLibrary.tsx

* Update flattenUploadParams.ts

* Update shouldFetchObservationLocation.ts

* Update Developer.tsx

* Update vision-camera.js

* Update sentinelFiles.ts

* Move mock

* Switch to unlink util
2026-04-14 00:57:20 +02:00
Johannes Klein
164ca02fa0 Replace involuntary sign out on jwt 401 with user action to login again (#3502)
* MOB-1276: first pass

* Move realm clearing below other resets

Before we were seeing a crash where a user signsOut and while deleting realm still has a reference to a realm object somewhere the app crashes (something along the lines of "accessing object which has been invalidated or deleted", I think). Which meant that subsequent lines here after reaml.deleteAll were never hit. So, we got rid of realm but still had the signals that the user is logged in like jwt and mmkv stuff. This is problematic because UI and server request have different definitions of a user is logged in: 1) sensitive item named "username" exists, and 2) realm entry for current user exists.
I don't see how this change here get's rid of the actual crash, but at least we maybe have more likelihood of deleting all things we want to delete here.

According to @FLGMwt s investigations into this this closes MOB-820 https://linear.app/inaturalist/issue/MOB-820/user-account-seem-to-be-mixed-up#comment-80cd5378

* Do not clear auth cache and sensitive info on automatic login again initiation

I think we should fully rely on the login again action to refresh jwtToken, jwtGeneratedAt, and accessToken.

We don't know which one of them is corrupt at this point, and a re-login will give us correct new ones.

* Remove comments

A) I don't think it means that *for any reason* we delete the local database. Only when we had a 401 we were deleting everything.
B) is alleviated

* Quick fix idea

If we are on the login screen for the login again flow do not show a close button. This means the user has to close the app and open again. If the 401 persists the only action the user can take is to do the login again.

* Alternative fix: sign out on login again flow close

Adding back the X button to the login flow. Pressing it explains that this is a sign out action and signs the user out making sure we also clear realm during an entire sign out deletion flow.

* Remove test

* Update src/components/LoginSignUp/LoginForm.tsx

Co-authored-by: Ryan Stelly <ryan@inaturalist.org>

* Clean up previous code suggestion

* Revert "Clean up previous code suggestion"

This reverts commit 345bb31510.

* Revert "Update src/components/LoginSignUp/LoginForm.tsx"

This reverts commit 968fcd8601.

---------

Co-authored-by: sepeterson <10458078+sepeterson@users.noreply.github.com>
Co-authored-by: Ryan Stelly <ryan@inaturalist.org>
2026-04-08 22:34:35 +02:00
Abbey Campbell
8438d0248a Merge pull request #3486 from inaturalist/mob-1056-nav-bar-ui-changes
Mob 1056 nav bar UI changes
2026-04-02 11:23:57 -07:00
Abbey Campbell
7736471a35 update snapshot 2026-03-31 15:41:20 -07:00
Abbey Campbell
fee6b8176f Merge pull request #3478 from inaturalist/mob-1264-announcements-design-changes
Mob 1264 announcements design changes
2026-03-31 10:19:35 -07:00
Abbey Campbell
d979202df4 test query updates 2026-03-30 11:55:44 -07:00
Johannes Klein
e3c53cf7ad Switch to react-native-exify (#3471)
* Update package.json

* Update package.json

* MIgrate parseExif to TS

* Update parseExif.ts

* Type exif objects

* Update types

* Remove write wrapper

* Update parseExif.ts

* Remove react-native-exif-reader

* Replace mock

* Wrongly mocked

* Replace library in test

* Update package-lock.json

* Update Podfile.lock

* Update project.pbxproj

* Append scheme if missing

* Log rejected promises reasons

* Update parseExif.ts

* Adjust exif coordinates with ref with

* Time zone error

* Revert "Time zone error"

This reverts commit 538fb244b7.

* Update parseExif.ts

* Update parseExif.test.js

* Show literal date string in debug mode

* Simpler regex

* Update parseExif.ts

* Major code cleanup

* Update parseExif.test.js

* Update parseExif.ts

* Update Observation.js

* Rename param

* Infer readExifFromMultiplePhotos return type
2026-03-29 20:32:40 +02:00
Abbey Campbell
4b621d69ee remove layout prop from tests 2026-03-27 12:54:24 -07:00
Abbey Campbell
77c620c2f4 fix tests 2026-03-26 18:02:33 -07:00
Abbey Campbell
e2346888fb mock only screenOptions 2026-03-25 12:18:36 -07:00
Abbey Campbell
c210b7c1de Merge pull request #3455 from inaturalist/mob-1184-startup-time-time-to-interactive
Mob 1184 startup time time to interactive
2026-03-24 11:01:01 -07:00
Seth Peterson
22be7db215 Merge pull request #3456 from inaturalist/mob-1224-refactor-obsdetails-components-to-pass-observation-id-2
MOB-1224: refactor project fetching for ProjectList
2026-03-24 09:06:28 -05:00
Abbey Campbell
a19fb0541c add polyfill for idleCallback 2026-03-23 23:46:37 -07:00
sepeterson
1c48dfe403 MOB-1224: flesh out unit test 2026-03-20 10:40:07 -05:00
Johannes Klein
c7b596a519 Update react-native-logs jest mock (#3450)
* Update jest.setup.js

* Let's log all args instead
2026-03-19 09:34:53 +01:00
sepeterson
d6964b0e86 MOB-1224: first pass 2026-03-18 16:53:17 -05:00
Ryan Stelly
793c6bb215 MOB-992 start using rolling daily logs instead of a single append-only (#3433)
* extract non-react log helpers out of custom hook

* git mv useLogs to more appropriate name / location

* update logmgmt imports, clean up getLogs

* git mv Log.js Log.tsx

* remove sharing functionality from log preview screen

* reorganize debug screen w/ headers

* refactor all Debug sections for consistency

* add rolling log config, switch existing logmgmt to 'legacy' var

* factor path out of share/email for legacy wrappers

* add 'legacy' log category in prep for showing new logs

* add legacy flag to log preview screen params

* add useLogPreview for Log screen supporting legacy and aggregated recent rolling logs

* actually support sharing the new logs w/ a tmp file of concatenated recent logs

* delete low value developer screen test

* fix double reverse and handle bad filename
2026-03-17 16:19:18 -05:00
Abbey Campbell
41f66ecf3c Merge pull request #3427 from inaturalist/mob-1234-upgrade-react-native-reanimated-to-latest-version-and-fix
Mob 1234 upgrade react native reanimated to latest version and fix
2026-03-12 16:22:43 -07:00
Abbey Campbell
1a7faba1d9 remove eslint-disables 2026-03-12 15:15:08 -07:00
Abbey Campbell
a7f262d9d6 add mock for worklets and update snapshots 2026-03-11 13:06:09 -07:00
Seth Peterson
adf33cb8b2 Merge pull request #3407 from inaturalist/mob-1182-disable-firebase-for-unauthenticated-users-and-users-with
MOB-1182: disable firebase for unauthenticated and opted-out users
2026-03-10 17:10:45 -05:00