Commit Graph

94 Commits

Author SHA1 Message Date
Johannes Klein
360a63cdbe Photo similarity representative photo result sent to taxon details (#2699)
* A key like this does not exist because we don't save rep Photo to realm

* Show rep photo on suggestions

* Add comment

* Update types.d.ts

* Move code around

* Send rep photo ID to taxon result

* Send rep photo to taxon result

* Add white background to box on taxon details

Closes MOB-491

* Comments

* Only send ID around and move photo to top

* Send first photo id also from match screen

* If rep photo is of same taxon, only send ID, else send entire photo to taxon details

* Refactor taxon image

* Updated realm types

* If rep photo is of other taxon send entire object

* Create copy of realm taxon

Avoids an error "object has been invalidated and deleted" which I didn't have tome to track down.
2025-02-27 15:20:06 +01:00
Johannes Klein
cbf9c1b24d For online suggestions, setting common ancestor rank limit to Kingdom, in unrestricted mode (#2681) 2025-02-21 08:25:42 +01:00
Johannes Klein
08910a13bf Include taxon photo similarity parameter when making online vision api requests for the match screen (#2673)
* Include search for representative photos

* Request representative photo as a taxon field

* Show representative photo if given for alternative suggestions

* Add comment

* Use representative photo of top suggestion in photos section
2025-02-19 15:28:02 +01:00
Johannes Klein
574627fb6d During signup check first if an email is taken or not (#2665) 2025-02-14 11:49:37 +01:00
Angie
7e19fd58dc Adds a follow and unfollow button when viewing others ObsDetails (#2639) 2025-01-31 15:51:44 -08:00
Ken-ichi
fb7a9bb421 fix: allow Explore searches in places again (#2634)
* remove assumed and undocumented meaning of page being zero from our use of
  useInfiniteScroll in Explore; uses explicit type checks instead
* document byzantine pagination logic in useInfiniteExploreScroll
* fix broken infinite scroll when sorting by faves (was only showing first
  page)

The underlying problem from 96c316a was setting initialPageParam to 1 in
useAuthenticatedInfiniteQuery, which seems rational, except
useInfiniteExploreScroll was using a false-ish value of page to detect when
it was requesting its first page. This does the same by being more explicit
about page's type without injecting undocumented meaning into the params we
hand to useInfiniteScroll.

* refactor: move Explore page param munging into unit tested helper

Closes MOB-400
2025-01-23 17:32:27 -08:00
Ken-ichi
8121e1452c feat: show simplified MyObservations to logged in users (#2616)
* refactor: convert UserIcon to TypeScript
* feat: show simple MyObs to signed in user; add user icon & login to header
* feat: show warning and edit button for unuploaded obs w/o basics
* refactor: consolidate ObsEdit navigation logic
* feat: show edit button with circle dots
* refactor: upload UploadQueuedRotatingIcon to the more reusable CircleDots
  component
* refactor: upload icons to use more composition and fewer specialized, one-off
  components
* fix: bugs in determining if an obs has date and coords
* refactor: extract MyObservationsSimple business logic into container
* refactor: get total obs count from relevant hooks
* feat: show remote species for signed in users
* fix: hide photo count icon when missing basics icon is present
* feat: show banner alerting user when missing location or date

Closes MOB-318
2025-01-17 17:21:29 -08:00
Ken-ichi
96c316a257 feat: show all results in Explore projects search (#2621)
* refactor: convert ExploreProjectSearch to TS and assoc'd TS changes
* feat: use infinite scroll in Explore Filters project search
* feat: show universal search results in Explore project search

This should show the same ranked search results a user would see at
https://www.inaturalist.org/search?source[]=projects

Closes MOB-313
2025-01-17 16:31:07 -08:00
Ken-ichi
75d69f8c74 feat: add simplified MyObservations for logged out users with at least 1 obs (#2599)
Simplified version of MyObs for signed out users with more than 1 obs. Currently only in debug mode.

Also:

* refactor: extract TaxonGridItem into a reusable component
* chore: TypeScript cleanup

Closes MOB-317
2025-01-10 19:48:29 -08:00
Ken-ichi
15f36386fd feat: sign in with Apple (#2543)
* Support Sign in with Apple on iOS, w/o design
* Typescript conversions
* Add authenticateUserByAssertion that should be usable w/ Google OAuth-based auth

Closes #583
2024-12-11 17:25:23 -08:00
Ken-ichi
e3bf7969ed feat: remove interaction from AI camera suggestion (#2524)
Closes #2456
2024-12-11 16:12:10 -08:00
budowski
eefb53af85 #1433 - when viewing explore map from project details - zoom on project's place (#2439)
* #2253 - when viewing explore map from project details - zoom on project's place

* #1433 - show loading indicator as map is loading

---------

Co-authored-by: Amanda Bullington <albullington@gmail.com>
2024-12-05 11:01:26 -08:00
Ken-ichi
7f9a272820 feat: show notifications from others (#2491)
* split notifications into tabs
* lots of TypeScript conversion
* feat: resize Heading5 and add Heading6 (closes #2480)
* fix: mark remote observations as viewed from ObsDetails
* feat: show indicator in Notifications tabs if unviewed notifications

Closes #2451
2024-11-27 23:32:31 -08:00
Ken-ichi
69959869ca feat: offline taxon search (#2469)
Searches the local database for taxa if there are no online results.

Also

* typescript conversions
* refactor and consolidate view logic around taxon search

Closes #2348
2024-11-21 14:44:48 -08:00
Ken-ichi Ueda
6305ca9023 refactor: improve debug suggestion score visibility 2024-11-15 13:15:59 -08:00
Amanda Bullington
39fa3a9edb Handle capitalization for multiple lexicons (#2416)
* Make sure API calls have options to fetch correct lexicons; separate capitalization logic for each lexicon

* Fix Explore nav test
2024-11-12 18:18:14 -08:00
Ken-ichi
64d07fad35 fix: only show onboarding once per install (#2390)
* refactor: give the install MMKV instance a more accurate name
* refactor: rename install data wrapper, verbify function names
2024-11-07 14:25:25 -08:00
budowski
7b8c88c84d feat: add onboarding carousel (#2285)
Note that offsetting the onboarding images ended up being a bit hard. We're
mostly doing so with a cropped version of one of the images.

Closes #1906

Also tried to de-flake some tests:

* Use fake timers when possible
* Ensure time travel helper doesn't un-fake our timers
* Wait for time travel helper to finish so changes don't happen outside of
  act
* Stop mocking useCurrentUser in integration tests; that's app code and should
  not be mocked when integrating all parts of the app; instead use signIn /
  signOut helpers
* Remove unnecessary direct uses of act()
* Mocked some inatjs calls to prevent React Query complaints about undefined
  query return values
* Close onboarding before all e2e tests

---------

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2024-11-04 12:03:55 -08:00
Amanda Bullington
bc817e8b80 Add projects, followers, and following lists via UserProfile (#2300)
Show projects, followers, and following lists via UserProfile
2024-10-24 19:04:42 -07:00
Ken-ichi
ddca126ed5 refactor: log around repeat errors (#2293)
* Catch and squelch "Network request failed" errors that happen during logging itself (#1639)
* Log around RNSI access to resolve when/where those errors occur (#1639)
* Log around JWT retrieval to resolve when/where JWT missing errors occur (#2155)
2024-10-22 15:41:54 -07:00
Amanda Bullington
5872a3680d Project requirements screen (#2192)
* Create a project requirements modal screen

* Add text and set defaults for project requirements

* Fill in project inclusions for requirements

* Add more project rules

* Show taxon exceptions

* Rules for establishment means

* Rules for media types

* Show multiple locations in project reqs

* Use project_observation_rules to show projects

* Cleanup
2024-09-27 16:23:45 -07:00
Amanda Bullington
653340d854 Add infinite scroll to Projects (#2185)
* Implement infinite scroll in Projects

* Styling fixes for empty state in projects; add infinite loading wheel

* Resolve require cycle from ObsFlashList and FlashList shared components

* Order by distance and remove radius for nearby projects fetch

* Code cleanup

* Fix test

* Code cleanup

* Minor tweaks to search API request and results
2024-09-25 11:17:32 -07:00
Ken-ichi Ueda
bef2a96262 fix: log 429 errors before they get screwed up by failed JSON parsing 2024-09-17 14:42:50 -07:00
Johannes Klein
f85aba771b Username mentions navigate to User profile screen in-app (#2057)
* On user profile screen, if routed here with login as param search for user id

* UserText to TS

* Add linkify mention plugin dependency

* Rely on plugin for mention parsing

* Adjust rel

* Add a title attribute to mentions only

* Navigate to profile screen for mentions

* Use props

* Fix some types

* We dont really need this plugin if we check for href includes people link

* Replace user search api call with fetch by login

* Push new profiles on top of the navigation stack every time

* Add error strings

* If there is no user found for this id show error

This can happen I assume when a user changes the login but comments are not updated.

* Use this plugin

* Remove log

* Only react to anchors that have mention as a title

* Update types

* Another inferred type
2024-09-12 12:28:10 +02:00
Amanda Bullington
5945ccc525 Fixes and error handling for API throttling (#1971)
* Add new error type for 429; remove unnecessary logs

* Batch API calls for SpeciesSeenCheckmark

* Remove SpeciesSeenCheckmark test

* Revert logging errors

* Use Set for observedTaxonIds

* Add comments around logger.info statements

* Merge linting update

* More fixes from code review

* Switch to non-authenticated useQuery for fetching taxon ids seen by X user id

* Fix tests
2024-08-14 22:08:03 -07:00
Ken-ichi Ueda
48cd972afe Disable remote logging for dev builds
At this point this mostly just pollutes the log data with minor
development-related crashes.
2024-08-05 15:49:25 -07:00
Ken-ichi
960f3e3b67 Some typescript conversions in an attempt to improve CodeQL coverage (#1904) 2024-08-01 17:55:33 -07:00
Amanda Bullington
65ea27c751 Clear user data on sign out (#1873)
* Clear documents directory & mmkv on signout

* Add code comment

* Rename userData.ts
2024-07-29 13:30:50 -07:00
Amanda Bullington
5c1a5142a4 Load suggestions with location after permission granted (#1846)
* Refactor into useReducer

* Use reducer for Suggestions

* Offline working

* Progress on getting location permissions button to work as expected

* Code improvements

* Fix photo deletion test

* Fix AICamera nav test

* Ensure suggestions location permission uses location immediately

* Loading wheel fixes

* Fix photo deletion test

* Use online result to advance to obsedit in PhotoDeletion

* Fix test by using online mock
2024-07-24 22:19:05 -07:00
Amanda Bullington
d9d7a6ff06 Suggestions screen UI fixes, location toggle, and offline reloading state (#1708)
* UI changes to suggestions screen

* Update offline suggestions UI and allow refetch

* Allow user to search online suggestions with and without evidence location

* Add improve location button and refactor header

* Use loading screen correctly between location/ignore location

* Hide location permission button and code cleanup

* Fix test for suggestions changes
2024-06-24 16:26:40 -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
budowski
716efc1a78 Change language from Settings while offline (#1423)
* Closes #83 - fetch and cache available locales for app; allow user to change app language
* Use different language chooser picker
2024-06-04 14:57:21 -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
7ea60f7b9b Add X-Installation-ID logging (#1608)
* Add X-Installation-ID logging
* Allow logged out logging
* Log whether user has enabled advanced add obs btn
2024-05-24 21:06:20 -07:00
Ken-ichi Ueda
63e9f47512 Stop logging INatApiErrors that might be handled; log JSON parse issues separately 2024-05-20 10:46:48 -07:00
Ken-ichi
08c04ad1ab Improved error reporting for logstash (#1529)
When an Error object is passed to logger.error() as the last arg, this change

* extracts error_type and backtrace
* reports a shorter message that should be searchable

Also:
* Avoid double logging errors; ErrorBoundary should log errors in a way we can parse
* Added restart button to default ErrorBoundary; globalized text
2024-05-13 18:28:56 -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
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
Amanda Bullington
4916e960c3 Show Suggestions after camera in ObsEdit flow (#1294)
* Navigate user to Suggestions after Camera; add location check to usePrepareStateForObsEdit function

* Test that Camera advances to Suggestions when checkmark tapped

* Use vision result as top suggestion on Suggestions screen

* Write AR nav test; filter vision result from all suggestions list

* Show LocationPermission on camera screen; navigate back from ObsEdit

* Updates to flow so user can back out of ObsEdit to cameras

* Fixes

* Add evidence to existing observation when backing out of ObsEdit flow

* Fix tests

* Add mocks for worklet functions

---------

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2024-03-27 12:34:37 -07:00
Angie
822909b002 1279 user profile UI changes for mvp (#1295)
* Follow Button changes

* Change non pressable count icons to gray, removed onPress, hide post mvp sections of userprofile

* createRelationships api call, follow/unfollow functionality

* Unfollow and follow button functionality, refactoring
2024-03-21 09:56:27 -07:00
Johannes Klein
48fcea1526 359 post logs to internal logging (#1256)
* Made react-native-logs post to API log endpoint

* Try to build a slightly more informative user agent

* Made react-native-logs post to API log endpoint

* Try to build a slightly more informative user agent

* Remove unused const

* Replace other usages of exported user agent

* Revert "Remove unused const"

This reverts commit 02389c8390.

* Revert removal of axios instance

* Strange order

* Remove device name from user agent

* Copy logstash transporter to new file and change to post

* Update import

* Remove comma

* Get the user jwt token as authorization for the log request

* Use anonymous token as app token

* Mock away logs config file because it now has a dependency on authentication

* Code style

* Typo

* Add timestamp field to form data, to show client_timestamp on the logs

* Add TODO

* Add a developer button to force a js-side error

* Add comments

---------

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2024-03-07 00:04:29 +01:00
Ken-ichi
6fdf3d2faf Taxon result updates (#1254)
* Only requests remote taxon if local is missing or hasn't been synced in a
  week
* Returns a localized version of the remote taxon immediately without waiting
  to get a newly-created record from realm
* Expands tests to use a unique realm, integrate more of our code, and check
  to ensure the API gets called
* Show indicator while loading taxon on ARCamera
* Show iconic taxon found in model results if we can't load a remote taxon
* Show iconic taxon as backdrop for ObsImage whenever possible
2024-03-05 16:54:42 -08:00
budowski
02d8f16883 account settings webview
Replaces account settings with a small set of settings and a web view to show settings on the website.

Also

* Minor taxon detail fixes
* Display taxon name on observations according to the current user's
  preferences, not the observers

Closes #927

---------

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2024-02-28 19:34:57 -08:00
Johannes Klein
7bd5f32fd7 Changes to Sync button (#1166)
* Add string

* Add a state that signifies syncing in progress

* Rename state as it no longer only pertains to uploading

* Set flag on button press

* Fix bug with wrong number of obs to upload shown

* Update MyObservations.test.js

* Add 1 to param for human readability

* Update MyObservations.perf-test.js

* Update ToolbarContainer.test.js

* Reintroduce number of finished uploads

* Update comment

* Use animation for gallery loading screen
2024-02-23 16:39:47 +01:00
Ken-ichi
f45108036f Sound recording (#1164)
* Added basic navigation test for StandardCamera & SoundRecorder
* Abstracted camera nav buttons and used in SoundRecorder
* Show sounds in the MediaViewer
* Added sounds to ObsEdit, w/ MediaViewer support
* Ensure sounds get both uploaded and added to observations
* Local sound deletion
* Remote sound deletion
* Rudimentary and deeply unperformative sound visualization

Closes #869
2024-02-22 22:02:25 -08:00
Ken-ichi Ueda
c90acad6f0 Log stringified JSON errors 2024-02-12 12:52:56 -08:00
Angie
9de83f7fdf Unread notifications indicator in tab bar (#1101)
* Shows indicator in tab bar when you have new updates
* Should update every minute
* Make unread updates indicator go away when you view the updates

Closes #900

---------

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2024-02-08 13:22:05 -08:00
Johannes Klein
93061bf8de Set user-agent in global config (#1096)
* Update inatjs

* Globally set user-agent for inaturalist js usage

* Remove user-agent from announcements
2024-01-30 15:41:32 +01:00
Amanda Bullington
bb6a180527 Observation deletion on MyObservations (#1082)
* Delete local & remote observations on MyObs; show progress

* Update tests & add test for delete hook

* Fix test failures

* Add tests for deletion strings in Toolbar; add test for multiple deletion

* Clear deletion text on toolbar when user navigates away from MyObs

* Add a check in e2e test to make sure observation was deleted
2024-01-24 17:32:11 -08:00
Johannes Klein
47b3525228 Announcements (#1081)
* Update iNatjs

* Add webshell dependency

* Basic announcement fetching component

* Styling

* Dismiss function

* Error handling TODO

* Add param

* React to link presses

* Missing code

* Add unit test

* Add string

* Refactor search query and dismiss to use react-query

* Activity indicator when refetching

* Add query provider to test

* Mock component in other integration tests

* Move user agent to api

* Throw error instead of logging
2024-01-24 22:22:50 +01:00