Commit Graph

617 Commits

Author SHA1 Message Date
Johannes Klein
eaed9ada59 Only add zoom options if camera device has the actual physical devices (#2737)
* Only add zoom options if camera device has the actual physical devices

* Fix mock

* Add mocks to unit test

* Revert "Add mocks to unit test"

This reverts commit 0738d2b115.

* Optional chaining
2025-03-10 14:04:58 +01:00
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
d1398a4d29 Add UI for match screen not identifying (#2728)
* Alternative return for match screen in absence of suggestion

* Add lower part text elements

* Add margin at bottom

* Copy code to make a new suggestions scrll for iconic taxa

* Removing not needed properties of the copied code

* Remove log

* Remove width constraints

* Add a state to track selected iconic taxon

* Comment and code style

* Pass prop down to taxa scroll

* Use new props in iconic taxa scroll

* Color border according to selected state

* Use iconic taxon as top ID if none given

* Remove testing code

* Update Match.test.js
2025-03-07 19:42:38 +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
Amanda Bullington
fd6cd0148d Filter out hidden content from ObsDetails advanced/default activity feeds (#2721)
* Hide comments and ids that are supposed to be hidden on remote/local observations

* Add and fix tests related to hiding content
2025-03-06 15:33:02 -08:00
Johannes Klein
271d0bd856 Add higher rank mode unrestricted to offline suggestions (#2711)
* Use unrestricted commonAncestorRankType for offline predictions from file

* The plugin provides an interface for this

* Fix type error

* Add missing type

* The iconic taxon is no longer part of the predictions result

If we use common ancestor rollup mode the ancestor taxa are no longer included in the result (which in turn are the top 10 species predictions). So, we have to get the iconic taxon name for each result in a different manner.

* Not needed as results are returned with highest score first

* Remove number wrapper

* Update comment

* There is no special offline not-confident criterion

This now returns common ancestor as top ID in case there is none over the threshold. So, same as online.

* No distinction between debug types

* Update ModelPrediction.js

* This is actually redundant

* Offline suggestions need to be sorted same as online

* Should not have removed the export

* Update comments
2025-03-04 16:37:14 +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
Johannes Klein
002d3615b8 Changing to Advanced Mode should set the Observation Button setting to "All Observation Options" (#2687)
* Changing to Advanced Mode should set the Observation Button setting to "All Observation Options"

* Fix test
2025-02-21 14:40:16 +01:00
Johannes Klein
e2ee6170ea Some camera design changes with using geomodel (#2677)
* Do not show double gap for when no zoom button to show

* Add location-off icon

* Basic location button for camera

* Do not show new button in default mode

* In advanced mode using geomodel is opt-in with the button state

* Basic info box layout

* Add opacity

* Update strings.ftl

* Use location if present

* If no location permission given, show permission gate on pressing use location

* Minor restyle for offline text

* Refactor LocationStatus and add animation

* Update snapshot tests
2025-02-20 11:32:47 +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
Amanda Bullington
0a7ae03832 Fix attempt: Signal 11 crash on install (#2676)
* Split up all the custom hooks in App.js; begin to only run things when they're needed

* Code cleanup
2025-02-19 19:18:08 -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
Johannes Klein
aaf4336a9a Few minor UI changes on default mode's ObsDetail screen (#2647)
* Remove FaveButton

* Remove ObsStatus

* Change community string

* Remove status text

* Add text to activity item

* Boolean prop to show this text

* Completely unrelated crash fix for suggestions on obs without photot

* Remove UUID

* Status section

* Update strings

* Move ID to Details

* Show ID explainer only conditionally

* Status section spacing

* Update ActivityItem.test.js
2025-02-06 10:08:19 +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
7e960d9010 feat: display time zones and times in time zones (#2636)
* fix: show observation datetime in the obs time zone

I.e. it doesn't offset the observation datetime into the viewer's time zone.

* test: adjust to literal times by default

* chore: update to date-fns 3.0

* wip: show time zone names with all times

* show time zone name whenever a time zone is passed to a formatting function
* store observation IANA time zone in Realm

Note that this required patching around a bug in Hermes in which it should be
returning a GMT offset for the short time zone but is instead just returning
GMT.

* fix: omit time zone for unuploaded obs

* feat: show relative time differences on ActivityItem headers

* fix: hide zone/offset on ObsEdit before upload when signed in

* fix: hide clock icon in activity item header in new default mode

Also

* stop using checkCamelAndSnakeCase when not necessary in DetailsTab.js
* make POJO types only refer to other POJO types
2025-01-31 23:22:55 +01:00
Amanda Bullington
3fbb2c470a Prevent cell recycling in FlashList (#2643)
* Create simple taxon grid item and prevent cell recycling for this component

* Code cleanup

* Apply cell recycling fixes to Explore > SpeciesView and ObservationFlashList

* Fix tests; update snapshot
2025-01-29 14:29:29 -08:00
Amanda Bullington
9fae07cb16 Reduce size of nav button text (#2640) 2025-01-29 08:32:31 -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
Amanda Bullington
20952ec7aa Add a loading wheel and freeze frame before awaiting logs in AICamera (#2632) 2025-01-22 18:47:07 -08: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
21a66c8580 fix: make UUIDs more random (#2629)
Replaces react-native-uuid with uuid, which might do a better job making UUIDs random
2025-01-21 15:23:15 -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
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
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
4902dcf825 Show match screen after gallery; limit gallery selection to one photo (#2614) 2025-01-15 14:43:29 -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
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
Amanda Bullington
40a375dd9f Create text style Subheading2 and apply in Match screen (#2605)
* Add Subheading2 component and apply to Match screen

* Add snapshot test for Subheading2

* Add snapshot
2025-01-09 17:10:26 -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
7ec14e9e78 fix: fill ObsEdit BottomBar with Save button when logged out (#2597)
* chore: TypeScript and style fixes
* fix: fill ObsEdit BottomBar with Save button when logged out
2025-01-08 11:00:07 -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
Ken-ichi Ueda
a73f54bb38 test: fix test that won't pass for the first 40 days of the year 2025-01-01 17:50:51 -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
Amanda Bullington
1d340eb558 Feat: redesigned ObsDetails screen in debug mode (#2580)
* Create ObsDetailsDefaultMode and rearrange items on top of screen

* Move activity, details, and more into three different sections instead of tabs

* Styling cleanup; change Activity name to Community

* Fix scroll to activity item from Notifications

* Add ObsDetailsDefaultMode unit tests

* Show kebab menu on other users' observations
2024-12-18 19:24:24 -08:00
Angie
ce7e91e209 fix side by side button text is cut off in different languages and large font sizes (#2571)
* fixes issues where side by side button text is cut off in different languages and large font sizes.
Refactor to use ButtonBar in all places with side by side buttons. Truncates header in ObsEdit when language text exeeds space to not push kebab menu off screen. Closes #2500.

* update snapshots

* clean up BottomButtons.tsx
2024-12-18 10:56:00 -08:00
budowski
f89736188c feat: use physical volume buttons to capture photo (#2495)
* Fix #2212 - use physical volume buttons to capture photo

* Fixed tests (mocking VolumeManager)

* Fixed tests (mocking VolumeManager)

* #2212 - physical volume buttons for camera capture - also in AI camera

* #2212 - additional fixes for AI camera

* Update pods

* Update pods

---------

Co-authored-by: Amanda Bullington <albullington@gmail.com>
2024-12-17 16:40:26 -08:00
budowski
2162f55ac3 Fix #2323 - view taxon observations from explore screen by tapping on taxon (#2554)
* Fix #2323 - view taxon observations from explore screen by tapping on taxon

* Updated test snapshots
2024-12-17 16:30:11 -08:00
Ken-ichi
7f09778a7f fix: center number in photo count (#2512)
Closes #2506
2024-12-03 22:14:13 -08:00
Ken-ichi
25e50379bc fix: restore observation fetch when focusing on myobs (#2511) 2024-12-03 18:52:47 -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