Commit Graph

223 Commits

Author SHA1 Message Date
Johannes Klein
37a9f6d58b Add a plus icon button to add all observation types to default mode header (#2734)
* AddObsButton TS

* Add simple plus icon version of the AddObsButton to my obs list header

* Update imports
2025-03-10 11:52:00 +01:00
Johannes Klein
15c1946b71 Use default mode from first app install (#2733)
* Default mode used on app install

* Update integration tests
2025-03-10 09:47:47 +01:00
Johannes Klein
626fbfd94f Full screen loading state on match screen (#2717)
* Build UI for loading state between AI->Match

* Make designs for AI loading screen match Figma

* Selective changes from bf872e2d4f

* Selective changes from 9ed81f99c7

* Selective changes from 4bc7c3474f

* Selective changes from 4916cf70fb

* Replace loading state from store with props

* Add some types

* Make component agnostic of what skipping does

* Remove debug info

* Add more debug data

* Elongate loading state if online errors out and offline is still loading in sequence

* Remove underline

This classname had no effect as far as I can tell.

* Hide skip button when it has no function

* Remove a comment that slipped through partial cherry-picking

* Split apart online and offline fetch status

Weird but even though they start in sequence it happened to me that online error was received after offline was fetched successfully. So, Let's split apart online and offline loading state.

---------

Co-authored-by: Amanda Bullington <albullington@gmail.com>
2025-03-07 11:50:49 +01:00
Johannes Klein
a44f0412f3 Hide observation status for logged out users on simple MyObs (#2710)
* Show simple my obs header only for logged-in users

* ActivityCount TS

* CommentsCount TS

* IdentificationsCount TS

* ObsStatus TS initial pass not looking at errors

* QualityGradeStatus TS

* Update RealmObservation interface

* Update RealmObservation interface

* ObsUploadStatus TS, plain copy, no errors yet

* Update types

* Update type

* IconicTaxonIcon TS

* ObsImage TS

* PhotoCount TS

* ObsImagePreview TS

* Image is only opaque when logged in

* DateDisplay TS

* Remove debug flag from UploadObsStatus

* Update type

* Prop to hide ObsUploadStatus

* Test observations need those otherwise they appear as needing edit

* Update imports
2025-03-04 09:01:21 +01:00
Johannes Klein
12c2e0e8ea Update vision-camera-plugin; breaking changes (#2701)
* Update vc plugin

* Update tests with breaking change: combined_score now 0-100

* Frame processor predictions are in range of 0-100 with new key

* Remove offline convert score to confidence

* Update calculateConfidence.js

* Common ancestor should use combine_score

* Offline suggestions have combined_scores now instead of scores

* Change filtering to range 0-100

* Only use combined_score for Match screen

* Update debug data

* Fic typo in tests

* Remove key from type
2025-02-28 14:21:01 +01:00
Johannes Klein
83bb3a88a6 Setting to control if screen after camera/library is suggestions (#2695) 2025-02-26 07:30:50 +01:00
Amanda Bullington
a25386169b Fix: scroll to activity item in default mode (#2698)
* Minimize the number of rerenders by splitting sheet logic into separate component

* Fix agree sheet

* Fix y offset for scrolling from notifications to activity item
2025-02-25 19:00:23 -08:00
Johannes Klein
bb03bb695a Change default MyObs layout to grid (#2686)
* Change default MyObs layout to grid

* Rename testID

* Update tests expecting to start with list view

* Reverse order of buttons in layout selector

* Fix layout bug of having empty boxes on explore
2025-02-21 18:50:14 +01:00
Amanda Bullington
750e1fa9a9 Fix: show loading wheel after login on MyObs (#2671)
* Keep showing loading wheel when remote obs are still being stored in realm

* Fix tests
2025-02-19 19:55:42 -08:00
Johannes Klein
ff6a5d690a Add pivot cards and onboarding cards (#2667)
This adds pivot cards to the app.
The cards are shown only once per app install lifetime, as their state being shown is persisted in the zustand store.
The basic idea is, if the triggerCondition of the modal turns true it is shown, if dismissed it is never shown again.
2025-02-19 14:51:37 +01:00
Amanda Bullington
5cf1d16999 Remove DefaultMode from debug mode (#2662)
* Remove default mode from debug mode

* Make sure tests with advanced options are fully out of default mode

* Add two simple tests to make sure correct screens show in default mode

* Show logged out empty observation screen before loading either MyObs screen

* Fix tests

* Fix tests

* Update e2e ios node module caching

* Update caching for node modules

* Modify cache node modules setup for CI

* Revert e2e signIn code
2025-02-13 20:30:50 -08:00
Amanda Bullington
400f118ad9 Change terminology from gallery to photo library (#2663)
* Update user-facing terminology from gallery to photo library

* Update terminology for devs to make the user-facing change easier to remember

* Update snapshots
2025-02-13 17:11:28 -08:00
budowski
6cbfcc5be7 Fix #2572 - New design for MyObservations - default mode, logged out,… (#2650)
* Fix #2572 - New design for MyObservations - default mode, logged out, no observations

* Fixed tests

* Update close onboarding part of e2e tests

* Update sign-in for e2e

* Update loadTranslations.js

---------

Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
2025-02-07 10:09:54 +01:00
Ken-ichi
9429fd0996 fix: prevent iconic taxon common names from disappearing in the local db (#2631)
Ensure useAuthenticatedQuery only executes the query when it knows if the user
is signed in or not, and appends that state to the query key so signed in and
signed out results are distinct.

The problem here was that useIconicTaxa was mysteriously returning stale,
signed out results while offline.

Closes MOB-383
2025-01-22 17:17:26 -08:00
Ken-ichi
736eba5a52 feat: add labels to tab buttons (#2611)
* feat: add text labels to bottom tabs
* fix: treat icon and text as single pressable for screen readers in bottom tabs
* feat: float AddObs button outside of bottom tab bar

Closes MOB-254

---------

Co-authored-by: Kirk van Gorkom <55742+kvangork@users.noreply.github.com>
2025-01-21 11:20:48 -08:00
Ken-ichi
fc07e53adc test: run same suite of tests for ObsDetails and its default mode equivalent (#2619)
Closes MOB-333
2025-01-17 12:01:41 -08:00
Amanda Bullington
94ac9f2c05 Add suggestions to match screen (#2609)
* Create useSuggestions hook with all online/offline logic for reuse in Match screen

* Show real online/offline suggestions on Match screen

* Code improvements

* Display top suggestion from useSuggestions, not AICamera
2025-01-14 16:55:41 -08:00
Amanda Bullington
4652929056 UI for Match Screen after AICamera (#2598)
* Save TaxonPhoto to realm; display taxon on match screen

* Code tweaks

* Add match screen to navigation after AI camera in debug/default mode

* Fix test and refactor

* Fix issue with infinite renders in useLayoutPrefs
2025-01-08 14:28:16 -08:00
Ken-ichi Ueda
454e361b48 test: find elements with localized text in LanguageSetting test
Hard-coding text values is especially brittle when testing localized
interfaces, where text values might change with every new set of
translations.
2025-01-03 13:41:50 -05:00
Amanda Bullington
1c59f89a14 Add functionality for advanced iNaturalist mode (#2591)
* Add functionality for advanced iNaturalist mode

* Fix language settings test by toggling advanced mode on

* Fix e2e tests by adding advanced user toggle

* Fix more tests in Settings with advanced toggle
2024-12-26 21:35:27 -08:00
Ken-ichi
7bd46be9d6 fix: load new Explore results when filters change (#2507)
URL params got removed from the query key as a part of pull-to-refresh, but
that's how changes to filters were triggering a new request. This restores
that behavior, adds a test to ensure changes to filters call the API again,
and fixes the prior test of pull to refresh which was not testing the
equivalent behavior when pulling to refresh (API on first load, so the mock
needed to be cleared).
2024-12-03 18:41:56 -08:00
Ken-ichi
10a768e8d0 fix: show onboarding content when signed in user has 0 observations (#2510)
Closes #2508
2024-12-03 17:47:34 -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
Amanda Bullington
6678f4565e Add pull-to-refresh observations functionality in Explore (#2479)
* Add pull to refresh handler to Explore Observations

* Ensure pull to refresh clears cache and refetches queries

* Add test for pull to refresh in Explore Observations
2024-11-22 14:28:08 -08:00
Amanda Bullington
5ec903a267 Add pull-to-refresh on MyObservations list and grid (#2474)
* Add push to refresh and sync observations to MyObservations list/grid

* Add a pull-to-refresh test in MyObservations
2024-11-21 21:39:26 -08:00
Ken-ichi
6bc0d0098c fix: update user language on server after changing in app (#2467)
Main fix was updating inaturalistjs to get a recent bug fix. Also submits a
JSON body instead of a pseudo-formdata-style body.

Also:

* Only try to process queued items that have not failed in the last minute
* Delete queued items after failing 3 times
* Fix index.js error handler bug that was squelching errors that weren't
  getting caught by the ErrorBoundary
2024-11-21 13:21:29 -08:00
Amanda Bullington
836876f90d Start uploads directly from multi-observation ObsEdit; show upload progress bar and status text (#2471)
* Build out UI for multiple obs upload status and progress bar

* Show expected number of uploads/uploading in ObsEdit and MyObs progress bars

* Add test for upload progress

* Add tests

* Fix test

* Mock useUploadObservations to fix test

* Maybe fix tests in the cloud

* Reset unsynced number only if realm is still open
2024-11-21 13:14:40 -08:00
Johannes Klein
f8e37409c3 Make projects visible in drawer, observation details and on user profiles (#2463)
* Show projects in drawer

* Show projects section on UserProfile

* Show ObsDetail project section

* Update tests
2024-11-20 20:15:01 +01:00
Amanda Bullington
970c686933 Camera refactor to potentially address lagginess (#2457)
* Add usePerformance load time to cameras and suggestions

* Declare when to hide delete photo mode without a useEffect

* Use StatusBar hidden component in CameraContainer, instead of useEffects

* Directly handle discards from bottom sheet instead of using useEffect

* Rewrite a whole bunch of camera code to be more declarative and less imperative

* Make sure permissions gate works as expected

* Code cleanup

* Consolidate focus/blur listeners in AICamera

* Fix timing issues in Suggestions tests

* Fix tests

* Ensure photos are still saving to gallery when write permission given & update saving photo state
2024-11-19 18:14:44 -08:00
Ken-ichi
44f90e205c fix: edit location without location permission (#2418)
* fix: show LocationPicker on location tap when permission denied
* fix: zoom LocationPicker out all the way if no pre-existing coordinates
* fix: stop showing sound recorder when microphone permission denied
* fix: ask for permission on clicking the current location button on LocationPicker

Closes #2319
2024-11-13 09:53:52 -08:00
Amanda Bullington
69b1921119 Fetch observation after upload with authentication to show correct localization (#2420)
* Make sure API calls have options to fetch correct lexicons; separate capitalization logic for each lexicon

* Fix Explore nav test

* Use auth token to fetch observation after upload; simplify upserting in obs infinite scroll

* Fix useSyncObservations test
2024-11-12 19:46:14 -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
b5ed9d0475 feat: show obs on TaxonDetails map (#2399)
* reduce prop surface area for map-related components
* map just receives an observation, not a bunch of its properties
* adjust a lot of logic based on observation.obscured to more specific logic
  based on whether the current user can view the coordinates
* hide the map on ObsDetails if there are no coordinates
* show the spec'd explanation for why coordinates are obscured
* remove a prop that just hides a component if true; that should really be up
  to the outer context
* fixed a bug on ObsDetail where the remote obs wasn't getting mapped to
  Realm-ish attributes
* prevent button mashing from opening multiple TaxonDetails
* clean out the state related obs create / edit after exiting that flow so
  that TaxonDetails (or anyone else trying to detect an obs being edited)
  doesn't end up finding it when the user has finished creating / editing.

Closes #2271
2024-11-11 14:20:14 -08:00
Ken-ichi Ueda
9bd33b4176 test: mock installData helper 2024-11-11 10:34:37 -08:00
Amanda Bullington
6b391fbb9b Restore queued upload animation & disable press on queued observations (#2397)
* Disable row when upload is queued

* Show UploadQueuedRotatingIcon if obs is in queue with no progress

* Refactoring to make list rendering a little faster

* Fix UploadStatus test

* Fix tests

* Remove outdated snapshot
2024-11-08 15:16:21 -08:00
Amanda Bullington
6c0f5ec485 Upgrade MediaViewer image zoom component (#2392)
* Replace image zoom library with a newer, simpler library

* Fix tests for MediaViewer

* Code cleanup
2024-11-07 17:32:17 -08:00
Amanda Bullington
f61c68a3e2 Reset queue before adding new observations to upload queue (#2385)
* Clear upload state when user lands on ObsEdit; closes #2083

* Fix test which was displaying buggy upload number
2024-11-06 22:33:31 -08:00
Amanda Bullington
29f0812594 Show discard sheet if any observations saved/uploaded in multi-obs flow (#2380)
* Show discard observation sheet if any multi-obs are saved or uploaded

* Add some tests for navigation flows from GroupPhotos > ObsEdit > back
2024-11-06 15:26:16 -08:00
Amanda Bullington
f4dae74fe8 Animate AddObsModal with fade in/out; closes #2350 (#2372) 2024-11-06 15:26:03 -08:00
Amanda Bullington
0916da7787 Remove @ symbol from usernames (#2339)
* Remove @ symbol from user handle

* Remove @ symbol from e2e test

---------

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2024-11-06 10:03:09 -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
a4d2c7ca24 Restore language chooser and queue offline locale changes (#2329)
Restore language chooser with system locale (signed out users), web locale (signed in users), or app locale (as selected by user)
2024-11-03 20:12:06 -08:00
Angie
0cdccddf02 Prevents text in explore species and observation grid view from flowing off grid in large font sizes. (#2330)
* Prevents text in explore species and observation grid view from flowing off grid in large font sizes.
Includes several UI fixes for Explore in large font sizes. Closes #2257.

* Updated snapshots and fixed failing test
2024-10-31 11:46:31 -07:00
Ken-ichi
b3638460ef fix: prevent multiple obs details from opening (#2311)
Debouncing by relying on the nav path continued to allow multiple ObsDetails
instances to get pushed onto the stack b/c the nav path changed before a
subsequent tap was handled. This ensures that only one ObsDetails instance is
allowed per list per obs.

Closes #2204
Closes #2216

---------

Co-authored-by: israr002 <israr002khan@gmail.com>
Co-authored-by: israr002 <66955016+israr002@users.noreply.github.com>
2024-10-28 15:53:52 -07:00
Ken-ichi
88c7d778c5 feat: set app locale on install, sign in, and sign out (#2294)
* Use system locale on install
* Check for system locale when app comes to foreground (required in Android
  b/c app doesn't get restarted when system locale changes)
* Create a constant of SUPPORTED_LOCALES in loadTranslations.js
* Restart app on sign out
* Use existing transaction when writing to Realm if available (might also
  consider an approach that waits for the existing transaction to complete)
* Make value returned by useCurrentUser actually reactive

Closes #2243
2024-10-25 09:39:50 -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
Ken-ichi
bb0e357683 test: ensure Suggestions can skip ID (#2280)
* Failing Jest test: Skip id button unmounted as soon as you try to press it
* fix: memoize SuggestionsFooter to prevent dismounts and stabilize tests
* test: wait for elements to be visible in PhotoDeletion test

Also stabilizes several other dependencies, and uses findBy instead of queryBy
to ensure tests can find the skip ID button even it takes a second to
render.

Closes #2094

---------

Co-authored-by: Amanda Bullington <albullington@gmail.com>
2024-10-22 11:15:14 -07:00
Amanda Bullington
67dffdcf28 Screen transitions with fade animation (#2284)
* Disable animations on tab bar screens

* Fade in pages accessible from the tab bar

* Add fade in view to stack navigator screens

* Use time travel to step through frames of animation for SoundRecorder

* Use time travel to fix all tests with fade in navigation

* Nav fix
2024-10-20 14:45:31 -07:00
Amanda Bullington
bd6bed71ce Simplify bottom sheet component; don't use onChange to close (#2226) 2024-10-03 21:36:17 -07:00
Johannes Klein
6f8f2ea926 1953 suggestion logged out (#2163)
* TaxonResult TS

* Suggestion TS

* Do not show checkmark for logged out online suggestions

* Update strings.ftl

* From suggestions show bottom sheet on taxon detail

* Refactor updateTaxon

* Add text

* Another text

* Two more texts

* Fix import

* Function stubs

* Use a bulleted text list

* Restyle entire bottom sheet

* Code reorder

* Refactor saveObservation function

* Navigate to login screen for Upload now button

* Add key

* Save obs on press and nav to list

* Code style

* Get updated currentObservation immediately to pass to saveObservation

* Test AICamera with current user

* Show the bottom sheet only for logged out users

* Mock useCurrentUser hook

* Mock useCurrentUser hook

* Mock user

* Mock user
2024-09-25 12:56:32 +02:00