Commit Graph

486 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
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
Johannes Klein
1823ae0d2f Some smaller layout changes on ObsEdit; plus fix for evidence list not scrolling to side of screens (#2452)
* Change text to size 2

* Change text size for date to Body2

* Change text size for other data to Body2

* Adjust tappable height for other data

* Adjust tappable height for date picker

* DatePicker TS

* Change padding of location section

* Push pixels to center icons with first line of text

* Fix a UI issue with evidence list not scrolling to the sides of the screen

* Align all icons at same vertical axis

* Apply margin to evidence list and iconic taxon list
2024-11-20 08:28:00 +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
israr002
c11681f6e0 fix: limit text scaling in PhotoCount (#2235)
Limit text scaling in PhotoCount so it doesn't overflow at large font sizes.

Closes #2131
2024-11-19 16:54:43 -08:00
Angie
04271bef07 Prevent activityheader text and withdraw button from being cut off in smaller screens (#2431)
Also includes adjustments to explore at large font sizes. Closes #2315.
2024-11-15 10:09:37 -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
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
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
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
Ken-ichi
3dcc833c98 feat: support basic layout, typography, and photo carousel in RTL (#2334)
* Use a wrapper around Text for all typography components that sets
  app-specific defaults, allowing default RTL to work
* feat: make iOS permission prompt text translatable
* fix: allow RTL layout of char limit on text input bottom sheet
* fix: allow RTL photo carousel on ObsDetails and TaxonDetails

Removes react-native-reanimated-carousel, which needs to be patched to support
RTL and maybe wasn't providing anything beyond FlatList for us anyway.

InfoPlist.xcstrings will not be automatically updated on Crowdin sync pending
a Crowdin bug.

Work toward #2099
2024-11-01 12:59:25 -07:00